Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -ra8bb1da29825b5d666333629fda871652d16229a -r8467f8ff09e382e0991f14d02683080dc811e24e --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision a8bb1da29825b5d666333629fda871652d16229a) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 8467f8ff09e382e0991f14d02683080dc811e24e) @@ -112,7 +112,6 @@ static F32 roPumpPWMDutyCyclePct = 0.0; ///< Initial RO pump PWM duty cycle. static F32 roPumpDutyCyclePctSet = 0.0; ///< Currently set RO pump PWM duty cycle. static PUMP_CONTROL_MODE_T roPumpControlMode = PUMP_CONTROL_MODE_CLOSED_LOOP; ///< Requested RO pump control mode. -static PUMP_CONTROL_MODE_T roPumpControlModeSet = PUMP_CONTROL_MODE_CLOSED_LOOP; ///< Currently set RO pump control mode. TODO do we need this? static F32 targetROPumpFlowRate = 0.0; ///< Target RO flow rate (in L/min). static F32 targetROPumpMaxPressure = 0.0; ///< Target RO max allowed pressure (in PSI). @@ -126,11 +125,6 @@ static F32 roPumpOpenLoopTargetDutyCycle = 0; ///< Target RO pump open loop PWM. -/* TODO These variables are used for POST. POST has not been implemented yet -static RO_PUMP_SELF_TEST_STATE_T roPumpSelfTestState = RO_PUMP_SELF_TEST_STATE_START; ///< Current RO pump self test state. -static U32 roPumpSelfTestTimerCount = 0; ///< Timer counter for RO pump self test. -*/ - static S32 measuredFlowReadingsSum = 0; ///< Raw flow reading sums for averaging. static U32 flowFilterCounter = 0; ///< Flow filtering counter. @@ -154,7 +148,7 @@ * @details Inputs: roControlTimerCounter,roPumpOpenLoopTargetDutyCycle, * roPumpFlowRateRunningSum, roPumpPressureRunningSum, measuredFlowReadingsSum, * flowFilterCounter, flowVerificationCounter, roPumpState, roPumpControlMode - * roPumpDataPublicationTimerCounter, roPumpControlModeSet + * roPumpDataPublicationTimerCounter * @details Outputs: none * @return none *************************************************************************/ @@ -172,16 +166,11 @@ // Initialize the persistent alarm for flow out of upper and lower range initPersistentAlarm( ALARM_ID_FLOW_RATE_OUT_OF_UPPER_RANGE, FLOW_OUT_OF_RANGE_PERSISTENT_INTERVAL, FLOW_OUT_OF_RANGE_PERSISTENT_INTERVAL ); - initPersistentAlarm( ALARM_ID_FLOW_RATE_OUT_OF_LOWER_RANGE, FLOW_OUT_OF_RANGE_PERSISTENT_INTERVAL, FLOW_OUT_OF_RANGE_PERSISTENT_INTERVAL ); // Initialize the persistent alarm for max allowed pressure out of range - initPersistentAlarm( ALARM_ID_RO_PUMP_PRESSURE_OUT_OF_RANGE, MAX_PRESSURE_OUT_OF_RANGE_PERSISTENT_INTERVAL, - MAX_PRESSURE_OUT_OF_RANGE_PERSISTENT_INTERVAL ); + initPersistentAlarm( ALARM_ID_RO_PUMP_PRESSURE_OUT_OF_RANGE, MAX_PRESSURE_OUT_OF_RANGE_PERSISTENT_INTERVAL, MAX_PRESSURE_OUT_OF_RANGE_PERSISTENT_INTERVAL ); - // Initialize the persistent alarm for ramp up to target flow timeout - initPersistentAlarm( ALARM_ID_RO_PUMP_RAMP_UP_TO_FLOW_TIMEOUT, MAX_ALLOWED_RAMP_UP_TIME, MAX_ALLOWED_RAMP_UP_TIME ); - // Initialize the persistent alarm for not turning off the pump initPersistentAlarm( ALARM_ID_RO_PUMP_OFF_FAULT, SAFETY_SHUTDOWN_TIMEOUT, SAFETY_SHUTDOWN_TIMEOUT ); @@ -193,7 +182,6 @@ roPumpDataPublicationTimerCounter = 0; roPumpState = RO_PUMP_OFF_STATE; roPumpControlMode = NUM_OF_PUMP_CONTROL_MODES; - roPumpControlModeSet = roPumpControlMode; isROPumpOn = FALSE; } @@ -406,23 +394,6 @@ /*********************************************************************//** * @brief - * The execROPumpTest function executes the state machine for the RO pump - * self-test. - * @details Inputs: TODO FILL UP - * @details Outputs: TODO FILL UP - * @return the current state of the ROPump self test. - *************************************************************************/ -SELF_TEST_STATUS_T execROPumpTest( void ) -{ - SELF_TEST_STATUS_T result = SELF_TEST_STATUS_FAILED; - - // TODO - implement self-test(s) - - return result; -} - -/*********************************************************************//** - * @brief * The handleROPumpOffState function handles the RO pump off state of the * controller state machine. * @details Inputs: roPumpControlMode, roPumpPWMDutyCyclePctSet, @@ -437,7 +408,6 @@ // If there is a flow, transition to the PI controller to get the corresponding pressure of that flow if ( getTargetROPumpFlowRate() > 0 && roPumpControlMode == PUMP_CONTROL_MODE_CLOSED_LOOP ) { - roPumpControlModeSet = PUMP_CONTROL_MODE_CLOSED_LOOP; // Set pump to on isROPumpOn = TRUE; roPumpDutyCyclePctSet = ROP_FLOW_TO_PWM_DC( getTargetROPumpFlowRate() ); @@ -519,7 +489,6 @@ * The handleROPumpControlToTargetFlowState function handles the control to * target flow state of the RO pump controller state machine. * @details Inputs: roPumpPWMDutyCyclePctSet, roControlTimerCounter, - * roPumpControlModeSet * @details Outputs: roPumpPWMDutyCyclePctSet, roControlTimerCounter * @return next state of the controller state machine *************************************************************************/ @@ -557,7 +526,6 @@ * The handleROPumpControlToMaxPressureState function handles the control * to max pressure state of the RO pump controller state machine. * @details Inputs: roPumpPWMDutyCyclePctSet, roControlTimerCounter, - * roPumpControlModeSet * @details Outputs: roPumpPWMDutyCyclePctSet, roControlTimerCounter * @return next state of the controller state machine *************************************************************************/