Index: firmware/App/Drivers/BloodLeakDriver.c =================================================================== diff -u -rd4ff0e628e0cd7866272a8a8a6f26db97286e3b4 -rcf465d563d6f19d8eee4d4283b968694eb59ef94 --- firmware/App/Drivers/BloodLeakDriver.c (.../BloodLeakDriver.c) (revision d4ff0e628e0cd7866272a8a8a6f26db97286e3b4) +++ firmware/App/Drivers/BloodLeakDriver.c (.../BloodLeakDriver.c) (revision cf465d563d6f19d8eee4d4283b968694eb59ef94) @@ -38,7 +38,6 @@ // ********** private definitions ********** -#define BLOOD_LEAK_PERSISTENCE ( 10 * MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Persistence for blood leak detected alarm. #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. @@ -58,7 +57,6 @@ #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_DETECT_RECOVERY_MIN_TIME_MS ( 2 * MS_PER_SECOND ) ///< Blood leak blood detect recovery minimum time in milliseconds. /// Embedded mode defines #define BLOOD_LEAK_EMB_MODE_CMD_SEQ_LENGTH 6 ///< Blood leak embedded mode command sequence length. @@ -91,13 +89,11 @@ #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 COMM_BUFFER_OUT_CAN_PC 15 // ********** private data ********** -static BLOOD_LEAK_STATE_T bloodLeakState; static U32 bloodLeakUARTCmdIndex; static U32 bloodLeakSetPointSeqLength; -static U08 bloodLeakSetPointSequence[ BLOOD_LEAK_SET_POINT_SEQ_MAX_LENGTH ][ 2 ]; +static U08 bloodLeakSetPointSequence[ BLOOD_LEAK_SET_POINT_SEQ_MAX_LENGTH ][ 2 ]; ///< Blood leak set point sequence array. // Embedded mode variables static BOOL bloodLeakSignalEmbModeReq; ///< Blood leak signal embedded mode has been requested. @@ -170,6 +166,12 @@ // 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 ); @@ -403,11 +405,11 @@ * bloodLeakEmbModeInfoCmdCounter * @return none *************************************************************************/ -void enqueueInfoEmbModeCmds( void ) +void enqueueInfoEmbModeCmds( BLOOD_LEAK_STATE_T currentState ) { if ( TRUE == didTimeout( bloodLeakEmbModeInfoCmdEnqLastTimeStamp, BLOOD_LEAK_EMB_MODE_INFO_CMD_TIMEOUT_MS ) ) { - switch ( bloodLeakState ) + switch ( currentState ) { case BLOOD_LEAK_INIT_STATE: case BLOOD_LEAK_NORMAL_STATE: