Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r11e3b3ea59f507ffc4cd6b64e1821689295e207c -r956bf7dbc9e63c875428495061dbdbcdbb8cacb0 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 11e3b3ea59f507ffc4cd6b64e1821689295e207c) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 956bf7dbc9e63c875428495061dbdbcdbb8cacb0) @@ -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,10 +95,17 @@ // re-initialize standby mode each time we transition to standby mode initStandbyMode(); + //deenergizeActuators(); + // set initial actuator states setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); +#ifndef V_2_SYSTEM + setValveState( VRD1, VALVE_STATE_CLOSED ); + setValveState( VRD2, VALVE_STATE_CLOSED ); +#else setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); +#endif setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); @@ -181,7 +189,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_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; } else if ( TRUE == pendingStartDGRequest ) @@ -246,7 +258,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; } @@ -270,7 +286,12 @@ { stopSampleWaterRequest = FALSE; 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; } @@ -360,6 +381,29 @@ /*********************************************************************//** * @brief + * The startDGFlush function starts DG flush mode. + * @details Inputs: standbyState + * @details Outputs: none + * @return: TRUE if the switch was successful, otherwise FALSE + *************************************************************************/ +BOOL startDGFlush( void ) +{ + BOOL result = FALSE; + + // If DG is in standby mode or in the solo mode and the standby mode is in Idle state, request DG flush + if ( ( DG_MODE_STAN == getCurrentOperationMode() && DG_STANDBY_MODE_STATE_IDLE == standbyState ) || + DG_MODE_SOLO == getCurrentOperationMode() ) + { + requestNewOperationMode( DG_MODE_FLUS ); + + result = TRUE; + } + + return result; +} + +/*********************************************************************//** + * @brief * The startDGHeatDisinfect function starts heat disinfect mode. * @details Inputs: standbyState * @details Outputs: none @@ -374,7 +418,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; }