Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r9883c6362e8de5ce0d2f667825ac8b85d820bbf2 -rc3315e0cc263df74569bbb58591229418b50fe92 --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 9883c6362e8de5ce0d2f667825ac8b85d820bbf2) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision c3315e0cc263df74569bbb58591229418b50fe92) @@ -241,7 +241,7 @@ static F32 calcDialInFlow( void ); static F32 dialysateInPumpRPMFromTargetFlowRate( F32 QdTarget ); static F32 dialysateInPumpPWMFromTargetFlowRate( F32 QdTarget ); -static BOOL testSetDialInPumpWithPWM( F32 pwm ); +static BOOL setDialInPumpToFixedPWM( F32 pwm ); /*********************************************************************//** * @brief @@ -394,7 +394,7 @@ pwm = ( MOTOR_DIR_REVERSE == dir ? pwm * -1.0F : pwm ); - result = testSetDialInPumpWithPWM( pwm ); + result = setDialInPumpToFixedPWM( pwm ); return result; } @@ -1550,15 +1550,14 @@ /*********************************************************************//** * @brief - * The testSetDialInPumpWithPWM function sets a new pwm value and - * pump direction. + * The setDialInPumpToFixedPWM function sets a new pwm value and pump direction. * @details Inputs: isDialInPumpOn, dialInPumpPWMDutyCyclePct, dialInPumpDirectionSet, * dialInPumpState * @details Outputs: dialInPumpControlMode, dialInPumpdirection, dialInPumpPWMDutyCyclePct * @param pwm the new pwm value * @return TRUE if new flow rate & dir are set, FALSE if not **************************************************************************/ -static BOOL testSetDialInPumpWithPWM( F32 pwm ) +static BOOL setDialInPumpToFixedPWM( F32 pwm ) { MOTOR_DIR_T dir = MOTOR_DIR_FORWARD; BOOL result = FALSE; @@ -1584,6 +1583,7 @@ resetDialInFlowMovingAverage(); dialInPumpControlMode = PUMP_CONTROL_MODE_OPEN_LOOP; dialInPumpPWMDutyCyclePct = RANGE( pwmFabs, MIN_DIAL_IN_PUMP_PWM_DUTY_CYCLE, MAX_DIAL_IN_PUMP_PWM_DUTY_CYCLE ); + targetDialInFlowRate = DIP_ML_PER_MIN_FROM_PWM( pwmFabs ); // clear test flag if we are turning off the pump. if ( pwmFabs <= MIN_DIAL_IN_PUMP_PWM_DUTY_CYCLE ) @@ -1966,7 +1966,7 @@ // check for max of pump pwm for acceptance. if ( absolutePWM < MAX_DIAL_IN_PUMP_PWM_DUTY_CYCLE ) { - result = testSetDialInPumpWithPWM( pwmPct ); + result = setDialInPumpToFixedPWM( pwmPct ); } } return result;