From 54f73661fc4ebca11c1d7321d889370ea9ac329f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 16 Sep 2022 14:01:54 +0200 Subject: [PATCH] fix init error --- CMakeLists.txt | 3 +++ bsp_q7s/OBSWConfig.h.in | 1 + bsp_q7s/core/InitMission.cpp | 8 +++++--- bsp_q7s/em/emObjectFactory.cpp | 5 ++--- dummies/helpers.cpp | 9 ++++++++- dummies/helpers.h | 2 ++ 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 03c1eece..c5f3d1bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,6 +98,9 @@ set(OBSW_ADD_ACS_BOARD set(OBSW_ADD_GPS_CTRL ${INIT_VAL} CACHE STRING "Add GPS controllers") +set(OBSW_ADD_TCS_CTRL + ${INIT_VAL} + CACHE STRING "Add TCS controllers") set(OBSW_ADD_ACS_CTRL ${INIT_VAL} CACHE STRING "Add ACS controller") diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index c20db3f1..9ff67209 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -32,6 +32,7 @@ #define OBSW_ADD_ACS_BOARD @OBSW_ADD_ACS_BOARD@ #define OBSW_ADD_ACS_CTRL @OBSW_ADD_ACS_CTRL@ #define OBSW_ADD_GPS_CTRL @OBSW_ADD_GPS_CTRL@ +#define OBSW_ADD_TCS_CTRL @OBSW_ADD_TCS_CTRL@ #define OBSW_ADD_RW @OBSW_ADD_RW@ #define OBSW_ADD_RTD_DEVICES @OBSW_ADD_RTD_DEVICES@ #define OBSW_ADD_TMP_DEVICES @OBSW_ADD_TMP_DEVICES@ diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index e60c2caf..5116e808 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -189,8 +189,7 @@ void initmission::initTasks() { objects::RTD_14_IC17_TCS_BOARD, objects::RTD_15_IC18_IMTQ, }; - tcsTask->addComponent(objects::TCS_BOARD_ASS); - tcsTask->addComponent(objects::THERMAL_CONTROLLER); + for (const auto& rtd : rtdIds) { tcsTask->addComponent(rtd, DeviceHandlerIF::PERFORM_OPERATION); tcsTask->addComponent(rtd, DeviceHandlerIF::SEND_WRITE); @@ -198,8 +197,11 @@ void initmission::initTasks() { tcsTask->addComponent(rtd, DeviceHandlerIF::SEND_READ); tcsTask->addComponent(rtd, DeviceHandlerIF::GET_READ); } + tcsTask->addComponent(objects::TCS_BOARD_ASS); #endif /* OBSW_ADD_RTD_DEVICES */ - +#if OBSW_ADD_TCS_CTRL == 1 + tcsTask->addComponent(objects::THERMAL_CONTROLLER); +#endif // FS task, task interval does not matter because it runs in permanent loop, priority low // because it is a non-essential background task PeriodicTaskIF* fsTask = factory->createPeriodicTask( diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 219ed580..780b6b13 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -31,7 +31,6 @@ void ObjectFactory::produce(void* args) { dummyCfg.addCoreCtrlCfg = false; dummy::createDummies(dummyCfg); - createTmpComponents(); new CoreController(objects::CORE_CONTROLLER); gpioCallbacks::disableAllDecoder(gpioComIF); @@ -42,6 +41,8 @@ void ObjectFactory::produce(void* args) { // createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher); // createSyrlinksComponents(pwrSwitcher); // createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV); + // createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF); + // createTmpComponents(); createRadSensorComponent(gpioComIF); #if OBSW_ADD_ACS_BOARD == 1 @@ -49,8 +50,6 @@ void ObjectFactory::produce(void* args) { #endif createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); createSolarArrayDeploymentComponents(); - - createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF); createPayloadComponents(gpioComIF); #if OBSW_ADD_MGT == 1 diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 46cf207d..8eb73250 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -17,6 +17,7 @@ #include #include #include +#include using namespace dummy; @@ -27,7 +28,9 @@ void dummy::createDummies(DummyCfg cfg) { if (cfg.addCoreCtrlCfg) { new CoreControllerDummy(objects::CORE_CONTROLLER); } - + if (cfg.addRtdComIFDummy) { + new ComIFDummy(objects::SPI_RTD_COM_IF); + } new RwDummy(objects::RW1, objects::DUMMY_COM_IF, comCookieDummy); new RwDummy(objects::RW2, objects::DUMMY_COM_IF, comCookieDummy); new RwDummy(objects::RW3, objects::DUMMY_COM_IF, comCookieDummy); @@ -56,5 +59,9 @@ void dummy::createDummies(DummyCfg cfg) { if (cfg.addSusDummies) { new SusDummy(); } + + if (cfg.addTempSensorDummies) { + new TemperatureSensorsDummy(); + } new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); } diff --git a/dummies/helpers.h b/dummies/helpers.h index dfda7d81..680f97c1 100644 --- a/dummies/helpers.h +++ b/dummies/helpers.h @@ -7,6 +7,8 @@ struct DummyCfg { bool addPowerDummies = true; bool addAcsBoardDummies = true; bool addSusDummies = true; + bool addTempSensorDummies = true; + bool addRtdComIFDummy = true; }; void createDummies(DummyCfg cfg);