Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -rf0745a42b391c571718598d306eeb5d8554e46ad -rfe82031357b8615b4535f0ca527f010656308a7d --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision f0745a42b391c571718598d306eeb5d8554e46ad) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision fe82031357b8615b4535f0ca527f010656308a7d) @@ -746,10 +746,11 @@ * The handleBloodLeakRecoverBloodDetectState function handles the blood * leak recover blood detect state. * @details Inputs: bloodLeakStatus, bloodLeakRecoveryStartTimeMS, - * bloodLeakEnterNormalRequested, bloodLeakEmbModeHasZeroBeenRqustd + * bloodLeakEnterNormalRequested, bloodLeakEmbModeHasZeroBeenRqustd, + * bloodLeakExitNormalRequested * @details Outputs: bloodLeakStatus, bloodLeakRecoveryStartTimeMS, * bloodLeakPersistenceCtr, bloodLeakEnterNormalRequested, - * bloodLeakEmbModeHasZeroBeenRqustd + * bloodLeakEmbModeHasZeroBeenRqustd, bloodLeakExitNormalRequested * @return next state *************************************************************************/ static BLOOD_LEAK_STATE_T handleBloodLeakRecoverBloodDetectState( void ) @@ -785,6 +786,13 @@ bloodLeakEmbModeHasZeroBeenRqustd = FALSE; state = BLOOD_LEAK_CHECK_ZERO_AND_SELF_TEST_STATE; } + if ( TRUE == bloodLeakExitNormalRequested ) + { + // Although we are not in the normal state but with the recovery alarm the user might press end treatment in that case exit normal + // mode is selected and the state machine is supposed to go back to the init state waiting for the next command. + bloodLeakExitNormalRequested = FALSE; + state = BLOOD_LEAK_INIT_STATE; + } return state; }