Index: firmware/App/Modes/StateTxPaused.c =================================================================== diff -u -rb57e35bcded6968444b66e7a58dec34c3dd99082 -r8749beb3f7bed2f9d7fcd2c6916496ea300d9f9d --- firmware/App/Modes/StateTxPaused.c (.../StateTxPaused.c) (revision b57e35bcded6968444b66e7a58dec34c3dd99082) +++ firmware/App/Modes/StateTxPaused.c (.../StateTxPaused.c) (revision 8749beb3f7bed2f9d7fcd2c6916496ea300d9f9d) @@ -97,7 +97,8 @@ // Set user alarm recovery actions allowed in this sub-mode setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); if ( FALSE ) // TODO ( TRUE == getRinsebackCompleted() ) - { // block rinseback action if already done + { + // block rinseback action if already done setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); } else @@ -259,7 +260,6 @@ { TREATMENT_PAUSED_STATE_T result = TREATMENT_PAUSED_NO_RECIRC_STATE; - doorClosedRequired( FALSE ); handleTreatmentPausedBloodSittingTimer(); result = handleTreatmentPausedAlarmsAndSignals( result ); @@ -278,8 +278,9 @@ { TREATMENT_PAUSED_STATE_T result = TREATMENT_PAUSED_RECOVER_BLOOD_DETECT_STATE; + // TODO uncomment //execBloodLeakZeroing(); - // + //// Keep reseting the blood sitting timer handleTreatmentPausedBloodSittingTimer(); result = handleTreatmentPausedAlarmsAndSignals( result ); @@ -397,6 +398,7 @@ { U32 targetBloodFlowMLPM = getTreatmentParameterU32( TREATMENT_PARAM_BLOOD_FLOW ); U32 targetDialysateFlowMLPM = (F32)getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ); + setBloodPumpTargetFlowRate( targetBloodFlowMLPM, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); setValvePosition( H1_VALV, VALVE_POSITION_C_CLOSE ); setValvePosition( H19_VALV, VALVE_POSITION_C_CLOSE ); @@ -406,12 +408,14 @@ cmdBypassDialyzer( TRUE ); cmdChangeQd( targetDialysateFlowMLPM ); cmdChangeQuf( 0.0F ); + doorClosedRequired( FALSE ); } break; case TREATMENT_PAUSED_RECIRC_DIALYSATE_ONLY_STATE: { U32 targetDialysateFlowMLPM = (F32)getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ); + signalBloodPumpHardStop(); setValvePosition( H1_VALV, VALVE_POSITION_C_CLOSE ); setValvePosition( H19_VALV, VALVE_POSITION_C_CLOSE ); @@ -421,12 +425,14 @@ cmdBypassDialyzer( TRUE ); cmdChangeQd( targetDialysateFlowMLPM ); cmdChangeQuf( 0.0F ); + doorClosedRequired( FALSE ); } break; case TREATMENT_PAUSED_RECIRC_BLOOD_ONLY_STATE: { U32 targetBloodFlowMLPM = getTreatmentParameterU32( TREATMENT_PARAM_BLOOD_FLOW ); + setBloodPumpTargetFlowRate( targetBloodFlowMLPM, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); setValvePosition( H1_VALV, VALVE_POSITION_B_OPEN ); setValvePosition( H19_VALV, VALVE_POSITION_B_OPEN ); @@ -436,6 +442,7 @@ cmdBypassDialyzer( TRUE ); cmdChangeQd( 0.0F ); cmdChangeQuf( 0.0F ); + doorClosedRequired( TRUE ); } break; @@ -449,6 +456,7 @@ cmdBypassDialyzer( TRUE ); cmdChangeQd( 0.0F ); cmdChangeQuf( 0.0F ); + doorClosedRequired( FALSE ); break; case TREATMENT_PAUSED_RECOVER_BLOOD_DETECT_STATE: