Index: firmware/App/Controllers/AirTrap.c =================================================================== diff -u -rf3d625e2593ced120c4a98b9ed7e28b132445642 -r0bb3fe3f34c02bd19c36aff2b98876e46a2ad177 --- firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision f3d625e2593ced120c4a98b9ed7e28b132445642) +++ firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision 0bb3fe3f34c02bd19c36aff2b98876e46a2ad177) @@ -466,8 +466,8 @@ setValvePosition( VBV, VALVE_POSITION_C_CLOSE ); fillStartTime = getMSTimerCount(); SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_AIR_TRAP_FILL, STATE_OPEN, 0 ); - result = AIR_TRAP_VALVE_OPEN_STATE; SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_AIR_TRAP_STATE_CHANGE, (U32)AIR_TRAP_VALVE_CLOSED_STATE, (U32)result ) + result = AIR_TRAP_VALVE_OPEN_STATE; } return result; Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -rf3d625e2593ced120c4a98b9ed7e28b132445642 -r0bb3fe3f34c02bd19c36aff2b98876e46a2ad177 --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision f3d625e2593ced120c4a98b9ed7e28b132445642) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 0bb3fe3f34c02bd19c36aff2b98876e46a2ad177) @@ -221,6 +221,8 @@ setDialOutUFVolumes( refUFVolume, measUFVolume ); // initialize air trap fill flag airTrapFillInProgress = FALSE; + // Reset saline bolus state machine + resetSalineBolus(); resetReservoirsVariables(); Index: firmware/App/Modes/Rinseback.c =================================================================== diff -u -rf3d625e2593ced120c4a98b9ed7e28b132445642 -r0bb3fe3f34c02bd19c36aff2b98876e46a2ad177 --- firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision f3d625e2593ced120c4a98b9ed7e28b132445642) +++ firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision 0bb3fe3f34c02bd19c36aff2b98876e46a2ad177) @@ -464,10 +464,12 @@ // Otherwise, continue rinseback else { - // re-open VBV after air trap fill + // 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 ) ) @@ -651,10 +653,12 @@ setBloodPumpTargetFlowRate( AIR_TRAP_FILL_BLOOD_FLOW_RATE, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); } } - // re-open VBV after air trap fill + // 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; Index: firmware/App/Modes/SalineBolus.c =================================================================== diff -u -rf3d625e2593ced120c4a98b9ed7e28b132445642 -r0bb3fe3f34c02bd19c36aff2b98876e46a2ad177 --- firmware/App/Modes/SalineBolus.c (.../SalineBolus.c) (revision f3d625e2593ced120c4a98b9ed7e28b132445642) +++ firmware/App/Modes/SalineBolus.c (.../SalineBolus.c) (revision 0bb3fe3f34c02bd19c36aff2b98876e46a2ad177) @@ -15,7 +15,6 @@ * ***************************************************************************/ - #include "BloodFlow.h" #include "Dialysis.h" #include "ModeTreatment.h" @@ -46,7 +45,6 @@ static BOOL salineBolusAbortRequested; ///< Flag indicates a salien bolus abort has been requested by user. static BOOL airTrapFillInProgress; ///< Flag indicates an air trap fill is in progress. - static F32 totalSalineVolumeDelivered_mL; ///< Volume (mL) in total of saline delivered so far (cumulative for all boluses including current one). static F32 bolusSalineVolumeDelivered_mL; ///< Volume (mL) of current bolus delivered so far (calculated from measured blood flow rate). static U32 bolusSalineLastVolumeTimeStamp; ///< Time stamp for last saline volume update. Index: firmware/App/Modes/TreatmentEnd.c =================================================================== diff -u -rf3d625e2593ced120c4a98b9ed7e28b132445642 -r0bb3fe3f34c02bd19c36aff2b98876e46a2ad177 --- firmware/App/Modes/TreatmentEnd.c (.../TreatmentEnd.c) (revision f3d625e2593ced120c4a98b9ed7e28b132445642) +++ firmware/App/Modes/TreatmentEnd.c (.../TreatmentEnd.c) (revision 0bb3fe3f34c02bd19c36aff2b98876e46a2ad177) @@ -279,10 +279,11 @@ setBloodPumpTargetFlowRate( AIR_TRAP_FILL_BLOOD_FLOW_RATE, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); } } - // re-open VBV after air trap fill + // 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 ); + setBloodPumpTargetFlowRate( TX_END_BP_FLOW_RATE_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); } return result;