Index: firmware/App/Drivers/BloodLeakDriver.c =================================================================== diff -u -r86ea3cba20edaebf20fe2f9b82c7c73048c36f6c -r32e2bfb5cc2e778a6ccb7e93a118644a4f34068a --- firmware/App/Drivers/BloodLeakDriver.c (.../BloodLeakDriver.c) (revision 86ea3cba20edaebf20fe2f9b82c7c73048c36f6c) +++ firmware/App/Drivers/BloodLeakDriver.c (.../BloodLeakDriver.c) (revision 32e2bfb5cc2e778a6ccb7e93a118644a4f34068a) @@ -38,83 +38,81 @@ // ********** private definitions ********** -#define BLOOD_LEAK_RESET_TX_FIFO 2 ///< Blood leak reset transmit FIFO command. -#define BLOOD_LEAK_UART_COMM_ACTIVE_LOW 0 ///< Blood leak UART communication active low command. -#define BLOOD_LEAK_UART_COMM_ACTIVE_HIGH 1 ///< Blood leak UART communication active high command. +#define BLOOD_LEAK_RESET_TX_FIFO 2 ///< Blood leak reset transmit FIFO command. +#define BLOOD_LEAK_UART_COMM_ACTIVE_LOW 0 ///< Blood leak UART communication active low command. +#define BLOOD_LEAK_UART_COMM_ACTIVE_HIGH 1 ///< Blood leak UART communication active high command. -#define BLOOD_LEAK_SET_POINT_MAX_CHAR_LENGTH 11 ///< Blood leak set point maximum character length. -#define BLOOD_LEAK_SET_POINT_START_CHAR_ASCII 83 ///< Blood leak set point sequence start character in ASCII (letter S). -#define BLOOD_LEAK_STOP_WRITE_FIFO_COMMAND 0 ///< Blood leak set point stop writing to FIFO command. -#define BLOOD_LEAK_SET_POINT_START_CHAR_INDEX 0 ///< Blood leak set point sequence start character index number. -#define BLOOD_LEAK_CARRIAGE_RETURN_ASCII 13 ///< Blood leak set point sequence carriage return character in ASCII. -#define BLOOD_LEAK_SET_POINT_SEQ_MAX_LENGTH 17 ///< Blood leak set point sequence maximum length. +#define BLOOD_LEAK_SET_POINT_MAX_CHAR_LENGTH 11 ///< Blood leak set point maximum character length. +#define BLOOD_LEAK_SET_POINT_START_CHAR_ASCII 83 ///< Blood leak set point sequence start character in ASCII (letter S). +#define BLOOD_LEAK_STOP_WRITE_FIFO_COMMAND 0 ///< Blood leak set point stop writing to FIFO command. +#define BLOOD_LEAK_SET_POINT_START_CHAR_INDEX 0 ///< Blood leak set point sequence start character index number. +#define BLOOD_LEAK_CARRIAGE_RETURN_ASCII 13 ///< Blood leak set point sequence carriage return character in ASCII. +#define BLOOD_LEAK_SET_POINT_SEQ_MAX_LENGTH 17 ///< Blood leak set point sequence maximum length. -#define BLOOD_LEAK_ZERO_CMD_STATUS_READY 0x80 ///< Blood leak zero command status ready value. -#define BLOOD_LEAK_SELF_TEST_CMD_STATUS_READY 0x80 ///< Blood leak self test command status ready value. -#define BLOOD_LEAK_STATUS_BIT_HIGH 1 ///< Blood leak status bit high. -#define BLOOD_LEAK_STATUS_BIT_LOW 0 ///< Blood leak status bit low. -#define BLOOD_LEAK_ZERO_CMD_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< Blood leak zero command timeout in milliseconds. -#define BLOOD_LEAK_SELF_TEST_CMD_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< Blood leak self test command timeout in milliseconds. -#define BLOOD_LEAK_BETWEEN_ZERO_ST_WAIT_MS 250 ///< Blood leak wait time in between zero and self test commands in milliseconds. -#define DATA_PUBLISH_COUNTER_START_COUNT 60 ///< Data publish counter start count. +#define BLOOD_LEAK_ZERO_CMD_STATUS_READY 0x80 ///< Blood leak zero command status ready value. +#define BLOOD_LEAK_SELF_TEST_CMD_STATUS_READY 0x80 ///< Blood leak self test command status ready value. +#define BLOOD_LEAK_STATUS_BIT_HIGH 1 ///< Blood leak status bit high. +#define BLOOD_LEAK_STATUS_BIT_LOW 0 ///< Blood leak status bit low. +#define BLOOD_LEAK_ZERO_CMD_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< Blood leak zero command timeout in milliseconds. +#define BLOOD_LEAK_SELF_TEST_CMD_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< Blood leak self test command timeout in milliseconds. +#define BLOOD_LEAK_BETWEEN_ZERO_ST_WAIT_MS 250 ///< Blood leak wait time in between zero and self test commands in milliseconds. +#define DATA_PUBLISH_COUNTER_START_COUNT 60 ///< Data publish counter start count. /// Embedded mode defines -#define BLOOD_LEAK_EMB_MODE_CMD_SEQ_LENGTH 6 ///< Blood leak embedded mode command sequence length. -#define BLOOD_LEAK_EMB_MODE_RQST_RX_LENGTH 2 ///< Blood leak embedded mode request new Rx data length. -#define BLOOD_LEAK_EMB_MODE_COMM_ACTIVE_HIGH 5 ///< Blood leak embedded mode communication active high command. -#define BLOOD_LEAK_EMB_MODE_COMM_ACTIVE_LOW 4 ///< Blood leak embedded mode communication active low command. -#define BLOOD_LEAK_EMB_MODE_COMM_RESET 6 ///< Blood leak embedded mode communication reset. -#define BLOOD_LEAK_EMB_MODE_COMM_READ_REQST 12 ///< Blood leak embedded mode communication read Rx byte request. -#define BLOOD_LEAK_EMB_MODE_RX_BUFFER_EMPTY 0x80 ///< Blood leak embedded mode buffer empty value. -#define BLOOD_LEAK_EMB_MODE_RESP_BUFFER_LEN 5 ///< Blood leak embedded mode number of commands. -#define BLOOD_LEAK_EMB_MODE_MAX_NUM_CMD_TRIES 3 ///< Blood leak embedded mode max number of command tries. -#define BLOOD_LEAK_EMB_MODE_0_NUM_ASCII 48 ///< Blood leak embedded mode character 0 in ASCII. -#define BLOOD_LEAK_EMB_MODE_9_NUM_ASCII 57 ///< Blood leak embedded mode character 9 in ASCII. -#define BLOOD_LEAK_EMB_MODE_SET_PNT_RESP_LEN 4 ///< Blood leak embedded mode set point response length. -#define BLOOD_LEAK_EMB_MODE_CMD_COL_INDEX 0 ///< Blood leak embedded mode command (UART/Transmit) column index number. -#define BLOOD_LEAK_EMB_MODE_IS_UART_COL_INDEX 1 ///< Blood leak embedded mode is command type UART or transmit flag. -#define BLOOD_LEAK_EMB_MODE_PASS_ASCII 80 ///< Blood leak embedded mode P (pass) in ASCII. -#define BLOOD_LEAK_EMB_MODE_FAIL_ASCII 70 ///< Blood leak embedded mode F (fail) in ASCII. +#define BLOOD_LEAK_EMB_MODE_CMD_SEQ_LENGTH 6 ///< Blood leak embedded mode command sequence length. +#define BLOOD_LEAK_EMB_MODE_RQST_RX_LENGTH 2 ///< Blood leak embedded mode request new Rx data length. +#define BLOOD_LEAK_EMB_MODE_COMM_ACTIVE_HIGH 5 ///< Blood leak embedded mode communication active high command. +#define BLOOD_LEAK_EMB_MODE_COMM_ACTIVE_LOW 4 ///< Blood leak embedded mode communication active low command. +#define BLOOD_LEAK_EMB_MODE_COMM_RESET 6 ///< Blood leak embedded mode communication reset. +#define BLOOD_LEAK_EMB_MODE_COMM_READ_REQST 12 ///< Blood leak embedded mode communication read Rx byte request. +#define BLOOD_LEAK_EMB_MODE_RX_BUFFER_EMPTY 0x80 ///< Blood leak embedded mode buffer empty value. +#define BLOOD_LEAK_EMB_MODE_RESP_BUFFER_LEN 5 ///< Blood leak embedded mode number of commands. +#define BLOOD_LEAK_EMB_MODE_MAX_NUM_CMD_TRIES 3 ///< Blood leak embedded mode max number of command tries. +#define BLOOD_LEAK_EMB_MODE_0_NUM_ASCII 48 ///< Blood leak embedded mode character 0 in ASCII. +#define BLOOD_LEAK_EMB_MODE_9_NUM_ASCII 57 ///< Blood leak embedded mode character 9 in ASCII. +#define BLOOD_LEAK_EMB_MODE_SET_PNT_RESP_LEN 4 ///< Blood leak embedded mode set point response length. +#define BLOOD_LEAK_EMB_MODE_PASS_ASCII 80 ///< Blood leak embedded mode P (pass) in ASCII. +#define BLOOD_LEAK_EMB_MODE_FAIL_ASCII 70 ///< Blood leak embedded mode F (fail) in ASCII. -#define BLOOD_LEAK_EMB_MODE_RESET_INDEX 0 ///< Blood leak embedded mode reset FIFO command index. -#define BLOOD_LEAK_EMB_MODE_CMD_INDEX 2 ///< Blood leak embedded mode command index. -#define BLOOD_LEAK_EMB_MODE_STOP_WRITE_INDEX 3 ///< Blood leak embedded mode stop write to FIFO index. -#define BLOOD_LEAK_EMB_MODE_ACTIVE_HIGH_INDEX 4 ///< Blood leak embedded mode active high command index. -#define BLOOD_LEAK_EMB_MODE_REQUEST_RX_INDEX 0 ///< Blood leak embedded mode request Rx to read index. -#define BLOOD_LEAK_EMB_MODE_CMD_Q_MAX_SIZE 12 ///< Blood leak embedded mode command queue maximum size. -#define BLOOD_LEAK_EMB_MODE_ZERO_CMD_RQRD_Q 5 ///< Blood leak embedded mode zero command required queue count. -#define BLOOD_LEAK_EMB_MODE_NUM_OF_RETRIES 3 ///< Blood leak embedded mode number of retries to enqueue. -#define BLOOD_LEAK_EMB_MODE_INFO_CMD_TIMEOUT_MS ( 1 * MS_PER_SECOND ) ///< Blood leak embedded mode informative command timeout in milliseconds. -#define BLOOD_LEAK_EMB_MODE_NUM_OF_INFO_CMDS 2 ///< Blood leak embedded mode number of informative commands. +#define BLOOD_LEAK_EMB_MODE_RESET_INDEX 0 ///< Blood leak embedded mode reset FIFO command index. +#define BLOOD_LEAK_EMB_MODE_CMD_INDEX 2 ///< Blood leak embedded mode command index. +#define BLOOD_LEAK_EMB_MODE_STOP_WRITE_INDEX 3 ///< Blood leak embedded mode stop write to FIFO index. +#define BLOOD_LEAK_EMB_MODE_ACTIVE_HIGH_INDEX 4 ///< Blood leak embedded mode active high command index. +#define BLOOD_LEAK_EMB_MODE_REQUEST_RX_INDEX 0 ///< Blood leak embedded mode request Rx to read index. +#define BLOOD_LEAK_EMB_MODE_CMD_Q_MAX_SIZE 12 ///< Blood leak embedded mode command queue maximum size. +#define BLOOD_LEAK_EMB_MODE_ZERO_CMD_RQRD_Q 5 ///< Blood leak embedded mode zero command required queue count. +#define BLOOD_LEAK_EMB_MODE_NUM_OF_RETRIES 3 ///< Blood leak embedded mode number of retries to enqueue. +#define BLOOD_LEAK_EMB_MODE_INFO_CMD_TIMEOUT_MS ( 1 * MS_PER_SECOND ) ///< Blood leak embedded mode informative command timeout in milliseconds. +#define BLOOD_LEAK_EMB_MODE_NUM_OF_INFO_CMDS 2 ///< Blood leak embedded mode number of informative commands. -#define BLOOD_LEAK_FPGA_ERROR_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< Blood leak embedded mode FPGA error timeout in milliseconds. -#define BLOOD_LEAK_RXFIFO_COUNT_MASK 0x03FF ///< Mask high order bits of blood leak sensor rx count. +#define BLOOD_LEAK_FPGA_ERROR_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< Blood leak embedded mode FPGA error timeout in milliseconds. +#define BLOOD_LEAK_RXFIFO_COUNT_MASK 0x03FF ///< Mask high order bits of blood leak sensor rx count. // ********** private data ********** static U32 bloodLeakUARTCmdIndex; static U32 bloodLeakSetPointSeqLength; -static U08 bloodLeakSetPointSequence[ BLOOD_LEAK_SET_POINT_SEQ_MAX_LENGTH ][ 2 ]; ///< Blood leak set point sequence array. +static U08 bloodLeakSetPointSequence[ BLOOD_LEAK_SET_POINT_SEQ_MAX_LENGTH ][ NUM_OF_BLOOD_LEAK_EMB_MODE_COL_INDEX ]; ///< Blood leak set point sequence array. // Embedded mode variables -static BOOL bloodLeakSignalEmbModeReq; ///< Blood leak signal embedded mode has been requested. -static U08 bloodLeakEmbModeRqstedCmd; ///< Blood leak signal embedded mode requested command. -static U08 bloodLeakEmbModeCmdSeq[ BLOOD_LEAK_EMB_MODE_CMD_SEQ_LENGTH ][ 2 ]; ///< Blood leak embedded mode command sequence. -static BLOOD_LEAK_EMB_MODE_STATE_T bloodLeakEmbModeSubstate; ///< Blood leak embedded mode state. -static U32 bloodLeakEmbModeOpsStartTime; ///< Blood leak embedded mode operations start time. -static U16 bloodLeakEmbModeSetPoint; ///< Blood leak embedded mode set point command. -static EMB_MODE_CMD_T bloodLeakEmbModeCmd[ NUM_OF_EMB_CMDS ]; ///< Blood leak embedded mode commands. -static U08 bloodLeakEmbModeRespBuffer[ BLOOD_LEAK_EMB_MODE_RESP_BUFFER_LEN ]; ///< Blood leak embedded mode response buffer. -static U32 bloodLeakEmbModeRespIndex; ///< Blood leak embedded mode response buffer index. -static U32 bloodLeakEmbModeCmdSeqLength; ///< Blood leak embedded mode command sequence length. -static BOOL bloodLeakEmbModeHasRxRqstBeenSent; ///< Blood leak embedded mode Rx request has been sent signal. -static U08 bloodLeakEmbModeCmdQ[ BLOOD_LEAK_EMB_MODE_CMD_Q_MAX_SIZE ]; ///< Blood leak embedded mode command queue. -static U08 bloodLeakEmbModeCmdQRearIndex; ///< Blood leak embedded mode command queue rear index. -static U08 bloodLeakEmbModeCmdQFrontIndex; ///< Blood leak embedded mode command queue front index. -static U08 bloodLeakEmbModeCmdQCount; ///< Blood leak embedded mode command queue count. -static U32 bloodLeakEmbModeInfoCmdEnqLastTimeStamp; ///< Blood leak embedded mode informative command (i.e. I, V, D) timer. -static U32 bloodLeakEmbModeInfoCmdCounter; ///< Blood leak embedded mode informative command counter. -static OVERRIDE_U32_T bloodLeakEmbModeIntensityOverride; ///< Blood leak embedded mode intensity override. -static OVERRIDE_U32_T bloodLeakEmbModeDetectOverride; ///< Blood leak embedded mode blood detect override. +static BOOL bloodLeakSignalEmbModeReq; ///< Blood leak signal embedded mode has been requested. +static U08 bloodLeakEmbModeRqstedCmd; ///< Blood leak signal embedded mode requested command. +static U08 bloodLeakEmbModeCmdSeq[ BLOOD_LEAK_EMB_MODE_CMD_SEQ_LENGTH ][ NUM_OF_BLOOD_LEAK_EMB_MODE_COL_INDEX ]; ///< Blood leak embedded mode command sequence. +static BLOOD_LEAK_EMB_MODE_STATE_T bloodLeakEmbModeSubstate; ///< Blood leak embedded mode state. +static U32 bloodLeakEmbModeOpsStartTime; ///< Blood leak embedded mode operations start time. +static U16 bloodLeakEmbModeSetPoint; ///< Blood leak embedded mode set point command. +static EMB_MODE_CMD_T bloodLeakEmbModeCmd[ NUM_OF_EMB_CMDS ]; ///< Blood leak embedded mode commands. +static U08 bloodLeakEmbModeRespBuffer[ BLOOD_LEAK_EMB_MODE_RESP_BUFFER_LEN ]; ///< Blood leak embedded mode response buffer. +static U32 bloodLeakEmbModeRespIndex; ///< Blood leak embedded mode response buffer index. +static U32 bloodLeakEmbModeCmdSeqLength; ///< Blood leak embedded mode command sequence length. +static BOOL bloodLeakEmbModeHasRxRqstBeenSent; ///< Blood leak embedded mode Rx request has been sent signal. +static U08 bloodLeakEmbModeCmdQ[ BLOOD_LEAK_EMB_MODE_CMD_Q_MAX_SIZE ]; ///< Blood leak embedded mode command queue. +static U08 bloodLeakEmbModeCmdQRearIndex; ///< Blood leak embedded mode command queue rear index. +static U08 bloodLeakEmbModeCmdQFrontIndex; ///< Blood leak embedded mode command queue front index. +static U08 bloodLeakEmbModeCmdQCount; ///< Blood leak embedded mode command queue count. +static U32 bloodLeakEmbModeInfoCmdEnqLastTimeStamp; ///< Blood leak embedded mode informative command (i.e. I, V, D) timer. +static U32 bloodLeakEmbModeInfoCmdCounter; ///< Blood leak embedded mode informative command counter. +static OVERRIDE_U32_T bloodLeakEmbModeIntensityOverride; ///< Blood leak embedded mode intensity override. +static OVERRIDE_U32_T bloodLeakEmbModeDetectOverride; ///< Blood leak embedded mode blood detect override. // ********** private function prototypes ********** @@ -129,7 +127,6 @@ static BOOL sendBloodLeakEmbeddedModeCommandResponse( U08 cmd, U32 responseLen, U08 *responseBuffer ); static void processReceivedEmbModeChar( U08 data ); - /*********************************************************************//** * @brief * The initBloodLeakDriver function initializes the Blood Leak module. @@ -149,6 +146,7 @@ *************************************************************************/ void initBloodLeakDriver( void ) { + U32 i = 0; // Initialize the embedded mode specifications initEmbModeSpecs(); @@ -165,15 +163,27 @@ // Initialize the blood leak embedded mode response buffer memset( bloodLeakEmbModeRespBuffer, 0x0, BLOOD_LEAK_EMB_MODE_RESP_BUFFER_LEN ); + // Set the blood leak embedded mode command queue to zero + memset( bloodLeakEmbModeCmdQ, 0x0, BLOOD_LEAK_EMB_MODE_CMD_Q_MAX_SIZE ); + // Initialize the blood leak embedded mode command sequence + for ( i = 0; i < BLOOD_LEAK_EMB_MODE_CMD_SEQ_LENGTH; i++ ) + { + memset( bloodLeakEmbModeCmdSeq[ i ], 0x0, sizeof( bloodLeakEmbModeCmdSeq[ 0 ] ) ); + } + + // Set the blood leak set point sequence to 0 to be initialized + for ( i = 0; i < BLOOD_LEAK_SET_POINT_SEQ_MAX_LENGTH; i++ ) + { + memset( bloodLeakSetPointSequence[ i ], 0x0, sizeof( bloodLeakSetPointSequence[ 0 ] ) ); + } + + // Initialize the blood leak embedded mode command sequence memset( bloodLeakEmbModeCmdSeq, 0x0, BLOOD_LEAK_EMB_MODE_CMD_SEQ_LENGTH ); // Set the blood leak set pint sequence to 0 to be initialized memset( bloodLeakSetPointSequence, 0x0, BLOOD_LEAK_SET_POINT_SEQ_MAX_LENGTH ); - // Set the blood leak embedded mode command queue to zero - memset( bloodLeakEmbModeCmdQ, 0x0, BLOOD_LEAK_EMB_MODE_CMD_Q_MAX_SIZE ); - // Enqueue the commands to set the embedded mode and request the set point of the blood leak sensor enqueueEmbModeCmd( CS_EMB_MODE_CMD ); enqueueEmbModeCmd( D_EMB_MODE_CMD ); @@ -184,15 +194,15 @@ * The getBloodLeakEmbCmdMode function retrieves the blood leak embedded mode * command specification from the driver. * @details \b Inputs: none - * @details \b Outputs: bloodLeakEmbModeSubstate + * @details \b Outputs: bloodLeakEmbModeCmd * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when in an unknown state * @return none *************************************************************************/ void getBloodLeakEmbCmdMode( BLOOD_LEAK_EMB_MODE_CMD_T cmd, EMB_MODE_CMD_T* results ) { if ( cmd < NUM_OF_EMB_CMDS ) { - memcpy( results, &bloodLeakEmbModeCmd[cmd], sizeof( EMB_MODE_CMD_T) ); + memcpy( results, &bloodLeakEmbModeCmd[ cmd ], sizeof( EMB_MODE_CMD_T) ); } else @@ -330,7 +340,7 @@ * @brief * The getAvailableEmbModeQueueCount function returns the available embedded * mode queue count. - * @details \b ts: bloodLeakEmbModeCmdQCount + * @details \b Inputs: bloodLeakEmbModeCmdQCount * @details \b Outputs: none * @return Current available embedded mode queue count *************************************************************************/ Index: firmware/App/Drivers/BloodLeakDriver.h =================================================================== diff -u -r86ea3cba20edaebf20fe2f9b82c7c73048c36f6c -r32e2bfb5cc2e778a6ccb7e93a118644a4f34068a --- firmware/App/Drivers/BloodLeakDriver.h (.../BloodLeakDriver.h) (revision 86ea3cba20edaebf20fe2f9b82c7c73048c36f6c) +++ firmware/App/Drivers/BloodLeakDriver.h (.../BloodLeakDriver.h) (revision 32e2bfb5cc2e778a6ccb7e93a118644a4f34068a) @@ -52,6 +52,14 @@ // ********** shared definitions (used by monitor + driver) ********** +/// Enumeration of blood leak embedded mode command column index. +typedef enum BloodLeakEmbModeCmdColIndex +{ + BLOOD_LEAK_EMB_MODE_CMD_COL_INDEX = 0, ///< Blood leak embedded mode command (UART/Transmit) column index number. + BLOOD_LEAK_EMB_MODE_IS_UART_COL_INDEX = 1, ///< Blood leak embedded mode is command type UART or transmit flag. + NUM_OF_BLOOD_LEAK_EMB_MODE_COL_INDEX, ///< NUmber of bLood leak embedded mode colum index +} BLOOD_LEAK_EMB_MODE_COL_INDEX_T; + /// Enumeration of blood leak detector status. typedef enum BloodLeakDetectorStatus { Index: firmware/App/Monitors/BloodLeak.c =================================================================== diff -u -r86ea3cba20edaebf20fe2f9b82c7c73048c36f6c -r32e2bfb5cc2e778a6ccb7e93a118644a4f34068a --- firmware/App/Monitors/BloodLeak.c (.../BloodLeak.c) (revision 86ea3cba20edaebf20fe2f9b82c7c73048c36f6c) +++ firmware/App/Monitors/BloodLeak.c (.../BloodLeak.c) (revision 32e2bfb5cc2e778a6ccb7e93a118644a4f34068a) @@ -299,8 +299,8 @@ // 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. - getBloodLeakEmbCmdMode(G_EMB_MODE_CMD, &cmdSpec); - BOOL status = (cmdSpec.commandRqstCount > BLOOD_LEAK_EMB_MODE_MAX_NUM_CMD_TRIES ? TRUE : FALSE); + getBloodLeakEmbCmdMode( G_EMB_MODE_CMD, &cmdSpec ); + BOOL status = ( cmdSpec.commandRqstCount > BLOOD_LEAK_EMB_MODE_MAX_NUM_CMD_TRIES ? TRUE : FALSE ); return status; } @@ -344,7 +344,6 @@ BOOL isBloodLeakZeroingNeeded( void ) { BOOL status = FALSE; - TD_MODE_SUB_MODE_T tdModes; getTDOperationMode( &tdModes ); @@ -476,10 +475,12 @@ { BLOOD_LEAK_STATE_T state = BLOOD_LEAK_CHECK_SET_POINT_STATE; EMB_MODE_CMD_T dCmdSpec; + BOOL isCommandRespReady; + U08 commandDRqstCount; getBloodLeakEmbCmdMode( D_EMB_MODE_CMD, &dCmdSpec ); - BOOL isCommandRespReady = dCmdSpec.isCmdRespRdy; - U08 commandDRqstCount = dCmdSpec.commandRqstCount; + isCommandRespReady = dCmdSpec.isCmdRespRdy; + commandDRqstCount = dCmdSpec.commandRqstCount; SEND_EVENT_WITH_2_U32_DATA( DD_EVENT_BLOOD_LEAK_NUM_OF_SET_POINT_CHECK_FAILURES, (U32)commandDRqstCount, state ) @@ -539,7 +540,6 @@ { BLOOD_LEAK_STATE_T state = BLOOD_LEAK_CHECK_ZERO_AND_SELF_TEST_STATE; EMB_MODE_CMD_T spec; - U08 i; BOOL areCommandsReady = TRUE; @@ -673,7 +673,6 @@ static BLOOD_LEAK_STATE_T handleBloodLeakNormalState( void ) { BLOOD_LEAK_STATE_T state = BLOOD_LEAK_NORMAL_STATE; - TD_MODE_SUB_MODE_T tdModes; getTDOperationMode( &tdModes );