Index: firmware/App/Controllers/BoostPump.c =================================================================== diff -u -r94d93795b2a516b3bdd7fc7030eb5eac933bfcd0 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Controllers/BoostPump.c (.../BoostPump.c) (revision 94d93795b2a516b3bdd7fc7030eb5eac933bfcd0) +++ firmware/App/Controllers/BoostPump.c (.../BoostPump.c) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -15,12 +15,8 @@ * ***************************************************************************/ -//#include - - #include "BoostPump.h" #include "Flow.h" -#include "FluidPump.h" #include "FPOperationModes.h" //#include "NVDataMgmt.h" #include "Messaging.h" @@ -278,21 +274,21 @@ BOOST_PUMP_STATE_T state = BOOST_PUMP_CONTROL_TO_TARGET_FLOW_STATE; // Check if need to switch control modes - if ( getTargetBoostPumpPressure() > 0.0F && ( PUMP_CONTROL_MODE_CLOSED_LOOP == boostPumpControlMode ) ) + if ( ( getTargetBoostPumpPressure() > 0.0F ) && ( PUMP_CONTROL_MODE_CLOSED_LOOP == boostPumpControlMode ) ) { // Transition to target pressure resetPIController( PI_CONTROLLER_ID_BOOST_PUMP_PRES, boostPumpDutyCyclePctSet, 0 ); state = BOOST_PUMP_CONTROL_TO_TARGET_PRESSURE_STATE; } - else if ( getTargetBoostPumpDutyCyclePCT() > 0.0F && ( PUMP_CONTROL_MODE_OPEN_LOOP == boostPumpControlMode ) ) + else if ( ( getTargetBoostPumpDutyCyclePCT() > 0.0F ) && ( PUMP_CONTROL_MODE_OPEN_LOOP == boostPumpControlMode ) ) { setFluidPumpPctToPWMDutyCycle( P40_PUMP, getTargetBoostPumpDutyCyclePCT() ); boostPumpDutyCyclePctSet = getTargetBoostPumpDutyCyclePCT(); state = BOOST_PUMP_OPEN_LOOP_STATE; } // Control at set interval or shut off - if ( getTargetBoostPumpFlowRateMLPM() == 0.0F && ( PUMP_CONTROL_MODE_CLOSED_LOOP == boostPumpControlMode ) ) + if ( ( getTargetBoostPumpFlowRateMLPM() == 0.0F ) && ( PUMP_CONTROL_MODE_CLOSED_LOOP == boostPumpControlMode ) ) { signalBoostPumpHardStop(); } @@ -325,15 +321,15 @@ resetPIController( PI_CONTROLLER_ID_BOOST_PUMP_FLOW, boostPumpDutyCyclePctSet, 0.0F ); state = BOOST_PUMP_CONTROL_TO_TARGET_FLOW_STATE; } - else if ( getTargetBoostPumpDutyCyclePCT() > 0.0F && ( PUMP_CONTROL_MODE_OPEN_LOOP == boostPumpControlMode ) ) + else if ( ( getTargetBoostPumpDutyCyclePCT() > 0.0F ) && ( PUMP_CONTROL_MODE_OPEN_LOOP == boostPumpControlMode ) ) { setFluidPumpPctToPWMDutyCycle( P40_PUMP, getTargetBoostPumpDutyCyclePCT() ); boostPumpDutyCyclePctSet = getTargetBoostPumpDutyCyclePCT(); state = BOOST_PUMP_OPEN_LOOP_STATE; } // Control at set interval or shut off - if ( getTargetBoostPumpPressure() == 0.0F && ( PUMP_CONTROL_MODE_CLOSED_LOOP == boostPumpControlMode ) ) + if ( ( getTargetBoostPumpPressure() == 0.0F ) && ( PUMP_CONTROL_MODE_CLOSED_LOOP == boostPumpControlMode ) ) { signalBoostPumpHardStop(); } @@ -475,7 +471,6 @@ return status; } - /*********************************************************************//** * @brief * The getTargetBoostPumpDutyCyclePCT function gets the current target Boost pump @@ -754,5 +749,4 @@ return result; } - /**@}*/ Fisheye: Tag 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff refers to a dead (removed) revision in file `firmware/App/Controllers/Heaters.c'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff refers to a dead (removed) revision in file `firmware/App/Controllers/Heaters.h'. Fisheye: No comparison available. Pass `N' to diff? Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -r8e72441bc5cd51272b1dc6b14d6c95b4888d6301 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 8e72441bc5cd51272b1dc6b14d6c95b4888d6301) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -38,21 +38,24 @@ // ********** private definitions ********** -#define RO_PUMP_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the RO Pump data is published on the CAN bus. -#define ROP_CONTROL_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the RO pump is controlled. +#define RO_PUMP_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the RO Pump data is published on the CAN bus. +#define ROP_CONTROL_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the RO pump is controlled. -#define ROP_FLOW_CONTROL_P_COEFFICIENT 0.15F ///< P term for RO pump flow control. -#define ROP_FLOW_CONTROL_I_COEFFICIENT 0.65F ///< I term for RO pump flow control. -#define ROP_PRESSURE_CONTROL_P_COEFFICIENT 0.15F ///< P term for RO pump pressure control. -#define ROP_PRESSURE_CONTROL_I_COEFFICIENT 0.65F ///< I term for RO pump pressure control. +#define ROP_FLOW_CONTROL_P_COEFFICIENT 0.15F ///< P term for RO pump flow control. +#define ROP_FLOW_CONTROL_I_COEFFICIENT 0.65F ///< I term for RO pump flow control. +#define ROP_PRESSURE_CONTROL_P_COEFFICIENT 0.15F ///< P term for RO pump pressure control. +#define ROP_PRESSURE_CONTROL_I_COEFFICIENT 0.65F ///< I term for RO pump pressure control. -#define ROP_FLOW_TO_PWM_SLOPE 0.5F ///< Slope of flow to PWM line equation. -#define ROP_FLOW_TO_PWM_INTERCEPT 0.0F ///< Intercept of flow to PWM line equation. -#define ROP_PRESSURE_TO_PWM_SLOPE 0.5F ///< Slope of pressure to PWM line equation. -#define ROP_PRESSURE_TO_PWM_INTERCEPT 0.0F ///< Intercept of pressure to PWM line equation. +#define ROP_FLOW_TO_PWM_SLOPE 0.5F ///< Slope of flow to PWM line equation. +#define ROP_FLOW_TO_PWM_INTERCEPT 0.0F ///< Intercept of flow to PWM line equation. +#define ROP_PRESSURE_TO_PWM_SLOPE 0.5F ///< Slope of pressure to PWM line equation. +#define ROP_PRESSURE_TO_PWM_INTERCEPT 0.0F ///< Intercept of pressure to PWM line equation. -#define DATA_PUBLISH_COUNTER_START_COUNT 10 ///< Data publish counter start count. +#define DATA_PUBLISH_COUNTER_START_COUNT 10 ///< Data publish counter start count. +#define ROP_FLOW_TO_PWM(flow) ( ROP_FLOW_TO_PWM_SLOPE * flow + ROP_FLOW_TO_PWM_INTERCEPT ) ///< PWM line equation for flow. +#define ROP_PRESSURE_TO_PWM(pres) ( ROP_PRESSURE_TO_PWM_SLOPE * pres + ROP_PRESSURE_TO_PWM_INTERCEPT )///< PWM line equation for pressure. + // ********** private data ********** static RO_PUMP_STATE_T roPumpState; ///< Current state of pump controller state machine. @@ -264,21 +267,21 @@ RO_PUMP_STATE_T state = RO_PUMP_CONTROL_TO_TARGET_FLOW_STATE; // Check if need to switch control modes - if ( getTargetROPumpPressure() > 0.0F && ( PUMP_CONTROL_MODE_CLOSED_LOOP == roPumpControlMode ) ) + if ( ( getTargetROPumpPressure() > 0.0F ) && ( PUMP_CONTROL_MODE_CLOSED_LOOP == roPumpControlMode ) ) { // Transition to target pressure resetPIController( PI_CONTROLLER_ID_RO_PUMP_PRES, roPumpDutyCyclePctSet, 0 ); state = RO_PUMP_CONTROL_TO_TARGET_PRESSURE_STATE; } - else if ( getTargetROPumpDutyCyclePCT() > 0.0F && ( PUMP_CONTROL_MODE_OPEN_LOOP == roPumpControlMode ) ) + else if ( ( getTargetROPumpDutyCyclePCT() > 0.0F ) && ( PUMP_CONTROL_MODE_OPEN_LOOP == roPumpControlMode ) ) { setFluidPumpPctToPWMDutyCycle( P12_PUMP, getTargetROPumpDutyCyclePCT() ); roPumpDutyCyclePctSet = getTargetROPumpDutyCyclePCT(); state = RO_PUMP_OPEN_LOOP_STATE; } // Control at set interval or shut off - if ( getTargetROPumpFlowRateMLPM() == 0.0F && ( PUMP_CONTROL_MODE_CLOSED_LOOP == roPumpControlMode ) ) + if ( ( getTargetROPumpFlowRateMLPM() == 0.0F ) && ( PUMP_CONTROL_MODE_CLOSED_LOOP == roPumpControlMode ) ) { signalROPumpHardStop(); } @@ -305,20 +308,20 @@ RO_PUMP_STATE_T state = RO_PUMP_CONTROL_TO_TARGET_PRESSURE_STATE; // Check if we are changing control - if ( getTargetROPumpFlowRateMLPM() > 0 && ( PUMP_CONTROL_MODE_CLOSED_LOOP == roPumpControlMode ) ) + if ( ( getTargetROPumpFlowRateMLPM() > 0 ) && ( PUMP_CONTROL_MODE_CLOSED_LOOP == roPumpControlMode ) ) { resetPIController( PI_CONTROLLER_ID_RO_PUMP_FLOW, roPumpDutyCyclePctSet, 0 ); state = RO_PUMP_CONTROL_TO_TARGET_FLOW_STATE; } - else if ( getTargetROPumpDutyCyclePCT() > 0.0F && ( PUMP_CONTROL_MODE_OPEN_LOOP == roPumpControlMode ) ) + else if ( ( getTargetROPumpDutyCyclePCT() > 0.0F ) && ( PUMP_CONTROL_MODE_OPEN_LOOP == roPumpControlMode ) ) { setFluidPumpPctToPWMDutyCycle( P12_PUMP, getTargetROPumpDutyCyclePCT() ); roPumpDutyCyclePctSet = getTargetROPumpDutyCyclePCT(); state = RO_PUMP_OPEN_LOOP_STATE; } // Control at set interval or shut off - if ( getTargetROPumpPressure() == 0.0F && ( PUMP_CONTROL_MODE_CLOSED_LOOP == roPumpControlMode ) ) + if ( ( getTargetROPumpPressure() == 0.0F ) && ( PUMP_CONTROL_MODE_CLOSED_LOOP == roPumpControlMode ) ) { signalROPumpHardStop(); } @@ -737,5 +740,4 @@ return result; } - /**@}*/ Index: firmware/App/Controllers/ROPump.h =================================================================== diff -u -r311c75cc5ac41b4b9ca4983df84e43af910f9be4 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Controllers/ROPump.h (.../ROPump.h) (revision 311c75cc5ac41b4b9ca4983df84e43af910f9be4) +++ firmware/App/Controllers/ROPump.h (.../ROPump.h) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -37,9 +37,6 @@ #define MAX_RO_PRESSURE_PSI 120.0F ///< Maximum allowed pressure that the RO pump can go to. #define MIN_RO_PRESSURE_PSI 10.0F ///< Minimum allowed pressure that the RO pump can go to. -#define ROP_FLOW_TO_PWM(flow) ( ROP_FLOW_TO_PWM_SLOPE * flow + ROP_FLOW_TO_PWM_INTERCEPT ) ///< PWM line equation for flow. -#define ROP_PRESSURE_TO_PWM(pres) ( ROP_PRESSURE_TO_PWM_SLOPE * pres + ROP_PRESSURE_TO_PWM_INTERCEPT ) ///< PWM line equation for pressure. - /// Enumeration of RO pump states. typedef enum ROPump_States { Fisheye: Tag 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff refers to a dead (removed) revision in file `firmware/App/Drivers/TemperatureSensor.c'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff refers to a dead (removed) revision in file `firmware/App/Drivers/TemperatureSensor.h'. Fisheye: No comparison available. Pass `N' to diff? Index: firmware/App/Modes/FPModeStandby.c =================================================================== diff -u -r94d93795b2a516b3bdd7fc7030eb5eac933bfcd0 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Modes/FPModeStandby.c (.../FPModeStandby.c) (revision 94d93795b2a516b3bdd7fc7030eb5eac933bfcd0) +++ firmware/App/Modes/FPModeStandby.c (.../FPModeStandby.c) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -141,9 +141,9 @@ return standbyState; } + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ - /**@}*/ Index: firmware/App/Modes/FlushConcentrate.c =================================================================== diff -u -r6dd382e3988fac2f9ee041b4738d67305e17a6a2 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Modes/FlushConcentrate.c (.../FlushConcentrate.c) (revision 6dd382e3988fac2f9ee041b4738d67305e17a6a2) +++ firmware/App/Modes/FlushConcentrate.c (.../FlushConcentrate.c) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -46,17 +46,19 @@ #define CONCENTRATE_FLUSH_VOLUME_THRESHOLD CONCENTRATE_FLUSH_VOLUME_THRESHOLD_ML * CONCENTRATE_FLUSH_VOLUME_THRESHOLD_PCT ///< alarm threshold for integrated volume // ********** private data ********** -/// Multiplier to convert flow (mL/min) into volume (mL) for period of general task interval. -static const F32 CONCENTRATE_FLOW_INTEGRATOR = 1.0F / (F32)( SEC_PER_MIN * ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ); -static FP_CONC_FLUSH_STATE_T concentrateFlushState; ///< Currently active Concentrate flush state. -static U32 concentrateFlushDataPublicationTimerCounter; ///< Used to schedule Concentrate flush data publication to CAN bus. -static OVERRIDE_U32_T concentrateFlushDataPublishInterval; ///< Concentrate Flush mode data publish interval. -static OVERRIDE_U32_T concentrateFlushTimeout; ///< Concentrate Flush timeout value -static U32 concentrateFlushTimer; ///< Concentrate Flush timeout timer -static BOOL pendingStartConcentrateFlushRequest; ///< signal to start flushing. -static BOOL isFlushComplete; ///< Concentrate Flush complete BOOL -static F32 cumulativeConcentrateVolume_mL; +/// + +static const F32 CONCENTRATE_FLOW_INTEGRATOR = 1.0F / (F32)( SEC_PER_MIN * ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ); ///< Multiplier to convert flow (mL/min) into volume (mL) for period of general task interval. +static FP_CONC_FLUSH_STATE_T concentrateFlushState; ///< Currently active Concentrate flush state. +static U32 concentrateFlushDataPublicationTimerCounter; ///< Used to schedule Concentrate flush data publication to CAN bus. +static OVERRIDE_U32_T concentrateFlushDataPublishInterval; ///< Concentrate Flush mode data publish interval. +static OVERRIDE_U32_T concentrateFlushTimeout; ///< Concentrate Flush timeout value +static U32 concentrateFlushTimer; ///< Concentrate Flush timeout timer +static BOOL pendingStartConcentrateFlushRequest; ///< signal to start flushing. +static BOOL isFlushComplete; ///< Concentrate Flush complete BOOL +static F32 cumulativeConcentrateVolume_mL; ///< cumulative concentrate volume for integrated volume + // ********** private function prototypes ********** static void publishConcentrateFlushData( void ); @@ -149,7 +151,6 @@ if( TRUE == didTimeout( concentrateFlushTimer, getConcentrateFlushTimeout() ) ) { - isVolumeOutOfRange = ( cumulativeConcentrateVolume_mL >= CONCENTRATE_FLUSH_VOLUME_THRESHOLD ? TRUE : FALSE ); if( FALSE == isVolumeOutOfRange ) @@ -184,6 +185,7 @@ pendingStartConcentrateFlushRequest = FALSE; state = CONC_FLUSH_IN_PROGRESS; } + return state; } @@ -223,7 +225,6 @@ break; case CONC_FLUSH_PAUSED: - // Stop pumps and close only if we alarm ( pause ) during flush. if ( FALSE == isConcentrateFlushComplete() ) { @@ -257,14 +258,18 @@ * The signalStartConcentrateFlush function signals the FP to start Concentrate flush. * @details \b Inputs: none * @details \b Outputs: pendingStartConcentrateFlushRequest - * @return the current state of Concentrate flush + * @return TRUE if the start signal is set, FALSE if not *************************************************************************/ -void signalStartConcentrateFlush( void ) +BOOL signalStartConcentrateFlush( void ) { + BOOL result = FALSE; if ( CONC_FLUSH_PAUSED == getCurrentConcentrateFlushState() ) { + result = TRUE; pendingStartConcentrateFlushRequest = TRUE; } + + return result; } /*********************************************************************//** @@ -286,7 +291,7 @@ * The getCurrentConcentrateFlushState function returns the current state of * Concentrate flush. * @details \b Inputs: concentrateFlushState - * @details \b Outputs: concentrateFlushState + * @details \b Outputs: none * @return the current state of Concentrate flush *************************************************************************/ FP_CONC_FLUSH_STATE_T getCurrentConcentrateFlushState( void ) @@ -297,9 +302,9 @@ /*********************************************************************//** * @brief * The isConcentrateFlushComplete function returns isConcentrateFlushComplete. - * @details \b Inputs: none + * @details \b Inputs: isFlushComplete * @details \b Outputs: none - * @return the complete boolean for Concentrate flush. + * @return TRUE if concentrate flush is complete, FALSE if not. *************************************************************************/ BOOL isConcentrateFlushComplete( void ) { @@ -312,7 +317,7 @@ * mode data publish interval. * @details \b Inputs: ConcentrateFlushTimeOut * @details \b Outputs: none - * @return the timeout timer for Concentrate flush. + * @return the concentrate flush timeout period in ms. *************************************************************************/ static U32 getConcentrateFlushTimeout( void ) { @@ -342,7 +347,7 @@ * mode data at defined interval. * @details \b Inputs: concentrateFlushDataPublicationTimerCounter * @details \b Outputs: fp Concentrate flush data broadcast message sent - * @details \b Message \Sent: MSG_ID_FP_CONCENTRATE_FLUSH_DATA to publish the + * @details \b Message \b Sent: MSG_ID_FP_CONCENTRATE_FLUSH_DATA to publish the * Concentrate flush mode data. * @return none *************************************************************************/ Index: firmware/App/Modes/FlushConcentrate.h =================================================================== diff -u -r8d272582cbd2cb5fc0c6af0fead2867ce02658b0 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Modes/FlushConcentrate.h (.../FlushConcentrate.h) (revision 8d272582cbd2cb5fc0c6af0fead2867ce02658b0) +++ firmware/App/Modes/FlushConcentrate.h (.../FlushConcentrate.h) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -43,7 +43,7 @@ U32 transitionToConcentrateFlush( void ); // Transition to Concentrate Flush void execConcentrateFlush( void ); // Execute the Concentrate Flush state machine BOOL isConcentrateFlushComplete( void ); // returns if flush is complete -void signalStartConcentrateFlush( void ); // signal to start flush +BOOL signalStartConcentrateFlush( void ); // signal to start flush void resetConcentrateFlushSignals( void ); // reset signals for flush FP_CONC_FLUSH_STATE_T getCurrentConcentrateFlushState( void ); // Get the current state of the Concentrate Flush @@ -52,5 +52,4 @@ BOOL testConcentrateFlushTimerOverride( MESSAGE_T *message ); /**@}*/ - #endif Index: firmware/App/Modes/FlushFilter.c =================================================================== diff -u -r6dd382e3988fac2f9ee041b4738d67305e17a6a2 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Modes/FlushFilter.c (.../FlushFilter.c) (revision 6dd382e3988fac2f9ee041b4738d67305e17a6a2) +++ firmware/App/Modes/FlushFilter.c (.../FlushFilter.c) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -119,7 +119,7 @@ /*********************************************************************//** * @brief * The handleFilterFlushProgressState handles the in progress state of filter flush - * @details \b Inputs: none + * @details \b Inputs: filterFlushTimer * @details \b Outputs: none * @return the next state of filter flush state *************************************************************************/ @@ -150,14 +150,15 @@ state = FILTER_FLUSH_PAUSED; } } + return state; } /*********************************************************************//** * @brief * The handleFilterFlushProgressState handles the in progress state of filter flush - * @details \b Inputs: none - * @details \b Outputs: none + * @details \b Inputs: pendingStartFilterFlushRequest + * @details \b Outputs: pendingStartFilterFlushRequest, isFlushComplete * @return the next state of filter flush state *************************************************************************/ static FP_FILTER_FLUSH_STATE_T handleFilterFlushPausedState( void ) @@ -170,6 +171,7 @@ pendingStartFilterFlushRequest = FALSE; state = FILTER_FLUSH_IN_PROGRESS; } + return state; } @@ -227,7 +229,7 @@ /*********************************************************************//** * @brief * The signalStartFilterFlush function signals the FP to start filter flush. - * @details \b Inputs: none + * @details \b Inputs: filterFlushState * @details \b Outputs: pendingStartFilterFlushRequest * @return none *************************************************************************/ @@ -257,8 +259,8 @@ * @brief * The getCurrentFilterFlushState function returns the current state of * filter flush. - * @details \b Inputs: filterFlushState - * @details \b Outputs: filterFlushState + * @details \b Inputs: none + * @details \b Outputs: none * @return the current state of filter flush *************************************************************************/ FP_FILTER_FLUSH_STATE_T getCurrentFilterFlushState( void ) @@ -269,16 +271,15 @@ /*********************************************************************//** * @brief * The isFilterFlushComplete function returns isFilterFlushComplete. - * @details \b Inputs: none + * @details \b Inputs: isFlushComplete * @details \b Outputs: none - * @return the complete boolean for filter flush. + * @return TRUE if filter flush is complete, FALSE if not. *************************************************************************/ BOOL isFilterFlushComplete( void ) { return isFlushComplete; } - /*********************************************************************//** * @brief * The getFilterFlushTimeout function gets the generate water @@ -315,7 +316,7 @@ * mode data at defined interval. * @details \b Inputs: filterFlushDataPublicationTimerCounter * @details \b Outputs: fp filter flush data broadcast message sent - * @details \b Message \Sent: MSG_ID_FP_GEN_WATER_MODE_DATA to publish the + * @details \b Message \b Sent: MSG_ID_FP_FILTER_FLUSH_DATA to publish the * filter flush mode data. * @return none *************************************************************************/ Index: firmware/App/Modes/FlushPermeate.c =================================================================== diff -u -r6dd382e3988fac2f9ee041b4738d67305e17a6a2 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Modes/FlushPermeate.c (.../FlushPermeate.c) (revision 6dd382e3988fac2f9ee041b4738d67305e17a6a2) +++ firmware/App/Modes/FlushPermeate.c (.../FlushPermeate.c) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -134,8 +134,8 @@ /*********************************************************************//** * @brief * The handlePermeateFlushProgressState handles the in progress state of Permeate flush - * @details \b Inputs: none - * @details \b Outputs: none + * @details \b Inputs: permeateFlushTimer, permeateFlushAlarmTimer + * @details \b Outputs: isFlushComplete * @return the next state of Permeate flush state *************************************************************************/ static FP_PERM_FLUSH_STATE_T handlePermeateFlushProgressState( void ) @@ -167,14 +167,15 @@ } } + return state; } /*********************************************************************//** * @brief * The handlePermeateFlushProgressState handles the in progress state of Permeate flush - * @details \b Inputs: none - * @details \b Outputs: none + * @details \b Inputs: pendingStartPermeateFlushRequest + * @details \b Outputs: isFlushComplete * @return the next state of Permeate flush state *************************************************************************/ static FP_PERM_FLUSH_STATE_T handlePermeateFlushPausedState( void ) @@ -186,6 +187,7 @@ isFlushComplete = FALSE; state = PERM_FLUSH_IN_PROGRESS; } + return state; } @@ -195,6 +197,7 @@ * for the state transition in Permeate flush mode. * @details Inputs: Valve states, Pump speed * @details Outputs: Actuate valves, pumps as desired. + * @details \b Alarm: ALARM_ID_FP_SOFTWARE_FAULT if in invalid flush transition * @param state Permeate flush state enum * @return none *************************************************************************/ @@ -260,7 +263,7 @@ * The signalStartPermeateFlush function signals the FP to start Permeate flush. * @details \b Inputs: none * @details \b Outputs: pendingStartPermeateFlushRequest - * @return the current state of Permeate flush + * @return none *************************************************************************/ void signalStartPermeateFlush( void ) { @@ -289,7 +292,7 @@ * The getCurrentPermeateFlushState function returns the current state of * Permeate flush. * @details \b Inputs: permeateFlushState - * @details \b Outputs: permeateFlushState + * @details \b Outputs: none * @return the current state of Permeate flush *************************************************************************/ FP_PERM_FLUSH_STATE_T getCurrentPermeateFlushState( void ) @@ -299,10 +302,11 @@ /*********************************************************************//** * @brief - * The isPermeateFlushComplete function returns isPermeateFlushComplete. - * @details \b Inputs: none + * The isPermeateFlushComplete function returns the state of completeness + * of Permeate Flush. + * @details \b Inputs: isFlushComplete * @details \b Outputs: none - * @return the complete boolean for Permeate flush. + * @return TRUE if permeate flush is complete, FALSE if not. *************************************************************************/ BOOL isPermeateFlushComplete( void ) { Index: firmware/App/Modes/ModeGenPermeate.c =================================================================== diff -u -r6dd382e3988fac2f9ee041b4738d67305e17a6a2 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Modes/ModeGenPermeate.c (.../ModeGenPermeate.c) (revision 6dd382e3988fac2f9ee041b4738d67305e17a6a2) +++ firmware/App/Modes/ModeGenPermeate.c (.../ModeGenPermeate.c) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -37,17 +37,15 @@ // ********** private definitions ********** -#define PRE_GEN_PERMEATE_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the gen permeate mode data published. -#define GEN_PERMEATE_BOOST_PUMP_TGT_PSI 25 ///< Pressure target in PSI for the boost pump during generate permeate mode. -#define GEN_PERMEATE_RO_PUMP_TGT_ML 700 ///< Flow target in ml/min for the ro pump during generate permeate mode. +#define PRE_GEN_PERMEATE_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the gen permeate mode data published. +#define GEN_PERMEATE_BOOST_PUMP_TGT_PSI 25.0F ///< Pressure target in PSI for the boost pump during generate permeate mode. +#define GEN_PERMEATE_RO_PUMP_TGT_ML 700 ///< Flow target in ml/min for the ro pump during generate permeate mode. - // ********** private data ********** -static FP_GENP_MODE_STATE_T genPermeateState; ///< Currently active generate Permeate state. -static U32 genPermeateDataPublicationTimerCounter; ///< Used to schedule generate Permeate data publication to CAN bus. -static OVERRIDE_U32_T genPermeateDataPublishInterval; ///< Generate permeate mode data publish interval. -static BOOL pendingStartGenRequest; ///< Flag indicating DD has requested FP start the generate permeate. +static FP_GENP_MODE_STATE_T genPermeateState; ///< Currently active generate Permeate state. +static U32 genPermeateDataPublicationTimerCounter; ///< Used to schedule generate Permeate data publication to CAN bus. +static OVERRIDE_U32_T genPermeateDataPublishInterval; ///< Generate permeate mode data publish interval. // ********** private function prototypes ********** @@ -72,14 +70,13 @@ genPermeateDataPublishInterval.ovInitData = 0; genPermeateDataPublishInterval.override = OVERRIDE_RESET; genPermeateDataPublicationTimerCounter = 0; - pendingStartGenRequest = 0; } /*********************************************************************//** * @brief * The transitionToGenPermeateMode function prepares for transition to gen * permeate mode. - * @details \b Inputs: none + * @details \b Inputs: genPermeateState * @details \b Outputs: none * @return initial state *************************************************************************/ @@ -90,14 +87,15 @@ setModeGenPTransition( genPermeateState ); startPermeateTankControl(); setROPumpTargetFlowRateMLPM( GEN_PERMEATE_RO_PUMP_TGT_ML ); + return genPermeateState; } /*********************************************************************//** * @brief * The execGenPermeateMode function executes the Gen Permeate mode state machine. - * @details \b Inputs: none - * @details \b Outputs: Gen Permeate mode state machine executed + * @details \b Inputs: genPermeateState + * @details \b Outputs: genPermeateState * @details \b Alarm: ALARM_ID_FP_SOFTWARE_FAULT when wrong gen Permeate state invoked. * @return current state. *************************************************************************/ @@ -222,19 +220,6 @@ /*********************************************************************//** * @brief - * The getGenPermeateRequest function returns the current state of the - * gen permeate mode. - * @details \b Inputs: pendingStartGenRequest - * @details \b Outputs: none - * @return the current state of gen permeate request - *************************************************************************/ -BOOL getGenPermeateRequest( void ) -{ - return pendingStartGenRequest; -} - -/*********************************************************************//** - * @brief * The getGenPermeateDataPublishInterval function gets the generate water * mode data publish interval. * @details \b Inputs: genPermeateDataPublishInterval @@ -276,14 +261,13 @@ /*********************************************************************//** * @brief * The requestGenWaterStart function handles an DD request to start (go to gen permeate mode). - * @details \b Inputs: preGenWState - * @details \b Outputs: pendingStartGenRequest + * @details \b Inputs: none + * @details \b Outputs: none * @return TRUE if request accepted, FALSE if not. *************************************************************************/ BOOL requestGenWaterStart( void ) { BOOL result = TRUE; - pendingStartGenRequest = TRUE; requestNewOperationMode( FP_MODE_GENP ); return result; @@ -293,13 +277,12 @@ * @brief * The requestGenWaterStop function handles an DD request to stop (go to standby mode). * @details \b Inputs: none - * @details \b Outputs: pendingStartGenRequest + * @details \b Outputs: none * @return TRUE if request accepted, FALSE if not. *************************************************************************/ BOOL requestGenWaterStop( void ) { BOOL result = TRUE; - pendingStartGenRequest = FALSE; signalROPumpHardStop(); if ( TRUE == isBoostPumpInstalled() ) Index: firmware/App/Modes/ModeGenPermeate.h =================================================================== diff -u -r8d272582cbd2cb5fc0c6af0fead2867ce02658b0 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Modes/ModeGenPermeate.h (.../ModeGenPermeate.h) (revision 8d272582cbd2cb5fc0c6af0fead2867ce02658b0) +++ firmware/App/Modes/ModeGenPermeate.h (.../ModeGenPermeate.h) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -43,18 +43,13 @@ void initGenPermeateMode( void ); // Initialize this gen permeate mode unit U32 transitionToGenPermeateMode( void ); // Transition to gen permeate mode U32 execGenPermeateMode( void ); // Execute the gen permeate mode state machine (call from OperationModes) -BOOL requestGenWaterStart( void ); -BOOL requestGenWaterStop( void ); -F32 getGenPermeateRODutyCycle( void ); -void setGenPermeateRODutyCycle( F32 duty); -F32 getGenPermeateBoostDutyCycle( void ); -void setGenPermeateBoostDutyCycle( F32 duty); +BOOL requestGenWaterStart( void ); // Request to start gen water and transition modes +BOOL requestGenWaterStop( void ); // Request to stop gen water and transition. -FP_GENP_MODE_STATE_T getCurrentGenPermeateState( void ); // Get the current state of the gen water mode +FP_GENP_MODE_STATE_T getCurrentGenPermeateState( void ); // Get the current state of the gen water mode -BOOL testGenPermeateDataPublishIntervalOverride( MESSAGE_T *message ); // override broadcast interval for gen permeate +BOOL testGenPermeateDataPublishIntervalOverride( MESSAGE_T *message ); // override broadcast interval for gen permeate /**@}*/ - #endif Index: firmware/App/Monitors/Conductivity.c =================================================================== diff -u -r94d93795b2a516b3bdd7fc7030eb5eac933bfcd0 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision 94d93795b2a516b3bdd7fc7030eb5eac933bfcd0) +++ firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -20,7 +20,6 @@ #include "Conductivity.h" #include "ConductivitySensor.h" -#include "FPOperationModes.h" #include "MessageSupport.h" #include "Messaging.h" #include "TaskPriority.h" Index: firmware/App/Monitors/Temperature.c =================================================================== diff -u -r6dd382e3988fac2f9ee041b4738d67305e17a6a2 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Monitors/Temperature.c (.../Temperature.c) (revision 6dd382e3988fac2f9ee041b4738d67305e17a6a2) +++ firmware/App/Monitors/Temperature.c (.../Temperature.c) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -52,9 +52,11 @@ *************************************************************************/ void initTemperature( void ) { - - // Initialize the temperature sensors - initTemperatureSensors(); + dataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; + tempSensorsPublishInterval.data = TEMP_SENSORS_DATA_PUBLISH_INTERVAL; + tempSensorsPublishInterval.ovData = TEMP_SENSORS_DATA_PUBLISH_INTERVAL; + tempSensorsPublishInterval.ovInitData = 0; + tempSensorsPublishInterval.override = OVERRIDE_RESET; } /*********************************************************************//** Index: firmware/App/Monitors/Temperature.h =================================================================== diff -u -r6dd382e3988fac2f9ee041b4738d67305e17a6a2 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Monitors/Temperature.h (.../Temperature.h) (revision 6dd382e3988fac2f9ee041b4738d67305e17a6a2) +++ firmware/App/Monitors/Temperature.h (.../Temperature.h) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -19,7 +19,6 @@ #define __TEMPERATURE_H__ #include "FPCommon.h" -#include "TemperatureSensor.h" /** * @defgroup Temperature Temperature Index: firmware/App/Monitors/WaterQualityMonitor.c =================================================================== diff -u -r6dd382e3988fac2f9ee041b4738d67305e17a6a2 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Monitors/WaterQualityMonitor.c (.../WaterQualityMonitor.c) (revision 6dd382e3988fac2f9ee041b4738d67305e17a6a2) +++ firmware/App/Monitors/WaterQualityMonitor.c (.../WaterQualityMonitor.c) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -181,7 +181,7 @@ *************************************************************************/ void checkInletTemperatures( void ) { - F32 temperatureP10 = getTemperatureValue( P10_TEMP ); + F32 temperatureP10 = getFilteredConductivitySensorTemperature( P9_COND ); F32 temperatureM1 = getFilteredPressureSensorTemperature( M1_PRES ); BOOL isTempOutOfLowRange = FALSE; BOOL isTempOutOfHighRange = FALSE; Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r6dd382e3988fac2f9ee041b4738d67305e17a6a2 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 6dd382e3988fac2f9ee041b4738d67305e17a6a2) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -98,7 +98,6 @@ { MSG_ID_FP_CONDUCTIVITY_TEMP_OVERRIDE_REQUEST, &testConductivitySensorTemperatureReadingsOverride }, { MSG_ID_FP_CONDUCTIVITY_READ_COUNT_OVERRIDE_REQUEST, &testConductivitySensorReadCounterOverride }, { MSG_ID_FP_CONDUCTIVITY_ERROR_COUNT_OVERRIDE_REQUEST, &testConductivitySensorErrorCounterOverride }, -{ MSG_ID_FP_TEMPERATURE_OVERRIDE_REQUEST, &testMeasuredTemperatureOverride }, { MSG_ID_DD_FP_START_STOP_CMD_REQUEST, &handleGenerateWaterRequestMsg }, { MSG_ID_FP_PRE_GEN_PUBLISH_INTERVAL_OVERRIDE_REQUEST, &testPreGenDataPublishIntervalOverride }, { MSG_ID_FP_SET_OPERATION_MODE_REQUEST, &testSetOperationMode }, Index: firmware/source/sys_main.c =================================================================== diff -u -r6dd382e3988fac2f9ee041b4738d67305e17a6a2 -r2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff --- firmware/source/sys_main.c (.../sys_main.c) (revision 6dd382e3988fac2f9ee041b4738d67305e17a6a2) +++ firmware/source/sys_main.c (.../sys_main.c) (revision 2652d50bbc5e78ed6fe3ad9ccbca0be6f802f1ff) @@ -191,7 +191,6 @@ initFluidPump(); initInternalADC(); initPressureSensor(); - initTemperatureSensors(); // Controllers initROPump();