diff --git a/bsp_stm32_freertos/core/ObjectFactory.cpp b/bsp_stm32_freertos/core/ObjectFactory.cpp index 5a4aac3..ecad8e2 100644 --- a/bsp_stm32_freertos/core/ObjectFactory.cpp +++ b/bsp_stm32_freertos/core/ObjectFactory.cpp @@ -24,11 +24,6 @@ #include "fsfw_hal/stm32h7/spi/SpiComIF.h" #include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h" -namespace spi { -SPI_TypeDef spiDriver = {}; -SPI_HandleTypeDef spiHandle = {}; -} - #endif void ObjectFactory::produce(void* args) { @@ -70,9 +65,8 @@ void ObjectFactory::produce(void* args) { #if OBSW_PERFORM_L3GD20H_TEST == 1 - new SpiComIF(objects::SPI_COM_IF, &spi::spiDriver, &spi::spiHandle, - spi::TransferModes::POLLING); - auto spiCookie = new SpiCookie(0, spi::SpiBus::SPI_1, 3900000, spi::SpiModes::MODE_3, + new SpiComIF(objects::SPI_COM_IF, spi::TransferModes::POLLING); + auto spiCookie = new SpiCookie(0, spi::SpiBus::SPI_1, SPI1, 3900000, spi::SpiModes::MODE_3, GPIO_PIN_14, GPIOD, 32); auto gyroDevice = new GyroHandlerL3GD20H(objects::SPI_DEVICE_TEST, objects::SPI_COM_IF, spiCookie); diff --git a/common/stm32_nucleo/STM32TestTask.cpp b/common/stm32_nucleo/STM32TestTask.cpp index 780034e..91b49a6 100644 --- a/common/stm32_nucleo/STM32TestTask.cpp +++ b/common/stm32_nucleo/STM32TestTask.cpp @@ -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(); } diff --git a/fsfw_hal b/fsfw_hal index 04166f8..5c40ca9 160000 --- a/fsfw_hal +++ b/fsfw_hal @@ -1 +1 @@ -Subproject commit 04166f87d82f3729b4462437677bae9105c1c88e +Subproject commit 5c40ca9ae85b59fd1f19115e2d02bae6df03dde7