Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -rf1d684e536e7911b356a5d35320c909a1016d3d0 -r80c4b42aae13511c7dcd0dbfa4fe9c742871e246 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision f1d684e536e7911b356a5d35320c909a1016d3d0) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 80c4b42aae13511c7dcd0dbfa4fe9c742871e246) @@ -198,6 +198,15 @@ handleDisinfectCancel( stop ); + // if no active alarms anymore, restore to default valve states for standby mode + if ( ( FALSE == doesAlarmStatusIndicateStop() ) && ( VALVE_POSITION_C_CLOSE == getValvePosition( VDI ) ) ) + { + setValvePosition( VDI, VALVE_POSITION_A_INSERT_EJECT ); + setValvePosition( VDO, VALVE_POSITION_A_INSERT_EJECT ); + setValvePosition( VBA, VALVE_POSITION_A_INSERT_EJECT ); + setValvePosition( VBV, VALVE_POSITION_A_INSERT_EJECT ); + } + // State machine to get DG to prep a reservoir so we can start a treatment switch ( currentStandbyState ) { @@ -354,7 +363,27 @@ *************************************************************************/ void signalAlarmActionToStandbyMode( ALARM_ACTION_T action ) { - // Alarm actions not handled in Standby mode + switch ( action ) + { + case ALARM_ACTION_STOP: + // Pumps should be off + signalBloodPumpHardStop(); + signalDialInPumpHardStop(); + signalDialOutPumpHardStop(); + stopSyringePump(); + + // Set valves to safe positions + 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 ); + break; + + default: + // do not handle other actions in standby mode + break; + } } /*********************************************************************//**