Index: firmware/App/Modes/ModeFault.c =================================================================== diff -u -r5f86e35ac3c021b68708457d17d4ef51b20aef9c -r7df1fae66b80c946ff1bcdee4b43afb5ab7a1d4c --- firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision 5f86e35ac3c021b68708457d17d4ef51b20aef9c) +++ firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision 7df1fae66b80c946ff1bcdee4b43afb5ab7a1d4c) @@ -15,9 +15,14 @@ * ***************************************************************************/ -#include "OperationModes.h" +#include "DrainPump.h" +#include "Heaters.h" #include "ModeFault.h" +#include "OperationModes.h" +#include "ROPump.h" #include "SystemCommMessages.h" +#include "UVReactors.h" +#include "Valves.h" /** * @addtogroup DGFaultMode @@ -97,4 +102,48 @@ return faultState; } +/*********************************************************************//** + * @brief + * The deenergizeActuators function sets all the actuators to reset and + * de-energized state. + * @details Inputs: none + * @details Outputs: none + * @return none + *************************************************************************/ +void deenergizeActuators( void ) +{ + // Turn off the UV reactors + turnOffUVReactor( INLET_UV_REACTOR ); + turnOffUVReactor( OUTLET_UV_REACTOR ); + + // De-energize all the valves + setValveState( VPI, VALVE_STATE_CLOSED ); + setValveState( VBF, VALVE_STATE_CLOSED ); + setValveState( VSP, VALVE_STATE_CLOSED ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); +#else + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); +#endif + setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); + setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); + setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); + setValveState( VRO, 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( VRI, VALVE_STATE_R1_C_TO_NO ); + setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); + + //TODO add the composition pumps + signalROPumpHardStop(); + signalDrainPumpHardStop(); + stopPrimaryHeater(); + stopTrimmerHeater(); +} + /**@}*/