diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 932cbad6..50762e2f 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1812,6 +1812,8 @@ void ThermalController::heaterMaxDurationControl( // The heater might still be one for some thermal components, so cross-check // those components crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast(i)); + } else if (currentHeaterStates[i] == HeaterHandler::SwitchState::OFF) { + heaterStates[i].heaterOnPeriod.resetTimer(); } } } @@ -1873,7 +1875,7 @@ void ThermalController::heaterSwitchHelper(heater::Switch switchNr, heater::Swit triggerEvent(tcsCtrl::TCS_SWITCHING_HEATER_ON, static_cast(currThermalComponent), static_cast(switchNr)); } else { - heaterHandler.switchHeater(switchNr, state); + heaterHandler.switchHeater(switchNr, targetState); thermalStates[componentIdx].heating = false; thermalStates[componentIdx].heaterEndTime = currentTime.tv_sec; triggerEvent(tcsCtrl::TCS_SWITCHING_HEATER_OFF, static_cast(currThermalComponent),