Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r00b244580f01f3cbd1b7d2d5a14ee61675bf4642 -r75c1e08603496809a6554b7540c9b78a66cb3733 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 00b244580f01f3cbd1b7d2d5a14ee61675bf4642) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 75c1e08603496809a6554b7540c9b78a66cb3733) @@ -68,13 +68,15 @@ 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. // ********** private function prototypes ********** static BOOL areInletWaterConditionsAlarmsActive( void ); +static void checkDGInstitutionalValuesReceived( void ); static DG_STANDBY_MODE_STATE_T handleStandbyIdleState( void ); static DG_STANDBY_MODE_STATE_T handleStandbyFlushFilterState( void ); @@ -90,7 +92,7 @@ * flushFilterRequest, endSampleWaterRequest, waterSampleStartTime, * filterFlushStartTime, filterFlushPublishTimerCounter, pendingStartDGRequest, * pendingStartDGHeatDisinfectActiveCoolRequest, - * pendingStartDGROPermeateSampleRequest + * pendingStartDGROPermeateSampleRequest, haveDGInstitutionalValuesBeenRcvd * @return none *************************************************************************/ void initStandbyMode( void ) @@ -109,6 +111,7 @@ pendingStartDGChemicalDisinfectRequest = FALSE; pendingStartDGHeatDisinfectActiveCoolRequest = FALSE; pendingStartDGROPermeateSampleRequest = FALSE; + haveDGInstitutionalValuesBeenRcvd = FALSE; // Reset the heaters efficiency for another treatment resetHeatersEstimationGain(); @@ -171,6 +174,8 @@ standbyState = DG_STANDBY_MODE_STATE_PAUSE; } + checkDGInstitutionalValuesReceived(); + // execute current Standby state switch ( standbyState ) { @@ -233,6 +238,26 @@ /*********************************************************************//** * @brief + * The checkDGInstitutionalValuesReceived function requests the DG institutional + * values from HD if HD is in standby and the values have not been received yet. + * @details Inputs: haveDGInstitutionalValuesBeenRcvd + * @details Outputs: None + * @return none + *************************************************************************/ +static void checkDGInstitutionalValuesReceived( void ) +{ + HD_MODE_SUB_MODE_T mode; + + getHDOperationMode( &mode ); + + if ( (mode.hdMode >= MODE_STAN ) && ( FALSE == haveDGInstitutionalValuesBeenRcvd ) ) + { + sendDGInstitutionalValuesRequestToHD(); + } +} + +/*********************************************************************//** + * @brief * The handleStandbyIdleState function executes the idle state of the * standby mode state machine. * @details Inputs: pendingSampleWaterRequest, pendingStartDGRequest, @@ -264,9 +289,6 @@ { pendingStartDGRequest = FALSE; signalSyncToHD(); - // About to start a treatment reset the chemical bottles volumes (regardless whether the user has inserted new bottles) - resetChemicalUsedVolumeML( BICARB ); - resetChemicalUsedVolumeML( ACID ); requestNewOperationMode( DG_MODE_GENE ); } else if ( TRUE == pendingStartDGFlushRequest ) @@ -492,7 +514,7 @@ { BOOL result = FALSE; - if ( DG_STANDBY_MODE_STATE_IDLE == standbyState ) + if ( ( DG_MODE_STAN == getCurrentOperationMode() ) && ( DG_STANDBY_MODE_STATE_IDLE == standbyState ) ) { result = TRUE; pendingStartDGRequest = TRUE; @@ -888,7 +910,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 *************************************************************************/