From fdf1c7a61164d6cb46361a1bbb5160184615e056 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 10 Jul 2023 18:29:55 +0200 Subject: [PATCH] seems to work now --- mission/controller/ThermalController.cpp | 6 ++---- mission/controller/tcsDefs.h | 2 +- mission/tcs/defs.h | 3 ++- tmtc | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index b5807d0a..2c5e2c9e 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1816,8 +1816,7 @@ void ThermalController::heaterMaxDurationControl( heaterStates[i].trackHeaterMaxBurnTime = false; triggerEvent(tcsCtrl::TCS_HEATER_MAX_BURN_TIME_REACHED, static_cast(i), MAX_HEATER_ON_DURATIONS_MS[i]); - heaterSwitchHelper(static_cast(i), heater::SwitchState::OFF, - std::nullopt); + heaterSwitchHelper(static_cast(i), heater::SwitchState::OFF, std::nullopt); // The heater might still be one for some thermal components, so cross-check // those components crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast(i)); @@ -1867,8 +1866,7 @@ void ThermalController::resetThermalStates() { } } -void ThermalController::heaterSwitchHelper(heater::Switch switchNr, - heater::SwitchState targetState, +void ThermalController::heaterSwitchHelper(heater::Switch switchNr, heater::SwitchState targetState, std::optional componentIdx) { timeval currentTime; Clock::getClockMonotonic(¤tTime); diff --git a/mission/controller/tcsDefs.h b/mission/controller/tcsDefs.h index 48f5f605..af03f146 100644 --- a/mission/controller/tcsDefs.h +++ b/mission/controller/tcsDefs.h @@ -40,7 +40,7 @@ struct ThermalState { // Is heating on for that thermal module? bool heating = false; // Which switch is being used for heating the component - heater::Switch heaterSwitch = heater::Switch::NUMBER_OF_SWITCHES; + heater::Switch heaterSwitch = heater::Switch::HEATER_NONE; // Heater start time and end times as UNIX seconds. Please note that these times will be updated // when a switch command is sent, with no guarantess that the heater actually went on. uint32_t heaterStartTime = 0; diff --git a/mission/tcs/defs.h b/mission/tcs/defs.h index e9f59e1a..e2843570 100644 --- a/mission/tcs/defs.h +++ b/mission/tcs/defs.h @@ -14,7 +14,8 @@ enum Switch : uint8_t { HEATER_5_STR, HEATER_6_DRO, HEATER_7_S_BAND, - NUMBER_OF_SWITCHES + NUMBER_OF_SWITCHES = 8, + HEATER_NONE = 0xff }; enum SwitchState : uint8_t { ON = 1, OFF = 0 }; diff --git a/tmtc b/tmtc index ba47757b..e27ad147 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit ba47757b508976943f2e042a8f42673ba1424a28 +Subproject commit e27ad147d4a3e8090f5a3efa18c1abbb0912a4b3