Index: firmware/App/Modes/ModeHeatDisinfect.c =================================================================== diff -u -r5738118966dd400f3d985329cf5a521dfe41c703 -rb7c391c953dad63a6704e292f7b82a00dac64a73 --- firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision 5738118966dd400f3d985329cf5a521dfe41c703) +++ firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision b7c391c953dad63a6704e292f7b82a00dac64a73) @@ -19,6 +19,7 @@ #include "ConcentratePumps.h" #include "ConductivitySensors.h" +#include "CPLD.h" #include "DrainPump.h" #include "Heaters.h" #include "LoadCell.h" @@ -38,7 +39,6 @@ #include "Timers.h" #include "UVReactors.h" #include "Valves.h" -#include "CPLD.h" /** * @addtogroup DGHeatDisinfectMode @@ -1149,9 +1149,8 @@ // Reset the timer for the next disinfect state tempGradOutOfRangeTimer = 0; state = DG_HEAT_DISINFECT_STATE_FILL_R2_WITH_HOT_WATER; + break; - break; - case HEAT_DISINFECT_HEAT_UP_IN_PROGRESS: default: heatDisinfectUIState = HEAT_DISINFECT_UI_STATE_HEAT_UP_WATER; @@ -1307,7 +1306,6 @@ ROFCoolingTimer = 0; stateTimer = getMSTimerCount(); state = DG_HEAT_DISINFECT_STATE_COOL_DOWN_RO_FILTER; - } return state; @@ -1369,53 +1367,6 @@ } return state; - -#if 0 - // Check if the coldest spot temperature is less than 45 C so the RO filter can safely run - if ( ( FALSE == isROPumpRunning() ) && ( THdTemp < TARGET_THD_SENSOR_FOR_RINSING_C ) ) - { - U32 time = calcTimeSince( ROFCoolingTimer ); - - if ( time <= THD_REACH_BELOW_45_AFTER_CIRC_TIME_MS ) - { - setValveState( VPI, VALVE_STATE_OPEN ); - setValveState( VBF, VALVE_STATE_CLOSED ); - setValveState( VPO, VALVE_STATE_FILL_C_TO_NC ); - setValveState( VRC, VALVE_STATE_RECIRC_C_TO_NC ); - setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); - setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); - setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); - setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); - - rsrvr1Status = DG_RESERVOIR_ABOVE_TARGET; - stateTimer = getMSTimerCount(); - state = DG_HEAT_DISINFECT_STATE_MIX_DRAIN_R1; - } - else - { - // Set the valves to circulation. VBf is opened because the fluid in the RO filter might still be hot - setValveState( VBF, VALVE_STATE_OPEN ); - setValveState( VDR, VALVE_STATE_RECIRC_C_TO_NC ); - setValveState( VRC, VALVE_STATE_RECIRC_C_TO_NC ); - setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); - - // Set the RO flow to maximum pressure of 30psi since it is the maximum pressure on the RO filter - // at inlet temperature > 45 C - setROPumpTargetFlowRateLPM( ROF_COOL_DOWN_TARGET_FLOW_LPM, HEAT_DISINFECT_MAX_RO_PRESSURE_PSI ); - - hasROFCirculationBeenStarted = TRUE; - ROFCirculationTimer = getMSTimerCount(); - } - } - // If the RO filter water circulation is in progress and the time for it has elapsed, stop the pump - else if ( ( TRUE == hasROFCirculationBeenStarted ) && ( TRUE == didTimeout( ROFCirculationTimer, ROF_COOL_DOWN_CIRCULATION_TIME_MS ) ) ) - { - hasROFCirculationBeenStarted = FALSE; - ROFCoolingTimer = getMSTimerCount(); - signalROPumpHardStop(); - } - return state; -#endif } /*********************************************************************//** @@ -2026,8 +1977,9 @@ // Check if the temperature gradient in between the coldest and the hottest spot is more than the specified temperature and // the timer has not started yet, start it - bool gradientOutOfRange = ( fabs( TPoTemp - ThdTemp ) > HEAT_DISINFECT_MAX_TEMP_GRADIENT_C ) ? TRUE : FALSE; - if ( !gradientOutOfRange ) + BOOL gradientOutOfRange = ( fabs( TPoTemp - ThdTemp ) > HEAT_DISINFECT_MAX_TEMP_GRADIENT_C ) ? TRUE : FALSE; + + if ( TRUE != gradientOutOfRange ) { tempGradOutOfRangeTimer = 0; }