Index: firmware/App/Modes/TreatmentStop.c =================================================================== diff -u -r90d598a098a5454769a7eabb8ba2b4595afe47a6 -rf0745a42b391c571718598d306eeb5d8554e46ad --- firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision 90d598a098a5454769a7eabb8ba2b4595afe47a6) +++ firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision f0745a42b391c571718598d306eeb5d8554e46ad) @@ -53,11 +53,11 @@ static TREATMENT_STOP_STATE_T handleTreatmentStopNoRecircState( void ); static void setupForDialysateRecirculationState( void ); static void setupForBloodRecirculationState( void ); +static void setupForRecoverBloodDetectState( void ); static TREATMENT_STOP_STATE_T handleTreatmentStopAlarmsAndSignals( TREATMENT_STOP_STATE_T state ); static TREATMENT_STOP_STATE_T handleTreatmentStopDialysateRecircState( void ); static TREATMENT_STOP_STATE_T handleTreatmentStopBloodRecircState( void ); static TREATMENT_STOP_STATE_T handleTreatmentStopRecoverBloodDetectState( void ); -static void setupForRecoverBloodDetectState( void ); static void handleTreatmentStopBloodSittingTimer( void ); static void publishTreatmentStopData( void ); @@ -189,6 +189,21 @@ /*********************************************************************//** * @brief + * The setupForRecoverBloodDetectState function handles the setup for + * recovering blood detection state. + * @details Inputs: none + * @details Outputs: none + * @return none + *************************************************************************/ +static void setupForRecoverBloodDetectState( void ) +{ + handleTreatmentStopBloodSittingTimer(); + doorClosedRequired( TRUE, TRUE ); + setDialInPumpTargetFlowRate( DIALYSATE_FLOW_RATE_FOR_BLOOD_DETECT_RECOVERY_MLPM, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); +} + +/*********************************************************************//** + * @brief * The setupForDialysateRecirculationStopState function sets actuators appropriately * for dialysate re-circulation stopped state. * @details Inputs: none @@ -414,25 +429,16 @@ result = handleTreatmentStopAlarmsAndSignals( result ); + if ( isAlarmActive( ALARM_ID_HD_BLOOD_LEAK_RECOVERING_PLEASE_WAIT ) != TRUE ) + { + enterBloodLeakNormalState(); + } + return result; } /*********************************************************************//** * @brief - * The setupForRecoverBloodDetectState function handles the setup for - * recovering blood detection state. - * @details Inputs: none - * @details Outputs: none - * @return none - *************************************************************************/ -static void setupForRecoverBloodDetectState( void ) -{ - doorClosedRequired( TRUE, TRUE ); - setDialInPumpTargetFlowRate( DIALYSATE_FLOW_RATE_FOR_BLOOD_DETECT_RECOVERY_MLPM, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); -} - -/*********************************************************************//** - * @brief * The handleTreatmentStopBloodSittingTimer function handles the no re-circ * blood timer. It should only be called when Blood is NOT circulating. * Increments and checks for warning and alarm timeouts.