moved gpiod test to bsp folder

This commit is contained in:
Robin Müller 2021-02-14 12:23:29 +01:00 committed by Robin Mueller
parent 572e3d5bba
commit 83530f9c4e
7 changed files with 11 additions and 76 deletions

View File

@ -7,6 +7,7 @@ target_sources(${TARGET_NAME} PUBLIC
add_subdirectory(boardconfig)
add_subdirectory(comIF)
add_subdirectory(gpio)
add_subdirectory(boardtest)

View File

@ -0,0 +1,7 @@
target_sources(${TARGET_NAME} PRIVATE
LibgpiodTest.cpp
)

View File

@ -1,10 +1,11 @@
#include "LibgpiodTest.h"
#include "devices/gpioIds.h"
#include <fsfwconfig/devices/gpioIds.h>
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
#include <fsfw/objectmanager/ObjectManagerIF.h>
LibgpiodTest::LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId, GpioCookie* gpioCookie) :
LibgpiodTest::LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId,
GpioCookie* gpioCookie):
TestTask(objectId) {
gpioInterface = objectManager->get<GpioIF>(gpioIfobjectId);

View File

@ -1,5 +1,4 @@
target_sources(${TARGET_NAME} PUBLIC
LibgpiodTest.cpp
TestTask.cpp
)

View File

@ -1,41 +0,0 @@
/*
* MutextestTask.cpp
*
* Created on: 19.07.2018
* Author: mohr
*/
#include <test/testtasks/MutextestTask.h>
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
MutexIF * MutextestTask::mutex = nullptr;
MutextestTask::MutextestTask(const char *name, object_id_t setObjectId) :
SystemObject(setObjectId), name(name), locked(false) {
if (mutex == NULL) {
mutex = MutexFactory::instance()->createMutex();
}
}
ReturnValue_t MutextestTask::performOperation(uint8_t operationCode) {
if (!locked){
sif::info << name << ": locking..." << std::endl;
ReturnValue_t result = mutex->lockMutex(MutexIF::BLOCKING);
sif::info << name << ": locked with " << (int) result << std::endl;
if (result == HasReturnvaluesIF::RETURN_OK){
locked = true;
}
} else {
sif::info << name << ": releasing" << std::endl;
mutex->unlockMutex();
locked = false;
}
return HasReturnvaluesIF::RETURN_OK;
}
MutextestTask::~MutextestTask() {
// TODO Auto-generated destructor stub
}

View File

@ -1,32 +0,0 @@
/*
* MutextestTask.h
*
* Created on: 19.07.2018
* Author: mohr
*/
#ifndef MISSION_MUTEXTESTTASK_H_
#define MISSION_MUTEXTESTTASK_H_
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/tasks/ExecutableObjectIF.h>
#include <fsfw/ipc/MutexFactory.h>
/**
* Start two of them with a little time difference and different periods to see mutex in action
*/
class MutextestTask: public SystemObject, public ExecutableObjectIF {
public:
virtual ReturnValue_t performOperation(uint8_t operationCode = 0);
MutextestTask(const char *name, object_id_t setObjectId);
virtual ~MutextestTask();
private:
static MutexIF *mutex;
const char * name;
bool locked;
};
#endif /* MISSION_MUTEXTESTTASK_H_ */