diff --git a/bsp_linux_board/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp index b245fee7..09a1001a 100644 --- a/bsp_linux_board/ObjectFactory.cpp +++ b/bsp_linux_board/ObjectFactory.cpp @@ -2,7 +2,6 @@ #include "OBSWConfig.h" #include "devConf.h" -#include "gpioInit.h" #include "devices/addresses.h" #include "devices/gpioIds.h" #include "fsfw/datapoollocal/LocalDataPoolManager.h" @@ -11,6 +10,7 @@ #include "fsfw/tmtcpacket/pus/tm.h" #include "fsfw/tmtcservices/CommandingServiceBase.h" #include "fsfw/tmtcservices/PusServiceBase.h" +#include "gpioInit.h" #include "linux/ObjectFactory.h" #include "linux/boardtest/LibgpiodTest.h" #include "linux/boardtest/SpiTestClass.h" @@ -83,7 +83,6 @@ void ObjectFactory::produce(void* args) { createSunSensorComponents(gpioIF, spiComIF, pwrSwitcher, spi::DEV); #endif - #if OBSW_ADD_TEST_CODE == 1 createTestTasks(); #endif /* OBSW_ADD_TEST_CODE == 1 */ diff --git a/bsp_linux_board/definitions.h b/bsp_linux_board/definitions.h index d1d7fe19..1b6814f4 100644 --- a/bsp_linux_board/definitions.h +++ b/bsp_linux_board/definitions.h @@ -1,9 +1,10 @@ #ifndef BSP_LINUX_BOARD_DEFINITIONS_H_ #define BSP_LINUX_BOARD_DEFINITIONS_H_ -#include "OBSWConfig.h" #include +#include "OBSWConfig.h" + #ifdef RASPBERRY_PI namespace spi { @@ -29,7 +30,7 @@ static constexpr uint8_t SPI_MUX_2_BCM = 22; static constexpr uint8_t SPI_MUX_3_BCM = 23; static constexpr uint8_t SPI_MUX_4_BCM = 5; static constexpr uint8_t SPI_MUX_5_BCM = 6; -} +} // namespace gpio #endif diff --git a/bsp_linux_board/gpioInit.cpp b/bsp_linux_board/gpioInit.cpp index 8b6eab26..f913db8a 100644 --- a/bsp_linux_board/gpioInit.cpp +++ b/bsp_linux_board/gpioInit.cpp @@ -1,18 +1,18 @@ #include "gpioInit.h" -#include "definitions.h" #include - #include #include -#include "fsfw_hal/linux/rpi/GpioRPi.h" #include +#include "definitions.h" +#include "fsfw_hal/linux/rpi/GpioRPi.h" + #ifdef RASPBERRY_PI struct MuxInfo { MuxInfo(gpioId_t gpioId, int bcmNum, std::string consumer) - : gpioId(gpioId), bcmNum(bcmNum), consumer(consumer) {} + : gpioId(gpioId), bcmNum(bcmNum), consumer(consumer) {} gpioId_t gpioId; int bcmNum; std::string consumer; @@ -27,20 +27,20 @@ void rpi::gpio::initSpiCsDecoder(GpioIF* gpioComIF) { return; } - std::array<::MuxInfo, 6> muxInfo { - MuxInfo(gpioIds::SPI_MUX_BIT_0, SPI_MUX_0_BCM, "SPI_MUX_0"), - MuxInfo(gpioIds::SPI_MUX_BIT_1, SPI_MUX_1_BCM, "SPI_MUX_1"), - MuxInfo(gpioIds::SPI_MUX_BIT_2, SPI_MUX_2_BCM, "SPI_MUX_2"), - MuxInfo(gpioIds::SPI_MUX_BIT_3, SPI_MUX_3_BCM, "SPI_MUX_3"), - MuxInfo(gpioIds::SPI_MUX_BIT_4, SPI_MUX_4_BCM, "SPI_MUX_4"), - MuxInfo(gpioIds::SPI_MUX_BIT_5, SPI_MUX_5_BCM, "SPI_MUX_5"), + std::array<::MuxInfo, 6> muxInfo{ + MuxInfo(gpioIds::SPI_MUX_BIT_0, SPI_MUX_0_BCM, "SPI_MUX_0"), + MuxInfo(gpioIds::SPI_MUX_BIT_1, SPI_MUX_1_BCM, "SPI_MUX_1"), + MuxInfo(gpioIds::SPI_MUX_BIT_2, SPI_MUX_2_BCM, "SPI_MUX_2"), + MuxInfo(gpioIds::SPI_MUX_BIT_3, SPI_MUX_3_BCM, "SPI_MUX_3"), + MuxInfo(gpioIds::SPI_MUX_BIT_4, SPI_MUX_4_BCM, "SPI_MUX_4"), + MuxInfo(gpioIds::SPI_MUX_BIT_5, SPI_MUX_5_BCM, "SPI_MUX_5"), }; GpioCookie* spiMuxGpios = new GpioCookie; - for (const auto& info: muxInfo) { + for (const auto& info : muxInfo) { result = createRpiGpioConfig(spiMuxGpios, info.gpioId, info.bcmNum, info.consumer, - Direction::OUT, Levels::LOW); - if(result != HasReturnvaluesIF::RETURN_OK) { + Direction::OUT, Levels::LOW); + if (result != HasReturnvaluesIF::RETURN_OK) { sif::error << "Creating Raspberry Pi SPI Mux GPIO failed with code " << result << std::endl; return; } diff --git a/bsp_linux_board/gpioInit.h b/bsp_linux_board/gpioInit.h index be7f2f99..0ca66412 100644 --- a/bsp_linux_board/gpioInit.h +++ b/bsp_linux_board/gpioInit.h @@ -14,7 +14,7 @@ namespace gpio { */ void initSpiCsDecoder(GpioIF* gpioComIF); -} // namespace gpioCallbacks +} // namespace gpio } // namespace rpi #endif diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index ed62840b..5e78bc0e 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -339,9 +339,7 @@ gpioId_t HeaterHandler::getGpioIdFromSwitchNr(int switchNr) { MessageQueueId_t HeaterHandler::getCommandQueue() const { return commandQueue->getId(); } -ReturnValue_t HeaterHandler::sendFuseOnCommand(uint8_t fuseNr) { - return RETURN_OK; -} +ReturnValue_t HeaterHandler::sendFuseOnCommand(uint8_t fuseNr) { return RETURN_OK; } ReturnValue_t HeaterHandler::getSwitchState(uint8_t switchNr) const { return 0; } diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index fa8f3c91..837d4f37 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -350,9 +350,7 @@ ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO return result; } -ReturnValue_t PCDUHandler::sendFuseOnCommand(uint8_t fuseNr) { - return RETURN_OK; -} +ReturnValue_t PCDUHandler::sendFuseOnCommand(uint8_t fuseNr) { return RETURN_OK; } ReturnValue_t PCDUHandler::getSwitchState(uint8_t switchNr) const { if (switchNr >= pcduSwitches::NUMBER_OF_SWITCHES) {