Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -r91982bb1378f3a4a614313a1c0d9dbf83b81014b -r3936f36dc75fc254ba676dd8d55bdfb54f4d2158 --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 91982bb1378f3a4a614313a1c0d9dbf83b81014b) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 3936f36dc75fc254ba676dd8d55bdfb54f4d2158) @@ -70,15 +70,6 @@ static F32 roPumpDutyCyclePctSet; ///< Currently set RO pump PWM duty cycle. static OVERRIDE_F32_T roPumpOpenLoopTargetDutyCycle; ///< Target RO pump open loop PWM. -//typedef enum -//{ -// OVERRIDE_NONE_ACTIVE = 0, -// OVERRIDE_FLOW, -// OVERRIDE_PRESSURE, -// OVERRIDE_DUTYCYCLE -//} OVERRIDE_TYPE_E; -// -//static OVERRIDE_TYPE_E lastOverrideType = OVERRIDE_NONE_ACTIVE; // ********** private function prototypes ********** @@ -395,7 +386,6 @@ { if ( roPumpOpenLoopTargetDutyCycle.override != OVERRIDE_RESET ) { -// roPumpOpenLoopTargetDutyCycle.ovInitData = roPumpOpenLoopTargetDutyCycle.data; roPumpOpenLoopTargetDutyCycle.data = 0.0; } else @@ -440,31 +430,28 @@ { if ( targetROPumpPressure.override != OVERRIDE_RESET ) { - if ( targetROPumpPressure.ovInitData == 0 ) - { - targetROPumpPressure.ovInitData = targetROPumpPressure.data; - } + targetROPumpPressure.ovInitData = targetROPumpPressure.data; if ( targetROPumpFlowRate.data > 0 ) { - if ( targetROPumpFlowRate.override != OVERRIDE_RESET ) + if ( targetROPumpFlowRate.ovInitData == 0 ) { + targetROPumpFlowRate.ovInitData = targetROPumpFlowRate.data; targetROPumpFlowRate.data = 0; } else { - targetROPumpFlowRate.ovInitData = targetROPumpFlowRate.data; targetROPumpFlowRate.data = 0; } } if ( roPumpOpenLoopTargetDutyCycle.data > 0.0 ) { - if ( roPumpOpenLoopTargetDutyCycle.override != OVERRIDE_RESET ) + if ( roPumpOpenLoopTargetDutyCycle.ovInitData == 0.0 ) { + roPumpOpenLoopTargetDutyCycle.ovInitData = roPumpOpenLoopTargetDutyCycle.data; roPumpOpenLoopTargetDutyCycle.data = 0.0; } else { - roPumpOpenLoopTargetDutyCycle.ovInitData = roPumpOpenLoopTargetDutyCycle.data; roPumpOpenLoopTargetDutyCycle.data = 0.0; } } @@ -478,6 +465,7 @@ } else if ( roPressure == 0.0F ) { +// stopPumpRequest = TRUE; result = TRUE; if ( ( getTargetROPumpFlowRateMLPM() == 0 ) && ( getTargetROPumpDutyCyclePCT() == 0.0 ) ) { @@ -550,8 +538,9 @@ } else if ( dutyCycle == 0.0F ) { +// stopPumpRequest = TRUE; result = TRUE; - if ( getTargetROPumpFlowRateMLPM() == 0 && getTargetROPumpPressure() == 0.0 ) + if ( ( getTargetROPumpFlowRateMLPM() == 0 ) && ( getTargetROPumpPressure() == 0.0 ) ) { stopPumpRequest = TRUE; } @@ -799,10 +788,7 @@ targetROPumpFlowRate.data = targetROPumpFlowRate.ovData; } } -// else if ( targetROPumpFlowRate.override != OVERRIDE_RESET ) -// { -// lastOverrideType = OVERRIDE_PRESSURE; -// } + BOOL result = f32Override( message, &targetROPumpPressure ); setROPumpTargetPressure(getTargetROPumpPressure()); @@ -843,10 +829,7 @@ targetROPumpPressure.data = targetROPumpPressure.ovData; } } -// else if ( targetROPumpFlowRate.override != OVERRIDE_RESET ) -// { -// lastOverrideType = OVERRIDE_FLOW; -// } + BOOL result = u32Override( message, &targetROPumpFlowRate, MIN_RO_FLOWRATE_MLPM, MAX_RO_FLOWRATE_MLPM ); setROPumpTargetFlowRateMLPM(getTargetROPumpFlowRateMLPM()); @@ -887,10 +870,6 @@ targetROPumpPressure.data = targetROPumpPressure.ovData; } } -// else if ( roPumpOpenLoopTargetDutyCycle.override != OVERRIDE_RESET ) -// { -// lastOverrideType = OVERRIDE_DUTYCYCLE; -// } BOOL result = f32Override( message, &roPumpOpenLoopTargetDutyCycle ); setROPumpTargetDutyCycle(getTargetROPumpDutyCyclePCT());