Compare commits
5 Commits
mueller/ex
...
f193608c38
Author | SHA1 | Date | |
---|---|---|---|
f193608c38 | |||
cf97d690fe | |||
473461a61d | |||
82147157b4 | |||
a0d775e086 |
@@ -116,7 +116,8 @@ void ObjectFactory::produceGenericObjects() {
|
|||||||
|
|
||||||
#if OBSW_CONTROLLER_PRINTOUT == 1
|
#if OBSW_CONTROLLER_PRINTOUT == 1
|
||||||
#endif
|
#endif
|
||||||
new TestController(objects::TEST_CONTROLLER);
|
new TestController(objects::TEST_CONTROLLER, objects::TEST_DEVICE_HANDLER_0,
|
||||||
|
objects::TEST_DEVICE_HANDLER_1);
|
||||||
|
|
||||||
#endif /* OBSW_ADD_CONTROLLER_DEMO == 1 */
|
#endif /* OBSW_ADD_CONTROLLER_DEMO == 1 */
|
||||||
|
|
||||||
|
@@ -2,4 +2,5 @@ target_sources(${TARGET_NAME} PRIVATE
|
|||||||
FsfwReaderTask.cpp
|
FsfwReaderTask.cpp
|
||||||
FsfwExampleTask.cpp
|
FsfwExampleTask.cpp
|
||||||
MutexExample.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_ */
|
@@ -3,8 +3,7 @@
|
|||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
|
|
||||||
STM32TestTask::STM32TestTask(object_id_t objectId, bool enablePrintout,
|
STM32TestTask::STM32TestTask(object_id_t objectId, bool enablePrintout,
|
||||||
bool blinkyLed): TestTask(objectId, enablePrintout),
|
bool blinkyLed): TestTask(objectId), blinkyLed(blinkyLed) {
|
||||||
blinkyLed(blinkyLed) {
|
|
||||||
BSP_LED_Init(LED1);
|
BSP_LED_Init(LED1);
|
||||||
BSP_LED_Init(LED2);
|
BSP_LED_Init(LED2);
|
||||||
BSP_LED_Init(LED3);
|
BSP_LED_Init(LED3);
|
||||||
@@ -18,5 +17,17 @@ ReturnValue_t STM32TestTask::performPeriodicAction() {
|
|||||||
#endif
|
#endif
|
||||||
BSP_LED_Toggle(LED3);
|
BSP_LED_Toggle(LED3);
|
||||||
}
|
}
|
||||||
|
if(testSpi) {
|
||||||
|
spiTest->performOperation();
|
||||||
|
}
|
||||||
return TestTask::performPeriodicAction();
|
return TestTask::performPeriodicAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReturnValue_t STM32TestTask::initialize() {
|
||||||
|
if(testSpi) {
|
||||||
|
spiComIF = new SpiComIF(objects::SPI_COM_IF);
|
||||||
|
spiTest = new SpiTest(*spiComIF);
|
||||||
|
|
||||||
|
}
|
||||||
|
return TestTask::initialize();
|
||||||
|
}
|
||||||
|
@@ -1,16 +1,22 @@
|
|||||||
#ifndef BSP_STM32_BOARDTEST_STM32TESTTASK_H_
|
#ifndef BSP_STM32_BOARDTEST_STM32TESTTASK_H_
|
||||||
#define BSP_STM32_BOARDTEST_STM32TESTTASK_H_
|
#define BSP_STM32_BOARDTEST_STM32TESTTASK_H_
|
||||||
|
|
||||||
#include "../test/TestTask.h"
|
#include "bsp_stm32h7_freertos/boardtest/SpiTest.h"
|
||||||
|
#include "fsfw_tests/integration/task/TestTask.h"
|
||||||
|
|
||||||
class STM32TestTask: public TestTask {
|
class STM32TestTask: public TestTask {
|
||||||
public:
|
public:
|
||||||
STM32TestTask(object_id_t objectId, bool enablePrintout, bool blinkyLed = true);
|
STM32TestTask(object_id_t objectId, bool enablePrintout, bool blinkyLed = true);
|
||||||
|
|
||||||
|
ReturnValue_t initialize() override;
|
||||||
ReturnValue_t performPeriodicAction() override;
|
ReturnValue_t performPeriodicAction() override;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
SpiComIF* spiComIF = nullptr;
|
||||||
|
SpiTest* spiTest = nullptr;
|
||||||
|
|
||||||
bool blinkyLed = false;
|
bool blinkyLed = false;
|
||||||
|
bool testSpi = true;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -44,6 +44,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "fsfw/FSFW.h"
|
||||||
#include "ethernetif.h"
|
#include "ethernetif.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
Reference in New Issue
Block a user