Index: firmware/App/Modes/TreatmentStop.c =================================================================== diff -u -r2dd90b6861e4cd229253ecb12467af5d657bb433 -r3833c8a7a90288a6010a625a884048c775c598d3 --- firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision 2dd90b6861e4cd229253ecb12467af5d657bb433) +++ firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision 3833c8a7a90288a6010a625a884048c775c598d3) @@ -7,8 +7,8 @@ * * @file TreatmentStop.c * -* @author (last) Michael Garthwaite -* @date (last) 09-Jun-2023 +* @author (last) Sean Nash +* @date (last) 21-Jun-2023 * * @author (original) Sean * @date (original) 15-Jan-2020 @@ -109,6 +109,8 @@ setupForDialysateRecirculationState(); + signalUserRateChange(); // so pressure limits re-stabilize + // Reset saline bolus state in case alarm interrupted one resetSalineBolus(); @@ -232,7 +234,6 @@ { TREATMENT_STOP_STATE_T priorSubState = currentTxStopState; - // Execute treatment stop sub-mode state machine switch ( currentTxStopState ) { case TREATMENT_STOP_RECIRC_STATE: @@ -404,15 +405,19 @@ // Ensure we do not sit in stopped state for too long (if blood in line) if ( getRinsebackCompleted() != TRUE ) { - if ( ++bloodSittingTimerCtr > WARN_TIME_BLOOD_SITTING ) + bloodSittingTimerCtr++; + if ( FALSE == doesAlarmStatusIndicateEndTxOnly() ) // Alarms appropriate only if we are not already at an alarm stop, end Tx only { - activateAlarmNoData( ALARM_ID_HD_BLOOD_SITTING_WARNING ); + if ( bloodSittingTimerCtr > WARN_TIME_BLOOD_SITTING ) + { + activateAlarmNoData( ALARM_ID_HD_BLOOD_SITTING_WARNING ); + } + if ( bloodSittingTimerCtr > MAX_TIME_BLOOD_SITTING ) + { + // Activate the alarm + activateAlarmNoData( ALARM_ID_HD_TREATMENT_STOPPED_NO_RINSEBACK ); + } } - if ( bloodSittingTimerCtr > MAX_TIME_BLOOD_SITTING ) - { - // Activate the alarm - activateAlarmNoData( ALARM_ID_HD_TREATMENT_STOPPED_NO_RINSEBACK ); - } } else { @@ -451,7 +456,9 @@ data.timeout = 0; data.countdown = 0; - if ( ( getRinsebackCompleted() != TRUE ) && ( isAlarmActive( ALARM_ID_HD_TREATMENT_RINSEBACK_TIMEOUT_ALARM ) != TRUE ) ) + if ( ( getRinsebackCompleted() != TRUE ) && + ( isAlarmActive( ALARM_ID_HD_TREATMENT_RINSEBACK_TIMEOUT_ALARM ) != TRUE ) && + ( isAlarmActive( ALARM_ID_HD_TREATMENT_STOPPED_NO_RINSEBACK ) != TRUE ) ) { if ( bloodSittingTimerCtr > 0 ) {