Index: firmware/App/Services/StateServices/TubeSetInstall.c =================================================================== diff -u -racc8c3eb9d40711058bd214251d7554ab50b3836 -rb314f68347ca0720d370fd5ace385a2d8d92fabe --- firmware/App/Services/StateServices/TubeSetInstall.c (.../TubeSetInstall.c) (revision acc8c3eb9d40711058bd214251d7554ab50b3836) +++ firmware/App/Services/StateServices/TubeSetInstall.c (.../TubeSetInstall.c) (revision b314f68347ca0720d370fd5ace385a2d8d92fabe) @@ -40,7 +40,7 @@ #define AUTO_LOAD_BLOOD_FLOW_RATE_ML_MIN 100U /// Blood pump torque threshold (mN.m) above which a tube-set jam is declared -#define INSTALL_AUTO_LOAD_TORQUE_LIMIT_MNM 9999.0F // TODO: Replace with lab characterized value +#define BP_TORQUE_LIMIT_MNM 9999.0F // TODO: Replace with lab characterized value // ********** private data ********** @@ -120,7 +120,7 @@ * Should wait for the user to confirm the tubeset is placed * @details \b Inputs: confirmTubsetPlaced * @details \b Outputs: confirmTubesetPlaced - * return next Install sub-state + * @return next Install sub-state *************************************************************************/ static TUBE_SET_INSTALL_STATE_T handleAwaitTubesetConfirmationState( void ) { @@ -144,7 +144,7 @@ * Should wait until blood pump door (H9) is closed. * @details \b Inputs: H9_SWCH state * @details \b Outputs: none - * return next Install sub-state + * @return next Install sub-state *************************************************************************/ static TUBE_SET_INSTALL_STATE_T handleAwaitBPDoorCloseState( void ) { @@ -164,10 +164,9 @@ * @brief * The handleAutoLoadState function handles the Auto-Load state of * Tube Set install state. - * @details \b Inputs: bloodPumpTimerCounter, getMeasuredBloodPumpTorque() - * isPeristalticPumpHome() - * @details \b Outputs: bloodPumpTimerCounter - * return next Install sub-state + * @details \b Inputs: bloodPumpTimerCounter, bpLastHome + * @details \b Outputs: bloodPumpTimerCounter, bpLastHome + * @return next Install sub-state *************************************************************************/ static TUBE_SET_INSTALL_STATE_T handleAutoLoadState( void ) { @@ -182,10 +181,10 @@ 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 ) + else if ( bpTorque > BP_TORQUE_LIMIT_MNM ) { signalBloodPumpHardStop(); - SET_ALARM_WITH_1_F32_DATA( ALARM_ID_TD_AUTO_LOAD_BLOOD_TUBE_SET_FAILURE, bpTorque ); + SET_ALARM_WITH_1_F32_DATA( ALARM_ID_TD_AUTO_LOAD_EJECT_BLOOD_TUBE_SET_FAILURE, bpTorque ); setBloodPumpTargetFlowRate( AUTO_LOAD_BLOOD_FLOW_RATE_ML_MIN, MOTOR_DIR_REVERSE, PUMP_CONTROL_MODE_OPEN_LOOP ); bloodPumpTimerCounter = 0; state = TUBE_SET_INSTALL_STATE_AUTO_LOAD_BACK_OFF; @@ -211,9 +210,9 @@ * @brief * The handleAutoLoadBackOffState function handles the Auto-Load Back-Off * state of Tube Set install state. - * @details \b Inputs: bloodPumpTimerCounter, isPeristalticPumpHome() + * @details \b Inputs: bloodPumpTimerCounter * @details \b Outputs: bloodPumpTimerCounter - * return next Install sub-state + * @return next Install sub-state *************************************************************************/ static TUBE_SET_INSTALL_STATE_T handleAutoLoadBackOffState( void ) { @@ -226,11 +225,11 @@ } else if ( TRUE == isPeristalticPumpHome() ) { - clearAlarmTD( ALARM_ID_TD_AUTO_LOAD_BLOOD_TUBE_SET_FAILURE ); + signalBloodPumpHardStop(); + clearAlarmTD( ALARM_ID_TD_AUTO_LOAD_EJECT_BLOOD_TUBE_SET_FAILURE ); - if ( FALSE == isAlarmActive( ALARM_ID_TD_AUTO_LOAD_BLOOD_TUBE_SET_FAILURE ) ) + if ( FALSE == isAlarmActive( ALARM_ID_TD_AUTO_LOAD_EJECT_BLOOD_TUBE_SET_FAILURE ) ) { - signalBloodPumpHardStop(); bloodPumpTimerCounter = 0; state = TUBE_SET_INSTALL_STATE_AWAIT_TUBE_SET_CONFIRMATION; } @@ -249,7 +248,7 @@ * state of Tube Set install state. * @details \b Inputs: none * @details \b Outputs: none - * return install complete state + * @return install complete state *************************************************************************/ static TUBE_SET_INSTALL_STATE_T handleInstallCompleteState( void ) {