added FSFW test task
This commit is contained in:
parent
cf97d690fe
commit
f193608c38
@ -2,4 +2,5 @@ target_sources(${TARGET_NAME} PRIVATE
|
||||
FsfwReaderTask.cpp
|
||||
FsfwExampleTask.cpp
|
||||
MutexExample.cpp
|
||||
FsfwTestTask.cpp
|
||||
)
|
12
example/test/FsfwTestTask.cpp
Normal file
12
example/test/FsfwTestTask.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include "FsfwTestTask.h"
|
||||
|
||||
FsfwTestTask::FsfwTestTask(object_id_t objectId, bool periodicEvent):
|
||||
TestTask(objectId), periodicEvent(periodicEvent) {
|
||||
}
|
||||
|
||||
ReturnValue_t FsfwTestTask::performPeriodicAction() {
|
||||
if(periodicEvent) {
|
||||
triggerEvent(TEST_EVENT, 0x1234, 0x4321);
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
21
example/test/FsfwTestTask.h
Normal file
21
example/test/FsfwTestTask.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef EXAMPLE_COMMON_EXAMPLE_TEST_FSFWTESTTASK_H_
|
||||
#define EXAMPLE_COMMON_EXAMPLE_TEST_FSFWTESTTASK_H_
|
||||
|
||||
#include "fsfw_tests/integration/task/TestTask.h"
|
||||
|
||||
#include "fsfw/events/Event.h"
|
||||
#include "events/subsystemIdRanges.h"
|
||||
|
||||
class FsfwTestTask: public TestTask {
|
||||
public:
|
||||
FsfwTestTask(object_id_t objectId, bool periodicEvent);
|
||||
|
||||
ReturnValue_t performPeriodicAction() override;
|
||||
private:
|
||||
|
||||
bool periodicEvent = false;
|
||||
static constexpr uint8_t subsystemId = SUBSYSTEM_ID::TEST_TASK_ID;
|
||||
static constexpr Event TEST_EVENT = event::makeEvent(subsystemId, 0, severity::INFO);
|
||||
};
|
||||
|
||||
#endif /* EXAMPLE_COMMON_EXAMPLE_TEST_FSFWTESTTASK_H_ */
|
Loading…
Reference in New Issue
Block a user