hal update

This commit is contained in:
2021-06-10 14:19:26 +02:00
parent 8ab484d3ac
commit 1f9fcecd98
3 changed files with 11 additions and 7 deletions

View File

@ -18,6 +18,10 @@ ReturnValue_t STM32TestTask::performPeriodicAction() {
#endif
BSP_LED_Toggle(LED3);
}
if(gyro != nullptr) {
gyro->performOperation();
}
return TestTask::performPeriodicAction();
}
@ -31,8 +35,7 @@ ReturnValue_t STM32TestTask::performOneShotAction() {
}
void STM32TestTask::performSpiL3gd20hTest() {
SPI_HandleTypeDef spiHandle = {};
GyroL3GD20H gyroDevice(&spiHandle, spi::TransferModes::POLLING);
gyroDevice.initialize();
gyroDevice.performOperation();
gyro = new GyroL3GD20H(&spiHandle, spi::TransferModes::POLLING);
gyro->initialize();
gyro->performOperation();
}

View File

@ -5,7 +5,7 @@
#include "stm32h7xx_hal.h"
#include "stm32h7xx_hal_spi.h"
class GyroL3GD20H;
class STM32TestTask: public TestTask {
public:
@ -18,7 +18,8 @@ public:
private:
bool blinkyLed = false;
SPI_HandleTypeDef spiHandle = {};
GyroL3GD20H* gyro = nullptr;
};