Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -r9af6fc3e5afc442a877bd5e23ecfa6872a3ad5a4 -rc74c1d99a011dd0fb7f98f183faecda675221fce --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 9af6fc3e5afc442a877bd5e23ecfa6872a3ad5a4) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision c74c1d99a011dd0fb7f98f183faecda675221fce) @@ -1,21 +1,32 @@ -/* - * OperationModes.c - * - * Created on: Aug 9, 2024 - * Author: fw - */ #include "ModeStandby.h" #include "ModeUpdate.h" #include "OperationModes.h" +/** + * @addtogroup BLOperationModes + * @{ + */ +// ********** private definitions ********** + +// ********** private data ********** + static BL_OP_MODE_T currentMode; ///< The currently active state of the active mode. -static BL_OP_MODE_T previousMode; -static BL_OP_MODE_T requestedMode; +static BL_OP_MODE_T previousMode; ///< Previous state of the operations mode. +static BL_OP_MODE_T requestedMode; ///< Request a new mode. +// ********** private function prototypes ********** + static void transitionToNewOperationMode( BL_OP_MODE_T newMode ); +/*********************************************************************//** + * @brief + * The initOperationModes function initializes the Operation Modes unit. + * @details \b Inputs: none + * @details \b Outputs: Operation Modes unit initialized. + * @return none + *************************************************************************/ void initOperationModes( void ) { currentMode = MODE_STAND; @@ -26,6 +37,13 @@ initUpdateMode(); } +/*********************************************************************//** + * @brief + * The execOperationModes function executes the Operation Modes state machine. + * @details \b Inputs: previousMode, currentMode, requestedMode + * @details \b Outputs: previousMode, currentMode, requestedMode + * @return none + *************************************************************************/ void execOperationModes( void ) { if ( requestedMode != currentMode ) @@ -52,6 +70,16 @@ } } +/*********************************************************************//** + * @brief + * The requestNewOperationMode function requests transition to a new + * operation mode. The request will be arbitrated when the state machine + * is next executed. + * @details \b Inputs: none + * @details \b Outputs: requestedMode + * @param new mode request + * @return none + *************************************************************************/ void requestNewOperationMode( BL_OP_MODE_T newMode ) { if ( newMode < NUM_OF_MODES ) @@ -60,7 +88,15 @@ } } - +/*********************************************************************//** + * @brief + * The transitionToNewOperationMode function calls the transition to function + * for a new operation mode that we are transitioning to. + * @details \b Inputs: none + * @details \b Outputs: transition function called for new mode + * @param new mode that is transitioning to. + * @return none + *************************************************************************/ static void transitionToNewOperationMode( BL_OP_MODE_T newMode ) { switch ( newMode ) @@ -79,11 +115,4 @@ } } - - - - - - - - +/**@}*/