Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -rde5a0d43bdef611d963d11855bc958a8d8899a09 -r194cc4e5fbe048bd60b137c33e68e96a1ae39dc5 --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision de5a0d43bdef611d963d11855bc958a8d8899a09) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 194cc4e5fbe048bd60b137c33e68e96a1ae39dc5) @@ -65,13 +65,12 @@ static void transitionToNewOperationMode( HD_OP_MODE_T newMode ); static void broadcastOperationMode( void ); -/************************************************************************* - * @brief execOperationModes - * The execOperationModes function initializes the Operation Modes module. +/*********************************************************************//** + * @brief + * The initOperationModes function initializes the Operation Modes module. * @details * Inputs : none * Outputs : Operation Modes module initialized. - * @param none * @return none *************************************************************************/ void initOperationModes( void ) @@ -100,13 +99,12 @@ initPostTreatmentMode(); } -/************************************************************************* - * @brief execOperationModes +/*********************************************************************//** + * @brief * The execOperationModes function executes the Operation Modes state machine. * @details * Inputs : none * Outputs : currentMode is set by state machine. - * @param none * @return none *************************************************************************/ void execOperationModes( void ) @@ -120,7 +118,7 @@ // is requested new mode valid and legal at this time? if ( newMode >= MODE_NLEG ) { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, SW_FAULT_ID_OP_MODES_ILLEGAL_MODE_TRANSITION_REQUESTED, newMode ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_OP_MODES_ILLEGAL_MODE_TRANSITION_REQUESTED, newMode ) newMode = currentMode; } @@ -170,21 +168,22 @@ default: currentMode = MODE_FAUL; currentSubMode = 0; - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, SW_FAULT_ID_OP_MODES_INVALID_MODE_STATE, currentMode ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_OP_MODES_INVALID_MODE_STATE, currentMode ) break; } // end switch // broadcast current operation mode on interval broadcastOperationMode(); } -/************************************************************************* - * @brief requestNewOperationMode - * The requestNewOperationMode function initializes the Operation Modes module. +/*********************************************************************//** + * @brief + * The requestNewOperationMode function requests transition to a new + * operation mode. The request will be arbitrated when the state machine + * is next executed. * @details * Inputs : none - * Outputs : Initializes the Operation Modes module. - * @param none + * Outputs : modeRequest[] * @return none *************************************************************************/ void requestNewOperationMode( HD_OP_MODE_T newMode ) @@ -197,32 +196,31 @@ } else { // invalid mode requested - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, SW_FAULT_ID_OP_MODES_INVALID_MODE_REQUESTED, newMode ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_OP_MODES_INVALID_MODE_REQUESTED, newMode ) } } -/************************************************************************* - * @brief getCurrentOperationMode - * The getCurrentOperationMode function initializes the Operation Modes module. +/*********************************************************************//** + * @brief + * The getCurrentOperationMode function gets the current operation mode. * @details - * Inputs : none - * Outputs : Initializes the Operation Modes module. - * @param none - * @return none + * Inputs : currentMode + * Outputs : none + * @return the current operation mode *************************************************************************/ HD_OP_MODE_T getCurrentOperationMode( void ) { return currentMode; } -/************************************************************************* - * @brief arbitrateModeRequest - * The arbitrateModeRequest function initializes the Operation Modes module. +/*********************************************************************//** + * @brief + * The arbitrateModeRequest function arbitrates any pending mode transition + * requests. * @details - * Inputs : none - * Outputs : Initializes the Operation Modes module. - * @param none - * @return none + * Inputs : modeRequest[] + * Outputs : modeRequest[] is reset + * @return the next operation mode (current mode if no requests pending) *************************************************************************/ static HD_OP_MODE_T arbitrateModeRequest( void ) { @@ -254,13 +252,13 @@ return reqMode; } -/************************************************************************* - * @brief transitionToNewOperationMode - * The transitionToNewOperationMode function initializes the Operation Modes module. +/*********************************************************************//** + * @brief + * The transitionToNewOperationMode function calls the transition to function + * for a new operation mode that we are transitioning to. * @details * Inputs : none - * Outputs : Initializes the Operation Modes module. - * @param none + * Outputs : transition function called for new mode * @return none *************************************************************************/ static void transitionToNewOperationMode( HD_OP_MODE_T newMode ) @@ -293,14 +291,14 @@ transitionToPostTreatmentMode(); break; default: - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, SW_FAULT_ID_OP_MODES_INVALID_MODE_TO_TRANSITION_TO, newMode ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_OP_MODES_INVALID_MODE_TO_TRANSITION_TO, newMode ) break; } } -/************************************************************************* +/*********************************************************************//** * @brief - * The broadcastOperationMode function sends the current operation mode at \n + * The broadcastOperationMode function sends the current operation mode at * the prescribed interval. * @details * Inputs : broadcastModeIntervalCtr