Index: firmware/App/Drivers/BloodLeakDriver.c =================================================================== diff -u -ra05a0eb6d5aa38f5d026b9049a6284282e192172 -r9273b79631e50be192556bb9eaffd3f3a22d49d2 --- firmware/App/Drivers/BloodLeakDriver.c (.../BloodLeakDriver.c) (revision a05a0eb6d5aa38f5d026b9049a6284282e192172) +++ firmware/App/Drivers/BloodLeakDriver.c (.../BloodLeakDriver.c) (revision 9273b79631e50be192556bb9eaffd3f3a22d49d2) @@ -22,14 +22,14 @@ #include "AlarmMgmtDD.h" #include "BloodLeak.h" #include "BloodLeakDriver.h" -#include "Messaging.h" -#include "Timers.h" -#include "Utilities.h" #include "FpgaDD.h" +#include "Messaging.h" #include "OperationModes.h" #include "PersistentAlarm.h" -#include "TDInterface.h" #include "TaskPriority.h" +#include "TDInterface.h" +#include "Timers.h" +#include "Utilities.h" /** * @addtogroup BloodLeak @@ -1021,7 +1021,6 @@ return value; } - /*********************************************************************//** * @brief * The sendBloodLeakEmbeddedModeCommandResponse function sends out Index: firmware/App/Drivers/BloodLeakDriver.h =================================================================== diff -u -rb2436685ec42e879781b0bc1348ba80f333196bb -r9273b79631e50be192556bb9eaffd3f3a22d49d2 --- firmware/App/Drivers/BloodLeakDriver.h (.../BloodLeakDriver.h) (revision b2436685ec42e879781b0bc1348ba80f333196bb) +++ firmware/App/Drivers/BloodLeakDriver.h (.../BloodLeakDriver.h) (revision 9273b79631e50be192556bb9eaffd3f3a22d49d2) @@ -50,6 +50,76 @@ } BLOOD_LEAK_DATA_T; #pragma pack(pop) +// ********** shared definitions (used by monitor + driver) ********** + +/// Enumeration of blood leak detector status. +typedef enum BloodLeakDetectorStatus +{ + BLOOD_LEAK_DETECTED = 0, ///< Blood leak detector senses blood. + BLOOD_LEAK_NOT_DETECTED, ///< Blood leak detector does not sense any blood. + NUM_OF_BLOOD_LEAK_STATUS ///< Number of blood leak detector status. +} BLOOD_LEAK_STATUS_T; + +/// Blood leak main state machine states. +typedef enum BloodLeakStates +{ + BLOOD_LEAK_WAIT_FOR_POST_STATE = 0, + BLOOD_LEAK_CHECK_SET_POINT_STATE, + BLOOD_LEAK_INIT_STATE, + BLOOD_LEAK_CHECK_ZERO_AND_SELF_TEST_STATE, + BLOOD_LEAK_VERIFY_INTENSITY_AFTER_ZEROING_STATE, + BLOOD_LEAK_NORMAL_STATE, + BLOOD_LEAK_RECOVER_BLOOD_DETECT_STATE, + NUM_OF_BLOOD_LEAK_STATES +} BLOOD_LEAK_STATE_T; + +/// Embedded mode internal states. +typedef enum EmbStates +{ + BLOOD_LEAK_EMB_MODE_WAIT_FOR_COMAND_STATE = 0, + BLOOD_LEAK_EMB_MODE_SEND_COMMAND_STATE, + BLOOD_LEAK_EMB_MODE_WAIT_FOR_COMMAND_RESPONSE_STATE, + NUM_OF_BLOOD_LEAK_EMB_MODE_STATES +} BLOOD_LEAK_EMB_MODE_STATE_T; + +/// Blood leak detector embedded mode commands. +typedef enum EmbCommands +{ + NU_EMB_MODE_CMD = 0, + CS_EMB_MODE_CMD, + SP_EMB_MODE_CMD, + T_EMB_MODE_CMD, + G_EMB_MODE_CMD, + I_EMB_MODE_CMD, + V_EMB_MODE_CMD, + Z_EMB_MODE_CMD, + Q_EMB_MODE_CMD, + D_EMB_MODE_CMD, + C_EMB_MODE_CMD, + NUM_OF_EMB_CMDS, +} BLOOD_LEAK_EMB_MODE_CMD_T; + +/// Embedded mode command specifications. +typedef struct +{ + U08 commandASCII; + U08 expChar1; + U08 expChar2; + U32 length; + U32 timeoutMS; + U32 commandResp; + U08 commandRqstCount; + BOOL isCmdRespRdy; +} EMB_MODE_CMD_T; + +/// Embedded mode response message. +typedef struct +{ + U08 command; + U32 responseLen; + U08 responseBuffer[ 5 ]; +} BLOOD_LEAK_EMB_MODE_RESP_T; + // ********** public function prototypes ********** void initBloodLeakDriver( void ); @@ -72,7 +142,6 @@ BOOL testSetBloodLeakEmbeddedModeCommand( MESSAGE_T *message ); BOOL testBloodLeakEmbeddedModeInfoOverride( MESSAGE_T *message ); - /**@}*/ #endif Index: firmware/App/Monitors/BloodLeak.c =================================================================== diff -u -ra05a0eb6d5aa38f5d026b9049a6284282e192172 -r9273b79631e50be192556bb9eaffd3f3a22d49d2 --- firmware/App/Monitors/BloodLeak.c (.../BloodLeak.c) (revision a05a0eb6d5aa38f5d026b9049a6284282e192172) +++ firmware/App/Monitors/BloodLeak.c (.../BloodLeak.c) (revision 9273b79631e50be192556bb9eaffd3f3a22d49d2) @@ -183,6 +183,7 @@ { // Initialize the embedded mode specifications //initEmbModeSpecs(); + initBloodLeakDriver(); bloodLeakDataPublicationCounter = DATA_PUBLISH_COUNTER_START_COUNT; bloodLeakState = BLOOD_LEAK_WAIT_FOR_POST_STATE; @@ -215,7 +216,6 @@ bloodLeakZeroingStatus.zeroingUpperRangeIntervalTimeMS.ovInitData = BLD_UPPER_INTENSITY_INTERVAL_MS; bloodLeakZeroingStatus.zeroingUpperRangeIntervalTimeMS.ovData = 0; bloodLeakZeroingStatus.zeroingUpperRangeIntervalTimeMS.override = 0; - } /*********************************************************************//** @@ -1008,6 +1008,7 @@ return result; } + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ Index: firmware/App/Monitors/BloodLeak.h =================================================================== diff -u -ra05a0eb6d5aa38f5d026b9049a6284282e192172 -r9273b79631e50be192556bb9eaffd3f3a22d49d2 --- firmware/App/Monitors/BloodLeak.h (.../BloodLeak.h) (revision a05a0eb6d5aa38f5d026b9049a6284282e192172) +++ firmware/App/Monitors/BloodLeak.h (.../BloodLeak.h) (revision 9273b79631e50be192556bb9eaffd3f3a22d49d2) @@ -18,6 +18,7 @@ #ifndef __BLOODLEAK_H__ #define __BLOODLEAK_H__ +#include "BloodLeakDriver.h" #include "DDCommon.h" #include "DDDefs.h" @@ -32,77 +33,6 @@ * @{ */ -// ********** shared definitions (used by monitor + driver) ********** - -/// Enumeration of blood leak detector status. -typedef enum BloodLeakDetectorStatus -{ - BLOOD_LEAK_DETECTED = 0, ///< Blood leak detector senses blood. - BLOOD_LEAK_NOT_DETECTED, ///< Blood leak detector does not sense any blood. - NUM_OF_BLOOD_LEAK_STATUS ///< Number of blood leak detector status. -} BLOOD_LEAK_STATUS_T; - -/// Blood leak main state machine states. -typedef enum BloodLeakStates -{ - BLOOD_LEAK_WAIT_FOR_POST_STATE = 0, - BLOOD_LEAK_CHECK_SET_POINT_STATE, - BLOOD_LEAK_INIT_STATE, - BLOOD_LEAK_CHECK_ZERO_AND_SELF_TEST_STATE, - BLOOD_LEAK_VERIFY_INTENSITY_AFTER_ZEROING_STATE, - BLOOD_LEAK_NORMAL_STATE, - BLOOD_LEAK_RECOVER_BLOOD_DETECT_STATE, - NUM_OF_BLOOD_LEAK_STATES -} BLOOD_LEAK_STATE_T; - -/// Embedded mode internal states. -typedef enum EmbStates -{ - BLOOD_LEAK_EMB_MODE_WAIT_FOR_COMAND_STATE = 0, - BLOOD_LEAK_EMB_MODE_SEND_COMMAND_STATE, - BLOOD_LEAK_EMB_MODE_WAIT_FOR_COMMAND_RESPONSE_STATE, - NUM_OF_BLOOD_LEAK_EMB_MODE_STATES -} BLOOD_LEAK_EMB_MODE_STATE_T; - -/// Blood leak detector embedded mode commands. -typedef enum EmbCommands -{ - NU_EMB_MODE_CMD = 0, - CS_EMB_MODE_CMD, - SP_EMB_MODE_CMD, - T_EMB_MODE_CMD, - G_EMB_MODE_CMD, - I_EMB_MODE_CMD, - V_EMB_MODE_CMD, - Z_EMB_MODE_CMD, - Q_EMB_MODE_CMD, - D_EMB_MODE_CMD, - C_EMB_MODE_CMD, - NUM_OF_EMB_CMDS, -} BLOOD_LEAK_EMB_MODE_CMD_T; - -/// Embedded mode command specifications. -typedef struct -{ - U08 commandASCII; - U08 expChar1; - U08 expChar2; - U32 length; - U32 timeoutMS; - U32 commandResp; - U08 commandRqstCount; - BOOL isCmdRespRdy; -} EMB_MODE_CMD_T; - -/// Embedded mode response message. -typedef struct -{ - U08 command; - U32 responseLen; - U08 responseBuffer[ 5 ]; -} BLOOD_LEAK_EMB_MODE_RESP_T; - - // ********** public function prototypes ********** void initBloodLeak( void );