Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -r722eb364d9b8d1fa9cc98da41f09c5fd73a8be39 -rd89f4eb7da7574306f45eefea5a2fc3b980fd7c9 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 722eb364d9b8d1fa9cc98da41f09c5fd73a8be39) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision d89f4eb7da7574306f45eefea5a2fc3b980fd7c9) @@ -417,7 +417,7 @@ *************************************************************************/ BOOL retractSyringePump( void ) { - if ( ( SYRINGE_PUMP_OFF_STATE == syringePumpState ) && ( FALSE == isSyringeDetected() ) && ( heparinDeliveryState != HEPARIN_STATE_OFF ) ) + if ( ( SYRINGE_PUMP_OFF_STATE == syringePumpState ) && ( heparinDeliveryState != HEPARIN_STATE_OFF ) ) { syringePumpSetRate = SYRINGE_PUMP_RETRACT_RATE; syringePumpRetractRequested = TRUE; @@ -1419,11 +1419,12 @@ { if ( ++syringePumpSpeedCalcTimerCounter > SYRINGE_PUMP_SPEED_CHECK_INTERVAL ) { - S32 countsPerSec = syringePumpMeasRate.data - syringePumpPosition1SecAgo; + S32 countsPerSec = syringePumpPosition.data - syringePumpPosition1SecAgo; S32 countsPerHr = countsPerSec * ( MIN_PER_HOUR * SEC_PER_MIN); F32 mLPerHr = (F32)countsPerHr / SYRINGE_ENCODER_COUNTS_PER_ML; syringePumpMeasRate.data = mLPerHr; + syringePumpPosition1SecAgo = syringePumpPosition.data; syringePumpSpeedCalcTimerCounter = 0; } }