Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r24fd1893101af40cc6736aacaa20382875c80bf1 -r3d131237935eb36e56e0d057a713430e31dc6405 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 24fd1893101af40cc6736aacaa20382875c80bf1) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 3d131237935eb36e56e0d057a713430e31dc6405) @@ -19,6 +19,7 @@ #include "CPLD.h" #include "DrainPump.h" #include "Heaters.h" +#include "ModeFault.h" #include "ModeStandby.h" #include "OperationModes.h" #include "Reservoirs.h" @@ -94,27 +95,7 @@ // re-initialize standby mode each time we transition to standby mode initStandbyMode(); - // set initial actuator states - setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); - setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); - setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); - setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); - setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); - setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); - setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); - setValveState( VPI, VALVE_STATE_CLOSED ); - setValveState( VSP, VALVE_STATE_CLOSED ); - - signalROPumpHardStop(); - signalDrainPumpHardStop(); - stopPrimaryHeater(); - stopTrimmerHeater(); - requestConcentratePumpsOff( CONCENTRATEPUMPS_CP1_ACID ); - requestConcentratePumpsOff( CONCENTRATEPUMPS_CP2_BICARB ); - - // UV off - turnOffUVReactor( INLET_UV_REACTOR ); - turnOffUVReactor( OUTLET_UV_REACTOR ); + deenergizeActuators(); } /*********************************************************************//** @@ -181,7 +162,11 @@ flushFilterRequest = FALSE; filterFlushStartTime = getMSTimerCount(); setValveState( VPI, VALVE_STATE_OPEN ); - setValveState( VPD, VALVE_STATE_OPEN ); // TODO: VPD drain state is closed for V3 +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); +#else + setValveState( VPD, VALVE_STATE_OPEN ); // TODO: VPD drain state is closed for V3 +#endif state = DG_STANDBY_MODE_STATE_FLUSH_FILTER; } else if ( TRUE == pendingStartDGRequest ) @@ -246,7 +231,11 @@ if ( TRUE == endSampleWaterRequest ) { setValveState( VPI, VALVE_STATE_CLOSED ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); +#else setValveState( VPD, VALVE_STATE_CLOSED ); +#endif state = DG_STANDBY_MODE_STATE_IDLE; } @@ -269,7 +258,12 @@ if ( ( TRUE == stopSampleWaterRequest ) || ( TRUE == didTimeout( waterSampleStartTime, MAX_WATER_SAMPLE_TIME_MS ) ) ) { setValveState( VSP, VALVE_STATE_CLOSED ); + +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); +#else setValveState( VPD, VALVE_STATE_OPEN ); // TODO: VPD drain state is closed for V3 +#endif state = DG_STANDBY_MODE_STATE_FLUSH_FILTER_IDLE; } @@ -396,7 +390,28 @@ ( DG_MODE_SOLO == getCurrentOperationMode() ) ) { requestNewOperationMode( DG_MODE_HEAT ); + status = TRUE; + } + return status; +} + +/*********************************************************************//** + * @brief + * The startDGChemicalDisinfect function starts chemical disinfect mode. + * @details Inputs: standbyState + * @details Outputs: none + * @return: TRUE if the switch was successful + *************************************************************************/ +BOOL startDGChemicalDisinfect( void ) +{ + BOOL status = FALSE; + + // If DG is in standby mode and the standby mode is in Idle, request chemical disinfect + // Chemical disinfect cannot be run in solo mode because the user has to confirm that the acid is inserted or removed + //if ( ( DG_MODE_STAN == getCurrentOperationMode() ) && ( DG_STANDBY_MODE_STATE_IDLE == standbyState ) ) TODO un-comment this line. This is commented to be able to run chemical without HD for development + { + requestNewOperationMode( DG_MODE_CHEM ); status = TRUE; }