From e98b985d66145632c928880b31efad4d18866511 Mon Sep 17 00:00:00 2001 From: IRS Cleanroom Laptop Date: Tue, 17 Aug 2021 17:48:51 +0200 Subject: [PATCH] cleaning up preproc defines --- bsp_q7s/boardconfig/busConf.h | 7 +- bsp_q7s/core/InitMission.cpp | 8 +- bsp_q7s/core/ObjectFactory.cpp | 129 +++++++++--------- bsp_q7s/devices/PlocSupervisorHandler.cpp | 6 +- common/config/devConf.h | 2 + linux/devices/SusHandler.cpp | 2 +- linux/fsfwconfig/OBSWConfig.h.in | 97 +++++++------ .../pollingSequenceFactory.cpp | 10 +- linux/obc/CCSDSIPCoreBridge.cpp | 2 +- mission/devices/ACUHandler.cpp | 2 +- mission/devices/GyroADIS16507Handler.cpp | 4 +- mission/devices/GyroADIS16507Handler.h | 2 +- mission/devices/IMTQHandler.cpp | 18 +-- mission/devices/Max31865PT1000Handler.cpp | 4 +- mission/devices/P60DockHandler.cpp | 2 +- mission/devices/PDU1Handler.cpp | 2 +- mission/devices/PDU2Handler.cpp | 2 +- mission/devices/RadiationSensorHandler.cpp | 2 +- mission/devices/RwHandler.cpp | 8 +- mission/devices/StarTrackerHandler.cpp | 2 +- mission/devices/SyrlinksHkHandler.cpp | 8 +- 21 files changed, 166 insertions(+), 153 deletions(-) diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index bdca6ee5..27f44b04 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -3,9 +3,12 @@ namespace q7s { -static constexpr char SPI_DEFAULT_FILE[] = "dev/spidev2.0"; -static constexpr char SPI_RW_FILE[] = "dev/spidev3.0"; +static constexpr char SPI_DEFAULT_DEV[] = "dev/spidev2.0"; +static constexpr char SPI_RW_DEV[] = "dev/spidev3.0"; +static constexpr char I2C_DEFAULT_DEV[] = "/dev/i2c-0"; + +static constexpr char UART_PLOC_MPSOC_DEV[] = "/dev/ttyUL3"; } diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 2ee4d374..230a80bf 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -112,7 +112,7 @@ void initmission::initTasks() { initmission::printAddObjectError("FILE_SYSTEM_TASK", objects::FILE_SYSTEM_HANDLER); } -#if TEST_CCSDS_BRIDGE == 1 +#if OBSW_TEST_CCSDS_BRIDGE == 1 PeriodicTaskIF* ptmeTestTask = factory->createPeriodicTask( "PTME_TEST", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); result = ptmeTestTask->addComponent(objects::CCSDS_IP_CORE_BRIDGE); @@ -152,7 +152,7 @@ void initmission::initTasks() { taskStarter(testTasks, "Test task vector"); #endif -#if TEST_CCSDS_BRIDGE == 1 +#if OBSW_TEST_CCSDS_BRIDGE == 1 ptmeTestTask->startTask(); #endif fsTask->startTask(); @@ -301,11 +301,11 @@ void initmission::createTestTasks(TaskFactory& factory, TaskDeadlineMissedFuncti initmission::printAddObjectError("SPI_TEST", objects::SPI_TEST); } #endif -#if BOARD_TE0720 == 1 && TEST_LIBGPIOD == 1 +#if BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1 result = testTask->addComponent(objects::LIBGPIOD_TEST); if(result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("GPIOD_TEST", objects::LIBGPIOD_TEST); } -#endif /* BOARD_TE0720 == 1 && TEST_LIBGPIOD == 1 */ +#endif /* BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1 */ taskVec.push_back(testTask); } diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index b48d3bf7..1f9cccca 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -76,7 +76,7 @@ #include "linux/boardtest/SpiTestClass.h" -#if TEST_LIBGPIOD == 1 +#if OBSW_TEST_LIBGPIOD == 1 #include "linux/boardtest/LibgpiodTest.h" #endif @@ -127,15 +127,15 @@ void ObjectFactory::produce(void* args){ createRtdComponents(); #endif /* Q7S_ADD_RTD_DEVICES == 1 */ - I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, - std::string("/dev/i2c-0")); + I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, + IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV); new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie); -#if ADD_PLOC_MPSOC == 1 - UartCookie* mpsocUartCookie = new UartCookie(objects::RW1, std::string("/dev/ttyUL3"), - UartModes::NON_CANONICAL, 115200, PLOC_MPSOC::MAX_REPLY_SIZE); +#if OBSW_ADD_PLOC_MPSOC == 1 + UartCookie* mpsocUartCookie = new UartCookie(objects::RW1, q7s::UART_PLOC_MPSOC_DEV, + UartModes::NON_CANONICAL, uart::PLOC_MPSOC_BAUD, PLOC_MPSOC::MAX_REPLY_SIZE); new PlocMPSoCHandler(objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocUartCookie); -#endif /* ADD_PLOC_MPSOC */ +#endif /* OBSW_ADD_PLOC_MPSOC */ createReactionWheelComponents(gpioComIF); #endif /* TE7020 != 0 */ @@ -159,7 +159,7 @@ void ObjectFactory::produce(void* args){ new FileSystemHandler(objects::FILE_SYSTEM_HANDLER); -#if ADD_PLOC_MPSOC == 1 +#if OBSW_ADD_PLOC_MPSOC == 1 UartCookie* plocMpsocCookie = new UartCookie(objects::RW1, std::string("/dev/ttyUL3"), UartModes::NON_CANONICAL, 115200, PLOC_MPSOC::MAX_REPLY_SIZE); new PlocMPSoCHandler(objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, plocMpsocCookie); @@ -172,7 +172,7 @@ void ObjectFactory::produce(void* args){ new StarTrackerHandler(objects::START_TRACKER, objects::UART_COM_IF, starTrackerCookie); #endif -#if ADD_PLOC_SUPERVISOR == 1 +#if OBSW_ADD_PLOC_SUPERVISOR == 1 UartCookie* plocSupervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, std::string("/dev/ttyUL4"), UartModes::NON_CANONICAL, 115200, PLOC_SPV::MAX_PACKET_SIZE * 20); @@ -267,7 +267,7 @@ void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) { gpioComIF->addGpios(gpioCookieRadSensor); SpiCookie* spiCookieRadSensor = new SpiCookie(addresses::RAD_SENSOR, gpioIds::CS_RAD_SENSOR, - std::string(q7s::SPI_DEFAULT_FILE), RAD_SENSOR::READ_SIZE, spi::DEFAULT_MAX_1227_MODE, + std::string(q7s::SPI_DEFAULT_DEV), RAD_SENSOR::READ_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED); new RadiationSensorHandler(objects::RAD_SENSOR, objects::SPI_COM_IF, spiCookieRadSensor); } @@ -318,43 +318,43 @@ void ObjectFactory::createSunSensorComponents(LinuxLibgpioIF *gpioComIF) { gpioComIF->addGpios(gpioCookieSus); SpiCookie* spiCookieSus1 = new SpiCookie(addresses::SUS_1, gpio::NO_GPIO, - std::string(q7s::SPI_DEFAULT_FILE), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + std::string(q7s::SPI_DEFAULT_DEV), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, SUS::MAX1227_SPI_FREQ); SpiCookie* spiCookieSus2 = new SpiCookie(addresses::SUS_2, gpio::NO_GPIO, - std::string(q7s::SPI_DEFAULT_FILE), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + std::string(q7s::SPI_DEFAULT_DEV), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, SUS::MAX1227_SPI_FREQ); SpiCookie* spiCookieSus3 = new SpiCookie(addresses::SUS_3, gpio::NO_GPIO, - std::string(q7s::SPI_DEFAULT_FILE), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + std::string(q7s::SPI_DEFAULT_DEV), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, SUS::MAX1227_SPI_FREQ); SpiCookie* spiCookieSus4 = new SpiCookie(addresses::SUS_4, gpio::NO_GPIO, - std::string(q7s::SPI_DEFAULT_FILE), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + std::string(q7s::SPI_DEFAULT_DEV), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, SUS::MAX1227_SPI_FREQ); SpiCookie* spiCookieSus5 = new SpiCookie(addresses::SUS_5, gpio::NO_GPIO, - std::string(q7s::SPI_DEFAULT_FILE), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + std::string(q7s::SPI_DEFAULT_DEV), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, SUS::MAX1227_SPI_FREQ); SpiCookie* spiCookieSus6 = new SpiCookie(addresses::SUS_6, gpio::NO_GPIO, - std::string(q7s::SPI_DEFAULT_FILE), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + std::string(q7s::SPI_DEFAULT_DEV), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, SUS::MAX1227_SPI_FREQ); SpiCookie* spiCookieSus7 = new SpiCookie(addresses::SUS_7, gpio::NO_GPIO, - std::string(q7s::SPI_DEFAULT_FILE), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + std::string(q7s::SPI_DEFAULT_DEV), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, SUS::MAX1227_SPI_FREQ); SpiCookie* spiCookieSus8 = new SpiCookie(addresses::SUS_8, gpio::NO_GPIO, - std::string(q7s::SPI_DEFAULT_FILE), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + std::string(q7s::SPI_DEFAULT_DEV), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, SUS::MAX1227_SPI_FREQ); SpiCookie* spiCookieSus9 = new SpiCookie(addresses::SUS_9, gpio::NO_GPIO, - std::string(q7s::SPI_DEFAULT_FILE), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + std::string(q7s::SPI_DEFAULT_DEV), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, SUS::MAX1227_SPI_FREQ); SpiCookie* spiCookieSus10 = new SpiCookie(addresses::SUS_10, gpio::NO_GPIO, - std::string(q7s::SPI_DEFAULT_FILE), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + std::string(q7s::SPI_DEFAULT_DEV), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, SUS::MAX1227_SPI_FREQ); SpiCookie* spiCookieSus11 = new SpiCookie(addresses::SUS_11, gpio::NO_GPIO, - std::string(q7s::SPI_DEFAULT_FILE), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + std::string(q7s::SPI_DEFAULT_DEV), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, SUS::MAX1227_SPI_FREQ); SpiCookie* spiCookieSus12 = new SpiCookie(addresses::SUS_12, gpio::NO_GPIO, - std::string(q7s::SPI_DEFAULT_FILE), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + std::string(q7s::SPI_DEFAULT_DEV), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, SUS::MAX1227_SPI_FREQ); SpiCookie* spiCookieSus13 = new SpiCookie(addresses::SUS_13, gpio::NO_GPIO, - std::string(q7s::SPI_DEFAULT_FILE), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + std::string(q7s::SPI_DEFAULT_DEV), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, SUS::MAX1227_SPI_FREQ); new SusHandler(objects::SUS_1, objects::SPI_COM_IF, spiCookieSus1, gpioComIF, @@ -416,7 +416,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI gpioComIF->addGpios(gpioCookieAcsBoard); - std::string spiDev = q7s::SPI_DEFAULT_FILE; + std::string spiDev = q7s::SPI_DEFAULT_DEV; SpiCookie* spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev, MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); auto mgmLis3Handler = new MGMHandlerLIS3MDL(objects::MGM_0_LIS3_HANDLER, @@ -589,52 +589,52 @@ void ObjectFactory::createRtdComponents(LinuxLibgpioIF *gpioComIF) { gpioComIF->addGpios(rtdGpioCookie); SpiCookie* spiRtdIc3 = new SpiCookie(addresses::RTD_IC3, gpioIds::RTD_IC3, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_3, 2000000); SpiCookie* spiRtdIc4 = new SpiCookie(addresses::RTD_IC4, gpioIds::RTD_IC4, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); SpiCookie* spiRtdIc5 = new SpiCookie(addresses::RTD_IC5, gpioIds::RTD_IC5, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); SpiCookie* spiRtdIc6 = new SpiCookie(addresses::RTD_IC6, gpioIds::RTD_IC6, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); SpiCookie* spiRtdIc7 = new SpiCookie(addresses::RTD_IC7, gpioIds::RTD_IC7, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); SpiCookie* spiRtdIc8 = new SpiCookie(addresses::RTD_IC8, gpioIds::RTD_IC8, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); SpiCookie* spiRtdIc9 = new SpiCookie(addresses::RTD_IC9, gpioIds::RTD_IC9, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); SpiCookie* spiRtdIc10 = new SpiCookie(addresses::RTD_IC10, gpioIds::RTD_IC10, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); SpiCookie* spiRtdIc11 = new SpiCookie(addresses::RTD_IC11, gpioIds::RTD_IC11, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); SpiCookie* spiRtdIc12 = new SpiCookie(addresses::RTD_IC12, gpioIds::RTD_IC12, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); SpiCookie* spiRtdIc13 = new SpiCookie(addresses::RTD_IC13, gpioIds::RTD_IC13, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); SpiCookie* spiRtdIc14 = new SpiCookie(addresses::RTD_IC14, gpioIds::RTD_IC14, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); SpiCookie* spiRtdIc15 = new SpiCookie(addresses::RTD_IC15, gpioIds::RTD_IC15, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 3900000); SpiCookie* spiRtdIc16 = new SpiCookie(addresses::RTD_IC16, gpioIds::RTD_IC16, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); SpiCookie* spiRtdIc17 = new SpiCookie(addresses::RTD_IC17, gpioIds::RTD_IC17, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); SpiCookie* spiRtdIc18 = new SpiCookie(addresses::RTD_IC18, gpioIds::RTD_IC18, - std::string(q7s::SPI_DEFAULT_FILE), Max31865Definitions::MAX_REPLY_SIZE, + std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); Max31865PT1000Handler* rtdIc3 = new Max31865PT1000Handler(objects::RTD_IC3, @@ -690,30 +690,30 @@ void ObjectFactory::createRtdComponents(LinuxLibgpioIF *gpioComIF) { void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) { GpioCookie* gpioCookieRw = new GpioCookie; - GpioCallback* csRw1 = new GpioCallback(std::string("Chip select reaction wheel 1"), gpio::OUT, + GpioCallback* csRw1 = new GpioCallback("Chip select reaction wheel 1", gpio::OUT, 1, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); gpioCookieRw->addGpio(gpioIds::CS_RW1, csRw1); - GpioCallback* csRw2 = new GpioCallback(std::string("Chip select reaction wheel 2"), gpio::OUT, + GpioCallback* csRw2 = new GpioCallback("Chip select reaction wheel 2", gpio::OUT, 1, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); gpioCookieRw->addGpio(gpioIds::CS_RW2, csRw2); - GpioCallback* csRw3 = new GpioCallback(std::string("Chip select reaction wheel 3"), gpio::OUT, + GpioCallback* csRw3 = new GpioCallback("Chip select reaction wheel 3", gpio::OUT, 1, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); gpioCookieRw->addGpio(gpioIds::CS_RW3, csRw3); - GpioCallback* csRw4 = new GpioCallback(std::string("Chip select reaction wheel 4"), gpio::OUT, + GpioCallback* csRw4 = new GpioCallback("Chip select reaction wheel 4", gpio::OUT, 1, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); gpioCookieRw->addGpio(gpioIds::CS_RW4, csRw4); - GpiodRegular* enRw1 = new GpiodRegular(std::string("gpiochip5"), 7, - std::string("Enable reaction wheel 1"), gpio::OUT, 0); + GpiodRegular* enRw1 = new GpiodRegular("gpiochip5", 7, + "Enable reaction wheel 1", gpio::OUT, 0); gpioCookieRw->addGpio(gpioIds::EN_RW1, enRw1); - GpiodRegular* enRw2 = new GpiodRegular(std::string("gpiochip5"), 3, - std::string("Enable reaction wheel 2"), gpio::OUT, 0); + GpiodRegular* enRw2 = new GpiodRegular("gpiochip5", 3, + "Enable reaction wheel 2", gpio::OUT, 0); gpioCookieRw->addGpio(gpioIds::EN_RW2, enRw2); - GpiodRegular* enRw3 = new GpiodRegular(std::string("gpiochip5"), 11, - std::string("Enable reaction wheel 3"), gpio::OUT, 0); + GpiodRegular* enRw3 = new GpiodRegular("gpiochip5", 11, + "Enable reaction wheel 3", gpio::OUT, 0); gpioCookieRw->addGpio(gpioIds::EN_RW3, enRw3); - GpiodRegular* enRw4 = new GpiodRegular(std::string("gpiochip5"), 6, - std::string("Enable reaction wheel 4"), gpio::OUT, 0); + GpiodRegular* enRw4 = new GpiodRegular("gpiochip5", 6, + "Enable reaction wheel 4", gpio::OUT, 0); gpioCookieRw->addGpio(gpioIds::EN_RW4, enRw4); /** @@ -721,22 +721,21 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) { * the PS SPI peripheral from the SPI interface and route out the SPI lines of the AXI SPI core. * Per default the PS SPI is selected (EMIO = 0). */ - GpiodRegular* spiMux = new GpiodRegular(std::string("gpiochip11"), 54, - std::string("EMIO 0 SPI Mux"), gpio::OUT, 0); + GpiodRegular* spiMux = new GpiodRegular("gpiochip11", 54, "EMIO 0 SPI Mux", gpio::OUT, 0); gpioCookieRw->addGpio(gpioIds::SPI_MUX, spiMux); gpioComIF->addGpios(gpioCookieRw); - auto rw1SpiCookie = new SpiCookie(addresses::RW1, gpioIds::CS_RW1, q7s::SPI_RW_FILE, + auto rw1SpiCookie = new SpiCookie(addresses::RW1, gpioIds::CS_RW1, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr); - auto rw2SpiCookie = new SpiCookie(addresses::RW2, gpioIds::CS_RW2, q7s::SPI_RW_FILE, + auto rw2SpiCookie = new SpiCookie(addresses::RW2, gpioIds::CS_RW2, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr); - auto rw3SpiCookie = new SpiCookie(addresses::RW3, gpioIds::CS_RW3, q7s::SPI_RW_FILE, + auto rw3SpiCookie = new SpiCookie(addresses::RW3, gpioIds::CS_RW3, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr); - auto rw4SpiCookie = new SpiCookie(addresses::RW4, gpioIds::CS_RW4, q7s::SPI_RW_FILE, + auto rw4SpiCookie = new SpiCookie(addresses::RW4, gpioIds::CS_RW4, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr); @@ -760,7 +759,7 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) { void ObjectFactory::createTestComponents() { new Q7STestTask(objects::TEST_TASK); -#if BOARD_TE0720 == 1 && TEST_LIBGPIOD == 1 +#if BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1 /* Configure MIO0 as input */ GpiodRegular gpioConfigMio0(std::string("gpiochip0"), 0, std::string("MIO0"), gpio::IN, 0); @@ -769,7 +768,7 @@ void ObjectFactory::createTestComponents() { new LibgpiodTest(objects::LIBGPIOD_TEST, objects::GPIO_IF, gpioCookie); #endif -#if BOARD_TE0720 == 1 && TEST_SUS_HANDLER == 1 +#if BOARD_TE0720 == 1 && OBSW_TEST_SUS_HANDLER == 1 GpioCookie* gpioCookieSus = new GpioCookie; GpiodRegular* chipSelectSus = new GpiodRegular(std::string("gpiochip1"), 9, std::string("Chip Select Sus Sensor"), gpio::OUT, 1); @@ -783,7 +782,7 @@ void ObjectFactory::createTestComponents() { gpioIds::CS_SUS_1); #endif -#if BOARD_TE0720 == 1 && TEST_CCSDS_BRIDGE == 1 +#if BOARD_TE0720 == 1 && OBSW_TEST_CCSDS_BRIDGE == 1 GpioCookie* gpioCookieCcsdsIp = new GpioCookie; GpiodRegular* papbBusyN = new GpiodRegular(std::string("gpiochip0"), 0, std::string("PAPBBusy_N")); gpioCookieCcsdsIp->addGpio(gpioIds::PAPB_BUSY_N, papbBusyN); @@ -797,7 +796,7 @@ void ObjectFactory::createTestComponents() { gpioIds::PAPB_BUSY_N, gpioIds::PAPB_EMPTY); #endif -#if BOARD_TE0720 == 1 && TEST_RADIATION_SENSOR_HANDLER == 1 +#if BOARD_TE0720 == 1 && OBSW_TEST_RADIATION_SENSOR_HANDLER == 1 GpioCookie* gpioCookieRadSensor = new GpioCookie; GpiodRegular* chipSelectRadSensor = new GpiodRegular(std::string("gpiochip1"), 0, std::string("Chip select radiation sensor"), gpio::OUT, 1); @@ -813,7 +812,7 @@ void ObjectFactory::createTestComponents() { radSensor->setStartUpImmediately(); #endif -#if BOARD_TE0720 == 1 && ADD_PLOC_MPSOC == 1 +#if BOARD_TE0720 == 1 && OBSW_ADD_PLOC_MPSOC == 1 UartCookie* plocUartCookie = new UartCookie(std::string("/dev/ttyPS1"), 115200, PLOC_MPSOC::MAX_REPLY_SIZE); /* Testing PlocMPSoCHandler on TE0720-03-1CFA */ @@ -822,7 +821,7 @@ void ObjectFactory::createTestComponents() { mpsocPlocHandler->setStartUpImmediately(); #endif -#if BOARD_TE0720 == 1 && TE0720_HEATER_TEST == 1 +#if BOARD_TE0720 == 1 && OBSW_TEST_TE7020_HEATER == 1 /* Configuration for MIO0 on TE0720-03-1CFA */ GpiodRegular* heaterGpio = new GpiodRegular(std::string("gpiochip0"), 0, std::string("MIO0"), gpio::IN, 0); GpioCookie* gpioCookie = new GpioCookie; @@ -831,7 +830,7 @@ void ObjectFactory::createTestComponents() { pcduSwitches::TCS_BOARD_8V_HEATER_IN); #endif -#if BOARD_TE0720 == 1 && ADD_PLOC_SUPERVISOR == 1 +#if BOARD_TE0720 == 1 && OBSW_ADD_PLOC_SUPERVISOR == 1 /* Configuration for MIO0 on TE0720-03-1CFA */ UartCookie* plocSupervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, std::string("/dev/ttyPS1"), UartModes::NON_CANONICAL, 115200, diff --git a/bsp_q7s/devices/PlocSupervisorHandler.cpp b/bsp_q7s/devices/PlocSupervisorHandler.cpp index de50955f..7d51874d 100644 --- a/bsp_q7s/devices/PlocSupervisorHandler.cpp +++ b/bsp_q7s/devices/PlocSupervisorHandler.cpp @@ -736,7 +736,7 @@ ReturnValue_t PlocSupervisorHandler::handleHkReport(const uint8_t* data) { nextReplyId = PLOC_SPV::EXE_REPORT; -#if OBSW_VERBOSE_LEVEL >= 1 && PLOC_SUPERVISOR_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PLOC_SUPERVISOR == 1 sif::info << "PlocSupervisorHandler::handleHkReport: temp_ps: " << hkset.tempPs << std::endl; sif::info << "PlocSupervisorHandler::handleHkReport: temp_pl: " << hkset.tempPl << std::endl; sif::info << "PlocSupervisorHandler::handleHkReport: temp_sup: " << hkset.tempSup << std::endl; @@ -793,7 +793,7 @@ ReturnValue_t PlocSupervisorHandler::handleBootStatusReport(const uint8_t* data) nextReplyId = PLOC_SPV::EXE_REPORT; -#if OBSW_VERBOSE_LEVEL >= 1 && PLOC_SUPERVISOR_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PLOC_SUPERVISOR == 1 sif::info << "PlocSupervisorHandler::handleBootStatusReport: Boot signal: " << static_cast(bootStatusReport.bootSignal.value) << std::endl; sif::info << "PlocSupervisorHandler::handleBootStatusReport: Reset counter: " @@ -868,7 +868,7 @@ ReturnValue_t PlocSupervisorHandler::handleLatchupStatusReport(const uint8_t* da nextReplyId = PLOC_SPV::EXE_REPORT; -#if OBSW_VERBOSE_LEVEL >= 1 && PLOC_SUPERVISOR_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PLOC_SUPERVISOR == 1 sif::info << "PlocSupervisorHandler::handleLatchupStatusReport: Latchup ID: " << static_cast(latchupStatusReport.id.value) << std::endl; sif::info << "PlocSupervisorHandler::handleLatchupStatusReport: CNT0: " diff --git a/common/config/devConf.h b/common/config/devConf.h index f97567ac..e5201450 100644 --- a/common/config/devConf.h +++ b/common/config/devConf.h @@ -33,6 +33,8 @@ static constexpr spi::SpiModes RW_MODE = spi::SpiModes::MODE_0; namespace uart { +static constexpr uint32_t PLOC_MPSOC_BAUD = 115200; + } #endif /* COMMON_CONFIG_DEVCONF_H_ */ diff --git a/linux/devices/SusHandler.cpp b/linux/devices/SusHandler.cpp index c31160c4..67263756 100644 --- a/linux/devices/SusHandler.cpp +++ b/linux/devices/SusHandler.cpp @@ -173,7 +173,7 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, dataset.ain3 = (*(packet + 8) << 8 | *(packet + 9)); dataset.ain4 = (*(packet + 10) << 8 | *(packet + 11)); dataset.ain5 = (*(packet + 12) << 8 | *(packet + 13)); -#if OBSW_VERBOSE_LEVEL >= 1 && DEBUG_SUS +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SUS sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", Temperature: " << dataset.temperatureCelcius << " °C" << std::endl; sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", AIN0: " diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index e2693430..7d8334d2 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -1,14 +1,14 @@ /** - * @brief This file can be used to add preprocessor define for conditional - * code inclusion exclusion or various other project constants and - * properties in one place. + * @brief This file can be used to add preprocessor define for conditional + * code inclusion exclusion or various other project constants and + * properties in one place. */ #ifndef FSFWCONFIG_OBSWCONFIG_H_ #define FSFWCONFIG_OBSWCONFIG_H_ -#cmakedefine RASPBERRY_PI -#cmakedefine XIPHOS_Q7S -#cmakedefine BEAGLEBONEBLACK +/* #undef RASPBERRY_PI */ +#define XIPHOS_Q7S +/* #undef BEAGLEBONEBLACK */ #ifdef RASPBERRY_PI #include "rpiConfig.h" @@ -20,55 +20,64 @@ /* These defines should be disabled for mission code but are useful for debugging. */ -#define OBSW_VERBOSE_LEVEL 1 +#define OBSW_VERBOSE_LEVEL 1 + +//! Board defines +#define BOARD_TE0720 0 + +/*******************************************************************/ +/** All of the following flags should be enabled for mission code */ +/*******************************************************************/ //! Timers can mess up the code when debugging -//! TODO: Enable for mission code, disable for debug code -#define OBSW_ENABLE_TIMERS 0 +//! All of this should be enabled for mission code! +#define OBSW_ENABLE_TIMERS 1 +#define OBSW_ADD_GPS 0 +#define OBSW_ADD_STAR_TRACKER 0 +#define OBSW_ADD_PLOC_SUPERVISOR 0 +#define OBSW_ADD_PLOC_MPSOC 0 -#define OBSW_PRINT_MISSED_DEADLINES 1 -#define OBSW_ADD_TEST_CODE 1 -#define OBSW_ADD_TEST_PST 1 -#define OBSW_ADD_GPS 0 -#define OBSW_ADD_STAR_TRACKER 0 +/*******************************************************************/ +/** All of the following flags should be disabled for mission code */ +/*******************************************************************/ -#define TEST_LIBGPIOD 0 -#define TEST_RADIATION_SENSOR_HANDLER 0 -#define TEST_SUS_HANDLER 0 -#define TEST_PLOC_HANDLER 0 -#define TEST_CCSDS_BRIDGE 0 -#define PERFORM_PTME_TEST 0 -#define ADD_PLOC_SUPERVISOR 1 -#define ADD_PLOC_MPSOC 0 +//! /* Can be used to switch device to NORMAL mode immediately */ +#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1 +#define OBSW_PRINT_MISSED_DEADLINES 1 +#define OBSW_ADD_TEST_CODE 1 +#define OBSW_ADD_TEST_PST 0 +#define OBSW_TEST_LIBGPIOD 0 +#define OBSW_TEST_RADIATION_SENSOR_HANDLER 0 +#define OBSW_TEST_SUS_HANDLER 0 +#define OBSW_TEST_PLOC_HANDLER 0 +#define OBSW_TEST_CCSDS_BRIDGE 0 +#define OBSW_TEST_CCSDS_PTME 0 +#define OBSW_TEST_TE7020_HEATER 0 -#define BOARD_TE0720 0 -#define TE0720_HEATER_TEST 0 - -#define P60DOCK_DEBUG 0 -#define PDU1_DEBUG 0 -#define PDU2_DEBUG 0 -#define ACU_DEBUG 0 -#define SYRLINKS_DEBUG 0 -#define IMQT_DEBUG 0 -#define ADIS16507_DEBUG 1 -#define L3GD20_GYRO_DEBUG 0 -#define DEBUG_RAD_SENSOR 0 -#define DEBUG_SUS 1 -#define DEBUG_RTD 1 -#define IMTQ_DEBUG 1 -#define RW_DEBUG 0 -#define START_TRACKER_DEBUG 0 -#define PLOC_MPSOC_DEBUG 0 -#define PLOC_SUPERVISOR_DEBUG 1 +#define OBSW_DEBUG_P60DOCK 0 +#define OBSW_DEBUG_PDU1 0 +#define OBSW_DEBUG_PDU2 0 +#define OBSW_DEBUG_ACU 0 +#define OBSW_DEBUG_SYRLINKS 0 +#define OBSW_DEBUG_IMQT 0 +#define OBSW_DEBUG_ADIS16507 0 +#define OBSW_DEBUG_L3GD20_GYRO 0 +#define OBSW_DEBUG_RAD_SENSOR 0 +#define OBSW_DEBUG_SUS 0 +#define OBSW_DEBUG_RTD 0 +#define OBSW_DEBUG_RW 0 +#define OBSW_DEBUG_STARTRACKER 0 +#define OBSW_DEBUG_PLOC_MPSOC 0 +#define OBSW_DEBUG_PLOC_SUPERVISOR 0 +/*******************************************************************/ +/** Hardcoded */ +/*******************************************************************/ // Leave at one as the BSP is linux. Used by the ADIS16507 device handler #define OBSW_ADIS16507_LINUX_COM_IF 1 #include "OBSWVersion.h" -/* Can be used to switch device to NORMAL mode immediately */ -#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1 - #ifdef __cplusplus #include "objects/systemObjectList.h" diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 2e2466f7..819f40a9 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -520,7 +520,7 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { // Length of a communication cycle uint32_t length = thisSequence->getPeriodMs(); -#if ADD_PLOC_MPSOC == 1 +#if OBSW_ADD_PLOC_MPSOC == 1 thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.2, @@ -533,7 +533,7 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { DeviceHandlerIF::GET_READ); #endif -#if ADD_PLOC_SUPERVISOR == 1 +#if OBSW_ADD_PLOC_SUPERVISOR == 1 thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0.2, @@ -793,7 +793,7 @@ ReturnValue_t pst::pollingSequenceTE0720(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); #endif -#if TEST_RADIATION_SENSOR_HANDLER == 1 +#if OBSW_TEST_RADIATION_SENSOR_HANDLER == 1 thisSequence->addSlot(objects::RAD_SENSOR, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::RAD_SENSOR, length * 0.2, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::RAD_SENSOR, length * 0.4, DeviceHandlerIF::GET_WRITE); @@ -801,7 +801,7 @@ ReturnValue_t pst::pollingSequenceTE0720(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::RAD_SENSOR, length * 0.8, DeviceHandlerIF::GET_READ); #endif -#if TEST_SUS_HANDLER == 1 +#if OBSW_TEST_SUS_HANDLER == 1 /* Write setup */ thisSequence->addSlot(objects::SUS_1, length * 0.901, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::SUS_1, length * 0.902, SusHandler::FIRST_WRITE); @@ -824,7 +824,7 @@ ReturnValue_t pst::pollingSequenceTE0720(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::SUS_1, length * 0.915, DeviceHandlerIF::GET_READ); #endif -#if ADD_PLOC_SUPERVISOR == 1 +#if OBSW_ADD_PLOC_SUPERVISOR == 1 thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE); diff --git a/linux/obc/CCSDSIPCoreBridge.cpp b/linux/obc/CCSDSIPCoreBridge.cpp index 2678e76f..fe5a7007 100644 --- a/linux/obc/CCSDSIPCoreBridge.cpp +++ b/linux/obc/CCSDSIPCoreBridge.cpp @@ -39,7 +39,7 @@ ReturnValue_t CCSDSIPCoreBridge::initialize() { ReturnValue_t CCSDSIPCoreBridge::handleTm() { -#if PERFORM_PTME_TEST == 1 +#if OBSW_TEST_CCSDS_PTME == 1 return sendTestFrame(); #else return TmTcBridge::handleTm(); diff --git a/mission/devices/ACUHandler.cpp b/mission/devices/ACUHandler.cpp index 3d5d82e8..24bd52fe 100644 --- a/mission/devices/ACUHandler.cpp +++ b/mission/devices/ACUHandler.cpp @@ -21,7 +21,7 @@ void ACUHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pack parseHkTableReply(packet); handleDeviceTM(&acuHkTableDataset, id, true); -#if OBSW_ENHANCED_PRINTOUT == 1 && ACU_DEBUG == 1 +#if OBSW_ENHANCED_PRINTOUT == 1 && OBSW_DEBUG_ACU == 1 acuHkTableDataset.read(); float temperatureC_1 = acuHkTableDataset.temperature1.value * 0.1; float temperatureC_2 = acuHkTableDataset.temperature2.value * 0.1; diff --git a/mission/devices/GyroADIS16507Handler.cpp b/mission/devices/GyroADIS16507Handler.cpp index ad20e65b..3065c249 100644 --- a/mission/devices/GyroADIS16507Handler.cpp +++ b/mission/devices/GyroADIS16507Handler.cpp @@ -16,7 +16,7 @@ GyroADIS16507Handler::GyroADIS16507Handler(object_id_t objectId, object_id_t deviceCommunication, CookieIF * comCookie): DeviceHandlerBase(objectId, deviceCommunication, comCookie), primaryDataset(this), configDataset(this), breakCountdown() { -#if ADIS16507_DEBUG == 1 +#if OBSW_DEBUG_ADIS16507 == 1 debugDivider = new PeriodicOperationDivider(5); #endif @@ -284,7 +284,7 @@ ReturnValue_t GyroADIS16507Handler::handleSensorData(const uint8_t *packet) { primaryDataset.setValidity(true, true); } -#if ADIS16507_DEBUG == 1 +#if OBSW_DEBUG_ADIS16507 == 1 if(debugDivider->checkAndIncrement()) { sif::info << "GyroADIS16507Handler: Angular velocities in deg / s" << std::endl; sif::info << "X: " << primaryDataset.angVelocX.value << std::endl; diff --git a/mission/devices/GyroADIS16507Handler.h b/mission/devices/GyroADIS16507Handler.h index faab3e5d..41be5734 100644 --- a/mission/devices/GyroADIS16507Handler.h +++ b/mission/devices/GyroADIS16507Handler.h @@ -69,7 +69,7 @@ private: const uint8_t *sendData, size_t sendLen, void* args); #endif -#if ADIS16507_DEBUG == 1 +#if OBSW_DEBUG_ADIS16507 == 1 PeriodicOperationDivider* debugDivider; #endif Countdown breakCountdown; diff --git a/mission/devices/IMTQHandler.cpp b/mission/devices/IMTQHandler.cpp index c75f7fde..125040d7 100644 --- a/mission/devices/IMTQHandler.cpp +++ b/mission/devices/IMTQHandler.cpp @@ -683,7 +683,7 @@ void IMTQHandler::fillEngHkDataset(const uint8_t* packet) { offset += 2; engHkDataset.mcuTemperature = (*(packet + offset + 1) << 8 | *(packet + offset)); -#if OBSW_VERBOSE_LEVEL >= 1 && IMTQ_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 sif::info << "IMTQ digital voltage: " << engHkDataset.digitalVoltageMv << " mV" << std::endl; sif::info << "IMTQ analog voltage: " << engHkDataset.analogVoltageMv << " mV" << std::endl; sif::info << "IMTQ digital current: " << engHkDataset.digitalCurrentmA << " mA" << std::endl; @@ -757,7 +757,7 @@ void IMTQHandler::fillCalibratedMtmDataset(const uint8_t* packet) { offset += 4; calMtmMeasurementSet.coilActuationStatus = (*(packet + offset + 3) << 24) | (*(packet + offset + 2) << 16) | (*(packet + offset + 1) << 8) | (*(packet + offset)); -#if OBSW_VERBOSE_LEVEL >= 1 && IMTQ_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 sif::info << "IMTQ calibrated MTM measurement X: " << calMtmMeasurementSet.mtmXnT << " nT" << std::endl; sif::info << "IMTQ calibrated MTM measurement Y: " << calMtmMeasurementSet.mtmYnT << " nT" @@ -783,7 +783,7 @@ void IMTQHandler::fillRawMtmDataset(const uint8_t* packet) { offset += 4; rawMtmMeasurementSet.coilActuationStatus = (*(packet + offset + 3) << 24) | (*(packet + offset + 2) << 16) | (*(packet + offset + 1) << 8) | (*(packet + offset)); -#if OBSW_VERBOSE_LEVEL >= 1 && IMTQ_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 sif::info << "IMTQ raw MTM measurement X: " << rawMtmMeasurementSet.mtmXnT << " nT" << std::endl; sif::info << "IMTQ raw MTM measurement Y: " << rawMtmMeasurementSet.mtmYnT << " nT" @@ -946,7 +946,7 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) { posXselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; -#if OBSW_VERBOSE_LEVEL >= 1 && IMTQ_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 sif::info << "IMTQ self test (INIT) err: " << static_cast(posXselfTestDataset.initErr.value) << std::endl; sif::info << "IMTQ self test (INIT) raw magnetic field X: " << posXselfTestDataset.initRawMagX @@ -1147,7 +1147,7 @@ void IMTQHandler::handleNegativeXSelfTestReply(const uint8_t* packet) { negXselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; -#if OBSW_VERBOSE_LEVEL >= 1 && IMTQ_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 sif::info << "IMTQ self test (INIT) err: " << static_cast(negXselfTestDataset.initErr.value) << std::endl; sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negXselfTestDataset.initRawMagX @@ -1348,7 +1348,7 @@ void IMTQHandler::handlePositiveYSelfTestReply(const uint8_t* packet) { posYselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; -#if OBSW_VERBOSE_LEVEL >= 1 && IMTQ_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 sif::info << "IMTQ self test (INIT) err: " << static_cast(posYselfTestDataset.initErr.value) << std::endl; sif::info << "IMTQ self test (INIT) raw magnetic field X: " << posYselfTestDataset.initRawMagX @@ -1549,7 +1549,7 @@ void IMTQHandler::handleNegativeYSelfTestReply(const uint8_t* packet) { negYselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; -#if OBSW_VERBOSE_LEVEL >= 1 && IMTQ_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 sif::info << "IMTQ self test (INIT) err: " << static_cast(negYselfTestDataset.initErr.value) << std::endl; sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negYselfTestDataset.initRawMagX @@ -1750,7 +1750,7 @@ void IMTQHandler::handlePositiveZSelfTestReply(const uint8_t* packet) { posZselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; -#if OBSW_VERBOSE_LEVEL >= 1 && IMTQ_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 sif::info << "IMTQ self test (INIT) err: " << static_cast(posZselfTestDataset.initErr.value) << std::endl; sif::info << "IMTQ self test (INIT) raw magnetic field X: " << posZselfTestDataset.initRawMagX @@ -1951,7 +1951,7 @@ void IMTQHandler::handleNegativeZSelfTestReply(const uint8_t* packet) { negZselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; -#if OBSW_VERBOSE_LEVEL >= 1 && IMTQ_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 sif::info << "IMTQ self test (INIT) err: " << static_cast(negZselfTestDataset.initErr.value) << std::endl; sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negZselfTestDataset.initRawMagX diff --git a/mission/devices/Max31865PT1000Handler.cpp b/mission/devices/Max31865PT1000Handler.cpp index fad0fc39..ac33e01d 100644 --- a/mission/devices/Max31865PT1000Handler.cpp +++ b/mission/devices/Max31865PT1000Handler.cpp @@ -325,7 +325,7 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply( case(Max31865Definitions::REQUEST_LOW_THRESHOLD): { uint16_t readLowThreshold = packet[0] << 8 | packet[1]; if(readLowThreshold != LOW_THRESHOLD) { -#if FSFW_CPP_OSTREAM_ENABLED == 1 && DEBUG_RTD == 1 +#if FSFW_CPP_OSTREAM_ENABLED == 1 && OBSW_DEBUG_RTD == 1 sif::error << "Max31865PT1000Handler::interpretDeviceReply: Missmatch between written " << "and readback value of low threshold register" @@ -338,7 +338,7 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply( case(Max31865Definitions::REQUEST_HIGH_THRESHOLD): { uint16_t readHighThreshold = packet[0] << 8 | packet[1]; if(readHighThreshold != HIGH_THRESHOLD) { -#if FSFW_CPP_OSTREAM_ENABLED == 1 && DEBUG_RTD == 1 +#if FSFW_CPP_OSTREAM_ENABLED == 1 && OBSW_DEBUG_RTD == 1 sif::error << "Max31865PT1000Handler::interpretDeviceReply: Missmatch between written " << "and readback value of high threshold register" diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 305606d9..357bee30 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -25,7 +25,7 @@ void P60DockHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t * */ handleDeviceTM(&p60dockHkTableDataset, id, true); -#if OBSW_VERBOSE_LEVEL >= 1 && P60DOCK_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_P60DOCK == 1 p60dockHkTableDataset.read(); sif::info << "P60 Dock: ACU VCC switch: " << static_cast(p60dockHkTableDataset.outputEnableStateAcuVcc.value) << std::endl; sif::info << "P60 Dock: PDU1 VCC switch: " << static_cast(p60dockHkTableDataset.outputEnableStatePdu1Vcc.value) << std::endl; diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index b18e0f79..f6bd938a 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -22,7 +22,7 @@ void PDU1Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pac parseHkTableReply(packet); handleDeviceTM(&pdu1HkTableDataset, id, true); -#if OBSW_VERBOSE_LEVEL >= 1 && PDU1_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PDU1 == 1 pdu1HkTableDataset.read(); sif::info << "PDU1 TCS Board voltage: " << pdu1HkTableDataset.voltageOutTCSBoard3V3 << std::endl; diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index 798a6d67..47fab6b6 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -26,7 +26,7 @@ void PDU2Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pac */ handleDeviceTM(&pdu2HkTableDataset, id, true); -#if OBSW_VERBOSE_LEVEL >= 1 && PDU2_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PDU2 == 1 pdu2HkTableDataset.read(); sif::info << "PDU2 Q7S current voltage: " << pdu2HkTableDataset.voltageOutQ7S << " mV" << std::endl; sif::info << "PDU2 VCC: " << pdu2HkTableDataset.vcc << " mV" << std::endl; diff --git a/mission/devices/RadiationSensorHandler.cpp b/mission/devices/RadiationSensorHandler.cpp index bb5176ee..95f045d8 100644 --- a/mission/devices/RadiationSensorHandler.cpp +++ b/mission/devices/RadiationSensorHandler.cpp @@ -147,7 +147,7 @@ ReturnValue_t RadiationSensorHandler::interpretDeviceReply(DeviceCommandId_t id, offset += 2; dataset.ain7 = (*(packet + offset) << 8 | *(packet + offset + 1)); -#if OBSW_VERBOSE_LEVEL >= 1 && DEBUG_RAD_SENSOR +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RAD_SENSOR sif::info << "Radiation sensor temperature: " << dataset.temperatureCelcius << " °C" << std::endl; sif::info << "Radiation sensor ADC value channel 0: " << dataset.ain0 diff --git a/mission/devices/RwHandler.cpp b/mission/devices/RwHandler.cpp index 81bb69ac..571f7eca 100644 --- a/mission/devices/RwHandler.cpp +++ b/mission/devices/RwHandler.cpp @@ -347,7 +347,7 @@ void RwHandler::handleResetStatusReply(const uint8_t* packet) { lastResetStatusSet.lastResetStatus = resetStatus; } lastResetStatusSet.currentResetStatus = resetStatus; -#if OBSW_VERBOSE_LEVEL >= 1 && RW_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1 sif::info << "RwHandler::handleResetStatusReply: Last reset status: " << static_cast(lastResetStatusSet.lastResetStatus.value) << std::endl; sif::info << "RwHandler::handleResetStatusReply: Current reset status: " @@ -378,7 +378,7 @@ void RwHandler::handleGetRwStatusReply(const uint8_t* packet) { << std::endl; } -#if OBSW_VERBOSE_LEVEL >= 1 && RW_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1 sif::info << "RwHandler::handleGetRwStatusReply: Current speed is: " << statusSet.currSpeed << " * 0.1 RPM" << std::endl; sif::info << "RwHandler::handleGetRwStatusReply: Reference speed is: " @@ -395,7 +395,7 @@ void RwHandler::handleTemperatureReply(const uint8_t* packet) { uint8_t offset = 2; temperatureSet.temperatureCelcius = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | *(packet + offset + 1) << 8 | *(packet + offset); -#if OBSW_VERBOSE_LEVEL >= 1 && RW_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1 sif::info << "RwHandler::handleTemperatureReply: Temperature: " << temperatureSet.temperatureCelcius << " °C" << std::endl; #endif @@ -472,7 +472,7 @@ void RwHandler::handleGetTelemetryReply(const uint8_t* packet) { offset += 4; tmDataset.spiTotalNumOfErrors = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | *(packet + offset + 1) << 8 | *(packet + offset); -#if OBSW_VERBOSE_LEVEL >= 1 && RW_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1 sif::info << "RwHandler::handleTemperatureReply: Last reset status: " << static_cast(tmDataset.lastResetStatus.value) << std::endl; sif::info << "RwHandler::handleTemperatureReply: MCU temperature: " << tmDataset.mcuTemperature diff --git a/mission/devices/StarTrackerHandler.cpp b/mission/devices/StarTrackerHandler.cpp index 48236cf7..a695403f 100644 --- a/mission/devices/StarTrackerHandler.cpp +++ b/mission/devices/StarTrackerHandler.cpp @@ -207,7 +207,7 @@ void StarTrackerHandler::handleTemperatureTm() { temperatureSet.cmosTemperature = *(decodedFrame + offset) << 24 | *(decodedFrame + offset + 1) << 16 | *(decodedFrame + offset + 2) << 8 | *(decodedFrame + offset + 3); -#if OBSW_VERBOSE_LEVEL >= 1 && START_TRACKER_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_STARTRACKER == 1 sif::info << "StarTrackerHandler::handleTemperatureTm: MCU Temperature: " << temperatureSet.mcuTemperature << " °C" << std::endl; sif::info << "StarTrackerHandler::handleTemperatureTm: CMOS Temperature: " diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index e55755e4..9f359bd1 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -384,7 +384,7 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) { offset += 6; rxDataset.rxDataRate = convertHexStringToUint8(reinterpret_cast(packet + offset)); -#if OBSW_VERBOSE_LEVEL >= 1 && SYRLINKS_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value << std::endl; sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl; sif::info << "Syrlinks RX Frequency Shift: " << rxDataset.rxFrequencyShift << std::endl; @@ -400,7 +400,7 @@ void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) { PoolReadGuard readHelper(&txDataset); uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE; txDataset.txStatus = convertHexStringToUint8(reinterpret_cast(packet + offset)); -#if OBSW_VERBOSE_LEVEL >= 1 && SYRLINKS_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int) txDataset.txStatus.value << std::endl; #endif @@ -410,7 +410,7 @@ void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) { PoolReadGuard readHelper(&txDataset); uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE; txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast(packet + offset)); -#if OBSW_VERBOSE_LEVEL >= 1 && SYRLINKS_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int) txDataset.txWaveform.value << std::endl; #endif @@ -420,7 +420,7 @@ void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) { PoolReadGuard readHelper(&txDataset); uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE; txDataset.txAgcValue = agcValueHighByte << 8 | convertHexStringToUint8(reinterpret_cast(packet + offset)); -#if OBSW_VERBOSE_LEVEL >= 1 && SYRLINKS_DEBUG == 1 +#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl; #endif }