Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -r223b7a2ff87e3559679b52e52236a7cb7195c985 -rfb1673d2282822995ed233f3e9ea5dfb0567780d --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 223b7a2ff87e3559679b52e52236a7cb7195c985) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision fb1673d2282822995ed233f3e9ea5dfb0567780d) @@ -247,8 +247,8 @@ /*********************************************************************//** * @brief * The execBloodLeak function executes the blood leak detector driver. - * @details Inputs: bloodLeakGetCalStartTime, bloodLeakSignalEmbeddedModeReq - * @details Outputs: bloodLeakStatus, bloodLeakGetCalStartTime + * @details Inputs: bloodLeakState + * @details Outputs: bloodLeakCalRecord, bloodLeakState * @return none *************************************************************************/ void execBloodLeak( void ) @@ -296,8 +296,8 @@ * @brief * The execBloodLeakEmbModeCommand function executes the blood leak embedded * mode command. - * @details Inputs: bloodLeakGetCalStartTime, bloodLeakSignalEmbeddedModeReq - * @details Outputs: bloodLeakStatus, bloodLeakGetCalStartTime + * @details Inputs: bloodLeakEmbModeSubstate + * @details Outputs: bloodLeakEmbModeSubstate * @return none *************************************************************************/ void execBloodLeakEmbModeCommand( void ) @@ -386,7 +386,7 @@ * The handleBloodLeakWaitForPostState function handles the wait for POST * state of the of blood leak state machine. * @details Inputs: bloodLeakEmbModeCmd - * @details Outputs: none + * @details Outputs: bloodLeakEmbModeCmd * @return next state *************************************************************************/ static BLOOD_LEAK_STATE_T handleBloodLeakWaitForPostState( void ) @@ -434,8 +434,8 @@ * @brief * The handleBloodLeakCheckSetPointState function handles the check set point * state to ensure the set point is set correctly. - * @details Inputs: none - * @details Outputs: bloodLeakUARTCmdIndex + * @details Inputs: bloodLeakCalRecord + * @details Outputs: bloodLeakCalRecord * @return next state *************************************************************************/ static BLOOD_LEAK_STATE_T handleBloodLeakCheckSetPointState( void ) @@ -474,7 +474,7 @@ * @brief * The handleBloodLeakInitState function handles the Blood Leak module in init * state. - * @details Inputs: none + * @details Inputs: bloodLeakEmbModeHasZeroBeenRqustd * @details Outputs: none * @return next state *************************************************************************/ @@ -584,16 +584,6 @@ { BLOOD_LEAK_STATE_T state = BLOOD_LEAK_NORMAL_STATE; - // TODO remove - /*if ( TRUE == noFPGABloodLeakDetected() ) // TODO remove noFPGABloodLeakDetected() - { - bloodLeakStatus.data = BLOOD_LEAK_NOT_DETECTED; - } - else - { - bloodLeakStatus.data = BLOOD_LEAK_DETECTED; - }*/ - // If the blood leak status bit is low (0) it means blood has not been detected, otherwise, blood has been detected bloodLeakStatus.data = ( BLOOD_LEAK_STATUS_BIT_LOW == getFPGABloodLeakStatus() ? BLOOD_LEAK_NOT_DETECTED : BLOOD_LEAK_DETECTED ); @@ -687,7 +677,7 @@ * The handleBloodLeakEmbModeWaitForCommandState function handles the wait for * command state. The state prepares the message to be sent to the blood leak * sensor. - * @details Inputs: bloodLeakCalCharacter + * @details Inputs: bloodLeakEmbModeRqstedCmd, bloodLeakCalCharacter * @details Outputs: bloodLeakCalCommandSquence, bloodLeakUARTCmdIndex * @return next state *************************************************************************/ @@ -763,10 +753,12 @@ /*********************************************************************//** * @brief * The handleBloodLeakEmbModeSendCommandState function handles the send command - * state. The state sends the command sequence to the blood leak sensor one by - * one. - * @details Inputs: bloodLeakCalCharacter, bloodLeakUARTCmdIndex - * @details Outputs: bloodLeakCalCommandSquence, bloodLeakUARTCmdIndex + * state. The state sends the command sequence to the blood leak sensor one by one. + * @details Inputs: bloodLeakEmbModeRqstedCmd, bloodLeakCalCharacter, bloodLeakUARTCmdIndex + * bloodLeakEmbModeCmdSeqLength + * @details Outputs: bloodLeakEmbModeRqstedCmd, bloodLeakCalCommandSquence, + * bloodLeakUARTCmdIndex, bloodLeakEmbModeCmdSeqLength, bloodLeakEmbModeCmdSeqLength, + * bloodLeakSetPointSequence * @return next state *************************************************************************/ static BLOOD_LEAK_EMB_MODE_STATE_T handleBloodLeakEmbModeSendCommandState( void ) @@ -826,7 +818,14 @@ // Check if the current index towards the end of the buffer which are FIFO set and FIFO reset if ( FALSE == isUARTCtrlDone ) { - FALSE == isUARTCtrlCmd ? setFPGABloodLeakUARTTransmit( command ) : setFPGABloodLeakUARTControl( command ); + if ( FALSE == isUARTCtrlCmd ) + { + setFPGABloodLeakUARTTransmit( command ); + } + else + { + setFPGABloodLeakUARTControl( command ); + } } else { @@ -846,8 +845,10 @@ * @brief * The handleBloodLeakEmbModeWaitForCommandResponseState function handles the * wait for command responses state. The state receives data in the buffer. - * @details Inputs: bloodLeakEmbModeCmd, bloodLeakEmbModeRespIndex - * @details Outputs: bloodLeakEmbModeRespBuffer, bloodLeakEmbModeRespIndex + * @details Inputs: bloodLeakEmbModeHasRxRqstBeenSent, bloodLeakEmbModeRespBuffer, + * bloodLeakEmbModeRespIndex, bloodLeakEmbModeRqstedCmd, bloodLeakEmbModeOpsStartTime + * @details Outputs: bloodLeakEmbModeCmd, bloodLeakEmbModeRqstedCmd, + * bloodLeakEmbModeCmdSeq, bloodLeakEmbModeRespBuffer * @return next state *************************************************************************/ static BLOOD_LEAK_EMB_MODE_STATE_T handleBloodLeakEmbModeWaitForCommandResponseState( void ) @@ -1286,9 +1287,10 @@ /*********************************************************************//** * @brief - * The enqueueEmbModeCmd function enqueues the embedded mode command. - * @details Inputs: bloodLeakEmbModeCmdQRearIndex + * The enqueueEmbModeCmd function enqueues an embedded mode command. + * @details Inputs: none * @details Outputs: bloodLeakEmbModeCmdQRearIndex, bloodLeakEmbModeCmdQCount + * bloodLeakEmbModeCmdQ, bloodLeakEmbModeCmd * @return none *************************************************************************/ static void enqueueEmbModeCmd( U08 cmd ) @@ -1483,7 +1485,7 @@ * The testSetBloodLeakEmbeddedModeCommand function sets the blood leak * calibration command. * @details Inputs: none - * @details Outputs: bloodLeakEmbModeRqstedCmd, bloodLeakEmbModeSetPoint + * @details Outputs: bloodLeakEmbModeSetPoint * @param command the command ID to be sent to blood leak in embedded mode * @param setpointPayload the set point value that is sent with the set point * command. This value is 0 with other commands since they do not have a payload