Index: firmware/App/Controllers/DrainPump.c =================================================================== diff -u -r8ebab816fadec93b2f3c6a42f15a07c26b3a4f59 -r8c8270dec772e34287a3825e6023ebf73b1e1e53 --- firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision 8ebab816fadec93b2f3c6a42f15a07c26b3a4f59) +++ firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision 8c8270dec772e34287a3825e6023ebf73b1e1e53) @@ -730,7 +730,7 @@ // If measured flow if greater than the target flow, adjust the DAC to lower the flow rate tempDACSet = (U32)( ( flowSubLPM * DRP_CONTROL_FLOW_TO_DAC_P_ONLY_TERM ) + FLOAT_TO_INT_ROUNDUP_OFFSET ); tempDACSet = ( tempDACSet > drainPumpDACSet ? DRAIN_PUMP_MIN_DAC : tempDACSet ); - drainPumpDACSet -= ( tempDACSet > 0.0F ? tempDACSet : DRP_CONTROL_MIN_DAC_CHANGE ); + drainPumpDACSet -= tempDACSet; } else { @@ -746,15 +746,15 @@ // If the calculated DAC value turned out to be 0, set it to 1 so it changes at least by 1 DAC tempDACSet = (U32)( ( maxPresPSI * DRP_CONTROL_PSI_TO_DAC_P_ONLY_TERM ) + FLOAT_TO_INT_ROUNDUP_OFFSET ); tempDACSet = ( tempDACSet > drainPumpDACSet ? DRAIN_PUMP_MIN_DAC : tempDACSet ); - drainPumpDACSet -= ( tempDACSet > 0.0F ? tempDACSet : DRP_CONTROL_MIN_DAC_CHANGE ); + drainPumpDACSet -= tempDACSet; } else if ( ( fabs(pdrSubPSI) > DRP_CONTROL_PRES_TO_MAX_THRESHOLD_PSI ) && ( fabs(ppoSubPSI) > DRP_CONTROL_PRES_TO_MAX_THRESHOLD_PSI ) ) { // If both of the DACs turned out to be less than their maximum pressure limits by more than the specified value, recalculate the // DAC. Using fabs for the subtraction means both pressure subtractions are negative so they are below their limits. // In the calculations use fabs for max pressure because it is negative so it will end of subtracting DAC but it should be adding tempDACSet = (U32)( ( fabs(maxPresPSI) * DRP_CONTROL_PSI_TO_DAC_P_ONLY_TERM ) + FLOAT_TO_INT_ROUNDUP_OFFSET ); - drainPumpDACSet += ( tempDACSet > 0.0F ? tempDACSet : DRP_CONTROL_MIN_DAC_CHANGE ); + drainPumpDACSet += tempDACSet; } } @@ -1002,7 +1002,7 @@ drainPumpHallMeasuredRPM.override = OVERRIDE_KEY; drainPumpHallMeasuredRPM.ovInitData = drainPumpHallMeasuredRPM.data; } - else if ( DRAIN_PUMP_MAXON_SNSR_FB == (DRAIN_PUMP_SPEED_FB_SNSR_T)sensor ) + else { drainPumpMaxonMeasuredRPM.ovData = value; drainPumpMaxonMeasuredRPM.override = OVERRIDE_KEY; @@ -1036,7 +1036,7 @@ drainPumpHallMeasuredRPM.ovData = drainPumpHallMeasuredRPM.ovInitData; drainPumpHallMeasuredRPM.override = OVERRIDE_RESET; } - else if ( DRAIN_PUMP_MAXON_SNSR_FB == (DRAIN_PUMP_SPEED_FB_SNSR_T)sensor ) + else { drainPumpMaxonMeasuredRPM.ovData = drainPumpMaxonMeasuredRPM.ovInitData; drainPumpMaxonMeasuredRPM.override = OVERRIDE_RESET;