Index: firmware/App/Modes/Rinseback.c =================================================================== diff -u -r1a36e9bd718b40ceaee21dd12eca2da353828e30 -r0bb3fe3f34c02bd19c36aff2b98876e46a2ad177 --- firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision 1a36e9bd718b40ceaee21dd12eca2da353828e30) +++ firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision 0bb3fe3f34c02bd19c36aff2b98876e46a2ad177) @@ -453,9 +453,25 @@ setupForRinsebackStopOrPause(); result = RINSEBACK_PAUSED_STATE; } + // set BP to air trap fill rate if air trap fill has been initiated + else if ( TRUE == isAirTrapFillInProgress() ) + { + if ( 0 == getTargetBloodFlowRate() ) + { + setBloodPumpTargetFlowRate( AIR_TRAP_FILL_BLOOD_FLOW_RATE, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); + } + } // Otherwise, continue rinseback else - { // Has user requested rate change? + { + // re-open VBV and restore BP rate after air trap fill + if ( VALVE_POSITION_C_CLOSE == getSetValvePosition( VBV ) ) + { + setValvePosition( VBV, VALVE_POSITION_B_OPEN ); + // restore BP to rinseback blood flow rate + setBloodPumpTargetFlowRate( rinsebackRate_mL_min, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); + } + // Has user requested rate change? if ( ( TRUE == incrRinsebackFlowRateRequested ) || ( TRUE == decrRinsebackFlowRateRequested ) ) { U32 rbRate = rinsebackRate_mL_min; @@ -629,6 +645,21 @@ setRinsebackIsCompleted( TRUE ); } } + // set BP to air trap fill rate if air trap fill has been initiated + else if ( TRUE == isAirTrapFillInProgress() ) + { + if ( 0 == getTargetBloodFlowRate() ) + { + setBloodPumpTargetFlowRate( AIR_TRAP_FILL_BLOOD_FLOW_RATE, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); + } + } + // re-open VBV and restore BP rate after air trap fill + else if ( VALVE_POSITION_C_CLOSE == getSetValvePosition( VBV ) ) + { + setValvePosition( VBV, VALVE_POSITION_B_OPEN ); + // restore BP to rinseback blood flow rate + setBloodPumpTargetFlowRate( rinsebackRate_mL_min, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); + } return result; }