/************************************************************************** * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file ModeFlush.c * * @author (last) Quang Nguyen * @date (last) 01-Sep-2020 * * @author (original) Leonardo Baloa * @date (original) 20-Dec-2019 * ***************************************************************************/ #include "ModeFlush.h" #include "OperationModes.h" #include "Pressures.h" /** * @addtogroup DGFlushMode * @{ */ // ********** private definitions ********** // ********** private data ********** static DG_FLUSH_STATE_T flushState = DG_FLUSH_STATE_START; ///< Currently active flush state. // ********** private function prototypes ********** /*********************************************************************//** * @brief * The initFlushMode function initializes flush mode module. * @details Inputs: none * @details Outputs: Initialized flush mode module * @return none *************************************************************************/ void initFlushMode( void ) { flushState = DG_FLUSH_STATE_START; } /*********************************************************************//** * @brief * The transitionToFlushMode function prepares for transition to flush mode. * @details Inputs: none * @details Outputs: Prepares for transition to flush mode * @return none *************************************************************************/ void transitionToFlushMode( void ) { initFlushMode(); } /*********************************************************************//** * @brief * The execFlushMode function executes the flush mode state machine. * @details Inputs: none * @details Outputs: Flush mode state machine executed * @return current state *************************************************************************/ U32 execFlushMode( void ) { checkInletPressureFault(); // execute current flush state switch ( flushState ) { case DG_FLUSH_STATE_START: break; default: // TODO - s/w fault flushState = DG_FLUSH_STATE_START; break; } return flushState; } /*********************************************************************//** * @brief * The getCurrentFlushState function returns the current state of the flush mode. * @details Inputs: flushState * @details Outputs: none * @return current state of flush mode. *************************************************************************/ DG_FLUSH_STATE_T getCurrentFlushState( void ) { return flushState; } /**@}*/