Index: firmware/App/Services/StateServices/TubeSetInstall.c =================================================================== diff -u -r26b65c70eca7d767f27a5cbbbd67a543ff9b5f26 -r253979e460b82c6d038e0a566f3be8c6df0a28c9 --- firmware/App/Services/StateServices/TubeSetInstall.c (.../TubeSetInstall.c) (revision 26b65c70eca7d767f27a5cbbbd67a543ff9b5f26) +++ firmware/App/Services/StateServices/TubeSetInstall.c (.../TubeSetInstall.c) (revision 253979e460b82c6d038e0a566f3be8c6df0a28c9) @@ -60,8 +60,8 @@ /*********************************************************************//** * @brief * The initTubeSetInstall function initializes the Tube Set Install service. -* @details Inputs: none -* @details Outputs: Resets the flags, counters and sets the initial +* @details \b Inputs: none +* @details \b Outputs: Resets the flags, counters and sets the initial * Tube Set Install sub-state. * @return none **************************************************************************/ @@ -76,8 +76,8 @@ * @brief * The execTubeSetInstall function executes the Tube Set Install * state machine. - * @details Inputs: currentInstallState - * @details Outputs: currentInstallState. Advances the + * @details \b Inputs: currentInstallState + * @details \b Outputs: currentInstallState. Advances the * Tube Set Install sub-state * @return none *************************************************************************/ @@ -116,8 +116,8 @@ * The handleAwaitTubesetConfirmationState function handles the Await * tubeset confirmation state of Tubing Set install state machine. * Should wait for the user to confirm the tubeset is placed - * @details Inputs: confirmTubsetPlaced - * @details Outputs: confirmTubesetPlaced + * @details \b Inputs: confirmTubsetPlaced + * @details \b Outputs: confirmTubesetPlaced * return next Install sub-state *************************************************************************/ static TUBE_SET_INSTALL_STATE_T handleAwaitTubesetConfirmationState( void ) @@ -140,8 +140,8 @@ * The handleAwaitBPDoorCloseState function handles the Await Blood Pump * Door Close state of Tubing Set install state machine. * Should wait until blood pump door (H9) is closed. - * @details Inputs: H9_SWCH state - * @details Outputs: none + * @details \b Inputs: H9_SWCH state + * @details \b Outputs: none * return next Install sub-state *************************************************************************/ static TUBE_SET_INSTALL_STATE_T handleAwaitBPDoorCloseState( void ) @@ -161,9 +161,9 @@ * @brief * The handleAutoLoadState function handles the Auto-Load state of * Tube Set install state. - * @details Inputs: bloodPumpTimerCounter, getMeasuredBloodPumpTorque() + * @details \b Inputs: bloodPumpTimerCounter, getMeasuredBloodPumpTorque() * isPeristalticPumpHome() - * @details Outputs: bloodPumpTimerCounter + * @details \b Outputs: bloodPumpTimerCounter * return next Install sub-state *************************************************************************/ static TUBE_SET_INSTALL_STATE_T handleAutoLoadState( void ) @@ -177,6 +177,7 @@ signalBloodPumpHardStop(); SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_AUTO_LOAD_EJECT_BP_TIMEOUT, isPeristalticPumpHome(), bloodPumpTimerCounter ); } + // Torque jam check. If measured torque exceeds the limit, the tubing set is likely jammed in the rotor. else if ( bpTorque > INSTALL_AUTO_LOAD_TORQUE_LIMIT_MNM ) { signalBloodPumpHardStop(); @@ -185,12 +186,17 @@ bloodPumpTimerCounter = 0; state = TUBE_SET_INSTALL_STATE_AUTO_LOAD_BACK_OFF; } + // BP home position check else if ( TRUE == isPeristalticPumpHome() ) { signalBloodPumpHardStop(); bloodPumpTimerCounter = 0; state = TUBE_SET_INSTALL_STATE_COMPLETE; } + else + { + // No action required + } return state; } @@ -199,8 +205,8 @@ * @brief * The handleAutoLoadBackOffState function handles the Auto-Load Back-Off * state of Tube Set install state. - * @details Inputs: bloodPumpTimerCounter, isPeristalticPumpHome() - * @details Outputs: bloodPumpTimerCounter + * @details \b Inputs: bloodPumpTimerCounter, isPeristalticPumpHome() + * @details \b Outputs: bloodPumpTimerCounter * return next Install sub-state *************************************************************************/ static TUBE_SET_INSTALL_STATE_T handleAutoLoadBackOffState( void ) @@ -223,6 +229,10 @@ state = TUBE_SET_INSTALL_STATE_AWAIT_TUBE_SET_CONFIRMATION; } } + else + { + // No action required + } return state; } @@ -231,8 +241,8 @@ * @brief * The handleInstallCompleteState function handles the Install Complete * state of Tube Set install state. - * @details Inputs: none - * @details Outputs: none + * @details \b Inputs: none + * @details \b Outputs: none * return install complete state *************************************************************************/ static TUBE_SET_INSTALL_STATE_T handleInstallCompleteState( void ) @@ -250,15 +260,20 @@ *************************************************************************/ BOOL isTubeSetInstallComplete( void ) { - return ( TUBE_SET_INSTALL_STATE_COMPLETE == currentInstallState ? TRUE : FALSE ); + BOOL result; + + result = ( TUBE_SET_INSTALL_STATE_COMPLETE == currentInstallState ? TRUE : FALSE ); + + return result; } /*********************************************************************//** * @brief * The handleAutoLoadRequest function handles a UI request to * confirm tubeset installation. - * @details Inputs: none - * @details Outputs: confirmTubesetPlaced + * @details \b Message \b Sent: MSG_ID_TD_ADJUST_DISPOSABLES_CONFIRM_RESPONSE + * @details \b Inputs: none + * @details \b Outputs: confirmTubesetPlaced * @param message UI message which includes the user confirmation of * tubset installation. * @return TRUE if confirmation/rejection accepted, FALSE if not