Index: firmware/App/Modes/ModeHeatDisinfect.c =================================================================== diff -u -r96d28944079164510a0742a7fcc6af11d7396d4b -r7ece7d32eb63fe626a54b1f8d0584e1f0f83eb56 --- firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision 96d28944079164510a0742a7fcc6af11d7396d4b) +++ firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision 7ece7d32eb63fe626a54b1f8d0584e1f0f83eb56) @@ -1511,8 +1511,6 @@ if ( TRUE == didTimeout( stateTimer, NOCTURNAL_COOL_RUN_TIME_PRIOR_TEMP_AVG_MS ) ) { - deenergizeActuators( FALSE ); - noctHeatDisStatus.TDiRunningSumC += getTemperatureValue( TEMPSENSORS_INLET_DIALYSATE ); noctHeatDisStatus.THdRunninSumC += getTemperatureValue( TEMPSENSORS_HEAT_DISINFECT ); noctHeatDisStatus.sampleCount += 1; @@ -1522,6 +1520,9 @@ F32 avgTDiC = noctHeatDisStatus.TDiRunningSumC / (F32)noctHeatDisStatus.sampleCount; F32 avgTHdC = noctHeatDisStatus.THdRunninSumC / (F32)noctHeatDisStatus.sampleCount; + // Time has elapsed, stop running + deenergizeActuators( FALSE ); + // Assume the default state transition is the nocturnal cool idle state = DG_HEAT_DISINFECT_STATE_NOCTURNAL_COOL_IDLE; @@ -1764,18 +1765,20 @@ } else { - // The fluid is hot so this is a mix drain. Set the VPd to direct the cold inlet fluid to drain - setValveState( VPI, VALVE_STATE_OPEN ); - setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); - - targetRPM = DRAIN_PUMP_RPM_IN_MIX_DRAIN; - cancellationMode = CANCELLATION_MODE_HOT; - if ( TRUE == noctHeatDisStatus.isNocturnalHeatDisRqustd ) { isDrainAllowed = FALSE; state = DG_HEAT_DISINFECT_STATE_NOCTURNAL_COOL_IDLE; } + else + { + // The fluid is hot so this is a mix drain. Set the VPd to direct the cold inlet fluid to drain + setValveState( VPI, VALVE_STATE_OPEN ); + setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); + + targetRPM = DRAIN_PUMP_RPM_IN_MIX_DRAIN; + cancellationMode = CANCELLATION_MODE_HOT; + } } stateTimer = getMSTimerCount(); @@ -2319,7 +2322,7 @@ switch( state ) { case DG_HEAT_DISINFECT_STATE_NOCTURNAL_COOL_IDLE: - deenergizeActuators( FALSE ); + deenergizeActuators( NO_PARK_CONC_PUMPS ); break; case DG_HEAT_DISINFECT_STATE_NOCTURNAL_COOL_CHECK_WATER_TEMP: @@ -2373,7 +2376,6 @@ * @details Outputs: none * @return TRUE if any of the RO and/or drain pump alarms are triggered otherwise, FALSE *************************************************************************/ - static BOOL areThereAnyDGPumpsAlarm( void ) { BOOL status = FALSE;