Index: firmware/App/Modes/TreatmentRecirc.c =================================================================== diff -u -r2a03f6c87706478406a4962d70f5bae2ccb57728 -rb73ca202edeef9c43966f32fcab31ef8743398fe --- firmware/App/Modes/TreatmentRecirc.c (.../TreatmentRecirc.c) (revision 2a03f6c87706478406a4962d70f5bae2ccb57728) +++ firmware/App/Modes/TreatmentRecirc.c (.../TreatmentRecirc.c) (revision b73ca202edeef9c43966f32fcab31ef8743398fe) @@ -82,7 +82,7 @@ *************************************************************************/ void initTreatmentRecirc( void ) { - treatmentRecircState = TREATMENT_RECIRC_RECIRC_STATE; + treatmentRecircState = TREATMENT_RECIRC_DISCONNECT_PATIENT_STATE; recircTimerCtr = 0; recircPublishTimerCtr = 0; resetTreatmentRecircFlags(); @@ -121,16 +121,15 @@ // Set valves to safe state setValvePosition( VDI, VALVE_POSITION_C_CLOSE ); setValvePosition( VDO, VALVE_POSITION_C_CLOSE ); - setValvePosition( VBA, VALVE_POSITION_B_OPEN ); - setValvePosition( VBV, VALVE_POSITION_B_OPEN ); + setupForRecirculationStopState(); - // Start blood pump at re-circulate flow rate - setBloodPumpTargetFlowRate( RECIRC_BP_FLOW_RATE_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); // Ensure syringe pump is stopped stopSyringePump(); - // Start air trap control - startAirTrapControl(); - // *Note - Dialysate pump should already be re-circulating from rinseback sub-mode + // Stop air trap leveling control + endAirTrapControl(); + // Re-circulate dialysate side of dialyzer w/ heating to maintain temperature + setDialInPumpTargetFlowRate( DIALYSATE_FLOW_RATE_FOR_RECIRC, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); + cmdStartDGTrimmerHeater(); // Set user alarm recovery actions allowed in this sub-mode setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, FALSE ); @@ -154,8 +153,6 @@ setValvePosition( VBV, VALVE_POSITION_B_OPEN ); // Start blood pump at re-circulate flow rate setBloodPumpTargetFlowRate( RECIRC_BP_FLOW_RATE_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); - // Start air trap leveling control - startAirTrapControl(); } /*********************************************************************//** @@ -174,8 +171,6 @@ // Close arterial and venous lines setValvePosition( VBA, VALVE_POSITION_C_CLOSE ); setValvePosition( VBV, VALVE_POSITION_C_CLOSE ); - // Stop air trap leveling control - endAirTrapControl(); } /*********************************************************************//** @@ -241,6 +236,7 @@ if ( TRUE == recircStartRecircRequested ) { + setupForRecirculationState(); result = TREATMENT_RECIRC_RECIRC_STATE; } @@ -439,7 +435,7 @@ { BOOL result = FALSE; - if ( TREATMENT_RECIRC_STOPPED_STATE == treatmentRecircState ) + if ( TREATMENT_RECIRC_RECONNECT_PATIENT_STATE == treatmentRecircState ) { result = TRUE; recircBackToTreatmenRequested = TRUE; @@ -466,7 +462,7 @@ { BOOL result = FALSE; - if ( TREATMENT_RECIRC_STOPPED_STATE == treatmentRecircState ) + if ( ( TREATMENT_RECIRC_STOPPED_STATE == treatmentRecircState ) || ( TREATMENT_RECIRC_RECONNECT_PATIENT_STATE == treatmentRecircState ) ) { result = TRUE; recircResumeRequested = TRUE; @@ -493,15 +489,8 @@ { BOOL result = FALSE; - if ( ( TREATMENT_RECIRC_RECIRC_STATE == treatmentRecircState ) || ( TREATMENT_RECIRC_STOPPED_STATE == treatmentRecircState ) ) - { - result = TRUE; - recircEndTreatmentRequested = TRUE; - } - else - { - *rejReason = REQUEST_REJECT_REASON_ACTION_DISABLED_IN_CURRENT_STATE; - } + result = TRUE; + recircEndTreatmentRequested = TRUE; return result; }