device handler partly working

This commit is contained in:
2021-06-10 12:06:51 +02:00
parent 5cbe18caa6
commit 5717a83e9e
3 changed files with 9 additions and 11 deletions

View File

@ -22,13 +22,17 @@ ReturnValue_t STM32TestTask::performPeriodicAction() {
}
ReturnValue_t STM32TestTask::performOneShotAction() {
// performSpiL3gd20hTest();
// Might be confusing but if this is defined to 1, the real device handler is tested and we
// should not mess with the SPI bus
#if OBSW_PERFORM_L3GD20H_TEST == 0
performSpiL3gd20hTest();
#endif
return HasReturnvaluesIF::RETURN_OK;
}
void STM32TestTask::performSpiL3gd20hTest() {
SPI_HandleTypeDef spiHandle = {};
GyroL3GD20H gyroDevice(&spiHandle, spi::TransferModes::DMA);
GyroL3GD20H gyroDevice(&spiHandle, spi::TransferModes::POLLING);
gyroDevice.initialize();
gyroDevice.performOperation();
}