Index: firmware/App/Controllers/Bubble.c =================================================================== diff -u -r58f8416a9ff9c68ee34361ac23a46dcf56cfa79e -r74be223d47ea7bb0ac7d814e74d3627d830a5fac --- firmware/App/Controllers/Bubble.c (.../Bubble.c) (revision 58f8416a9ff9c68ee34361ac23a46dcf56cfa79e) +++ firmware/App/Controllers/Bubble.c (.../Bubble.c) (revision 74be223d47ea7bb0ac7d814e74d3627d830a5fac) @@ -5,13 +5,13 @@ * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * -* @file Bubble.c +* @file Bubble.c * -* @author (last) Peman Montazemi -* @date (last) 30-Apr-2021 +* @author (last) Sean Nash +* @date (last) 13-Aug-2021 * -* @author (original) Peman Montazemi -* @date (original) 30-Apr-2021 +* @author (original) Peman Montazemi +* @date (original) 06-May-2021 * ***************************************************************************/ @@ -60,7 +60,6 @@ static BUBBLE_STATES_T handleBubbleSelfTestState( BUBBLES_T ); static void publishBubblesData( void ); -static U32 getPublishBubblesDataInterval( void ); /*********************************************************************//** * @brief @@ -304,7 +303,7 @@ { activateAlarmNoData( ALARM_ID_HD_ARTERIAL_BUBBLE_SELF_TEST_FAILURE ); } - else if ( bubble == ADV ) + else // ADV { activateAlarmNoData( ALARM_ID_HD_VENOUS_BUBBLE_SELF_TEST_FAILURE ); } @@ -329,26 +328,6 @@ /*********************************************************************//** * @brief - * The getPublishBubblesDataInterval function gets the air bubbles data - * publication interval. - * @details Inputs: bubblesDataPublishInterval - * @details Outputs: none - * @return the current air bubbles data publication interval (in task intervals). - *************************************************************************/ -static U32 getPublishBubblesDataInterval( void ) -{ - U32 result = bubblesDataPublishInterval.data; - - if ( OVERRIDE_KEY == bubblesDataPublishInterval.override ) - { - result = bubblesDataPublishInterval.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief * The publishBubblesData function publishes air bubble detectors data at * the set interval. * @details Inputs: status, bubblesState @@ -358,12 +337,15 @@ static void publishBubblesData( void ) { // Publish air bubble detectors data on interval - if ( ++bubblesDataPublicationTimerCounter >= getPublishBubblesDataInterval() ) + if ( ++bubblesDataPublicationTimerCounter >= getU32OverrideValue( &bubblesDataPublishInterval ) ) { - BUBBLE_STATUS_T statusADA = getBubbleStatus( ADA ); - BUBBLE_STATUS_T statusADV = getBubbleStatus( ADV ); + BUBBLES_DATA_T bubbleData; - broadcastBubblesData( (U32)statusADA, (U32)bubblesState[ ADA ], (U32)statusADV, (U32)bubblesState[ ADV ] ); + bubbleData.statusADA = (U32)getBubbleStatus( ADA ); + bubbleData.stateADA = (U32)bubblesState[ ADA ]; + bubbleData.statusADV = (U32)getBubbleStatus( ADV ); + bubbleData.stateADV = (U32)bubblesState[ ADV ]; + broadcastData( MSG_ID_HD_BUBBLES_DATA, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&bubbleData, sizeof( BUBBLES_DATA_T ) ); bubblesDataPublicationTimerCounter = 0; } }