Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -rdfe4ba063570881ed6d69862bd2d2e86a726f7fb -rbac52336ea9e23fc2dfb4a802afe49401dfb7057 --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision dfe4ba063570881ed6d69862bd2d2e86a726f7fb) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision bac52336ea9e23fc2dfb4a802afe49401dfb7057) @@ -96,22 +96,26 @@ // ***************** zeroing status *************** // #define BLD_NOMINAL_INTENSITY 930 ///< Blood leak nominal intensity. -#define BLD_MAX_INTENSITY_DRIFT_AFTER_ZEROING ( BLD_NOMINAL_INTENSITY * 0.01F ) ///< Blood leak max intensity drift after zeroing. +#define BLD_MAX_INTENSITY_DRFT_AFTER_ZEROING 10 ///< Blood leak max intensity drift after zeroing. #define BLD_MAX_INTENSITY_OUT_OF_RANGE 0.40F ///< Blood leak maximum allowed intensity. #define BLD_MIN_INTENSITY_OUT_OF_RANGE 0.35F ///< Blood leak minimum allowed intensity. #define BLD_ZERO_MIN_INTERVAL_MS ( 30 * SEC_PER_MIN * MS_PER_SECOND ) ///< Blood leak zeroing minimum interval in milliseconds. #define BLD_ZERO_MVG_AVG_NUM_OF_SAMPLES 16 ///< Blood leak number of moving average samples. -#define BLD_ZERO_IN_RANGE_DRIFT_TIMEOUT_MS ( 4 * MS_PER_SECOND ) ///< Blood leak zero value drift in range timeout in milliseconds. +#define BLD_ZERO_IN_RANGE_DRIFT_TIMEOUT_MS ( 10 * MS_PER_SECOND ) ///< Blood leak zero value drift in range timeout in milliseconds. +#define BLD_MAX_UPPER_INTENSITY_DRFIT ( BLD_NOMINAL_INTENSITY + 20 ) ///< Blood leak maximum upper range intensity drift. +#define BLD_START_OF_TX_MIN_INTENSITY_DRIFT 915 ///< Blood leak start of treatment minimum intensity. +#define BLD_UPPER_INTENSITY_INTERVAL_MS ( 30 * SEC_PER_MIN * MS_PER_SECOND ) ///< Blood leak upper drift interval in milliseconds. +#define BLD_ZERO_UPPER_RANGE_DRIFT_TIMEOUT_MS ( 60 * MS_PER_SECOND ) ///< Blood leak zero upper range drift timeout in milliseconds. /// Defined states for the blood leak detector state machine. typedef enum BloodLeakStates { - BLOOD_LEAK_WAIT_FOR_POST_STATE = 0, ///< Wait for post state. - BLOOD_LEAK_CHECK_SET_POINT_STATE, ///< Check set point state. - BLOOD_LEAK_INIT_STATE, ///< Init state. + BLOOD_LEAK_WAIT_FOR_POST_STATE = 0, ///< Blood leak wait for post state. + BLOOD_LEAK_CHECK_SET_POINT_STATE, ///< Blood leak check set point state. + BLOOD_LEAK_INIT_STATE, ///< Blood leak init state. BLOOD_LEAK_CHECK_ZERO_AND_SELF_TEST_STATE, ///< Blood leak check for zero and self test commands state. BLOOD_LEAK_VERIFY_INTENSITY_AFTER_ZEROING_STATE, ///< Blood leak verify intensity after zeroing state. - BLOOD_LEAK_NORMAL_STATE, ///< Normal state. + BLOOD_LEAK_NORMAL_STATE, ///< Blood leak normal state. BLOOD_LEAK_RECOVER_BLOOD_DETECT_STATE, ///< Blood leak recover blood detect state. NUM_OF_BLOOD_LEAK_STATES ///< Number of blood leak detector states. } BLOOD_LEAK_STATE_T; @@ -165,6 +169,8 @@ U32 rawIntensityNextIndex; ///< Blood leak raw intensity next index for moving average. OVERRIDE_F32_T intensityMovingAverage; ///< Blood leak intensity moving average. OVERRIDE_U32_T zeroingIntervalTimeMS; ///< Blood leak zeroing interval time in milliseconds. + U32 lastUpperZeroingStartTimeMS; ///< Blood leak last upper range zeroing start time in milliseconds. + U32 driftUpperRangeStartTimeMS; ///< Blood leak drift in upper range start time in milliseconds. } BLOOD_LEAK_ZEROING_STATUS_T; // ********** private data ********** @@ -239,6 +245,8 @@ static void processBloodLeakIntensityData( void ); static void resetEmbModeCmdRespConsumedFlag( U08 cmd ); static U32 getEmbModeInfoValue( U08 cmd ); +static BOOL isLowerRangeIntensityDriftZeroingNeeded( void ); +static BOOL isUpperRangeIntensityZeroingNeeded( void ); /*********************************************************************//** * @brief @@ -479,6 +487,78 @@ /*********************************************************************//** * @brief + * The getBloodLeakStatus function gets the current reading for the blood + * leak detector. + * @details Inputs: bloodLeakStatus + * @details Outputs: none + * @return the current blood leak status. + *************************************************************************/ +BLOOD_LEAK_STATUS_T getBloodLeakStatus( void ) +{ + BLOOD_LEAK_STATUS_T result = (BLOOD_LEAK_STATUS_T)bloodLeakStatus.data; + + if ( OVERRIDE_KEY == bloodLeakStatus.override ) + { + result = (BLOOD_LEAK_STATUS_T)bloodLeakStatus.ovData; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getBloodLeakSelfTestStatus function gets the status for the blood + * leak detector self-test. + * @details Inputs: bloodLeakSelfTestStatus + * @details Outputs: none + * @return status of blood leak detector self-test. + *************************************************************************/ +SELF_TEST_STATUS_T getBloodLeakSelfTestStatus( void ) +{ +#ifndef _RELEASE_ + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_BLOOD_LEAK_SELF_TEST ) ) + { + bloodLeakSelfTestStatus = SELF_TEST_STATUS_PASSED; + } +#endif + + return bloodLeakSelfTestStatus; +} + +/*********************************************************************//** + * @brief + * The isBloodLeakZeroingNeeded function checks whether blood leak zeroing + * is needed in terms of drift. + * @details Inputs: none + * @details Outputs: none + * @return TRUE if blood leak zeroing is needed otherwise, FALSE + *************************************************************************/ +BOOL isBloodLeakZeroingNeeded( void ) +{ + BOOL status = FALSE; + HD_OP_MODE_T opMode = getCurrentOperationMode(); + + if ( MODE_PRET == opMode ) + { + U32 intensity = bloodLeakEmbModeCmd[ I_EMB_MODE_CMD ].commandResp; + + if ( ( intensity <= BLD_START_OF_TX_MIN_INTENSITY_DRIFT ) || ( intensity >= BLD_MAX_UPPER_INTENSITY_DRFIT ) ) + { + SEND_EVENT_WITH_2_F32_DATA( HD_EVENT_BLOOD_LEAK_ZEROING_REQUIRED, intensity, opMode ) + status = TRUE; + } + } + else if ( MODE_TREA == opMode ) + { + status |= isLowerRangeIntensityDriftZeroingNeeded(); + status |= isUpperRangeIntensityZeroingNeeded(); + } + + return status; +} + +/*********************************************************************//** + * @brief * The exitBloodLeakNormalState requests that the blood leak sensor to exit * its normal state. * @details Inputs: bloodLeakState @@ -735,13 +815,14 @@ state = BLOOD_LEAK_INIT_STATE; bloodLeakSelfTestStatus = SELF_TEST_STATUS_FAILED; - if ( abs( BLD_NOMINAL_INTENSITY - intensity ) <= BLD_MAX_INTENSITY_DRIFT_AFTER_ZEROING ) + if ( abs( BLD_NOMINAL_INTENSITY - intensity ) <= BLD_MAX_INTENSITY_DRFT_AFTER_ZEROING ) { // Done with zero sequence, transition to other states zeroBloodLeakReset(); - bloodLeakZeroingStatus.lastZeroingStartTimeMS = getMSTimerCount(); - bloodLeakSelfTestStatus = SELF_TEST_STATUS_PASSED; - state = BLOOD_LEAK_NORMAL_STATE; + bloodLeakZeroingStatus.lastZeroingStartTimeMS = getMSTimerCount(); + bloodLeakZeroingStatus.lastUpperZeroingStartTimeMS = getMSTimerCount(); + bloodLeakSelfTestStatus = SELF_TEST_STATUS_PASSED; + state = BLOOD_LEAK_NORMAL_STATE; if ( TRUE == isAlarmActive( ALARM_ID_HD_BLOOD_LEAK_RECOVERING_PLEASE_WAIT ) ) { @@ -877,82 +958,6 @@ /*********************************************************************//** * @brief - * The getBloodLeakStatus function gets the current reading for the blood - * leak detector. - * @details Inputs: bloodLeakStatus - * @details Outputs: none - * @return the current blood leak status. - *************************************************************************/ -BLOOD_LEAK_STATUS_T getBloodLeakStatus( void ) -{ - BLOOD_LEAK_STATUS_T result = (BLOOD_LEAK_STATUS_T)bloodLeakStatus.data; - - if ( OVERRIDE_KEY == bloodLeakStatus.override ) - { - result = (BLOOD_LEAK_STATUS_T)bloodLeakStatus.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief - * The getBloodLeakSelfTestStatus function gets the status for the blood - * leak detector self-test. - * @details Inputs: bloodLeakSelfTestStatus - * @details Outputs: none - * @return status of blood leak detector self-test. - *************************************************************************/ -SELF_TEST_STATUS_T getBloodLeakSelfTestStatus( void ) -{ -#ifndef _RELEASE_ - if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_BLOOD_LEAK_SELF_TEST ) ) - { - bloodLeakSelfTestStatus = SELF_TEST_STATUS_PASSED; - } -#endif - - return bloodLeakSelfTestStatus; -} - -/*********************************************************************//** - * @brief - * The isBloodLeakZeroingNeeded function checks whether blood leak zeroing - * is needed in terms of drift. - * @details Inputs: bloodLeakZeroingStatus - * @details Outputs: bloodLeakZeroingStatus - * @return TRUE if blood leak zeroing is needed otherwise, FALSE - *************************************************************************/ -BOOL isBloodLeakZeroingNeeded( void ) -{ - BOOL status = FALSE; - BOOL isZeroingNeeded = TRUE; - U32 setPoint = bloodLeakEmbModeCmd[ D_EMB_MODE_CMD ].commandResp; - F32 driftMinFromTop = BLD_NOMINAL_INTENSITY - ( setPoint * BLD_MAX_INTENSITY_OUT_OF_RANGE ); - F32 driftMaxFromTop = BLD_NOMINAL_INTENSITY - ( setPoint * BLD_MIN_INTENSITY_OUT_OF_RANGE ); - U32 zeroingIntervalMS = getU32OverrideValue( &bloodLeakZeroingStatus.zeroingIntervalTimeMS ); - BOOL isZeroingAllowed = didTimeout( bloodLeakZeroingStatus.lastZeroingStartTimeMS, zeroingIntervalMS ); - F32 intensityMvgAvg = getF32OverrideValue( &bloodLeakZeroingStatus.intensityMovingAverage ); - - isZeroingNeeded &= ( intensityMvgAvg >= driftMinFromTop ? TRUE : FALSE ); - isZeroingNeeded &= ( intensityMvgAvg <= driftMaxFromTop ? TRUE : FALSE ); - - if ( FALSE == isZeroingNeeded ) - { - bloodLeakZeroingStatus.driftInRangeStartTimeMS = getMSTimerCount(); - } - - if ( ( TRUE == isZeroingAllowed ) && ( TRUE == didTimeout( bloodLeakZeroingStatus.driftInRangeStartTimeMS, BLD_ZERO_IN_RANGE_DRIFT_TIMEOUT_MS ) ) ) - { - SEND_EVENT_WITH_2_F32_DATA( HD_EVENT_BLOOD_LEAK_DRIFT_IN_RANGE, driftMinFromTop, driftMaxFromTop ) - status = TRUE; - } - - return status; -} - -/*********************************************************************//** - * @brief * The handleBloodLeakEmbModeWaitForCommandState function handles the wait for * command state. The state prepares the message to be sent to the blood leak * sensor. @@ -1439,8 +1444,8 @@ * @brief * The publishBloodLeakData function publishes blood leak data at the set interval. * @details Inputs: bloodLeakDataPublicationTimerCounter - * @details Outputs: bloodLeakDataPublicatimerCouonTinter, bloodLeakPersistenceCtr, - * bloodLeakState + * @details Outputs: bloodLeakDataPublicationTimerCounter, bloodLeakPersistenceCtr, + * bloodLeakState, bloodLeakZeroingStatus * @return none *************************************************************************/ static void publishBloodLeakData( void ) @@ -1450,13 +1455,15 @@ { BLOOD_LEAK_DATA_T data; - data.bloodLeakStatus = (U32)getBloodLeakStatus(); - data.bloodLeakState = (U32)bloodLeakState; - data.bloodLeakPersistentCounter = bloodLeakPersistenceCtr; - data.bloodLeakSerialCommState = bloodLeakEmbModeSubstate; - data.bloodLeakIntensity = getEmbModeInfoValue( I_EMB_MODE_CMD ); - data.bloodLeakDetect = getEmbModeInfoValue( V_EMB_MODE_CMD ); - data.bloodLeakIntensityMovingAvg = getF32OverrideValue( &bloodLeakZeroingStatus.intensityMovingAverage ); + data.bloodLeakStatus = (U32)getBloodLeakStatus(); + data.bloodLeakState = (U32)bloodLeakState; + data.bloodLeakPersistentCounter = bloodLeakPersistenceCtr; + data.bloodLeakSerialCommState = bloodLeakEmbModeSubstate; + data.bloodLeakIntensity = getEmbModeInfoValue( I_EMB_MODE_CMD ); + data.bloodLeakDetect = getEmbModeInfoValue( V_EMB_MODE_CMD ); + data.bloodLeakIntensityMovingAvg = getF32OverrideValue( &bloodLeakZeroingStatus.intensityMovingAverage ); + data.bloodLeakTimeSinceZeroMS = calcTimeSince( bloodLeakZeroingStatus.lastZeroingStartTimeMS ); + data.bloodLeakTimeSinceUpperZeroMS = calcTimeSince( bloodLeakZeroingStatus.lastUpperZeroingStartTimeMS ); bloodLeakDataPublicationCounter = 0; @@ -1833,6 +1840,71 @@ return value; } +/*********************************************************************//** + * @brief + * The isLowerRangeIntensityDriftZeroingNeeded function checks whether blood + * leak zeroing is needed in terms of drift in range drift (35-40%). + * @details Inputs: bloodLeakZeroingStatus + * @details Outputs: bloodLeakZeroingStatus + * @return TRUE if blood leak zeroing is needed otherwise, FALSE + *************************************************************************/ +static BOOL isLowerRangeIntensityDriftZeroingNeeded( void ) +{ + BOOL status = FALSE; + BOOL isZeroingNeeded = TRUE; + U32 setPoint = bloodLeakEmbModeCmd[ D_EMB_MODE_CMD ].commandResp; + F32 driftMinFromTop = BLD_NOMINAL_INTENSITY - ( setPoint * BLD_MAX_INTENSITY_OUT_OF_RANGE ); + F32 driftMaxFromTop = BLD_NOMINAL_INTENSITY - ( setPoint * BLD_MIN_INTENSITY_OUT_OF_RANGE ); + U32 zeroingIntervalMS = getU32OverrideValue( &bloodLeakZeroingStatus.zeroingIntervalTimeMS ); + BOOL isZeroingAllowed = didTimeout( bloodLeakZeroingStatus.lastZeroingStartTimeMS, zeroingIntervalMS ); + F32 intensityMvgAvg = getF32OverrideValue( &bloodLeakZeroingStatus.intensityMovingAverage ); + + isZeroingNeeded &= ( intensityMvgAvg >= driftMinFromTop ? TRUE : FALSE ); + isZeroingNeeded &= ( intensityMvgAvg <= driftMaxFromTop ? TRUE : FALSE ); + + if ( FALSE == isZeroingNeeded ) + { + bloodLeakZeroingStatus.driftInRangeStartTimeMS = getMSTimerCount(); + } + + if ( ( TRUE == isZeroingAllowed ) && ( TRUE == didTimeout( bloodLeakZeroingStatus.driftInRangeStartTimeMS, BLD_ZERO_IN_RANGE_DRIFT_TIMEOUT_MS ) ) ) + { + SEND_EVENT_WITH_2_F32_DATA( HD_EVENT_BLOOD_LEAK_ZEROING_REQUIRED, driftMinFromTop, driftMaxFromTop ) + status = TRUE; + } + + return status; +} + +/*********************************************************************//** + * @brief + * The isUpperRangeIntensityZeroingNeeded function checks whether blood + * leak zeroing is needed in terms of drift upper range intensity (>= 950). + * @details Inputs: bloodLeakZeroingStatus + * @details Outputs: bloodLeakZeroingStatus + * @return TRUE if blood leak zeroing is needed otherwise, FALSE + *************************************************************************/ +static BOOL isUpperRangeIntensityZeroingNeeded( void ) +{ + BOOL status = FALSE; + BOOL isZeroingAllowed = didTimeout( bloodLeakZeroingStatus.lastUpperZeroingStartTimeMS, BLD_UPPER_INTENSITY_INTERVAL_MS ); + F32 intensityMvgAvg = getF32OverrideValue( &bloodLeakZeroingStatus.intensityMovingAverage ); + BOOL isUpperZeroingNeeded = ( intensityMvgAvg >= BLD_MAX_UPPER_INTENSITY_DRFIT ); + + if ( FALSE == isUpperZeroingNeeded ) + { + bloodLeakZeroingStatus.driftUpperRangeStartTimeMS = getMSTimerCount(); + } + + if ( ( TRUE == isZeroingAllowed ) && ( TRUE == didTimeout( bloodLeakZeroingStatus.driftUpperRangeStartTimeMS, BLD_ZERO_UPPER_RANGE_DRIFT_TIMEOUT_MS ) ) ) + { + SEND_EVENT_WITH_2_F32_DATA( HD_EVENT_BLOOD_LEAK_ZEROING_REQUIRED, intensityMvgAvg, 0.0 ) + status = TRUE; + } + + return status; +} + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ Index: firmware/App/Controllers/BloodLeak.h =================================================================== diff -u -rf487bb5f87d2e09a94f0a609552f1c93d1efb684 -rbac52336ea9e23fc2dfb4a802afe49401dfb7057 --- firmware/App/Controllers/BloodLeak.h (.../BloodLeak.h) (revision f487bb5f87d2e09a94f0a609552f1c93d1efb684) +++ firmware/App/Controllers/BloodLeak.h (.../BloodLeak.h) (revision bac52336ea9e23fc2dfb4a802afe49401dfb7057) @@ -51,6 +51,8 @@ U32 bloodLeakIntensity; ///< Blood leak detector intensity. U32 bloodLeakDetect; ///< Blood leak detector detect. F32 bloodLeakIntensityMovingAvg; ///< Blood leak detector intensity moving average. + U32 bloodLeakTimeSinceZeroMS; ///< Blood leak detector time since last zero in milliseconds. + U32 bloodLeakTimeSinceUpperZeroMS; ///< Blood leak detector time since last upper zero in milliseconds. } BLOOD_LEAK_DATA_T; // ********** public function prototypes ********** Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -r898f3f1ba7612909316ec33f59f74fed4e4f3652 -rbac52336ea9e23fc2dfb4a802afe49401dfb7057 --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 898f3f1ba7612909316ec33f59f74fed4e4f3652) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision bac52336ea9e23fc2dfb4a802afe49401dfb7057) @@ -52,8 +52,8 @@ #define MAX_ACTIVE_LOAD_CELL_CHANGE_G 50.0F ///< Maximum delta between new and previous measured UF volume. -// 3.07 + 12.28 has been received from the mechanical team and 5 mL of margine has been added for safety -#define DPI_TO_BLD_VOLUME_ML ( 3.07F + 12.28F + 5.0F ) ///< Dialysate inlet pump to blood detect sensor volume in milliliters. +// 3.07 + 12.28 has been received from the mechanical team and extra volume as margin has been added for safety +#define DPI_TO_BLD_VOLUME_ML ( 3.07F + 12.28F + 8.0F ) ///< Dialysate inlet pump to blood detect sensor volume in milliliters. /// Defined states for the Load Cell cycles. typedef enum Reservoir_Steady_Cycle @@ -182,7 +182,6 @@ resFinalRefVolume[ i ] = 0.0F; resCurrVolume[ i ] = 0.0F; resLastVolume[ i ] = 0.0F; - } resetSalineBolus(); @@ -525,6 +524,19 @@ /*********************************************************************//** * @brief + * The getBloodLeakZeroingState function gets the current blood leak zeroing + * state of the state machine. + * @details Inputs: bloodLeakZeroingStatus + * @details Outputs: none + * @return Current state of the blood leak zeroing state machine + *************************************************************************/ +BLOOD_LEAK_ZEROING_STATE_T getBloodLeakZeroingState( void ) +{ + return bloodLeakZeroingStatus.bloodLeakZeroingState; +} + +/*********************************************************************//** + * @brief * The getUltrafiltrationVolumeCollected function gets the current ultrafiltration * volume collected so far for current treatment. * @details Inputs: measUFVolume Index: firmware/App/Modes/Dialysis.h =================================================================== diff -u -r0580c86830b1dabab9c5b73eb45abeab870c1383 -rbac52336ea9e23fc2dfb4a802afe49401dfb7057 --- firmware/App/Modes/Dialysis.h (.../Dialysis.h) (revision 0580c86830b1dabab9c5b73eb45abeab870c1383) +++ firmware/App/Modes/Dialysis.h (.../Dialysis.h) (revision bac52336ea9e23fc2dfb4a802afe49401dfb7057) @@ -67,6 +67,7 @@ DIALYSIS_STATE_T getDialysisState( void ); UF_STATE_T getUltrafiltrationState( void ); SALINE_BOLUS_STATE_T getSalineBolusState( void ); +BLOOD_LEAK_ZEROING_STATE_T getBloodLeakZeroingState( void ); F32 getUltrafiltrationVolumeCollected( void ); F32 getUltrafiltrationReferenceVolume( void ); Index: firmware/App/Modes/ModePreTreat.c =================================================================== diff -u -re8edb83fcba5c355198efc30944d51c54814bdbe -rbac52336ea9e23fc2dfb4a802afe49401dfb7057 --- firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision e8edb83fcba5c355198efc30944d51c54814bdbe) +++ firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision bac52336ea9e23fc2dfb4a802afe49401dfb7057) @@ -1176,6 +1176,11 @@ { DG_RESERVOIR_ID_T activeRes = getDGActiveReservoir(); + if ( TRUE == isBloodLeakZeroingNeeded() ) + { + zeroBloodLeak(); + } + patientConnectionConfirm = FALSE; doorOpened = FALSE; setStartReservoirVolume( activeRes ); Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -rb71077660606609cc3b06911ad4aaa2ffaebd9f2 -rbac52336ea9e23fc2dfb4a802afe49401dfb7057 --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision b71077660606609cc3b06911ad4aaa2ffaebd9f2) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision bac52336ea9e23fc2dfb4a802afe49401dfb7057) @@ -1496,6 +1496,7 @@ payload.txEndState = getCurrentTreatmentEndState(); payload.heparinState = getHeparinState(); payload.dialysisState = getDialysisState(); + payload.bloodLeakZeroingState = (U32)getBloodLeakZeroingState(); broadcastData( MSG_ID_TREATMENT_STATE_DATA, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&payload, sizeof( TREATMENT_STATE_DATA_T ) ); treatmentStateBroadcastTimerCtr = 0; Index: firmware/App/Modes/ModeTreatment.h =================================================================== diff -u -rb71077660606609cc3b06911ad4aaa2ffaebd9f2 -rbac52336ea9e23fc2dfb4a802afe49401dfb7057 --- firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision b71077660606609cc3b06911ad4aaa2ffaebd9f2) +++ firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision bac52336ea9e23fc2dfb4a802afe49401dfb7057) @@ -54,6 +54,7 @@ U32 txEndState; ///< Treatment end state. U32 txStopState; ///< Treatment stop state. U32 dialysisState; ///< Dialysis state. + U32 bloodLeakZeroingState; ///< Blood leak zeroing state. } TREATMENT_STATE_DATA_T; /// Payload record structure for an ultrafiltration volume change confirmation message.