From 617507b3d445309242567010d4f6e34052551a8e Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Sun, 29 Jan 2023 17:55:43 +0100 Subject: [PATCH] small changes ThermalController --- mission/controller/ThermalController.cpp | 6 ++++-- mission/controller/ThermalController.h | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 2d8a2b22..0f285530 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1180,10 +1180,12 @@ void ThermalController::ctrlPcduAcu() { if (heaterAvailable) { sensorTempAvailable = true; - if (deviceTemperatures.acu.isValid()) { + if (deviceTemperatures.acu.value[0] != INVALID_TEMPERATURE) { sensorTemp = deviceTemperatures.acu.value[0]; - } else if (deviceTemperatures.acu.isValid()) { + } else if (deviceTemperatures.acu.value[1] != INVALID_TEMPERATURE) { sensorTemp = deviceTemperatures.acu.value[1]; + } else if (deviceTemperatures.acu.value[2] != INVALID_TEMPERATURE) { + sensorTemp = deviceTemperatures.acu.value[2]; } else if (sensorTemperatures.sensor_acu.isValid()) { sensorTemp = sensorTemperatures.sensor_acu.value; } else { diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 5f2fe371..1f977524 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -61,7 +61,6 @@ class ThermalController : public ExtendedControllerBase { static const uint32_t DELAY = 500; - // TODO to be changed static const uint32_t TEMP_OFFSET = 5; enum class InternalState { STARTUP, INITIAL_DELAY, READY };