added periodic event
This commit is contained in:
parent
edaccc0dbd
commit
112adcbb64
@ -9,6 +9,7 @@
|
|||||||
namespace SUBSYSTEM_ID {
|
namespace SUBSYSTEM_ID {
|
||||||
enum commonSubsystemId: uint8_t {
|
enum commonSubsystemId: uint8_t {
|
||||||
COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE,
|
COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE,
|
||||||
|
TEST_TASK_ID = 105,
|
||||||
COMMON_SUBSYSTEM_ID_END
|
COMMON_SUBSYSTEM_ID_END
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -76,10 +76,9 @@ void ObjectFactory::produceGenericObjects() {
|
|||||||
new FsfwExampleTask(objects::TEST_DUMMY_3);
|
new FsfwExampleTask(objects::TEST_DUMMY_3);
|
||||||
|
|
||||||
|
|
||||||
#if OBSW_TASK_EXAMPLE_PRINTOUT == 1
|
|
||||||
bool enablePrintout = true;
|
|
||||||
#else
|
|
||||||
bool enablePrintout = false;
|
bool enablePrintout = false;
|
||||||
|
#if OBSW_TASK_EXAMPLE_PRINTOUT == 1
|
||||||
|
enablePrintout = true;
|
||||||
#endif
|
#endif
|
||||||
new FsfwReaderTask(objects::TEST_DUMMY_4, enablePrintout);
|
new FsfwReaderTask(objects::TEST_DUMMY_4, enablePrintout);
|
||||||
#endif /* OBSW_ADD_TASK_EXAMPLE == 1 */
|
#endif /* OBSW_ADD_TASK_EXAMPLE == 1 */
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
bool TestTask::oneShotAction = true;
|
bool TestTask::oneShotAction = true;
|
||||||
MutexIF* TestTask::testLock = nullptr;
|
MutexIF* TestTask::testLock = nullptr;
|
||||||
|
|
||||||
TestTask::TestTask(object_id_t objectId, bool periodicPrintout):
|
TestTask::TestTask(object_id_t objectId, bool periodicPrintout, bool periodicEvent):
|
||||||
SystemObject(objectId), testMode(testModes::A),
|
SystemObject(objectId), testMode(testModes::A),
|
||||||
periodicPrinout(periodicPrintout) {
|
periodicPrinout(periodicPrintout), periodicEvent(periodicEvent) {
|
||||||
if(testLock == nullptr) {
|
if(testLock == nullptr) {
|
||||||
testLock = MutexFactory::instance()->createMutex();
|
testLock = MutexFactory::instance()->createMutex();
|
||||||
}
|
}
|
||||||
@ -60,6 +60,9 @@ ReturnValue_t TestTask::performPeriodicAction() {
|
|||||||
sif::printInfo("TestTask::performPeriodicAction: Hello World!\n");
|
sif::printInfo("TestTask::performPeriodicAction: Hello World!\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
if(periodicEvent) {
|
||||||
|
triggerEvent(TEST_EVENT, 0x1234, 0x4321);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
#include <fsfw/objectmanager/SystemObject.h>
|
#include <fsfw/objectmanager/SystemObject.h>
|
||||||
#include <fsfw/storagemanager/StorageManagerIF.h>
|
#include <fsfw/storagemanager/StorageManagerIF.h>
|
||||||
|
|
||||||
|
#include "fsfw/events/Event.h"
|
||||||
|
#include "events/subsystemIdRanges.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Test class for general C++ testing and any other code which will not be part of the
|
* @brief Test class for general C++ testing and any other code which will not be part of the
|
||||||
@ -17,10 +19,13 @@ class TestTask :
|
|||||||
public ExecutableObjectIF,
|
public ExecutableObjectIF,
|
||||||
public HasReturnvaluesIF {
|
public HasReturnvaluesIF {
|
||||||
public:
|
public:
|
||||||
TestTask(object_id_t objectId, bool periodicPrintout);
|
TestTask(object_id_t objectId, bool periodicPrintout = false, bool periodicEvent = false);
|
||||||
virtual ~TestTask();
|
virtual ~TestTask();
|
||||||
virtual ReturnValue_t performOperation(uint8_t operationCode = 0);
|
virtual ReturnValue_t performOperation(uint8_t operationCode = 0);
|
||||||
|
|
||||||
|
static constexpr uint8_t subsystemId = SUBSYSTEM_ID::TEST_TASK_ID;
|
||||||
|
static constexpr Event TEST_EVENT = event::makeEvent(subsystemId, 0, severity::INFO);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ReturnValue_t performOneShotAction();
|
virtual ReturnValue_t performOneShotAction();
|
||||||
virtual ReturnValue_t performPeriodicAction();
|
virtual ReturnValue_t performPeriodicAction();
|
||||||
@ -34,6 +39,7 @@ protected:
|
|||||||
|
|
||||||
testModes testMode;
|
testModes testMode;
|
||||||
bool periodicPrinout = false;
|
bool periodicPrinout = false;
|
||||||
|
bool periodicEvent = false;
|
||||||
|
|
||||||
bool testFlag = false;
|
bool testFlag = false;
|
||||||
uint8_t counter { 1 };
|
uint8_t counter { 1 };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user