Index: firmware/App/Modes/ModeHeatDisinfectActiveCool.c =================================================================== diff -u -r5109bb981cab2025fcb9de33e303d046085efa18 -r653a028c13aff34d2ad06cbfb0e7a34691767dd1 --- firmware/App/Modes/ModeHeatDisinfectActiveCool.c (.../ModeHeatDisinfectActiveCool.c) (revision 5109bb981cab2025fcb9de33e303d046085efa18) +++ firmware/App/Modes/ModeHeatDisinfectActiveCool.c (.../ModeHeatDisinfectActiveCool.c) (revision 653a028c13aff34d2ad06cbfb0e7a34691767dd1) @@ -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 @@ -782,11 +782,14 @@ } } - if ( ( TRUE == isDGFaultAlarmActive() ) && ( heatDisinfectActiveCoolState != DG_HEAT_DISINFECT_ACTIVE_COOL_CANCEL_WATER_PATH_STATE ) ) + if ( ( TRUE == isDGFaultAlarmActive() ) || ( TRUE == isAnyCleaningModeInletWaterConditionActive() ) ) { - // If there is any fault alarm and we are not already in the cancel water path state, set it to cancel water path state - heatDisinfectActiceCoolPrevState = heatDisinfectActiveCoolState; - heatDisinfectActiveCoolState = DG_HEAT_DISINFECT_ACTIVE_COOL_CANCEL_WATER_PATH_STATE; + if ( heatDisinfectActiveCoolState != DG_HEAT_DISINFECT_ACTIVE_COOL_CANCEL_WATER_PATH_STATE ) + { + // If there is any fault alarm and we are not already in the cancel water path state, set it to cancel water path state + heatDisinfectActiceCoolPrevState = heatDisinfectActiveCoolState; + heatDisinfectActiveCoolState = DG_HEAT_DISINFECT_ACTIVE_COOL_CANCEL_WATER_PATH_STATE; + } } } @@ -1066,8 +1069,6 @@ { if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvrsStatus.rsrvr[ rsrvrID ].rStatus ) { - deenergizeActuators( NO_PARK_CONC_PUMPS ); - switch ( state ) { case DG_HEAT_DISINFECT_ACTIVE_COOL_FILL_R1_STATE: @@ -1110,10 +1111,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 ) @@ -1268,7 +1278,8 @@ } // Keep waiting until the TDi temperature is below the target temperature for the specified time - if ( TRUE == didTimeout( tempBelowTarget.tempBelowTargetStartTimeMS, RSRVR_ACTIVE_COOL_BELOW_TARGET_TEMP_TIMEOUT_MS ) ) + if ( ( TRUE == tempBelowTarget.hasTempTargetTimeBeenSet ) && + ( TRUE == didTimeout( tempBelowTarget.tempBelowTargetStartTimeMS, RSRVR_ACTIVE_COOL_BELOW_TARGET_TEMP_TIMEOUT_MS ) ) ) { stateStartTimeMS = getMSTimerCount(); tempBelowTarget.hasTempTargetTimeBeenSet = FALSE; @@ -1289,12 +1300,7 @@ setHeatDisinfectActiveCoolActuators( state ); } - if ( DG_RESERVOIR_BELOW_TARGET == rsrvrsStatus.rsrvr[ rsrvrID ].rStatus ) - { - // Check for the fill timeout only until the reservoir is being filled. After that the fluid is run until TDi is below - // the target temperature and it can take a while and varies. - state = checkRsrvrMgmtTimeoutStatus( rsrvrID, state ); - } + state = checkRsrvrMgmtTimeoutStatus( rsrvrID, state ); return state; }