diff --git a/docs/cFE Application Developers Guide.md b/docs/cFE Application Developers Guide.md index ebf9e6f0c..c8314f1b3 100644 --- a/docs/cFE Application Developers Guide.md +++ b/docs/cFE Application Developers Guide.md @@ -312,14 +312,14 @@ directory is described as a note under each folder. |-- osal | |-- Contains a copy of the OSAL component |-- psp - | |-- Contains the Platform Suport Package (PSP) library + | |-- Contains the Platform Support Package (PSP) library | |-- Can customize PSP implementation for each CPU and OS that the project needs |-- build | |-- The flight software is all configured and built under this directory | |-- All mission and platform configuration files are placed here |-- apps | |-- Contains application source code. - | |-- Application source code may be shared amoung multiple build CPUs + | |-- Application source code may be shared among multiple build CPUs |-- libs | |-- Contains Core Flight System (cFS) Sample Library (sample_lib) |-- tools @@ -623,7 +623,7 @@ of file names across all flight software packages once imported into a combined files should also be overridable at the mission level; that is, a component only provides a default file (with a `default_` prefix, for distinction) that can be "cloned and owned" by placing a copy, without the `default_` prefix, into the `_defs` directory for the CFE/CFS mission build. Any customized file(s) in the `_defs` directory will be seen by the CMake build system and used -instead of the default version of the file that is provided from the orignal source tree. +instead of the default version of the file that is provided from the original source tree. | **File Name Pattern** | **Scope** | **Content** | |:---------------------------|:---------:|:----------------------------------------------------------------------------------------------------| @@ -649,10 +649,10 @@ inclusion of the `_msgdefs.h` file alone provides the command codes as well as a However, the `_fcncodes.h` header should be strictly limited to defining command/function codes for the command interface and should not contain any other information. -**IMPORANT**: All of the header files above with "INTERFACE" scope control the table/message interface of the component. Changing any of the +**IMPORTANT**: All of the header files above with "INTERFACE" scope control the table/message interface of the component. Changing any of the values or definitions in these files will affect the inter-processor communication - either table files, exported data products, commands, or -telementry messages. Due caution should be exercised when customizing any of these files, as any changes will need to be propagated to all -other CFE instances, ground systems, test software or scripts, or any other tools that interact with the flight softare. +telemetry messages. Due caution should be exercised when customizing any of these files, as any changes will need to be propagated to all +other CFE instances, ground systems, test software or scripts, or any other tools that interact with the flight software. Also note that Electronic Data Sheets (EDS) definitions will supercede the "INTERFACE" header files listed above. These headers are not used by the software when building FSW based on EDS. Instead, the EDS tool will generate these headers based on the content of the EDS file(s) @@ -661,7 +661,7 @@ and the software will be configured to use the generated headers during the buil __Combination Headers__ The header files in this section combine two or more files from the above set for simplicity of usage in source code, as well as backward -compatiblity with traditional file names from older versions of CFS apps. Although these files may also be overridden directly, it is +compatibility with traditional file names from older versions of CFS apps. Although these files may also be overridden directly, it is recommended to only override/modify the more granular headers defined above. | **File Name Pattern** | **Content** | @@ -671,7 +671,7 @@ recommended to only override/modify the more granular headers defined above. | _module_`_msg.h` | Complete message interface: Combination of `msgdefs.h`, `msgstruct.h` and all dependencies | | _module_`_tbl.h` | Complete table interface: Combination of `tbldefs.h`, `tblstruct.h` and all dependencies | -**IMPORANT**: Files from a limited scope may depend on files from a broader scope, but not the other way around. For example, +**IMPORTANT**: Files from a limited scope may depend on files from a broader scope, but not the other way around. For example, the `platform_cfg.h` may depend on items defined in `mission_cfg.h`, but items in `mission_cfg.h` must **not** depend on items defined in `platform_cfg.h`. diff --git a/modules/tbl/fsw/src/cfe_tbl_dispatch.c b/modules/tbl/fsw/src/cfe_tbl_dispatch.c index b9d8a2484..07b29e7ed 100644 --- a/modules/tbl/fsw/src/cfe_tbl_dispatch.c +++ b/modules/tbl/fsw/src/cfe_tbl_dispatch.c @@ -169,18 +169,15 @@ void CFE_TBL_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr) *-----------------------------------------------------------------*/ int16 CFE_TBL_SearchCmdHndlrTbl(CFE_SB_MsgId_t MessageID, uint16 CommandCode) { - int16 TblIndx = CFE_TBL_BAD_CMD_CODE; + int16 TblIndx; + int16 Result; bool FoundMsg = false; bool FoundMatch = false; - do + for (TblIndx = 0; CFE_TBL_CmdHandlerTbl[TblIndx].MsgTypes != CFE_TBL_TERM_MSGTYPE; TblIndx++) { - /* Point to next entry in Command Handler Table */ - TblIndx++; - /* Check to see if we found a matching Message ID */ - if (CFE_SB_MsgId_Equal(CFE_TBL_CmdHandlerTbl[TblIndx].MsgId, MessageID) && - (CFE_TBL_CmdHandlerTbl[TblIndx].MsgTypes != CFE_TBL_TERM_MSGTYPE)) + if (CFE_SB_MsgId_Equal(CFE_TBL_CmdHandlerTbl[TblIndx].MsgId, MessageID)) { /* Flag any found message IDs so that if there is an error, */ /* we can determine if it was a bad message ID or bad command code */ @@ -194,31 +191,35 @@ int16 CFE_TBL_SearchCmdHndlrTbl(CFE_SB_MsgId_t MessageID, uint16 CommandCode) { /* Found matching message ID and Command Code */ FoundMatch = true; + break; } } else /* Message is not a command message with specific command code */ { - /* Automatically assume a match when legit */ - /* Message ID is all that is required */ + /* Automatically assume a match when legit Message ID is all that is required */ FoundMatch = true; + break; } } - } while ((!FoundMatch) && (CFE_TBL_CmdHandlerTbl[TblIndx].MsgTypes != CFE_TBL_TERM_MSGTYPE)); + } - /* If we failed to find a match, return a negative index */ - if (!FoundMatch) + if (FoundMatch) + { + Result = TblIndx; + } + else /* If we failed to find a match, return a negative index */ { /* Determine if the message ID was bad or the command code */ if (FoundMsg) { /* A matching message ID was found, so the command code must be bad */ - TblIndx = CFE_TBL_BAD_CMD_CODE; + Result = CFE_TBL_BAD_CMD_CODE; } else /* No matching message ID was found */ { - TblIndx = CFE_TBL_BAD_MSG_ID; + Result = CFE_TBL_BAD_MSG_ID; } } - return TblIndx; + return Result; }