Index: firmware/App/Modes/ModeHeatDisinfectActiveCool.c =================================================================== diff -u -r5fae4f2493e4a237ce0aedd2a3c71419ea297993 -r6c09efba6e0470bc899103e003e2ab3e3602a27c --- firmware/App/Modes/ModeHeatDisinfectActiveCool.c (.../ModeHeatDisinfectActiveCool.c) (revision 5fae4f2493e4a237ce0aedd2a3c71419ea297993) +++ firmware/App/Modes/ModeHeatDisinfectActiveCool.c (.../ModeHeatDisinfectActiveCool.c) (revision 6c09efba6e0470bc899103e003e2ab3e3602a27c) @@ -60,6 +60,7 @@ #define ROF_ACTIVE_COOL_TARGET_RSRVR_FILL_ML 600.0F ///< RO active cool target reservoir fill in mL. #define ROF_ACTIVE_COOL_TARGET_TEMP_C 40.0F ///< RO active cool target temperature in C. #define ROF_ACTIVE_COOL_BELOW_TEMP_TIMEOUT_MS ( 30 * MS_PER_SECOND ) ///< RO active cool temperature below target for cooling timeout in milliseconds. +#define ROF_ACTIVE_COOL_INITIAL_TARGET_DRAIN_RPM 600 ///< RO active cool initial target drain RPM. #define ROF_ACTIVE_COOL_TARGET_DARIN_RPM 300 ///< RO active cool target drain RPM. #define ROF_ACTIVE_COOL_MIX_DRAIN_VALVE_ON_TIMEOUT_MS ( 4 * MS_PER_SECOND ) ///< RO active cool mix drain VPd turn on timeout in milliseconds. #define ROF_ACTIVE_COOL_RSRVR_MIX_DRAIN_TIMEOUT_MS ( 8 * SEC_PER_MIN * MS_PER_SECOND ) ///< RO active cool reservoir mix drain timeout in milliseconds. @@ -79,7 +80,7 @@ BOOL hasDisStatusBeenWrittenToNV; ///< Boolean flag to indicate whether the disinfect status been written to NV or not. } DISINFECT_NV_OPS_T; -/// +/// Temperature below target structure typedef struct { U32 tempBelowTargetStartTimeMS; ///< Mode heat disinfect active cool temperature below target time in milliseconds. @@ -379,27 +380,29 @@ { SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_DG_RESERVOIR_SELECTED, rsrvrID ) } - - if ( FALSE == rsrvrStatus->rsrvr[ rsrvrID ].drainInit ) + else { - initDrainParameters( rsrvrID ); - rsrvrStatus->rsrvr[ rsrvrID ].drainInit = TRUE; - } + if ( FALSE == rsrvrStatus->rsrvr[ rsrvrID ].drainInit ) + { + initDrainParameters( rsrvrID ); + rsrvrStatus->rsrvr[ rsrvrID ].drainInit = TRUE; + } - // NOTE: the drain status should be checked once the reservoirs parameters are initialized. This is to make sure the - // the timers for stable drain time are initialized prior to using them again - isDrainComplete = hasTargetDrainVolumeBeenReached( rsrvrID, drainSteadyTimeoutMS ); + // NOTE: the drain status should be checked once the reservoirs parameters are initialized. This is to make sure the + // the timers for stable drain time are initialized prior to using them again + isDrainComplete = hasTargetDrainVolumeBeenReached( rsrvrID, drainSteadyTimeoutMS ); - if ( TRUE == isDrainComplete ) - { - rsrvrStatus->rsrvr[ rsrvrID ].drainInit = FALSE; - status = DG_RESERVOIR_REACHED_TARGET; + if ( TRUE == isDrainComplete ) + { + rsrvrStatus->rsrvr[ rsrvrID ].drainInit = FALSE; + status = DG_RESERVOIR_REACHED_TARGET; + } + else if ( TRUE == didTimeout( stateTimerMS, drainStateTimeoutMS ) ) + { + rsrvrStatus->rsrvr[ rsrvrID ].drainInit = FALSE; + status = DG_RESERVOIR_NOT_REACHED_TARGET; + } } - else if ( TRUE == didTimeout( stateTimerMS, drainStateTimeoutMS ) ) - { - rsrvrStatus->rsrvr[ rsrvrID ].drainInit = FALSE; - status = DG_RESERVOIR_NOT_REACHED_TARGET; - } return status; } @@ -791,6 +794,7 @@ switch ( state ) { case DG_HEAT_DISINFECT_ACITVE_COOL_MIX_DRAIN_R1_STATE: + { // Valves setValveState( VPI, VALVE_STATE_OPEN ); setValveState( VBF, VALVE_STATE_CLOSED ); @@ -813,10 +817,13 @@ // RO pump signalROPumpHardStop(); // Drain pump - setDrainPumpTargetRPM( ROF_ACTIVE_COOL_TARGET_DARIN_RPM ); + U32 rpm = ( TRUE == rsrvrsStatus.isThisInitialDrain ? ROF_ACTIVE_COOL_INITIAL_TARGET_DRAIN_RPM : ROF_ACTIVE_COOL_TARGET_DARIN_RPM ); + setDrainPumpTargetRPM( rpm ); + } break; case DG_HEAT_DISINFECT_ACTIVE_COOL_MIX_DRAIN_R2_STATE: + { // Valves setValveState( VPI, VALVE_STATE_OPEN ); setValveState( VBF, VALVE_STATE_CLOSED ); @@ -839,7 +846,9 @@ // RO pump signalROPumpHardStop(); // Drain pump - setDrainPumpTargetRPM( ROF_ACTIVE_COOL_TARGET_DARIN_RPM ); + U32 rpm = ( TRUE == rsrvrsStatus.isThisInitialDrain ? ROF_ACTIVE_COOL_INITIAL_TARGET_DRAIN_RPM : ROF_ACTIVE_COOL_TARGET_DARIN_RPM ); + setDrainPumpTargetRPM( rpm ); + } break; case DG_HEAT_DISINFECT_ACTIVE_COOL_FILL_R1_STATE: