Index: firmware/App/Modes/TreatmentStop.c =================================================================== diff -u -r8b73263b38f449dacc0795c67a7cf6240cb79026 -r1f91b5a53bda942b0967817bbd5e68a499dbf816 --- firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision 8b73263b38f449dacc0795c67a7cf6240cb79026) +++ firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision 1f91b5a53bda942b0967817bbd5e68a499dbf816) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2020-2022 Diality Inc. - All Rights Reserved. +* Copyright (c) 2020-2023 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) 13-Jul-2022 +* @author (last) Michael Garthwaite +* @date (last) 19-Jan-2023 * * @author (original) Sean * @date (original) 15-Jan-2020 @@ -90,6 +90,7 @@ // Set user alarm recovery actions allowed in this sub-mode setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); + if ( TRUE == getRinsebackCompleted() ) { // block rinseback action if already done setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); @@ -217,6 +218,8 @@ *************************************************************************/ void execTreatmentStop( void ) { + TREATMENT_STOP_STATE_T priorSubState = currentTxStopState; + // Execute treatment stop sub-mode state machine switch ( currentTxStopState ) { @@ -241,6 +244,10 @@ break; } + if ( priorSubState != currentTxStopState ) + { + SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_SUB_STATE_CHANGE, priorSubState, currentTxStopState ); + } // Broadcast treatment stop status publishTreatmentStopData(); } @@ -256,8 +263,8 @@ static TREATMENT_STOP_STATE_T handleTreatmentStopAlarmsAndSignals( TREATMENT_STOP_STATE_T state ) { TREATMENT_STOP_STATE_T result = state; - bool bloodRecircBlocked = isBloodRecircBlocked(); - bool dialysateRecircBlocked = isDialysateRecircBlocked(); + BOOL bloodRecircBlocked = isBloodRecircBlocked(); + BOOL dialysateRecircBlocked = isDialysateRecircBlocked(); // Both unblocked and not in recirculate both state if ( (TREATMENT_STOP_RECIRC_STATE != state) && ( FALSE == dialysateRecircBlocked ) @@ -367,7 +374,7 @@ handleTreatmentStopBloodSittingTimer(); - result = handleTreatmentStopAlarmsAndSignals(result); + result = handleTreatmentStopAlarmsAndSignals( result ); return result; }