Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -r2c4dfa08ac8ead07939b4f6aba3b0073e0997706 -r81dc975f13b9308e40aa0e33e0eca2d407276d44 --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 2c4dfa08ac8ead07939b4f6aba3b0073e0997706) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 81dc975f13b9308e40aa0e33e0eca2d407276d44) @@ -324,8 +324,12 @@ { U16 roFlowReading = getFPGAROPumpFlowRate(); - // Update sum for flow average calculation - measuredFlowReadingsSum += (S32)roFlowReading; + // If the flow is less than a certain value, FPGA will return 0xFFFF meaning that the flow is 0. + if ( FLOW_SENSOR_ZERO_READING != roFlowReading ) + { + // Update sum for flow average calculation + measuredFlowReadingsSum += (S32)roFlowReading; + } // Read the pressure at the sensor. The pump cannot be more that the maximum allowed pressure // to make sure the hardware (especially the ROF) is not damaged. If it is the case, we need to stop immediately @@ -749,7 +753,8 @@ roPumpDutyCyclePctSet = roPumpPWMDutyCyclePct; roPumpControlMode = PUMP_CONTROL_MODE_OPEN_LOOP; - setROPumpControlSignalDutyCycle( roPumpOpenLoopTargetDutyCycle ); // TODO remove + // Set the new duty cycle of the pump + setROPumpControlSignalDutyCycle( roPumpOpenLoopTargetDutyCycle ); } /*********************************************************************//**