4 Commits

4 changed files with 23 additions and 4 deletions

View File

@ -116,7 +116,8 @@ void ObjectFactory::produceGenericObjects() {
#if OBSW_CONTROLLER_PRINTOUT == 1
#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 */

View File

@ -3,8 +3,7 @@
#include "OBSWConfig.h"
STM32TestTask::STM32TestTask(object_id_t objectId, bool enablePrintout,
bool blinkyLed): TestTask(objectId, enablePrintout),
blinkyLed(blinkyLed) {
bool blinkyLed): TestTask(objectId), blinkyLed(blinkyLed) {
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
@ -18,5 +17,17 @@ ReturnValue_t STM32TestTask::performPeriodicAction() {
#endif
BSP_LED_Toggle(LED3);
}
if(testSpi) {
spiTest->performOperation();
}
return TestTask::performPeriodicAction();
}
ReturnValue_t STM32TestTask::initialize() {
if(testSpi) {
spiComIF = new SpiComIF(objects::SPI_COM_IF);
spiTest = new SpiTest(*spiComIF);
}
return TestTask::initialize();
}

View File

@ -1,16 +1,22 @@
#ifndef 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 {
public:
STM32TestTask(object_id_t objectId, bool enablePrintout, bool blinkyLed = true);
ReturnValue_t initialize() override;
ReturnValue_t performPeriodicAction() override;
private:
SpiComIF* spiComIF = nullptr;
SpiTest* spiTest = nullptr;
bool blinkyLed = false;
bool testSpi = true;
};

View File

@ -44,6 +44,7 @@
*/
/* Includes ------------------------------------------------------------------*/
#include "fsfw/FSFW.h"
#include "ethernetif.h"
#include <string.h>