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() )