Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -rc4f3105da2ed8a7c40950588b54b79067185a3ad -rfab0257d4913c021698418277e742c2a61e0368e --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision c4f3105da2ed8a7c40950588b54b79067185a3ad) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision fab0257d4913c021698418277e742c2a61e0368e) @@ -66,6 +66,7 @@ static BOOL pendingStartDGChemicalDisinfectRequest; ///< Flag indicating HD has requested DG start chemical disinfect. 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 OVERRIDE_U32_T filterFlushTimePeriod = { FILTER_FLUSH_TIME_MS, FILTER_FLUSH_TIME_MS, 0, 0 }; ///< Filter flush time period in ms. @@ -87,7 +88,8 @@ * @details Outputs: standbyState, stopSampleWaterRequest, startSampleWaterRequest, * flushFilterRequest, endSampleWaterRequest, waterSampleStartTime, * filterFlushStartTime, filterFlushPublishTimerCounter, pendingStartDGRequest, - * pendingStartDGHeatDisinfectActiveCoolRequest + * pendingStartDGHeatDisinfectActiveCoolRequest, + * pendingStartDGROPermeateSampleRequest * @return none *************************************************************************/ void initStandbyMode( void ) @@ -105,6 +107,7 @@ pendingStartDGHeatDisinfectRequest = FALSE; pendingStartDGChemicalDisinfectRequest = FALSE; pendingStartDGHeatDisinfectActiveCoolRequest = FALSE; + pendingStartDGROPermeateSampleRequest = FALSE; // Reset the heaters efficiency for another treatment resetHeatersEstimationGain(); @@ -282,6 +285,11 @@ pendingStartDGChemicalDisinfectFlushRequest = FALSE; requestNewOperationMode( DG_MODE_CHFL ); } + else if ( TRUE == pendingStartDGROPermeateSampleRequest ) + { + pendingStartDGROPermeateSampleRequest = FALSE; + requestNewOperationMode( DG_MODE_ROPS ); + } return state; } @@ -699,7 +707,7 @@ { cmdResponse.rejected = TRUE; cmdResponse.rejectCode = REQUEST_REJECT_REASON_DG_DIALYSATE_CAP_OPEN; - } + } else { pendingStartDGChemicalDisinfectRequest = TRUE; @@ -768,6 +776,59 @@ /*********************************************************************//** * @brief + * The startDGROPermeateSample function starts RO permeate sample mode. + * @details Inputs: standbyState + * @details Outputs: pendingStartDGChemicalDisinfectFlushRequest + * @return: TRUE if the switch was successful + *************************************************************************/ +BOOL startDGROPermeateSample( void ) +{ + BOOL status = FALSE; + DG_CMD_RESPONSE_T cmdResponse; + + cmdResponse.commandID = DG_CMD_START_RO_PERMEATE_SAMPLE; + cmdResponse.rejected = FALSE; + cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_NONE; + + // If DG is in standby mode and the standby mode is in Idle, request RO permeate sample + if ( ( DG_MODE_STAN == getCurrentOperationMode() ) && ( DG_STANDBY_MODE_STATE_IDLE == standbyState ) ) + { + OPN_CLS_STATE_T concCap = getSwitchStatus( CONCENTRATE_CAP ); + OPN_CLS_STATE_T diaCap = getSwitchStatus( DIALYSATE_CAP ); + +#ifndef _RELEASE_ + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_CAPS_MONITOR ) ) + { + concCap = STATE_CLOSED; + diaCap = STATE_CLOSED; + } +#endif + + if ( ( STATE_OPEN == concCap ) || ( STATE_OPEN == diaCap ) ) + { + cmdResponse.rejected = TRUE; + cmdResponse.rejectCode = ( STATE_OPEN == getSwitchStatus( DIALYSATE_CAP ) ? REQUEST_REJECT_REASON_DG_DIALYSATE_CAP_OPEN : + REQUEST_REJECT_REASON_DG_CONCENTRATE_CAP_OPEN ); + } + else + { + pendingStartDGROPermeateSampleRequest = TRUE; + status = TRUE; + } + } + else + { + cmdResponse.rejected = TRUE; + cmdResponse.rejectCode = REQUEST_REJECT_REASON_DG_NOT_IN_STANDBY_IDLE_STATE; + } + + sendCommandResponseMsg( &cmdResponse ); + + return status; +} + +/*********************************************************************//** + * @brief * The getCurrentStandbyState function returns the current state of standby mode. * @details Inputs: standbyState * @details Outputs: none