Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r7b60e2a885abe3a0bd06e63647c6a93da6501dda -rd5b85c44743b1aaaeb61b88179de032e8ca3c6a7 --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 7b60e2a885abe3a0bd06e63647c6a93da6501dda) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision d5b85c44743b1aaaeb61b88179de032e8ca3c6a7) @@ -1527,14 +1527,19 @@ dir = MOTOR_DIR_REVERSE; } - // Direction change while pump is running is not allowed - if ( ( FALSE == isDialInPumpOn ) && ( dir == dialInPumpDirectionSet ) || ( 0 == pwmFabs ) ) + // Check to see if pump is on or attempting to turn off + // Direction change while pump is running is not allowed unless we are turning off + if ( ( ( FALSE == isDialInPumpOn ) && ( dir == dialInPumpDirectionSet ) ) || ( MIN_DIAL_IN_PUMP_PWM_DUTY_CYCLE >= pwmFabs ) ) { // Don't interrupt pump control unless rate is changing if ( ( pwmFabs != dialInPumpPWMDutyCyclePct ) ) { resetDialInFlowMovingAverage(); - dialInPumpDirection = dir; + // accept direction changes only when we stop + if ( FALSE == isDialInPumpOn ) + { + dialInPumpDirection = dir; + } dialInPumpControlMode = PUMP_CONTROL_MODE_OPEN_LOOP; dialInPumpPWMDutyCyclePct = RANGE( pwmFabs, MIN_DIAL_IN_PUMP_PWM_DUTY_CYCLE, MAX_DIAL_IN_PUMP_PWM_DUTY_CYCLE );