Index: firmware/App/Modes/TreatmentEnd.c =================================================================== diff -u -r94940c975556f32d5b13f98aea84e83f8441f41d -r9bf209fc5813b7e806f51f408ece77174a336c9b --- firmware/App/Modes/TreatmentEnd.c (.../TreatmentEnd.c) (revision 94940c975556f32d5b13f98aea84e83f8441f41d) +++ firmware/App/Modes/TreatmentEnd.c (.../TreatmentEnd.c) (revision 9bf209fc5813b7e806f51f408ece77174a336c9b) @@ -111,26 +111,18 @@ // Stop any DG fill that may be in progress cmdStopDGFill(); - // Set valves + // Set user alarm recovery actions allowed in this sub-mode + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, TRUE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, TRUE ); + + // Set valves, pumps and heater setValvePosition( VDI, VALVE_POSITION_C_CLOSE ); setValvePosition( VDO, VALVE_POSITION_C_CLOSE ); - setValvePosition( VBA, VALVE_POSITION_B_OPEN ); - setValvePosition( VBV, VALVE_POSITION_B_OPEN ); - - // Ensure all pumps except BP stopped signalDialInPumpHardStop(); signalDialOutPumpHardStop(); stopSyringePump(); - setBloodPumpTargetFlowRate( TX_END_BP_FLOW_RATE_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); cmdStopDGTrimmerHeater(); - - // Continue air trap control - startAirTrapControl(); - - // Set user alarm recovery actions allowed in this sub-mode - setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); // Resume in this sub-mode indicates resume wait for user rinseback request (not resume treatment) - setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, TRUE ); - setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, TRUE ); + setupForTxEndWait4RinsebackState(); } /*********************************************************************//** @@ -144,15 +136,16 @@ *************************************************************************/ static void setupForTxEndWait4RinsebackState( void ) { + doorClosedRequired( TRUE, TRUE ); // No resume alarm action allowed - setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, FALSE ); // Resume in this sub-mode indicates resume wait for user rinseback request (not resume treatment) // Open VBA and VBV valves to allow flow from/to patient setValvePosition( VBA, VALVE_POSITION_B_OPEN ); setValvePosition( VBV, VALVE_POSITION_B_OPEN ); // Start blood pump at Tx End slow flow rate setBloodPumpTargetFlowRate( TX_END_BP_FLOW_RATE_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); bloodSittingTimerCtr = 0; - // Start air trap leveling control + // Continue air trap leveling control startAirTrapControl(); } @@ -167,6 +160,7 @@ *************************************************************************/ static void setupForTxEndPausedState( void ) { + doorClosedRequired( FALSE, FALSE ); // Resume alarm action will take us back to TxEndWait4RinsebackState setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); // Stop blood pump