Index: firmware/App/Modes/ModeFlush.c =================================================================== diff -u -r499e5de29e706d09f79ba22511068990c4044e84 -rbbf1e3736be03a4f041ace57e0f95e23caf472dd --- firmware/App/Modes/ModeFlush.c (.../ModeFlush.c) (revision 499e5de29e706d09f79ba22511068990c4044e84) +++ firmware/App/Modes/ModeFlush.c (.../ModeFlush.c) (revision bbf1e3736be03a4f041ace57e0f95e23caf472dd) @@ -1,4 +1,4 @@ -/************************************************************************** +/**********************************************************************//** * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * @@ -8,7 +8,7 @@ * @file ModeFlush.c * * @date 20-Dec-2019 - * @author L. Baloa + * @author S. Nash * * @brief Top-level state machine for flush mode. * @@ -17,47 +17,83 @@ #include "ModeFlush.h" #include "OperationModes.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 initFlushMode +/*********************************************************************//** + * @brief * The initFlushMode function initializes flush Mode module. * @details * Inputs : none * Outputs : none - * @param none * @return none *************************************************************************/ void initFlushMode( void ) { + flushState = DG_FLUSH_STATE_START; } -/************************************************************************* - * @brief transitionToFlushMode +/*********************************************************************//** + * @brief * The transitionToFlushMode function prepares for transition to \n * flush mode. * @details * Inputs : none * Outputs : - * @param none * @return none *************************************************************************/ void transitionToFlushMode( void ) { + initFlushMode(); } -/************************************************************************* - * @brief execFlushMode +/*********************************************************************//** + * @brief * The execFlushMode function executes the flush Mode state machine. * @details * Inputs : none * Outputs : - * @param none - * @return none + * @return current state. *************************************************************************/ -void execFlushMode( void ) +U32 execFlushMode( void ) { + // 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 \n + * flush mode. + * @details + * Inputs : flushState + * Outputs : none + * @return the current state of flush mode. + *************************************************************************/ +DG_FLUSH_STATE_T getCurrentFlushState( void ) +{ + return flushState; +} + +/**@}*/