Index: firmware/App/Modes/ModeHeatDisinfectActiveCool.c =================================================================== diff -u -ra12e1212c1cf49011ed8d65beaf9416ca18ffe98 -rbc2f07d1ccac37e4cb18a21bfe096db94e72a151 --- firmware/App/Modes/ModeHeatDisinfectActiveCool.c (.../ModeHeatDisinfectActiveCool.c) (revision a12e1212c1cf49011ed8d65beaf9416ca18ffe98) +++ firmware/App/Modes/ModeHeatDisinfectActiveCool.c (.../ModeHeatDisinfectActiveCool.c) (revision bc2f07d1ccac37e4cb18a21bfe096db94e72a151) @@ -8,7 +8,7 @@ * @file ModeHeatDisinfectActiveCool.c * * @author (last) Dara Navaei -* @date (last) 16-May-2023 +* @date (last) 31-May-2023 * * @author (original) Dara Navaei * @date (original) 18-Dec-2022 @@ -1108,10 +1108,19 @@ { F32 THdTemperatureC = getTemperatureValue( TEMPSENSORS_HEAT_DISINFECT ); - if ( ( THdTemperatureC <= ROF_ACTIVE_COOL_TARGET_TEMP_C ) && ( FALSE == tempBelowTarget.hasTempTargetTimeBeenSet ) ) + if ( THdTemperatureC <= ROF_ACTIVE_COOL_TARGET_TEMP_C ) { + // If THd is below the target and the timer for stable temperature has not been set, set it + if ( FALSE == tempBelowTarget.hasTempTargetTimeBeenSet ) + { + tempBelowTarget.tempBelowTargetStartTimeMS = getMSTimerCount(); + tempBelowTarget.hasTempTargetTimeBeenSet = TRUE; + } + } + else + { + // The temperature is still above the target so keep reseting the timer tempBelowTarget.tempBelowTargetStartTimeMS = getMSTimerCount(); - tempBelowTarget.hasTempTargetTimeBeenSet = TRUE; } if ( DG_RESERVOIR_BELOW_TARGET == rsrvrsStatus.rsrvr[ rsrvrID ].rStatus )