Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r610d25848e5127416f412bcdb5629bbaa1a92c75 -r80a1b6065901ac7a9516a8be17d3db5e4e589455 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 610d25848e5127416f412bcdb5629bbaa1a92c75) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 80a1b6065901ac7a9516a8be17d3db5e4e589455) @@ -68,6 +68,7 @@ static BOOL pendingStartDGHeatDisinfectActiveCoolRequest; ///< Flag indicating HD has requested DG start heat disinfect active cool. static BOOL pendingStartDGChemicalDisinfectFlushRequest; ///< Flag indicating HD has requested DG start chemical disinfect flush. static BOOL pendingStartDGROPermeateSampleRequest; ///< Flag indicating HD has requested DG start RO permeate sample. +static BOOL haveDGInstitutionalValuesBeenRcvd; ///< Flag indicating DG has received DG institutional values. static OVERRIDE_U32_T filterFlushTimePeriod = { FILTER_FLUSH_TIME_MS, FILTER_FLUSH_TIME_MS, 0, 0 }; ///< Filter flush time period in ms. @@ -90,7 +91,7 @@ * flushFilterRequest, endSampleWaterRequest, waterSampleStartTime, * filterFlushStartTime, filterFlushPublishTimerCounter, pendingStartDGRequest, * pendingStartDGHeatDisinfectActiveCoolRequest, - * pendingStartDGROPermeateSampleRequest + * pendingStartDGROPermeateSampleRequest, haveDGInstitutionalValuesBeenRcvd * @return none *************************************************************************/ void initStandbyMode( void ) @@ -109,6 +110,7 @@ pendingStartDGChemicalDisinfectRequest = FALSE; pendingStartDGHeatDisinfectActiveCoolRequest = FALSE; pendingStartDGROPermeateSampleRequest = FALSE; + haveDGInstitutionalValuesBeenRcvd = FALSE; // Reset the heaters efficiency for another treatment resetHeatersEstimationGain(); @@ -262,12 +264,18 @@ } else if ( TRUE == pendingStartDGRequest ) { - pendingStartDGRequest = FALSE; - signalSyncToHD(); - // Request the DG institutional values from HD in case DG was not restarted so DG did not request - // the institutional values at POST. Request again here for safety. - sendDGInstitutionalValuesRequestToHD(); - requestNewOperationMode( DG_MODE_GENE ); + if ( FALSE == haveDGInstitutionalValuesBeenRcvd ) + { + signalSyncToHD(); + // Request the DG institutional values from HD in case DG was not restarted so DG did not request + // the institutional values at POST. Request again here for safety. + sendDGInstitutionalValuesRequestToHD(); + } + else + { + pendingStartDGRequest = FALSE; + requestNewOperationMode( DG_MODE_GENE ); + } } else if ( TRUE == pendingStartDGFlushRequest ) { @@ -888,7 +896,20 @@ return standbyState; } +/*********************************************************************//** + * @brief + * The getDGInstitutionalValues function sets the signal DG institutional + * values have been received. + * @details Inputs: none + * @details Outputs: haveDGInstitutionalValuesBeenRcvd + * @return none + *************************************************************************/ +void signalDGInstituionalValuesReceived( void ) +{ + haveDGInstitutionalValuesBeenRcvd = TRUE; +} + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/