Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -r86dc010eacfdaad879327202bf03336e0c77ead3 -r51fd08fdee3c5471fb0ff598fcae31306374c425 --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 86dc010eacfdaad879327202bf03336e0c77ead3) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 51fd08fdee3c5471fb0ff598fcae31306374c425) @@ -755,6 +755,23 @@ { DIALYSIS_STATE_T result = DIALYSIS_BLOOD_LEAK_ZEROING_STATE; + // if an air trap fill has started, set BP rate and VBV state accordingly + if ( ( airTrapFillInProgress != TRUE ) && ( TRUE == isAirTrapFillInProgress() ) ) + { + // set BP to air trap fill rate if air trap fill has been initiated + setBloodPumpTargetFlowRate( AIR_TRAP_FILL_BLOOD_FLOW_RATE, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); + // close VBV for fill + setValvePosition( VBV, VALVE_POSITION_C_CLOSE ); + } + // if an air trap fill has completed, restore BP and VBV to blood prime ramp settings + if ( ( TRUE == airTrapFillInProgress ) && ( isAirTrapFillInProgress() != TRUE ) ) + { + // restore BP to set blood flow rate + setBloodPumpTargetFlowRate( setBloodFlowRate, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); + // re-open VBV for blood recirculation + setValvePosition( VBV, VALVE_POSITION_B_OPEN ); + } + result = execBloodLeakZeroing(); return result;