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 *************************************************************************/