Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -r9302e1bd2413cbf99e80ac51aac38502d94801d9 -rf88ce1aa5a00106b6ba51a625fe4c1d8f0408cfd --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision 9302e1bd2413cbf99e80ac51aac38502d94801d9) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision f88ce1aa5a00106b6ba51a625fe4c1d8f0408cfd) @@ -122,7 +122,7 @@ static DIAL_OUT_PUMP_STATE_T dialOutPumpState = DIAL_OUT_PUMP_OFF_STATE; ///< Current state of the dialysate outlet pump controller state machine. static U32 dialOutFlowDataPublicationTimerCounter = 6; ///< Timer counter controlling when to publish dialysate outlet data. Set non-zero to phase data publication to CAN bus. static BOOL isDialOutPumpOn = FALSE; ///< Flag set to TRUE when dialysate outlet pump is running. -static U32 lastGivenRate = 0.0; ///< Remembers the last given set point rate for the dialysate outlet pump. +static U32 lastGivenRate = 0; ///< Remembers the last given set point rate for the dialysate outlet pump. static F32 dialOutPumpPWMDutyCyclePct = 0.0; ///< Requested PWM duty cycle for dialysate outlet pump (based on given rate). static F32 dialOutPumpPWMDutyCyclePctSet = 0.0; ///< Currently set PWM duty cycle for dialysate outlet pump. static MOTOR_DIR_T dialOutPumpDirection = MOTOR_DIR_FORWARD; ///< Requested direction for dialysate outlet pump. @@ -242,8 +242,12 @@ // verify flow rate if ( flowRate <= MAX_DIAL_OUT_FLOW_RATE ) { - F32 adjFlow = (F32)flowRate * DPO_FLOW_ADJ_DUE_TO_HIGHER_INLET_PRES; + F32 adjFlow = (F32)flowRate; + if ( PUMP_CONTROL_MODE_CLOSED_LOOP == mode ) + { + adjFlow *= DPO_FLOW_ADJ_DUE_TO_HIGHER_INLET_PRES; + } lastGivenRate = flowRate; dialOutPumpDirection = dir; dialOutPumpControlMode = mode;