Index: firmware/App/Modes/Rinseback.c =================================================================== diff -u -rebfb8019ba74b6c614051d1bfd13ee186c9138fd -r70d33c50c8c3fd987f39eaa1f3b294860d569830 --- firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision ebfb8019ba74b6c614051d1bfd13ee186c9138fd) +++ firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision 70d33c50c8c3fd987f39eaa1f3b294860d569830) @@ -338,17 +338,14 @@ static RINSEBACK_STATE_T handleRinsebackRunState( void ) { RINSEBACK_STATE_T result = RINSEBACK_RUN_STATE; - U32 bldPumpMotorCount = getBloodPumpMotorCount(); - U32 bldPumpMotorDelta = u32DiffWithWrap( rinsebackLastMotorCount, bldPumpMotorCount ); // Reset rinseback t/o rinsebackTimerCtr = 0; // Update rinseback volume delivered so far cumulativeRinsebackVolume_mL += ( getMeasuredBloodFlowRate() * RINSEBACK_FLOW_INTEGRATOR ); // update independent calculated safety volume delivered so far - rinsebackMotorCount += bldPumpMotorDelta; - rinsebackLastMotorCount = bldPumpMotorCount; + rinsebackMotorCount = u32DiffWithWrap( rinsebackLastMotorCount, getBloodPumpMotorCount() ) / BP_HALL_EDGE_COUNTS_PER_REV; rinsebackVolumeDelivered_Safety = ( (F32)rinsebackMotorCount * VOLUME_PER_BP_MOTOR_REV_ML ); // TODO - include upstream pressure compensation to this calc // Has user requested to end rinseback?