Index: firmware/App/Modes/ModeWaterGen.c =================================================================== diff -u -r28b6e281605c1a944c982d0ec7dcdb6f28aac82b -r12c4f28723f9af89ae693df771039da1bc7ffc80 --- firmware/App/Modes/ModeWaterGen.c (.../ModeWaterGen.c) (revision 28b6e281605c1a944c982d0ec7dcdb6f28aac82b) +++ firmware/App/Modes/ModeWaterGen.c (.../ModeWaterGen.c) (revision 12c4f28723f9af89ae693df771039da1bc7ffc80) @@ -15,10 +15,12 @@ * ***************************************************************************/ -#include "ModeWaterGen.h" + #include "DDInterface.h" #include "Level.h" #include "ModeStandby.h" +#include "ModeWaterGen.h" +#include "ModeWaterPreGen.h" #include "MessageSupport.h" #include "Messaging.h" #include "OperationModes.h" @@ -42,6 +44,7 @@ static U32 genWaterDataPublicationTimerCounter; ///< Used to schedule generate water data publication to CAN bus. static OVERRIDE_U32_T genWaterDataPublishInterval; ///< Generate water mode data publish interval. static U32 stateDelayTime; ///< Time stamp to track delay before valve switch. +static U32 pendingStartGenRequest; ///< Flag indicating DD has requested RO start the generate permeate. // ********** private function prototypes ********** @@ -300,7 +303,43 @@ } } +/*********************************************************************//** + * @brief + * The requestGenWaterStart function handles an DD request to start (go to gen permeate mode). + * @details \b Inputs: preGenWState + * @details \b Outputs: pendingStartGenRequest + * @return TRUE if request accepted, FALSE if not. + *************************************************************************/ +BOOL requestGenWaterStart( void ) +{ + BOOL result = FALSE; + if ( RO_PRE_GENW_STATE_COMPLETE == getCurrentPreGenWState() ) + { + result = TRUE; + pendingStartGenRequest = TRUE; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The requestGenWaterStop function handles an DD request to stop (go to standby mode). + * @details \b Inputs: none + * @details \b Outputs: pendingStartGenRequest + * @return TRUE if request accepted, FALSE if not. + *************************************************************************/ +BOOL requestGenWaterStop( void ) +{ + BOOL result = TRUE; + pendingStartGenRequest = FALSE; + requestNewOperationMode( RO_MODE_STAN ); + + return result; +} + + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/