extended STM32 test task

This commit is contained in:
Robin Müller 2021-10-27 18:38:47 +02:00
parent 473461a61d
commit cf97d690fe
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 18 additions and 0 deletions

View File

@ -17,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();
}

View File

@ -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 "bsp_stm32h7_freertos/boardtest/SpiTest.h"
#include "fsfw_tests/integration/task/TestTask.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;
}; };