diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 52ecd30f..e52231bf 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -228,6 +228,13 @@ void initmission::initTasks() { } #endif /* OBSW_ADD_PLOC_SUPERVISOR */ + PeriodicTaskIF* thermalControllerTask = factory->createPeriodicTask( + "THERMAL_CTL_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc); + result = thermalControllerTask->addComponent(objects::THERMAL_CONTROLLER); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER); + } + #if OBSW_TEST_CCSDS_BRIDGE == 1 PeriodicTaskIF* ptmeTestTask = factory->createPeriodicTask( "PTME_TEST", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); @@ -298,6 +305,7 @@ void initmission::initTasks() { #if OBSW_ADD_PLOC_SUPERVISOR == 1 supvHelperTask->startTask(); #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ + thermalControllerTask->startTask(); sif::info << "Tasks started.." << std::endl; } diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 00e7bbd9..56c0a62a 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -62,4 +62,5 @@ void ObjectFactory::produce(void* args) { #endif /* OBSW_ADD_TEST_CODE == 1 */ createMiscComponents(); + createThermalController(); } diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index f84cf52f..4c56c837 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -319,6 +320,10 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, #endif // OBSW_ADD_RTD_DEVICES == 1 } +void ObjectFactory::createThermalController() { + new ThermalController(objects::THERMAL_CONTROLLER, objects::NO_OBJECT); +} + void ObjectFactory::gpioChecker(ReturnValue_t result, std::string output) { if (result != HasReturnvaluesIF::RETURN_OK) { sif::error << "ObjectFactory: Adding GPIOs failed for " << output << std::endl; diff --git a/linux/ObjectFactory.h b/linux/ObjectFactory.h index a5642729..966e9f2d 100644 --- a/linux/ObjectFactory.h +++ b/linux/ObjectFactory.h @@ -17,4 +17,6 @@ void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* p void gpioChecker(ReturnValue_t result, std::string output); +void createThermalController(); + } // namespace ObjectFactory diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 22c1a3f4..0f693a9f 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -9,22 +9,22 @@ ThermalController::ThermalController(object_id_t objectId, object_id_t parentId) susTemperatures(this), deviceTemperatures(this), componentTemperatures(this), - max31865Set0(objects::RTD_0_IC3_PLOC_HEATSPREADER), - max31865Set1(objects::RTD_1_IC4_PLOC_MISSIONBOARD), - max31865Set2(objects::RTD_2_IC5_4K_CAMERA), - max31865Set3(objects::RTD_3_IC6_DAC_HEATSPREADER), - max31865Set4(objects::RTD_4_IC7_STARTRACKER), - max31865Set5(objects::RTD_5_IC8_RW1_MX_MY), - max31865Set6(objects::RTD_6_IC9_DRO), - max31865Set7(objects::RTD_7_IC10_SCEX), - max31865Set8(objects::RTD_8_IC11_X8), - max31865Set9(objects::RTD_9_IC12_HPA), - max31865Set10(objects::RTD_10_IC13_PL_TX), - max31865Set11(objects::RTD_11_IC14_MPA), - max31865Set12(objects::RTD_12_IC15_ACU), - max31865Set13(objects::RTD_13_IC16_PLPCDU_HEATSPREADER), - max31865Set14(objects::RTD_14_IC17_TCS_BOARD), - max31865Set15(objects::RTD_15_IC18_IMTQ), + max31865Set0(objects::RTD_0_IC3_PLOC_HEATSPREADER, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set1(objects::RTD_1_IC4_PLOC_MISSIONBOARD, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set2(objects::RTD_2_IC5_4K_CAMERA, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set3(objects::RTD_3_IC6_DAC_HEATSPREADER, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set4(objects::RTD_4_IC7_STARTRACKER, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set5(objects::RTD_5_IC8_RW1_MX_MY, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set6(objects::RTD_6_IC9_DRO, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set7(objects::RTD_7_IC10_SCEX, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set8(objects::RTD_8_IC11_X8, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set9(objects::RTD_9_IC12_HPA, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set10(objects::RTD_10_IC13_PL_TX, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set11(objects::RTD_11_IC14_MPA, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set12(objects::RTD_12_IC15_ACU, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set13(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set14(objects::RTD_14_IC17_TCS_BOARD, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), + max31865Set15(objects::RTD_15_IC18_IMTQ, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), tmp1075Set1(objects::TMP1075_HANDLER_1), tmp1075Set2(objects::TMP1075_HANDLER_2), susSet0(objects::SUS_0_N_LOC_XFYFZM_PT_XF), @@ -437,4 +437,4 @@ void ThermalController::copySus() { } } -void ThermalController::copyDevices() {} \ No newline at end of file +void ThermalController::copyDevices() {} diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index c46babe9..2c998251 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -33,22 +33,22 @@ class ThermalController : public ExtendedControllerBase { thermalControllerDefinitions::ComponentTemperatures componentTemperatures; // Temperature Sensors - Max31865Definitions::Max31865Set max31865Set0; - Max31865Definitions::Max31865Set max31865Set1; - Max31865Definitions::Max31865Set max31865Set2; - Max31865Definitions::Max31865Set max31865Set3; - Max31865Definitions::Max31865Set max31865Set4; - Max31865Definitions::Max31865Set max31865Set5; - Max31865Definitions::Max31865Set max31865Set6; - Max31865Definitions::Max31865Set max31865Set7; - Max31865Definitions::Max31865Set max31865Set8; - Max31865Definitions::Max31865Set max31865Set9; - Max31865Definitions::Max31865Set max31865Set10; - Max31865Definitions::Max31865Set max31865Set11; - Max31865Definitions::Max31865Set max31865Set12; - Max31865Definitions::Max31865Set max31865Set13; - Max31865Definitions::Max31865Set max31865Set14; - Max31865Definitions::Max31865Set max31865Set15; + MAX31865::Max31865Set max31865Set0; + MAX31865::Max31865Set max31865Set1; + MAX31865::Max31865Set max31865Set2; + MAX31865::Max31865Set max31865Set3; + MAX31865::Max31865Set max31865Set4; + MAX31865::Max31865Set max31865Set5; + MAX31865::Max31865Set max31865Set6; + MAX31865::Max31865Set max31865Set7; + MAX31865::Max31865Set max31865Set8; + MAX31865::Max31865Set max31865Set9; + MAX31865::Max31865Set max31865Set10; + MAX31865::Max31865Set max31865Set11; + MAX31865::Max31865Set max31865Set12; + MAX31865::Max31865Set max31865Set13; + MAX31865::Max31865Set max31865Set14; + MAX31865::Max31865Set max31865Set15; TMP1075::Tmp1075Dataset tmp1075Set1; TMP1075::Tmp1075Dataset tmp1075Set2; diff --git a/mission/devices/Max31865EiveHandler.cpp b/mission/devices/Max31865EiveHandler.cpp index a77bbd51..05857f8f 100644 --- a/mission/devices/Max31865EiveHandler.cpp +++ b/mission/devices/Max31865EiveHandler.cpp @@ -170,6 +170,7 @@ ReturnValue_t Max31865EiveHandler::initializeLocalDataPool(localpool::DataPool& using namespace MAX31865; localDataPoolMap.emplace(static_cast(PoolIds::RTD_VALUE), new PoolEntry({0})); localDataPoolMap.emplace(static_cast(PoolIds::TEMPERATURE_C), new PoolEntry({0})); + localDataPoolMap.emplace(static_cast(PoolIds::LAST_FAULT_BYTE), new PoolEntry({0})); localDataPoolMap.emplace(static_cast(PoolIds::FAULT_BYTE), new PoolEntry({0})); poolManager.subscribeForPeriodicPacket(sensorDataset.getSid(), false, 30.0, false); return RETURN_OK; diff --git a/tmtc b/tmtc index ef349856..048a0ea4 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit ef349856d614be7a408ffadf0c27c677d8be3157 +Subproject commit 048a0ea447465b343c1067bd171b8b698c6e2006