Index: firmware/App/Modes/ModeFault.c =================================================================== diff -u -r37a8a58b766a496b39241dd7ae46dc10dbda35e4 -raf2674758d7b9dbe05e348b318845975b423509f --- firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision 37a8a58b766a496b39241dd7ae46dc10dbda35e4) +++ firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision af2674758d7b9dbe05e348b318845975b423509f) @@ -16,15 +16,15 @@ ***************************************************************************/ #include "AlarmLamp.h" -#ifdef EMC_TEST_BUILD // TODO - test code #include "BloodFlow.h" +#ifdef EMC_TEST_BUILD // TODO - test code #include "Buttons.h" +#endif #include "DialInFlow.h" #include "DialOutFlow.h" -#include "Valves.h" -#endif -#include "OperationModes.h" #include "ModeFault.h" +#include "OperationModes.h" +#include "Valves.h" /** * @addtogroup HDFaultMode @@ -44,6 +44,7 @@ *************************************************************************/ void initFaultMode( void ) { + // TODO - anything to do here? } /*********************************************************************//** @@ -55,6 +56,7 @@ *************************************************************************/ void transitionToFaultMode( void ) { + // TODO - anything to do here? } /*********************************************************************//** @@ -66,7 +68,19 @@ *************************************************************************/ U32 execFaultMode( void ) { -#ifdef EMC_TEST_BUILD // TODO - test code +#ifndef EMC_TEST_BUILD + // ensure all pumps are stopped + signalBloodPumpHardStop(); + signalDialInPumpHardStop(); + signalDialOutPumpHardStop(); + // ensure all valves are in safe position + setValveAirTrap( STATE_CLOSED ); + setValvePosition( VDI, VALVE_POSITION_C_CLOSE ); + setValvePosition( VDO, VALVE_POSITION_C_CLOSE ); + setValvePosition( VBA, VALVE_POSITION_C_CLOSE ); + setValvePosition( VBV, VALVE_POSITION_C_CLOSE ); +#else + // TODO - EMC test code - remove later static U32 toggle = 0; static BOOL button_state = FALSE; BOOL stop = isStopButtonPressed();