Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -rd325999b7b3ea03b7e294cb8a0b97df93812fbe9 -r79b494c344417ba6865db01ad5f456e439bec1b2 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision d325999b7b3ea03b7e294cb8a0b97df93812fbe9) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 79b494c344417ba6865db01ad5f456e439bec1b2) @@ -497,6 +497,29 @@ /*********************************************************************//** * @brief + * The signalAbortWaterSampling function handles an HD request to abort water + * sampling (return to standby idle state). + * @details Inputs: none + * @details Outputs: standby mode variable initialized + * @return TRUE if request accepted, FALSE if not + *************************************************************************/ +BOOL signalAbortWaterSampling( void ) +{ + BOOL result = FALSE; + + if ( ( DG_MODE_STAN == getCurrentOperationMode() ) && ( standbyState != DG_STANDBY_MODE_STATE_IDLE ) ) + { + result = TRUE; + initStandbyMode(); + setValveState( VSP, VALVE_STATE_CLOSED ); + setValveState( VPI, VALVE_STATE_CLOSED ); + } + + return result; +} + +/*********************************************************************//** + * @brief * The startDGFlush function starts DG flush mode. * @details Inputs: standbyState * @details Outputs: none Index: firmware/App/Modes/ModeStandby.h =================================================================== diff -u -rd325999b7b3ea03b7e294cb8a0b97df93812fbe9 -r79b494c344417ba6865db01ad5f456e439bec1b2 --- firmware/App/Modes/ModeStandby.h (.../ModeStandby.h) (revision d325999b7b3ea03b7e294cb8a0b97df93812fbe9) +++ firmware/App/Modes/ModeStandby.h (.../ModeStandby.h) (revision 79b494c344417ba6865db01ad5f456e439bec1b2) @@ -34,31 +34,32 @@ /// Standby mode data structure typedef struct { - U32 timeout; ///< Timeout. - U32 countdown; ///< Count down. + U32 timeout; ///< Timeout. + U32 countdown; ///< Count down. } STANDBY_MODE_DATA_T; // ********** public function prototypes ********** -void initStandbyMode( void ); // initialize this module -U32 transitionToStandbyMode( void ); // prepares for transition to standby mode -U32 execStandbyMode( void ); // execute the standby mode state machine (call from OperationModes) +void initStandbyMode( void ); // initialize this module +U32 transitionToStandbyMode( void ); // prepares for transition to standby mode +U32 execStandbyMode( void ); // execute the standby mode state machine (call from OperationModes) -void waterSampleCommandHandler( SAMPLE_WATER_CMD_T sampleWaterCmd ); -BOOL requestDGStart( void ); // HD requests DG start (go to generation idle mode) +void waterSampleCommandHandler( SAMPLE_WATER_CMD_T sampleWaterCmd ); // handle water sample command +BOOL requestDGStart( void ); // HD requests DG start (go to generation idle mode) -BOOL startDGFlush( void ); // HD start flush mode -BOOL startDGHeatDisinfect( void ); // HD start heat disinfect mode +BOOL signalAbortWaterSampling( void ); // HD signal to abort water sampling. +BOOL startDGFlush( void ); // HD start flush mode +BOOL startDGHeatDisinfect( void ); // HD start heat disinfect mode BOOL startDGHeatDisinfectActiveCool( void ); -DG_STANDBY_MODE_STATE_T getCurrentStandbyState( void ); // get the current state of the standby mode. +DG_STANDBY_MODE_STATE_T getCurrentStandbyState( void ); // get the current state of the standby mode. -BOOL testSetFilterFlushTimePeriodOverride( U32 value ); -BOOL testResetFilterFlushTimePeriodOverride( void ); +BOOL startDGChemicalDisinfect( void ); // HD start chemical disinfect mode +BOOL startDGChemicalDisinfectFlush( void ); // HD start chemical disinfect flush mode -BOOL startDGChemicalDisinfect( void ); // HD start chemical disinfect mode -BOOL startDGChemicalDisinfectFlush( void ); // HD start chemical disinfect flush mode +BOOL startDGROPermeateSample( void ); // HD start RO permeate sample -BOOL startDGROPermeateSample( void ); // HD start RO permeate sample +BOOL testSetFilterFlushTimePeriodOverride( U32 value ); // set filter flush time period override. +BOOL testResetFilterFlushTimePeriodOverride( void ); // reset filter flush time period override. /**@}*/ Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rd325999b7b3ea03b7e294cb8a0b97df93812fbe9 -r79b494c344417ba6865db01ad5f456e439bec1b2 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision d325999b7b3ea03b7e294cb8a0b97df93812fbe9) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 79b494c344417ba6865db01ad5f456e439bec1b2) @@ -1101,6 +1101,10 @@ { result = requestDGStop(); } + else if ( ( DG_MODE_STAN == dgMode ) && ( FALSE == startingTreatment.start ) ) + { + result = signalAbortWaterSampling(); + } } sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_DG_2_HD, result ); @@ -1860,7 +1864,6 @@ void sendROPermeateSampleDispenseReadyToHD( void ) { MESSAGE_T msg; - U08 *payloadPtr = msg.payload; // Create a message record blankMessage( &msg );