Index: firmware/App/Controllers/Bubble.c =================================================================== diff -u -rcdb087f7607a88b29c5ed4cdc9a76e3240fe42a3 -rf63f470a02e5584d107becc6d6ffcacaac88b19e --- firmware/App/Controllers/Bubble.c (.../Bubble.c) (revision cdb087f7607a88b29c5ed4cdc9a76e3240fe42a3) +++ firmware/App/Controllers/Bubble.c (.../Bubble.c) (revision f63f470a02e5584d107becc6d6ffcacaac88b19e) @@ -51,6 +51,7 @@ static U32 bubblesSelfTestStartTime[ NUM_OF_BUBBLES ]; ///< Air bubble detectors self-test start times. static BOOL bubblesSelfTestRequested[ NUM_OF_BUBBLES ]; ///< Air bubble detectors self-test requested flags. +static BOOL bubbleDetectionEnabled[ NUM_OF_BUBBLES ]; ///< Flag indicates whether air bubble alarm detection is enabled. /// Interval (in ms) at which to publish air bubble detectors data on CAN bus. static OVERRIDE_U32_T bubblesDataPublishInterval = { BUBBLE_PUB_INTERVAL, BUBBLE_PUB_INTERVAL, 0, 0 }; @@ -142,6 +143,20 @@ /*********************************************************************//** * @brief + * The setVenousBubbleDetectionEnabled function enabled or disables venous + * bubble detection. + * @details Inputs: none + * @details Outputs: bubbleDetectionEnabled[] + * @param enabled flag indicates whether venous bubble detection is enabled + * @return none + *************************************************************************/ +void setVenousBubbleDetectionEnabled( BOOL enabled ) +{ + bubbleDetectionEnabled[ ADV ] = enabled; +} + +/*********************************************************************//** + * @brief * The getBubbleStatus function gets the current reading for a given air bubble * detector. * @details Inputs: bubblesStatus @@ -201,35 +216,13 @@ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_BUBBLE_ALARMS ) != SW_CONFIG_ENABLE_VALUE ) #endif { - // Check status reading and act upon but the pump track switch must be closed - if ( ( BUBBLE_DETECTED == getBubbleStatus( bubble ) ) && ( STATE_CLOSED == getSwitchStatus( PUMP_TRACK_SWITCH ) ) ) + // Check for venous bubble alarm if enabled and pump track closed. + if ( ( BUBBLE_DETECTED == getBubbleStatus( bubble ) ) && + ( STATE_CLOSED == getSwitchStatus( PUMP_TRACK_SWITCH ) ) && + ( bubbleDetectionEnabled[ ADV ] != FALSE ) ) { - if ( getCurrentOperationMode() == MODE_TREA ) - { - switch ( treatmentState ) - { - case TREATMENT_BLOOD_PRIME_STATE: - case TREATMENT_DIALYSIS_STATE: - case TREATMENT_STOP_STATE: - case TREATMENT_END_STATE: - activateAlarmNoData( ALARM_ID_HD_VENOUS_BUBBLE_DETECTED ); - break; - - case TREATMENT_RINSEBACK_STATE: - activateAlarmNoData( ALARM_ID_HD_VENOUS_BUBBLE_DETECTED_RINSEBACK ); - break; - - default: - // Ignore other treatment states - break; - } - } + activateAlarmNoData( ALARM_ID_HD_VENOUS_BUBBLE_DETECTED ); } - else // Air bubble not detected - { - clearAlarmCondition( ALARM_ID_HD_VENOUS_BUBBLE_DETECTED ); - clearAlarmCondition( ALARM_ID_HD_VENOUS_BUBBLE_DETECTED_RINSEBACK ); - } } if ( TRUE == bubblesSelfTestRequested[ bubble ] )