Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -rfe82031357b8615b4535f0ca527f010656308a7d -rf14422a7576bf3c44d8fa23d8a14b6cab1922553 --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision fe82031357b8615b4535f0ca527f010656308a7d) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision f14422a7576bf3c44d8fa23d8a14b6cab1922553) @@ -158,7 +158,6 @@ static U08 bloodLeakSetPointSequence[ BLOOD_LEAK_SET_POINT_SEQ_MAX_LENGTH ][ 2 ]; ///< Blood leak set point sequence array. static HD_BLOOD_LEAK_SENSOR_CAL_RECORD_T bloodLeakCalRecord; ///< Blood leak calibration record structure. static BOOL bloodLeakExitNormalRequested; ///< Blood leak exit normal state requested. -static BOOL bloodLeakEnterNormalRequested; ///< Blood leak enter normal state requested. static U32 bloodLeakRecoveryStartTimeMS; ///< Blood leak recovery start time in milliseconds. // Embedded mode variables @@ -223,7 +222,6 @@ * bloodLeakExitNormalRequested, bloodLeakEmbModeCmdSeqLength, * bloodLeakEmbModeHasRxRqstBeenSent, bloodLeakEmbModeInfoCmdEnqLastTimeStamp, * bloodLeakEmbModeInfoCmdCounter, bloodLeakRecoveryStartTimeMS, - * bloodLeakEnterNormalRequested * @return none *************************************************************************/ void initBloodLeak( void ) @@ -257,7 +255,6 @@ bloodLeakEmbModeInfoCmdEnqLastTimeStamp = getMSTimerCount(); bloodLeakEmbModeInfoCmdCounter = 0; bloodLeakRecoveryStartTimeMS = getMSTimerCount(); - bloodLeakEnterNormalRequested = FALSE; // Set the blood leak embedded mode command queue to zero memset( bloodLeakEmbModeCmdQ, 0x0, BLOOD_LEAK_EMB_MODE_CMD_Q_MAX_SIZE ); @@ -433,19 +430,6 @@ /*********************************************************************//** * @brief - * The enterBloodLeakNormalState requests that the blood leak sensor to enter - * its normal state. - * @details Inputs: none - * @details Outputs: bloodLeakEnterNormalRequested - * @return none - *************************************************************************/ -void enterBloodLeakNormalState( void ) -{ - bloodLeakEnterNormalRequested = TRUE; -} - -/*********************************************************************//** - * @brief * The execBloodLeakSelfTest function executes the blood leak self-test. * @details Inputs: none * @details Outputs: none @@ -746,11 +730,10 @@ * The handleBloodLeakRecoverBloodDetectState function handles the blood * leak recover blood detect state. * @details Inputs: bloodLeakStatus, bloodLeakRecoveryStartTimeMS, - * bloodLeakEnterNormalRequested, bloodLeakEmbModeHasZeroBeenRqustd, - * bloodLeakExitNormalRequested - * @details Outputs: bloodLeakStatus, bloodLeakRecoveryStartTimeMS, - * bloodLeakPersistenceCtr, bloodLeakEnterNormalRequested, * bloodLeakEmbModeHasZeroBeenRqustd, bloodLeakExitNormalRequested + * @details Outputs: bloodLeakStatus, bloodLeakRecoveryStartTimeMS, + * bloodLeakPersistenceCtr, bloodLeakEmbModeHasZeroBeenRqustd, + * bloodLeakExitNormalRequested * @return next state *************************************************************************/ static BLOOD_LEAK_STATE_T handleBloodLeakRecoverBloodDetectState( void ) @@ -772,27 +755,19 @@ bloodLeakRecoveryStartTimeMS = getMSTimerCount(); } - if ( TRUE == bloodLeakEnterNormalRequested ) + if ( isAlarmActive( ALARM_ID_HD_BLOOD_LEAK_RECOVERING_PLEASE_WAIT ) != TRUE ) { // Once the user hit resume, transition back to normal state to continue detecting for blood // Reset the blood detect counter prior to transitioning back - bloodLeakPersistenceCtr = 0; - bloodLeakEnterNormalRequested = FALSE; - state = BLOOD_LEAK_NORMAL_STATE; + bloodLeakPersistenceCtr = 0; + state = BLOOD_LEAK_NORMAL_STATE; } else if ( TRUE == bloodLeakEmbModeHasZeroBeenRqustd ) { // Check whether zeroing the sensor has been requested or not if yes, transition to zero command state otherwise, stay in this state 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; }