Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -r9c7ade2642aff120bb84c8fe51fc7b18759dc6c8 -rf10e393f3d4c017d7e6f252b6ee203042ea5ee67 --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 9c7ade2642aff120bb84c8fe51fc7b18759dc6c8) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision f10e393f3d4c017d7e6f252b6ee203042ea5ee67) @@ -102,7 +102,7 @@ #define OCCLUSION_THRESHOLD_OFFSET 5500 ///< Threshold offset. Combined with initial reading after cartridge install, a threshold is derived above which an occlusion is detected. #define OCCLUSION_CLEAR_THRESHOLD_OFFSET 5000 ///< Threshold offset. Combined with initial reading after cartridge install, a threshold is derived below which an occlusion is cleared. -#define PARTIAL_OCCLUSION_THRESHOLD_OFFSET 1100 ///< Threshold offset. Combined with during treatment occlusion reading, a threshold is derived above which a partial occlusion is detected. +#define PARTIAL_OCCLUSION_THRESHOLD_OFFSET 1000 ///< Threshold offset. Combined with during treatment occlusion reading, a threshold is derived above which a partial occlusion is detected. #define CARTRIDGE_LOADED_THRESHOLD 5000 ///< Threshold above which a cartridge is considered loaded. #define MIN_OCCLUSION_COUNTS 2000 ///< Minimum occlusion sensor reading for range check. @@ -130,6 +130,8 @@ /// Measured blood pump occlusion is filtered w/ 10 second moving average for partial occlusions check. #define SIZE_OF_BLOODPUMP_OCCL_ROLLING_AVG ( ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) * 10 ) +/// Interval (15 minutes in task time) at which the partial blood pump occlusion baseline update happens during dialysis state. +#define PERIODIC_PARTIAL_BLOODPUMP_OCCL_BASELINE_UPDATE ( ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) * SEC_PER_MIN * 15 ) #define DATA_PUBLISH_COUNTER_START_COUNT 5 ///< Data publish counter start count. #define SHIFT_14_BITS 14 ///< Shift 14 bits. @@ -183,21 +185,21 @@ static OVERRIDE_F32_T shortFilteredArterialPressure = { 0.0, 0.0, 0.0, 0 }; ///< Measured arterial pressure after short (1 s) filter. static F32 longFilteredVenousPressure; ///< Measured venous pressure after long (10 s) filter. static OVERRIDE_F32_T shortFilteredVenousPressure = { 0.0, 0.0, 0.0, 0 }; ///< Measured venous pressure after short (1 s) filter. -static OVERRIDE_U32_T filteredBloodPumpOccl = { 0, 0, 0, 0 }; ///< Measured blood pump occlusion after 30s filter. +static OVERRIDE_F32_T filteredBloodPumpOccl = { 0.0, 0.0, 0.0, 0 }; ///< Measured blood pump occlusion after 10s filter. static STABILIZATION_PERIODS_T pressureStabilizeTime; ///< Pressure stabilization time based on system events such as airpump, treatment param changes etc., static BOOL resetFillExemptPeriod; ///< Flag to reset the exempt period after defined time expire. static BOOL lowVenousPressureExemptCheck; ///< low venous pressure exempt check flag based on the air trap valve status static U32 bloodPumpOcclusionAfterCartridgeInstall; ///< Measured blood pump occlusion reading taken after cartridge install. -static U32 bloodPumpOcclusionDuringTreatement; ///< Measured filtered blood pump occlusion reading taken during treatment. +static OVERRIDE_F32_T bloodPumpPartialOcclusionBaseline = { 0.0, 0.0, 0.0, 0 }; ///< Measured filtered blood pump occlusion baseline taken during treatment. static BOOL partialBloodPumpOcclBaselineUpdate; ///< Flag to update partial occlusion baseline in events such as start of treatment,resume from partial BP occlusion alarm occurrence. -static BOOL isPartialBloodPumpOcclBaselineSet; ///< Flag to raise alarm only when partial blood pump occlusion baseline set at start of treatment dialysis. +static U32 partialBloodPumpOcclBaselineUpdateTimerCounter = 0; ///< Used to update partial occlusion base line periodically during dialysis. static U32 emptySalineBagCtr = 0; ///< Timer counter for empty bag detection. -static U32 bloodPumpOcclReadings[ SIZE_OF_BLOODPUMP_OCCL_ROLLING_AVG ]; ///< Holds blood pump occlusion rolling average. +static F32 bloodPumpOcclReadings[ SIZE_OF_BLOODPUMP_OCCL_ROLLING_AVG ]; ///< Holds blood pump occlusion rolling average. static U32 bloodPumpOcclReadingsIdx = 0; ///< Index for next sample in rolling average array. -static U32 bloodPumpOcclReadingsTotal = 0; ///< Rolling total - used to calc average. +static F32 bloodPumpOcclReadingsTotal = 0.0; ///< Rolling total - used to calc average. static U32 bloodPumpOcclReadingsCount = 0; ///< Number of samples in blood pump occl rolling average buffer. static F32 artPressureReadingsLong[ SIZE_OF_LONG_ART_ROLLING_AVG ]; ///< Holds flow samples for long arterial pressure rolling average. @@ -238,7 +240,7 @@ static void determineArtVenPressureLimits( void ); static void filterInlinePressureReadings( F32 artPres, F32 venPres ); static void setOcclusionBaselineDuringTreatement( void ); -static void filterBloodPumpOcclReadings( U32 bloodPumpOccl ); +static void filterBloodPumpOcclReadings( F32 bloodPumpOccl ); /*********************************************************************//** * @brief @@ -281,14 +283,14 @@ shortFilteredArterialPressure.data = 0.0F; longFilteredVenousPressure = 0.0F; shortFilteredVenousPressure.data = 0.0F; - filteredBloodPumpOccl.data = 0; + filteredBloodPumpOccl.data = 0.0F; + bloodPumpPartialOcclusionBaseline.data = 0.0F; + partialBloodPumpOcclBaselineUpdateTimerCounter = 0; presOcclDataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; presOcclState = PRESSURE_WAIT_FOR_POST_STATE; presOcclPostState = PRESSURE_SELF_TEST_STATE_START; bloodPumpOcclusionAfterCartridgeInstall = 0; - bloodPumpOcclusionDuringTreatement = 0; partialBloodPumpOcclBaselineUpdate = FALSE; - isPartialBloodPumpOcclBaselineSet = FALSE; pressureStabilizeTime = USE_NORMAL_STABILIZATION_PERIOD; resetFillExemptPeriod = TRUE; lowVenousPressureExemptCheck = TRUE; @@ -417,13 +419,13 @@ * during treatment. This function called at start of treatment, periodic interval during * treatment. * @details Inputs: filteredBloodPumpOccl - * @details Outputs: bloodPumpOcclusionDuringTreatement + * @details Outputs: bloodPumpPartialOcclusionBaseline * @return none *************************************************************************/ static void setOcclusionBaselineDuringTreatement( void ) { - bloodPumpOcclusionDuringTreatement = getFilteredBloodPumpOccl(); - SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_PARTIAL_OCCLUSION_BASELINE, bloodPumpOcclusionDuringTreatement, PARTIAL_OCCLUSION_THRESHOLD_OFFSET ); + bloodPumpPartialOcclusionBaseline.data = getFilteredBloodPumpOccl(); + SEND_EVENT_WITH_2_F32_DATA( HD_EVENT_PARTIAL_OCCLUSION_BASELINE, getBloodPumpPartialOcclBaseline(), PARTIAL_OCCLUSION_THRESHOLD_OFFSET ); } /*********************************************************************//** @@ -560,12 +562,12 @@ /*********************************************************************//** * @brief - * The signalBloodPumpPressureOcclbaseline function sets the flag. + * The signalBloodPumpPressureOcclBaseline function sets the flag. * @details Inputs: partialBloodPumpOcclBaselineUpdate * @details Outputs: partialBloodPumpOcclBaselineUpdate * @return none *************************************************************************/ -void signalBloodPumpPressureOcclbaseline( void ) +void signalBloodPumpPressureOcclBaseline( void ) { partialBloodPumpOcclBaselineUpdate = TRUE; } @@ -673,6 +675,12 @@ currPresLimitsState = PRESSURE_LIMITS_STATE_OFF; } + // Increment the partial occlusion baseline update counter only in Dialysis state + if ( ( MODE_TREA == currMode ) && ( currTxState == TREATMENT_DIALYSIS_STATE ) ) + { + partialBloodPumpOcclBaselineUpdateTimerCounter++; + } + switch ( currPresLimitsState ) { case PRESSURE_LIMITS_STATE_OFF: @@ -738,7 +746,6 @@ { partialBloodPumpOcclBaselineUpdate = FALSE; setOcclusionBaselineDuringTreatement(); - isPartialBloodPumpOcclBaselineSet = TRUE; } } break; @@ -772,6 +779,13 @@ // Reset to normal period as default. pressureStabilizeTime = USE_NORMAL_STABILIZATION_PERIOD; } + else if ( ( currTxState == TREATMENT_DIALYSIS_STATE ) && + ( partialBloodPumpOcclBaselineUpdateTimerCounter >= PERIODIC_PARTIAL_BLOODPUMP_OCCL_BASELINE_UPDATE ) ) + { + //Periodical Update of partial blood pump occlusion baseline + setOcclusionBaselineDuringTreatement(); + partialBloodPumpOcclBaselineUpdateTimerCounter = 0; + } break; case PRESSURE_LIMITS_STATE_STABLE: @@ -789,9 +803,13 @@ stabilizationStartTimeMs = getMSTimerCount(); pressureStabilizeTime = STABILIZATION_PERIOD_OFF; currPresLimitsState = PRESSURE_LIMITS_STATE_STABILIZATION_2; - + } + else if ( ( currTxState == TREATMENT_DIALYSIS_STATE ) && + ( partialBloodPumpOcclBaselineUpdateTimerCounter >= PERIODIC_PARTIAL_BLOODPUMP_OCCL_BASELINE_UPDATE ) ) + { //Periodical Update of partial blood pump occlusion baseline setOcclusionBaselineDuringTreatement(); + partialBloodPumpOcclBaselineUpdateTimerCounter = 0; } break; @@ -871,7 +889,7 @@ bloodPumpOcclusion.data = (U32)getFPGABloodPumpOcclusion(); // Filter blood pump occlusion readings - filterBloodPumpOcclReadings( getMeasuredBloodPumpOcclusion() ); + filterBloodPumpOcclReadings( (F32)getMeasuredBloodPumpOcclusion() ); } /*********************************************************************//** @@ -1025,7 +1043,7 @@ static void checkOcclusions( void ) { U32 bpOccl = getMeasuredBloodPumpOcclusion(); - U32 filteredBpOccl = getFilteredBloodPumpOccl(); + F32 filteredBpOccl = getFilteredBloodPumpOccl(); BOOL outOfRange = ( bpOccl < MIN_OCCLUSION_COUNTS ? TRUE : FALSE ); #ifndef _RELEASE_ @@ -1044,6 +1062,7 @@ U32 hdSubMode = getCurrentSubMode(); BOOL ptxMode = ( MODE_PRET == hdMode && hdSubMode > HD_PRE_TREATMENT_CART_INSTALL_STATE ? TRUE : FALSE ); BOOL txModeRecirc = ( ( MODE_TREA == hdMode ) && ( TREATMENT_RECIRC_STATE == getTreatmentState() ) ? TRUE : FALSE ); + BOOL txModeDialysis = ( ( MODE_TREA == hdMode ) && ( TREATMENT_DIALYSIS_STATE == getTreatmentState() ) ? TRUE : FALSE ); // Range check occlusion sensor (OB) if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_BP_OCCLUSION_OUT_OF_RANGE, outOfRange ) ) @@ -1087,19 +1106,18 @@ clearAlarmCondition( ALARM_ID_HD_OCCLUSION_BLOOD_PUMP ); } - // Partial Occlusion check during treatment - if ( MODE_TREA == hdMode ) + // Partial Occlusion check during treatment dialysis state and pressure stable or stabilization_2 state + if ( ( TRUE == txModeDialysis ) && + ( ( PRESSURE_LIMITS_STATE_STABLE == currPresLimitsState ) || + ( PRESSURE_LIMITS_STATE_STABILIZATION_2 == currPresLimitsState ) ) ) { - if ( ( TRUE == isBloodPumpRunning() ) && ( TRUE == isPartialBloodPumpOcclBaselineSet ) ) + // Check for partial occlusion + if ( filteredBpOccl > ( PARTIAL_OCCLUSION_THRESHOLD_OFFSET + getBloodPumpPartialOcclBaseline() ) ) { - // Check for partial occlusion - if ( filteredBpOccl > ( PARTIAL_OCCLUSION_THRESHOLD_OFFSET + bloodPumpOcclusionDuringTreatement ) ) - { - signalBloodPumpHardStop(); // Stop pump immediately - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_PARTIAL_OCCLUSION_BLOOD_PUMP, filteredBpOccl, PARTIAL_OCCLUSION_THRESHOLD_OFFSET + bloodPumpOcclusionDuringTreatement ) - // Update partial occlusion baseline - signalBloodPumpPressureOcclbaseline(); - } + signalBloodPumpHardStop(); // Stop pump immediately + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_PARTIAL_OCCLUSION_BLOOD_PUMP, filteredBpOccl, PARTIAL_OCCLUSION_THRESHOLD_OFFSET + getBloodPumpPartialOcclBaseline() ) + // Update partial occlusion baseline + signalBloodPumpPressureOcclBaseline(); } } @@ -1213,13 +1231,25 @@ * @details Outputs: none * @return the current filtered blood pump occlusion. *************************************************************************/ -U32 getFilteredBloodPumpOccl( void ) +F32 getFilteredBloodPumpOccl( void ) { - return getU32OverrideValue( &filteredBloodPumpOccl ); + return getF32OverrideValue( &filteredBloodPumpOccl ); } /*********************************************************************//** * @brief + * The getBloodPumpPartialOcclBaseline function gets the blood pump partial occlusion baseline. + * @details Inputs: bloodPumpPartialOcclusionBaseline + * @details Outputs: none + * @return the blood pump occlusion base line. + *************************************************************************/ +F32 getBloodPumpPartialOcclBaseline( void ) +{ + return getF32OverrideValue( &bloodPumpPartialOcclusionBaseline ); +} + +/*********************************************************************//** + * @brief * The getFilteredVenousPressure function gets the measured filtered venous pressure. * @details Inputs: shortFilteredVenousPressure * @details Outputs: none @@ -1333,7 +1363,7 @@ * @param bloodPumpOccl newest blood pump occlusion sample to add to filters * @return none *************************************************************************/ -static void filterBloodPumpOcclReadings( U32 bloodPumpOccl ) +static void filterBloodPumpOcclReadings( F32 bloodPumpOccl ) { if ( bloodPumpOcclReadingsCount >= SIZE_OF_BLOODPUMP_OCCL_ROLLING_AVG ) { @@ -1343,7 +1373,7 @@ bloodPumpOcclReadingsTotal += bloodPumpOccl; bloodPumpOcclReadingsIdx = INC_WRAP( bloodPumpOcclReadingsIdx, 0, SIZE_OF_BLOODPUMP_OCCL_ROLLING_AVG - 1 ); bloodPumpOcclReadingsCount = INC_CAP( bloodPumpOcclReadingsCount, SIZE_OF_BLOODPUMP_OCCL_ROLLING_AVG ); - filteredBloodPumpOccl.data = bloodPumpOcclReadingsTotal / bloodPumpOcclReadingsCount; + filteredBloodPumpOccl.data = bloodPumpOcclReadingsTotal / (F32)bloodPumpOcclReadingsCount; } /*********************************************************************//** @@ -1371,8 +1401,8 @@ data.venMaxLimit = currentVenousMaxLimit; data.arterialLongFilterPres = longFilteredArterialPressure; data.venousLongFilterPres = longFilteredVenousPressure; - data.filteredbldPumpOcclusion = getFilteredBloodPumpOccl(); - data.partialOcclBaseline = PARTIAL_OCCLUSION_THRESHOLD_OFFSET + bloodPumpOcclusionDuringTreatement; + data.bldPumpOcclusionLongFilter = getFilteredBloodPumpOccl(); + data.partialOcclBaseline = (F32)PARTIAL_OCCLUSION_THRESHOLD_OFFSET + getBloodPumpPartialOcclBaseline(); broadcastData( MSG_ID_PRESSURE_OCCLUSION_DATA, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&data, sizeof( PRESSURE_OCCLUSION_DATA_T ) ); presOcclDataPublicationTimerCounter = 0; @@ -1704,7 +1734,7 @@ * @param value override measured filtered blood pump occlusion pressure with * @return TRUE if override successful, FALSE if not *************************************************************************/ -BOOL testSetFilteredBloodPumpOcclusionOverride( U32 value ) +BOOL testSetFilteredBloodPumpOcclusionOverride( F32 value ) { BOOL result = FALSE; @@ -1740,4 +1770,49 @@ return result; } +/*********************************************************************//** + * @brief + * The testSetBloodPumpPartialOcclusionOverride function overrides the + * blood pump partial occlusion pressure baseline. + * @details Inputs: none + * @details Outputs: bloodPumpPartialOcclusionBaseline + * @param value override blood pump occlusion baseline + * @return TRUE if override successful, FALSE if not + *************************************************************************/ +BOOL testSetBloodPumpPartialOcclusionBaselineOverride( F32 value ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + bloodPumpPartialOcclusionBaseline.ovData = value; + bloodPumpPartialOcclusionBaseline.override = OVERRIDE_KEY; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testResetBloodPumpPartialOcclusionBaselineOverride function resets the override of the + * blood pump partial occlusion baseline. + * @details Inputs: none + * @details Outputs: bloodPumpPartialOcclusionBaseline + * @return TRUE if reset successful, FALSE if not + *************************************************************************/ +BOOL testResetBloodPumpPartialOcclusionBaselineOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + bloodPumpPartialOcclusionBaseline.override = OVERRIDE_RESET; + bloodPumpPartialOcclusionBaseline.ovData = bloodPumpPartialOcclusionBaseline.ovInitData; + } + + return result; +} + /**@}*/ Index: firmware/App/Controllers/PresOccl.h =================================================================== diff -u -r14be978c00cef299cf67b515117b689de6cef353 -rf10e393f3d4c017d7e6f252b6ee203042ea5ee67 --- firmware/App/Controllers/PresOccl.h (.../PresOccl.h) (revision 14be978c00cef299cf67b515117b689de6cef353) +++ firmware/App/Controllers/PresOccl.h (.../PresOccl.h) (revision f10e393f3d4c017d7e6f252b6ee203042ea5ee67) @@ -74,8 +74,8 @@ S32 venMaxLimit; ///< Current venous maximum pressure limit (mmHg) F32 arterialLongFilterPres; ///< Latest long filtered arterial pressure (mmHg) F32 venousLongFilterPres; ///< Latest long filtered venous pressure (mmHg) - U32 filteredbldPumpOcclusion; ///< Latest filtered BP occlusion (no units) - U32 partialOcclBaseline; ///< PartialBloodPump Occlusion baseline (no units) + F32 bldPumpOcclusionLongFilter; ///< Latest long filtered BP occlusion (no units) + F32 partialOcclBaseline; ///< PartialBloodPump Occlusion baseline (no units) } PRESSURE_OCCLUSION_DATA_T; // ********** public function prototypes ********** @@ -101,9 +101,9 @@ F32 getFilteredVenousPressure( void ); F32 getLongFilteredVenousPressure( void ); U32 getMeasuredBloodPumpOcclusion( void ); -U32 getFilteredBloodPumpOccl( void ); -void signalBloodPumpPressureOcclbaseline( void ); - +F32 getFilteredBloodPumpOccl( void ); +void signalBloodPumpPressureOcclBaseline( void ); +F32 getBloodPumpPartialOcclBaseline( void ); BOOL isCartridgeLoaded( void ); BOOL isCartridgeUnloaded( void ); BOOL isSalineBagEmpty( void ); @@ -120,8 +120,10 @@ BOOL testResetVenousPressureOverride( BOOL filtered ); BOOL testSetBloodPumpOcclusionOverride( U32 value ); BOOL testResetBloodPumpOcclusionOverride( void ); -BOOL testSetFilteredBloodPumpOcclusionOverride( U32 value ); +BOOL testSetFilteredBloodPumpOcclusionOverride( F32 value ); BOOL testResetFilteredBloodPumpOcclusionOverride( void ); +BOOL testSetBloodPumpPartialOcclusionBaselineOverride( F32 value ); +BOOL testResetBloodPumpPartialOcclusionBaselineOverride( void ); /**@}*/ Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -r14be978c00cef299cf67b515117b689de6cef353 -rf10e393f3d4c017d7e6f252b6ee203042ea5ee67 --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 14be978c00cef299cf67b515117b689de6cef353) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision f10e393f3d4c017d7e6f252b6ee203042ea5ee67) @@ -754,7 +754,7 @@ } transitionToDialysis(); // To update partial blood pump occlusion baseline - start of treatment - signalBloodPumpPressureOcclbaseline(); + signalBloodPumpPressureOcclBaseline(); result = TREATMENT_DIALYSIS_STATE; } } Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r32686e74ff7c694bc219dfe7138328098d6159ee -rf10e393f3d4c017d7e6f252b6ee203042ea5ee67 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 32686e74ff7c694bc219dfe7138328098d6159ee) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision f10e393f3d4c017d7e6f252b6ee203042ea5ee67) @@ -1326,6 +1326,10 @@ case MSG_ID_HD_PARTIAL_OCCLUSION_BLOOD_PUMP_OVERRIDE: handleTestFilteredBloodPumpOcclusionOverrideRequest( message ); + break; + + case MSG_ID_HD_PARTIAL_OCCL_BLOOD_PUMP_BASELINE_OVERRIDE: + handleTestBloodPumpOcclusionBaselineOverrideRequest( message ); break; case MSG_ID_PRES_OCCL_SEND_INTERVAL_OVERRIDE: Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r32686e74ff7c694bc219dfe7138328098d6159ee -rf10e393f3d4c017d7e6f252b6ee203042ea5ee67 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 32686e74ff7c694bc219dfe7138328098d6159ee) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision f10e393f3d4c017d7e6f252b6ee203042ea5ee67) @@ -4598,7 +4598,7 @@ memcpy( &payload, message->payload, sizeof(TEST_OVERRIDE_PAYLOAD_T) ); if ( FALSE == payload.reset ) { - result = testSetFilteredBloodPumpOcclusionOverride( payload.state.u32 ); + result = testSetFilteredBloodPumpOcclusionOverride( payload.state.f32 ); } else { @@ -4612,6 +4612,38 @@ /*********************************************************************//** * @brief + * The handleTestBloodPumpOcclusionBaselineOverrideRequest function handles a request to + * override the blood pump occlusion baseline value. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestBloodPumpOcclusionBaselineOverrideRequest( MESSAGE_T *message ) +{ + TEST_OVERRIDE_PAYLOAD_T payload; + BOOL result = FALSE; + + // Verify payload length + if ( sizeof(TEST_OVERRIDE_PAYLOAD_T) == message->hdr.payloadLen ) + { + memcpy( &payload, message->payload, sizeof(TEST_OVERRIDE_PAYLOAD_T) ); + if ( FALSE == payload.reset ) + { + result = testSetBloodPumpPartialOcclusionBaselineOverride( payload.state.f32 ); + } + else + { + result = testResetBloodPumpPartialOcclusionBaselineOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief * The handleTestPresOcclBroadcastIntervalOverrideRequest function handles a request to * override the broadcast interval for pressure/occlusion data. * @details Inputs: none Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r32686e74ff7c694bc219dfe7138328098d6159ee -rf10e393f3d4c017d7e6f252b6ee203042ea5ee67 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 32686e74ff7c694bc219dfe7138328098d6159ee) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision f10e393f3d4c017d7e6f252b6ee203042ea5ee67) @@ -647,7 +647,10 @@ void handleTestBloodPumpOcclusionOverrideRequest( MESSAGE_T *message ); //MSG_ID_HD_PARTIAL_OCCLUSION_BLOOD_PUMP_OVERRIDE -void handleTestFilteredBloodPumpOcclusionOverrideRequest( MESSAGE_T *message ); +void handleTestFilteredBloodPumpOcclusionOverrideRequest( MESSAGE_T *message ); + +//MSG_ID_HD_PARTIAL_OCCL_BLOOD_PUMP_BASELINE_OVERRIDE +void handleTestBloodPumpOcclusionBaselineOverrideRequest( MESSAGE_T *message ); // MSG_ID_PRES_OCCL_SEND_INTERVAL_OVERRIDE void handleTestPresOcclBroadcastIntervalOverrideRequest( MESSAGE_T *message );