Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -r8bd1ae47aa13a843aa8abd6321ddc050deacb4a6 -rb9eccdfcf1727112664b85977a16a18811b9fde7 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 8bd1ae47aa13a843aa8abd6321ddc050deacb4a6) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision b9eccdfcf1727112664b85977a16a18811b9fde7) @@ -1769,12 +1769,12 @@ *************************************************************************/ static void calcStepperToggleTimeForTargetRate( F32 rate ) { - double temp; + F64 temp; F32 conv; // Convert given rate to stepper toggle period - temp = (double)rate * SYRINGE_MICRO_STEPS_PER_ML; // = uSteps/hr - temp /= (double)( MIN_PER_HOUR * SEC_PER_MIN); // = uSteps/sec + temp = (F64)rate * SYRINGE_MICRO_STEPS_PER_ML; // = uSteps/hr + temp /= (F64)( MIN_PER_HOUR * SEC_PER_MIN); // = uSteps/sec temp /= MICRO_SECONDS_PER_SECOND; // = uSteps/uSec conv = (F32)temp * SYRINGE_TOGGLES_PER_STEP; // = toggles/uSec conv = 1.0 / conv; // = uSec/toggle @@ -1803,7 +1803,7 @@ U32 nextIdx = INC_WRAP( syringePumpMotorSpeedCalcIdx, 0, SYRINGE_PUMP_SPEED_CALC_BUFFER_LEN - 1 ); S32 countsPerSec = pos - syringePumpLastPositions[ syringePumpMotorSpeedCalcIdx ]; // Calc delta between pos 1 second ago and pos now S32 countsPerHr = countsPerSec * ( MIN_PER_HOUR * SEC_PER_MIN); - F32 mLPerHr = (F32)((double)countsPerHr / (double)SYRINGE_ENCODER_COUNTS_PER_ML); + F32 mLPerHr = (F32)((F64)countsPerHr / (F64)SYRINGE_ENCODER_COUNTS_PER_ML); // Set latest measured rate syringePumpMeasRate.data = mLPerHr;