Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -rf53ecc014c076fc476e7963b67d688b7233579ee -r8747e947a7bc52dc3a4fb1346935740e08f5e974 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision f53ecc014c076fc476e7963b67d688b7233579ee) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 8747e947a7bc52dc3a4fb1346935740e08f5e974) @@ -7,8 +7,8 @@ * * @file ModeStandby.c * -* @author (last) Sean Nash -* @date (last) 04-May-2023 +* @author (last) Michael Garthwaite +* @date (last) 16-May-2023 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -147,6 +147,7 @@ resetDialInPumpRotorCount(); resetPreLoadStatus(); setVenousBubbleDetectionEnabled( FALSE ); + setCurrentSubState( NO_SUB_STATE ); // Set user alarm recovery actions allowed in this mode setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, FALSE ); @@ -198,6 +199,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 ) { @@ -355,7 +365,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; + } } /*********************************************************************//**