Index: firmware/App/Drivers/BloodLeakDriver.c =================================================================== diff -u -r55b07134d116ff3068a6b5d5cae28bce7100adb3 -rd4ff0e628e0cd7866272a8a8a6f26db97286e3b4 --- firmware/App/Drivers/BloodLeakDriver.c (.../BloodLeakDriver.c) (revision 55b07134d116ff3068a6b5d5cae28bce7100adb3) +++ firmware/App/Drivers/BloodLeakDriver.c (.../BloodLeakDriver.c) (revision d4ff0e628e0cd7866272a8a8a6f26db97286e3b4) @@ -7,8 +7,8 @@ * * @file BloodLeakDriver.c * -* @author (last) Dara Navaei -* @date (last) 10-Sep-2024 +* @author (last) Jashwant Gantyada +* @date (last) 07-Jan-2026 * * @author (original) Dara Navaei * @date (original) 10-Sep-2024 @@ -32,7 +32,7 @@ #include "Utilities.h" /** - * @addtogroup BloodLeak + * @addtogroup BloodLeakDriver * @{ */ @@ -186,14 +186,17 @@ *************************************************************************/ void getBloodLeakEmbCmdMode( BLOOD_LEAK_EMB_MODE_CMD_T cmd, EMB_MODE_CMD_T* results ) { - if ((results == NULL) || (cmd >= NUM_OF_EMB_CMDS)) + if ( cmd < NUM_OF_EMB_CMDS ) { - //Throw an alarm - activateAlarmNoData( ALARM_ID_DD_SOFTWARE_FAULT ); - return; + memcpy( results, &bloodLeakEmbModeCmd[cmd], sizeof( EMB_MODE_CMD_T) ); } - memcpy( results, &bloodLeakEmbModeCmd[cmd], sizeof( EMB_MODE_CMD_T) ); + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_BLOOD_LEAK_INVALID_EMB_MODE_CMD_SELECTED, cmd ) + } + + } /*********************************************************************//** * @brief Index: firmware/App/Drivers/BloodLeakDriver.h =================================================================== diff -u -r55b07134d116ff3068a6b5d5cae28bce7100adb3 -rd4ff0e628e0cd7866272a8a8a6f26db97286e3b4 --- firmware/App/Drivers/BloodLeakDriver.h (.../BloodLeakDriver.h) (revision 55b07134d116ff3068a6b5d5cae28bce7100adb3) +++ firmware/App/Drivers/BloodLeakDriver.h (.../BloodLeakDriver.h) (revision d4ff0e628e0cd7866272a8a8a6f26db97286e3b4) @@ -5,10 +5,10 @@ * 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 BloodLeakDriver.c +* @file BloodLeakDriver.h * -* @author (last) Dara Navaei -* @date (last) 10-Sep-2024 +* @author (last) Jashwant Gantyada +* @date (last) 07-Jan-2026 * * @author (original) Dara Navaei * @date (original) 10-Sep-2024 Index: firmware/App/Monitors/BloodLeak.c =================================================================== diff -u -r55b07134d116ff3068a6b5d5cae28bce7100adb3 -rd4ff0e628e0cd7866272a8a8a6f26db97286e3b4 --- firmware/App/Monitors/BloodLeak.c (.../BloodLeak.c) (revision 55b07134d116ff3068a6b5d5cae28bce7100adb3) +++ firmware/App/Monitors/BloodLeak.c (.../BloodLeak.c) (revision d4ff0e628e0cd7866272a8a8a6f26db97286e3b4) @@ -1,19 +1,14 @@ /************************************************************************** * -<<<<<<< HEAD * Copyright (c) 2025-2026 Diality Inc. - All Rights Reserved. -======= -* Copyright (c) 2025-2025 Diality Inc. - All Rights Reserved. ->>>>>>> staging * * 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 BloodLeak.c * -* @author (last) Dara Navaei -<<<<<<< HEAD -* @date (last) 10-Sep-2024 +* @author (last) Jashwant Gantyada +* @date (last) 07-Jan-2026 * * @author (original) Dara Navaei * @date (original) 10-Sep-2024 @@ -128,7 +123,6 @@ U32 driftUpperRangeStatus; ///< Blood leak drift upper range status. } BLOOD_LEAK_ZEROING_STATUS_T; - // ********** private data ********** static BLOOD_LEAK_STATE_T bloodLeakState; ///< Current state of blood leak state machine. @@ -185,8 +179,6 @@ *************************************************************************/ void initBloodLeak( void ) { - // Initialize the embedded mode specifications - //initEmbModeSpecs(); initBloodLeakDriver(); bloodLeakDataPublicationCounter = DATA_PUBLISH_COUNTER_START_COUNT; @@ -346,10 +338,10 @@ *************************************************************************/ BOOL hasBloodLeakZeroSequenceFailed( void ) { + EMB_MODE_CMD_T cmdSpec; // The zero sequence contains Z->G->Z->Q->T and each of the commands has a request counter but for checking whether the // zero sequence has failed only the Z command is checked. When the zero sequence is enqueued, all of the them enqueued so they are // at the same request count number. - EMB_MODE_CMD_T cmdSpec; getBloodLeakEmbCmdMode(G_EMB_MODE_CMD, &cmdSpec); BOOL status = (cmdSpec.commandRqstCount > BLOOD_LEAK_EMB_MODE_MAX_NUM_CMD_TRIES ? TRUE : FALSE); @@ -477,10 +469,9 @@ static BLOOD_LEAK_STATE_T handleBloodLeakWaitForPostState( void ) { BLOOD_LEAK_STATE_T state = BLOOD_LEAK_WAIT_FOR_POST_STATE; - BOOL isEmbModeReady = FALSE; - //U32 cmdResp = bloodLeakEmbModeCmd[ CS_EMB_MODE_CMD ].commandResp; - EMB_MODE_CMD_T csCmdSpec; + + BOOL isEmbModeReady = FALSE; getBloodLeakEmbCmdMode( CS_EMB_MODE_CMD, &csCmdSpec ); U32 cmdResp = csCmdSpec.commandResp; @@ -527,10 +518,8 @@ static BLOOD_LEAK_STATE_T handleBloodLeakCheckSetPointState( void ) { BLOOD_LEAK_STATE_T state = BLOOD_LEAK_CHECK_SET_POINT_STATE; - //U16 bloodLeakSetPoint = bloodLeakEmbModeCmd[ D_EMB_MODE_CMD ].commandResp; - //BOOL isCommandRespReady = bloodLeakEmbModeCmd[ D_EMB_MODE_CMD ].isCmdRespRdy; - //U08 commandDRqstCount = bloodLeakEmbModeCmd[ D_EMB_MODE_CMD ].commandRqstCount; EMB_MODE_CMD_T dCmdSpec; + getBloodLeakEmbCmdMode(D_EMB_MODE_CMD, &dCmdSpec); BOOL isCommandRespReady = dCmdSpec.isCmdRespRdy; U08 commandDRqstCount = dCmdSpec.commandRqstCount; @@ -591,11 +580,12 @@ *************************************************************************/ static BLOOD_LEAK_STATE_T handleBloodLeakCheckZeroAndSelfTestState( void ) { - U08 i; BLOOD_LEAK_STATE_T state = BLOOD_LEAK_CHECK_ZERO_AND_SELF_TEST_STATE; - BOOL areCommandsReady = TRUE; EMB_MODE_CMD_T spec; + U08 i; + BOOL areCommandsReady = TRUE; + // Check to see if all commands in sequence have been responded to for ( i = 0; i < NUM_OF_EMB_CMDS; i++ ) { @@ -606,8 +596,6 @@ case Q_EMB_MODE_CMD: case T_EMB_MODE_CMD: // All the commands shall be processed and have data prior to checking the results - //areCommandsReady &= bloodLeakEmbModeCmd[ i ].isCmdRespRdy; - //break; getBloodLeakEmbCmdMode( (BLOOD_LEAK_EMB_MODE_CMD_T)i, &spec ); areCommandsReady &= spec.isCmdRespRdy; break; @@ -633,17 +621,13 @@ case Q_EMB_MODE_CMD: case T_EMB_MODE_CMD: // Check to see if any of the command responses failed - //hasCurrCmdFailed = ( BLOOD_LEAK_EMB_MODE_PASS_ASCII == bloodLeakEmbModeCmd[ i ].commandResp ? FALSE : TRUE ); - //hasCmdSqncFailed |= hasCurrCmdFailed; getBloodLeakEmbCmdMode( (BLOOD_LEAK_EMB_MODE_CMD_T)i, &spec ); hasCurrCmdFailed = ( BLOOD_LEAK_EMB_MODE_PASS_ASCII == spec.commandResp ? FALSE : TRUE ); hasCmdSqncFailed |= hasCurrCmdFailed; break; case G_EMB_MODE_CMD: // G command will return a value that has to be greater than 0 - //hasCurrCmdFailed = ( bloodLeakEmbModeCmd[ i ].commandResp > 0 ? FALSE : TRUE ); - //hasCmdSqncFailed |= hasCurrCmdFailed; getBloodLeakEmbCmdMode( (BLOOD_LEAK_EMB_MODE_CMD_T)i, &spec ); hasCurrCmdFailed = ( spec.commandResp > 0 ? FALSE : TRUE ); hasCmdSqncFailed |= hasCurrCmdFailed; @@ -685,8 +669,8 @@ static BLOOD_LEAK_STATE_T handleBloodLeakVerifyIntensityAfterZeroingState( void ) { BLOOD_LEAK_STATE_T state = BLOOD_LEAK_VERIFY_INTENSITY_AFTER_ZEROING_STATE; - EMB_MODE_CMD_T iCmdSpec; + getBloodLeakEmbCmdMode( I_EMB_MODE_CMD, &iCmdSpec ); if ( TRUE == iCmdSpec.isCmdRespRdy ) { @@ -844,7 +828,6 @@ return state; } - /*********************************************************************//** * @brief * The publishBloodLeakData function publishes blood leak data at the set interval. @@ -878,7 +861,6 @@ } } - /*********************************************************************//** * @brief * The getFPGABloodDetectProcessedStatus function returns the status of the @@ -924,6 +906,7 @@ static void processBloodLeakIntensityData( void ) { EMB_MODE_CMD_T iCmdSpec; + getBloodLeakEmbCmdMode( I_EMB_MODE_CMD, &iCmdSpec ); if ( ( TRUE == iCmdSpec.isCmdRespRdy ) && ( bloodLeakState != BLOOD_LEAK_VERIFY_INTENSITY_AFTER_ZEROING_STATE ) ) @@ -940,6 +923,7 @@ resetEmbModeCmdRespConsumedFlag( I_EMB_MODE_CMD ); } } + /*********************************************************************//** * @brief * The isLowerRangeIntensityDriftZeroingNeeded function checks whether blood @@ -950,6 +934,7 @@ *************************************************************************/ static BOOL isLowerRangeIntensityDriftZeroingNeeded( void ) { + EMB_MODE_CMD_T cmdSpec; /* * Nominal intensity = 930 * Set point is queried from the blood leak detector @@ -960,8 +945,6 @@ */ BOOL status = FALSE; BOOL isZeroingNeeded = TRUE; - //U32 setPoint = bloodLeakEmbModeCmd[ D_EMB_MODE_CMD ].commandResp; - EMB_MODE_CMD_T cmdSpec; getBloodLeakEmbCmdMode(D_EMB_MODE_CMD, &cmdSpec); U32 setPoint = cmdSpec.commandResp; F32 driftMinFromTop = BLD_NOMINAL_INTENSITY - ( setPoint * BLD_MAX_INTENSITY_OUT_OF_RANGE ); @@ -1052,6 +1035,7 @@ * TEST SUPPORT FUNCTIONS *************************************************************************/ + /*********************************************************************//** * @brief * The testBloodLeakDataPublishIntervalOverride function overrides the Index: firmware/App/Monitors/BloodLeak.h =================================================================== diff -u -rdabc7e65f46140329a5d8b75343e5adbcb225436 -rd4ff0e628e0cd7866272a8a8a6f26db97286e3b4 --- firmware/App/Monitors/BloodLeak.h (.../BloodLeak.h) (revision dabc7e65f46140329a5d8b75343e5adbcb225436) +++ firmware/App/Monitors/BloodLeak.h (.../BloodLeak.h) (revision d4ff0e628e0cd7866272a8a8a6f26db97286e3b4) @@ -1,19 +1,14 @@ /************************************************************************** * -<<<<<<< HEAD * Copyright (c) 2025-2026 Diality Inc. - All Rights Reserved. -======= -* Copyright (c) 2025-2025 Diality Inc. - All Rights Reserved. ->>>>>>> staging * * 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 BloodLeak.h * -<<<<<<< HEAD -* @author (last) Dara Navaei -* @date (last) 10-Sep-2024 +* @author (last) Jashwant Gantyada +* @date (last) 07-Jan-2026 * * @author (original) Dara Navaei * @date (original) 10-Sep-2024 Index: firmware/App/Services/Messaging.c =================================================================== diff -u -rdabc7e65f46140329a5d8b75343e5adbcb225436 -rd4ff0e628e0cd7866272a8a8a6f26db97286e3b4 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision dabc7e65f46140329a5d8b75343e5adbcb225436) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision d4ff0e628e0cd7866272a8a8a6f26db97286e3b4) @@ -20,7 +20,6 @@ #include "reg_system.h" #include "BalancingChamber.h" #include "BloodLeak.h" -#include "BloodLeakDriver.h" #include "BoostPump.h" #include "Conductivity.h" #include "Compatible.h"