Index: firmware/App/Modes/TreatmentStop.c =================================================================== diff -u -re21e33dc6ae05c705bab8639a3d05a9376b26c25 -rcd5be724d5a3ba7457e761191d82f278654d7f5c --- firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision e21e33dc6ae05c705bab8639a3d05a9376b26c25) +++ firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision cd5be724d5a3ba7457e761191d82f278654d7f5c) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2020-2023 Diality Inc. - All Rights Reserved. +* Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file TreatmentStop.c * * @author (last) Sean Nash -* @date (last) 11-Jul-2023 +* @date (last) 11-Oct-2023 * * @author (original) Sean * @date (original) 15-Jan-2020 @@ -105,14 +105,15 @@ setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, TRUE ); // Set Dialysate valves to bypass filter for recirculation + signalDialOutPumpHardStop(); setValvePosition( VDI, VALVE_POSITION_C_CLOSE ); setValvePosition( VDO, VALVE_POSITION_C_CLOSE ); setupForBloodRecirculationState(); setupForDialysateRecirculationState(); - signalInitiatePressureStabilization(); + signalInitiatePressureStabilization( USE_NORMAL_STABILIZATION_PERIOD ); // Reset saline bolus state in case alarm interrupted one resetSalineBolus(); @@ -447,15 +448,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 {