Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r7d040a0df47ab9babe67aa1d54036b60bdee52be -rdad9875b809383ca3cd5a24c6f888d02d5f6f2ab --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 7d040a0df47ab9babe67aa1d54036b60bdee52be) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision dad9875b809383ca3cd5a24c6f888d02d5f6f2ab) @@ -242,7 +242,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 @@ -395,7 +395,7 @@ pwm = ( MOTOR_DIR_REVERSE == dir ? pwm * -1.0F : pwm ); - result = testSetDialInPumpWithPWM( pwm ); + result = setDialInPumpToFixedPWM( pwm ); return result; } @@ -1551,15 +1551,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; @@ -1585,6 +1584,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 ) @@ -1967,7 +1967,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;