diff --git a/cmake/arch_build.cmake b/cmake/arch_build.cmake index e94f86fe4..f173e5d06 100644 --- a/cmake/arch_build.cmake +++ b/cmake/arch_build.cmake @@ -606,6 +606,81 @@ function(cfs_app_check_intf MODULE_NAME) endfunction(cfs_app_check_intf) +################################################################## +# +# FUNCTION: setup_platform_msgids +# +# This is intended to support cases where MsgIDs for all apps +# and modules are assigned in a single/unified header file +# +function(setup_platform_msgids) + + set(PLATFORM_MSGID_HEADERFILE) + + # In an EDS build, the msg IDs always come from EDS, there should not be a local msgids.h file + if (NOT CFE_EDS_ENABLED_BUILD) + + # Check for the presence of a platform-specific msgid file + # This uses cfe_locate_implementation_file() as this returns whether or not it found one + cfe_locate_implementation_file(PLATFORM_MSGID_HEADERFILE "msgids.h" + PREFIX ${BUILD_CONFIG} cfs + SUBDIR config + ) + + # If a top level file was found, then create a wrapper around it called "cfs_msgids.h" + # Note that at this point it could be a list + if (PLATFORM_MSGID_HEADERFILE) + + set(TEMP_WRAPPER_FILE_CONTENT) + foreach(SELECTED_FILE ${PLATFORM_MSGID_HEADERFILE}) + file(TO_NATIVE_PATH "${SELECTED_FILE}" SRC_NATIVE_PATH) + list(APPEND TEMP_WRAPPER_FILE_CONTENT "#include \"${SRC_NATIVE_PATH}\"\n") + endforeach() + + # Generate a header file + generate_c_headerfile("${CMAKE_BINARY_DIR}/inc/cfs_msgids.h" ${TEMP_WRAPPER_FILE_CONTENT}) + unset(TEMP_WRAPPER_FILE_CONTENT) + + # From here on use the wrapper file + set(PLATFORM_MSGID_HEADERFILE "cfs_msgids.h") + + endif(PLATFORM_MSGID_HEADERFILE) + + endif(NOT CFE_EDS_ENABLED_BUILD) + + # Finally, export a CFGFILE_SRC variable for each of the deps + # This should make each respective "mission_build" create a wrapper + # that points directly at this global file, ignoring the default + if (PLATFORM_MSGID_HEADERFILE) + + # Historically there has been a cfe_msgids.h defined at the core api level + # be sure to include this in the export list + set (OUTPUT_VAR_LIST + CORE_API_CFGFILE_SRC_cfe_msgids + ) + + # Slight inconsistency: for CFE core components, the cfe_ prefix is omitted in DEP_NAME + # To make this work without major impact, add it back in here + foreach(DEP_NAME ${MISSION_CORE_MODULES}) + string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC) + list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_cfe_${DEP_NAME}_msgids) + endforeach(DEP_NAME ${MISSION_CORE_MODULES}) + + foreach(DEP_NAME ${TGTSYS_${SYSVAR}_APPS} ${TGTSYS_${SYSVAR}_STATICAPPS}) + string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC) + list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_${DEP_NAME}_msgids) + endforeach(DEP_NAME ${MISSION_APPS}) + + # This is the actual export to parent scope + foreach(VAR_NAME ${OUTPUT_VAR_LIST}) + message("${VAR_NAME}=${PLATFORM_MSGID_HEADERFILE}") + set(${VAR_NAME} ${PLATFORM_MSGID_HEADERFILE} PARENT_SCOPE) + endforeach(VAR_NAME ${OUTPUT_VAR_LIST}) + + endif (PLATFORM_MSGID_HEADERFILE) + +endfunction(setup_platform_msgids) + ################################################################## @@ -658,6 +733,9 @@ function(prepare) list(REMOVE_AT BUILD_CONFIG 0) set(BUILD_CONFIG ${BUILD_CONFIG} PARENT_SCOPE) + # Check if the user has provided a platform-specific "msgids.h" file and set up a wrapper to it + setup_platform_msgids() + # Pull in any application-specific platform-scope configuration # This may include user configuration files such as cfe_platform_cfg.h, # or any other configuration/preparation that needs to happen at @@ -746,7 +824,6 @@ function(process_arch SYSVAR) endif() endforeach() - # Add all core modules # The osal is handled explicitly (above) since this has special extra config foreach(DEP ${MISSION_CORE_INTERFACES} ${MISSION_CORE_MODULES}) diff --git a/cmake/mission_build.cmake b/cmake/mission_build.cmake index 192c2e6c4..4664ee6a3 100644 --- a/cmake/mission_build.cmake +++ b/cmake/mission_build.cmake @@ -161,6 +161,78 @@ function(generate_build_version_templates) endfunction(generate_build_version_templates) +################################################################## +# +# FUNCTION: setup_global_topicids +# +# This is intended to support cases where topic IDs for all apps +# and modules are assigned in a single/unified header file +# +function(setup_global_topicids) + + if (CFE_EDS_ENABLED_BUILD) + + # In an EDS build, the topic IDs always come from EDS + set(MISSION_GLOBAL_TOPICID_HEADERFILE "cfe_mission_eds_designparameters.h") + + else(CFE_EDS_ENABLED_BUILD) + + # Check for the presence of a mission-wide/global topic ID file + # This uses cfe_locate_implementation_file() as this returns whether or not it found one + cfe_locate_implementation_file(MISSION_GLOBAL_TOPICID_HEADERFILE "global_topicids.h" + PREFIX ${MISSIONCONFIG} cfs + SUBDIR config + ) + + # If a top level file was found, then create a wrapper around it called "cfs_global_topicids.h" + # Note that at this point it could be a list + if (MISSION_GLOBAL_TOPICID_HEADERFILE) + + set(TEMP_WRAPPER_FILE_CONTENT) + foreach(SELECTED_FILE ${MISSION_GLOBAL_TOPICID_HEADERFILE}) + file(TO_NATIVE_PATH "${SELECTED_FILE}" SRC_NATIVE_PATH) + list(APPEND TEMP_WRAPPER_FILE_CONTENT "#include \"${SRC_NATIVE_PATH}\"\n") + endforeach() + + # Generate a header file + generate_c_headerfile("${CMAKE_BINARY_DIR}/inc/cfs_global_topicids.h" ${TEMP_WRAPPER_FILE_CONTENT}) + unset(TEMP_WRAPPER_FILE_CONTENT) + + # From here on use the wrapper file + set(MISSION_GLOBAL_TOPICID_HEADERFILE "cfs_global_topicids.h") + + endif(MISSION_GLOBAL_TOPICID_HEADERFILE) + + endif(CFE_EDS_ENABLED_BUILD) + + # Finally, export a CFGFILE_SRC variable for each of the deps + # This should make each respective "mission_build" create a wrapper + # that points directly at this global file, ignoring the default + if (MISSION_GLOBAL_TOPICID_HEADERFILE) + + set (OUTPUT_VAR_LIST) + + # Slight inconsistency: for CFE core components, the cfe_ prefix is omitted in DEP_NAME + # To make this work without major impact, add it back in here + foreach(DEP_NAME ${MISSION_CORE_MODULES}) + string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC) + list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_cfe_${DEP_NAME}_topicids) + endforeach(DEP_NAME ${MISSION_CORE_MODULES}) + + foreach(DEP_NAME ${MISSION_APPS}) + string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC) + list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_${DEP_NAME}_topicids) + endforeach(DEP_NAME ${MISSION_APPS}) + + # This is the actual export to parent scope + foreach(VAR_NAME ${OUTPUT_VAR_LIST}) + set(${VAR_NAME} ${MISSION_GLOBAL_TOPICID_HEADERFILE} PARENT_SCOPE) + endforeach(VAR_NAME ${OUTPUT_VAR_LIST}) + + endif (MISSION_GLOBAL_TOPICID_HEADERFILE) + +endfunction(setup_global_topicids) + ################################################################## # # FUNCTION: prepare @@ -348,6 +420,9 @@ function(prepare) add_dependencies(cfe-usersguide doc-prebuild) add_dependencies(mission-doc doc-prebuild) + # Set up the global topicid header file, if present + setup_global_topicids() + # Pull in any application-specific mission-scope configuration # This may include user configuration files such as cfe_mission_cfg.h, # msgid definitions, or any other configuration/preparation that needs to diff --git a/cmake/sample_defs/example_platform_cfg.h b/cmake/sample_defs/example_platform_cfg.h index c40f44e7d..5e2d6d278 100644 --- a/cmake/sample_defs/example_platform_cfg.h +++ b/cmake/sample_defs/example_platform_cfg.h @@ -16,26 +16,26 @@ * limitations under the License. ************************************************************************/ - /** +/** * @file * * This header file contains the internal configuration parameters and * typedefs with platform scope. - * + * * This provides default values for configurable items that do NOT affect * the interface(s) of this module. This includes internal parameters, * path names, and limit value(s) that are relevant for a specific platform. - * + * * @note It is no longer necessary to provide this file directly in the defs - * directory, but if present, this file is still supported/usable for backward + * directory, but if present, this file is still supported/usable for backward * compatibility. To use this file, is should be called "cfe_platform_cfg.h". - * + * * Going forward, more fine-grained (module/purposes-specific) header files are * included with each submodule. These may be overridden as necessary, but only * if a definition within that file needs to be changed from the default. This - * approach will reduce the amount of duplicate/cloned definitions and better + * approach will reduce the amount of duplicate/cloned definitions and better * support alternative build configurations in the future. - * + * * Note that if this file is present, the fine-grained header files noted above * will _not_ be used. */ @@ -83,7 +83,6 @@ */ #define CFE_PLATFORM_CORE_MAX_STARTUP_MSEC 30000 - /*******************************************************************************/ /* * CFE Executive Services (CFE_ES) Application Private Config Definitions @@ -1726,7 +1725,7 @@ */ #define CFE_PLATFORM_TIME_START_TASK_PRIORITY 60 #define CFE_PLATFORM_TIME_TONE_TASK_PRIORITY 25 -#define CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY 25 +#define CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY 25 /** ** \cfetimecfg Define TIME Task Stack Sizes @@ -1745,7 +1744,6 @@ */ #define CFE_PLATFORM_TIME_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE #define CFE_PLATFORM_TIME_TONE_TASK_STACK_SIZE 4096 -#define CFE_PLATFORM_TIME_1HZ_TASK_STACK_SIZE 8192 +#define CFE_PLATFORM_TIME_ONEHZ_TASK_STACK_SIZE 8192 #endif /* EXAMPLE_PLATFORM_CFG_H */ - diff --git a/docs/src/cfe_time.dox b/docs/src/cfe_time.dox index 1f16a05cb..773cc46c4 100644 --- a/docs/src/cfe_time.dox +++ b/docs/src/cfe_time.dox @@ -657,7 +657,7 @@ TIME provides the ability to command a one time adjustment (#CFE_TIME_ADD_ADJUST_CC and #CFE_TIME_SUB_ADJUST_CC) to the current STCF. In addition there is a 1Hz adjustment - (#CFE_TIME_ADD_1HZ_ADJUSTMENT_CC and #CFE_TIME_SUB_1HZ_ADJUSTMENT_CC) + (#CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC and #CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC) that can be made to the STCF to compensate for oscillator drift. Mission specific ground correlation should be used to assist in determining the proper values to use. The Leap Seconds should be @@ -671,7 +671,7 @@ to by the other systems. \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_SET_STCF_CC, - #CFE_TIME_ADD_1HZ_ADJUSTMENT_CC, #CFE_TIME_SUB_1HZ_ADJUSTMENT_CC, #CFE_TIME_SET_LEAP_SECONDS_CC + #CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC, #CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC, #CFE_TIME_SET_LEAP_SECONDS_CC **/ diff --git a/modules/cfe_testcase/config/default_cfe_test_msgids.h b/modules/cfe_testcase/config/default_cfe_test_msgids.h index a4b41aa30..ba1a9a879 100644 --- a/modules/cfe_testcase/config/default_cfe_test_msgids.h +++ b/modules/cfe_testcase/config/default_cfe_test_msgids.h @@ -29,11 +29,11 @@ /* ** cFE Command Message Id's */ -#define CFE_TEST_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TEST_CMD_MSG /* 0x1802 */ +#define CFE_TEST_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TEST_CMD_TOPICID) /* 0x1802 */ /* ** CFE Telemetry Message Id's */ -#define CFE_TEST_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TEST_HK_TLM_MSG /* 0x0802 */ +#define CFE_TEST_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TEST_HK_TLM_TOPICID) /* 0x0802 */ #endif diff --git a/modules/cfe_testcase/config/default_cfe_test_topicids.h b/modules/cfe_testcase/config/default_cfe_test_topicids.h index 6ecca4fb5..4d90e525e 100644 --- a/modules/cfe_testcase/config/default_cfe_test_topicids.h +++ b/modules/cfe_testcase/config/default_cfe_test_topicids.h @@ -32,7 +32,7 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TEST_CMD_MSG 2 +#define CFE_MISSION_TEST_CMD_TOPICID 2 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -43,6 +43,6 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TEST_HK_TLM_MSG 2 +#define CFE_MISSION_TEST_HK_TLM_TOPICID 2 #endif diff --git a/modules/cfe_testcase/src/sb_subscription_test.c b/modules/cfe_testcase/src/sb_subscription_test.c index a55c73716..12cf51eb3 100644 --- a/modules/cfe_testcase/src/sb_subscription_test.c +++ b/modules/cfe_testcase/src/sb_subscription_test.c @@ -206,7 +206,7 @@ void TestSBMaxSubscriptions(void) while (NumSubs <= CFE_PLATFORM_SB_MAX_MSG_IDS) { /* fabricate a msgid to subscribe to (this may overlap real msgids) */ - TestMsgId = CFE_SB_ValueToMsgId(CFE_PLATFORM_CMD_MID_BASE + NumSubs); + TestMsgId = CFE_SB_ValueToMsgId(1 + NumSubs); Status = CFE_SB_Subscribe(TestMsgId, PipeId); if (Status != CFE_SUCCESS) diff --git a/modules/core_api/arch_build.cmake b/modules/core_api/arch_build.cmake index 738d770bd..be7d5edc3 100644 --- a/modules/core_api/arch_build.cmake +++ b/modules/core_api/arch_build.cmake @@ -9,17 +9,27 @@ ########################################################### # Generate the "cfe_platform_cfg.h" and "cfe_msgids.h" header files -# these must come from mission config +# these usually come from user config, but CFE provides defaults -generate_config_includefile( - FILE_NAME "cfe_msgids.h" - MATCH_SUFFIX "msgids.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_msgids.h" - PREFIXES ${BUILD_CONFIG} cfe +set(CORE_API_PLATFORM_CONFIG_FILE_LIST + cfe_core_api_base_msgids.h + cfe_msgids.h ) -generate_config_includefile( - FILE_NAME "cfe_core_api_base_msgids.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_core_api_base_msgids.h" - PREFIXES ${BUILD_CONFIG} -) +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(CORE_API_CFGFILE ${CORE_API_PLATFORM_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${CORE_API_CFGFILE}" NAME_WE) + if (DEFINED CORE_API_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${CORE_API_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${CORE_API_CFGFILE}") + endif() + + generate_config_includefile( + FILE_NAME "${CORE_API_CFGFILE}" + PREFIXES ${BUILD_CONFIG} cfe + ${DEFAULT_SOURCE} + ) +endforeach() diff --git a/modules/core_api/config/default_cfe_core_api_base_msgids.h b/modules/core_api/config/default_cfe_core_api_base_msgids.h index ffb8b6d62..f210d8c8b 100644 --- a/modules/core_api/config/default_cfe_core_api_base_msgids.h +++ b/modules/core_api/config/default_cfe_core_api_base_msgids.h @@ -19,9 +19,8 @@ /** * @file * - * Purpose: - * This header file contains the Message Id's for messages used by the - * cFE core. + * This header file contains the platform-specific base msg ID values and + * logic to convert a topic ID to a message ID value. * */ @@ -44,7 +43,7 @@ * of MIDs in the framework it will not scale so an alternative * method of deconfliction is recommended. */ -#define CFE_PLATFORM_CMD_MID_BASE 0x1800 +#define CFE_CPU1_CMD_MID_BASE 0x1800 /** * \brief Platform telemetry message ID base offset @@ -54,9 +53,9 @@ * 0x0000-0x007F since the command bit is 0x0080. Alternative * method of deconfliction is recommended. * - * See #CFE_PLATFORM_CMD_MID_BASE for more information + * See #CFE_CPU1_CMD_MID_BASE for more information */ -#define CFE_PLATFORM_TLM_MID_BASE 0x0800 +#define CFE_CPU1_TLM_MID_BASE 0x0800 /** * \brief "Global" command message ID base offset @@ -65,8 +64,65 @@ * 0x00E0 - Potential value for MISSION_MSGID_V2, note command bit is 0x0080. * Works in limited cases only, alternative method of deconfliction * is recommended. - * See #CFE_PLATFORM_CMD_MID_BASE for more information + * See #CFE_CPU1_CMD_MID_BASE for more information */ -#define CFE_PLATFORM_CMD_MID_BASE_GLOB 0x1860 +#define CFE_GLOBAL_CMD_MID_BASE 0x1860 + +/** + * \brief "Global" telemetry message ID base offset + * + * 0x0860 - Nominal value for message ID V1 + * 0x0060 - Potential value for MISSION_MSGID_V2, note command bit is 0x0080. + * Works in limited cases only, alternative method of deconfliction + * is recommended. + * See #CFE_CPU1_CMD_MID_BASE for more information + */ +#define CFE_GLOBAL_TLM_MID_BASE 0x0860 + +/** + * \brief Convert a command topic ID to a MsgID value + * + * This defines the logic to convert a topic ID value into a message ID value. + * This operates on integer values and should resolve at compile time such + * that it can be used in e.g. switch/case statements. + * + * \note The result of this conversion is a simple integer, thus also needs to + * go through CFE_SB_ValueToMsgId() to obtain a properly-typed CFE_SB_MsgId_t + * for interacting with SB APIs. + */ +#define CFE_PLATFORM_CMD_TOPICID_TO_MIDV(topic) (CFE_CPU1_CMD_MID_BASE | (topic)) + +/** + * \brief Convert a telemetry topic ID to a MsgID value + * + * This defines the logic to convert a topic ID value into a message ID value. + * This operates on integer values and should resolve at compile time such + * that it can be used in e.g. switch/case statements. + * + * \note The result of this conversion is a simple integer, thus also needs to + * go through CFE_SB_ValueToMsgId() to obtain a properly-typed CFE_SB_MsgId_t + * for interacting with SB APIs. + */ +#define CFE_PLATFORM_TLM_TOPICID_TO_MIDV(topic) (CFE_CPU1_TLM_MID_BASE | (topic)) + +/** + * \brief Convert a "global" command topic ID to a MsgID value + * + * A global command is one that is not specific to an individual instance of CFE, + * but rather intended to be broadcast to all CFE instances at the same time. + * + * This is otherwise identical to #CFE_PLATFORM_CMD_TOPICID_TO_MIDV + */ +#define CFE_GLOBAL_CMD_TOPICID_TO_MIDV(topic) (CFE_GLOBAL_CMD_MID_BASE | (topic)) + +/** + * \brief Convert a "global" telemetry topic ID to a MsgID value + * + * A global telemetry is one that is not specific to an individual instance of CFE, + * but rather intended to be broadcast to all CFE instances at the same time. + * + * This is otherwise identical to #CFE_PLATFORM_TLM_TOPICID_TO_MIDV + */ +#define CFE_GLOBAL_TLM_TOPICID_TO_MIDV(topic) (CFE_GLOBAL_TLM_MID_BASE | (topic)) #endif /* CFE_CORE_BASE_MSGIDS_H */ diff --git a/modules/core_api/mission_build.cmake b/modules/core_api/mission_build.cmake index 1139b1bc1..57f6a04af 100644 --- a/modules/core_api/mission_build.cmake +++ b/modules/core_api/mission_build.cmake @@ -9,23 +9,41 @@ ########################################################### # Generate the "cfe_mission_cfg.h" and "cfe_perfids.h" header files -# these must come from mission config -generate_config_includefile( - FILE_NAME "cfe_mission_cfg.h" - MATCH_SUFFIX "mission_cfg.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_mission_cfg.h" - PREFIXES ${MISSIONCONFIG} cfe -) +# these usually come from user config, but CFE provides defaults -generate_config_includefile( - FILE_NAME "cfe_perfids.h" - MATCH_SUFFIX "perfids.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_perfids.h" - PREFIXES ${MISSIONCONFIG} cfe +set(CORE_API_PLATFORM_CONFIG_FILE_LIST + cfe_core_api_interface_cfg.h + cfe_mission_cfg.h + cfe_perfids.h ) -generate_config_includefile( - FILE_NAME "cfe_core_api_interface_cfg.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_core_api_interface_cfg.h" - PREFIXES ${BUILD_CONFIG} -) +if (CFE_EDS_ENABLED_BUILD) + + # In an EDS-based build, these files come generated from the EDS tool + set(CORE_API_CFGFILE_SRC_cfe_core_api_interface_cfg "cfe_mission_eds_designparameters.h") + +endif(CFE_EDS_ENABLED_BUILD) + + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(CORE_API_CFGFILE ${CORE_API_PLATFORM_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${CORE_API_CFGFILE}" NAME_WE) + if (DEFINED CORE_API_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${CORE_API_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${CORE_API_CFGFILE}") + endif() + + # For backward compatibilty, strip off the leading "cfe_" and do a suffix match + # Other CFS apps don't do this, but this is a remnant of when the build system was first implemented + string(REPLACE "cfe_" "" SUFFIX ${CORE_API_CFGFILE}) + + generate_config_includefile( + FILE_NAME "${CORE_API_CFGFILE}" + MATCH_SUFFIX ${SUFFIX} + PREFIXES ${MISSIONCONFIG} cfe + ${DEFAULT_SOURCE} + ) +endforeach() diff --git a/modules/es/arch_build.cmake b/modules/es/arch_build.cmake index 27403bd88..28707caa0 100644 --- a/modules/es/arch_build.cmake +++ b/modules/es/arch_build.cmake @@ -15,18 +15,21 @@ set(ES_PLATFORM_CONFIG_FILE_LIST cfe_es_platform_cfg.h ) +message("ES_CFGFILE_SRC_cfe_es_msgids = ${ES_CFGFILE_SRC_cfe_es_msgids}") + + # Create wrappers around the all the config header files # This makes them individually overridable by the missions, without modifying # the distribution default copies foreach(ES_CFGFILE ${ES_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${ES_CFGFILE}" NAME_WE) if (DEFINED ES_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE "${ES_CFGFILE_SRC_${CFGKEY}}") + set(DEFAULT_SOURCE GENERATED_FILE "${ES_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${ES_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${ES_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${ES_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/es/config/default_cfe_es_msgids.h b/modules/es/config/default_cfe_es_msgids.h index 9ee2bb252..cb442c326 100644 --- a/modules/es/config/default_cfe_es_msgids.h +++ b/modules/es/config/default_cfe_es_msgids.h @@ -29,14 +29,14 @@ /* ** cFE ES Command Message Id's */ -#define CFE_ES_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_ES_CMD_MSG /* 0x1806 */ -#define CFE_ES_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_ES_SEND_HK_MSG /* 0x1808 */ +#define CFE_ES_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_ES_CMD_TOPICID) /* 0x1806 */ +#define CFE_ES_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_ES_SEND_HK_TOPICID) /* 0x1808 */ /* ** CFE ES Telemetry Message Id's */ -#define CFE_ES_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_HK_TLM_MSG /* 0x0800 */ -#define CFE_ES_APP_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_APP_TLM_MSG /* 0x080B */ -#define CFE_ES_MEMSTATS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_MEMSTATS_TLM_MSG /* 0x0810 */ +#define CFE_ES_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_ES_HK_TLM_TOPICID) /* 0x0800 */ +#define CFE_ES_APP_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_ES_APP_TLM_TOPICID) /* 0x080B */ +#define CFE_ES_MEMSTATS_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_ES_MEMSTATS_TLM_TOPICID) /* 0x0810 */ #endif diff --git a/modules/es/config/default_cfe_es_topicids.h b/modules/es/config/default_cfe_es_topicids.h index b45705c21..267411945 100644 --- a/modules/es/config/default_cfe_es_topicids.h +++ b/modules/es/config/default_cfe_es_topicids.h @@ -32,8 +32,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_ES_CMD_MSG 6 -#define CFE_MISSION_ES_SEND_HK_MSG 8 +#define CFE_MISSION_ES_CMD_TOPICID 6 +#define CFE_MISSION_ES_SEND_HK_TOPICID 8 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -44,8 +44,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_ES_HK_TLM_MSG 0 -#define CFE_MISSION_ES_APP_TLM_MSG 11 -#define CFE_MISSION_ES_MEMSTATS_TLM_MSG 16 +#define CFE_MISSION_ES_HK_TLM_TOPICID 0 +#define CFE_MISSION_ES_APP_TLM_TOPICID 11 +#define CFE_MISSION_ES_MEMSTATS_TLM_TOPICID 16 #endif diff --git a/modules/evs/arch_build.cmake b/modules/evs/arch_build.cmake index 63c50f8e2..0822defb0 100644 --- a/modules/evs/arch_build.cmake +++ b/modules/evs/arch_build.cmake @@ -21,12 +21,12 @@ set(EVS_PLATFORM_CONFIG_FILE_LIST foreach(EVS_CFGFILE ${EVS_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${EVS_CFGFILE}" NAME_WE) if (DEFINED EVS_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE "${EVS_CFGFILE_SRC_${CFGKEY}}") + set(DEFAULT_SOURCE GENERATED_FILE "${EVS_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${EVS_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${EVS_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${EVS_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/evs/config/default_cfe_evs_msgids.h b/modules/evs/config/default_cfe_evs_msgids.h index 1d31ddb5b..2ee5292d3 100644 --- a/modules/evs/config/default_cfe_evs_msgids.h +++ b/modules/evs/config/default_cfe_evs_msgids.h @@ -29,14 +29,17 @@ /* ** cFE Command Message Id's */ -#define CFE_EVS_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_EVS_CMD_MSG /* 0x1801 */ -#define CFE_EVS_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_EVS_SEND_HK_MSG /* 0x1809 */ +#define CFE_EVS_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_EVS_CMD_TOPICID) /* 0x1801 */ +#define CFE_EVS_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_EVS_SEND_HK_TOPICID) /* 0x1809 */ /* ** CFE Telemetry Message Id's */ -#define CFE_EVS_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_HK_TLM_MSG /* 0x0801 */ -#define CFE_EVS_LONG_EVENT_MSG_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_LONG_EVENT_MSG_MSG /* 0x0808 */ -#define CFE_EVS_SHORT_EVENT_MSG_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_SHORT_EVENT_MSG_MSG /* 0x0809 */ +#define CFE_EVS_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_EVS_HK_TLM_TOPICID) /* 0x0801 */ +#define CFE_EVS_LONG_EVENT_MSG_MID \ + CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_EVS_LONG_EVENT_MSG_TOPICID) /* 0x0808 \ + */ +#define CFE_EVS_SHORT_EVENT_MSG_MID \ + CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_EVS_SHORT_EVENT_MSG_TOPICID) /* 0x0809 */ #endif diff --git a/modules/evs/config/default_cfe_evs_topicids.h b/modules/evs/config/default_cfe_evs_topicids.h index 842758da0..f03aecb4f 100644 --- a/modules/evs/config/default_cfe_evs_topicids.h +++ b/modules/evs/config/default_cfe_evs_topicids.h @@ -32,8 +32,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_EVS_CMD_MSG 1 -#define CFE_MISSION_EVS_SEND_HK_MSG 9 +#define CFE_MISSION_EVS_CMD_TOPICID 1 +#define CFE_MISSION_EVS_SEND_HK_TOPICID 9 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -44,8 +44,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_EVS_HK_TLM_MSG 1 -#define CFE_MISSION_EVS_LONG_EVENT_MSG_MSG 8 -#define CFE_MISSION_EVS_SHORT_EVENT_MSG_MSG 9 +#define CFE_MISSION_EVS_HK_TLM_TOPICID 1 +#define CFE_MISSION_EVS_LONG_EVENT_MSG_TOPICID 8 +#define CFE_MISSION_EVS_SHORT_EVENT_MSG_TOPICID 9 #endif diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index 95b6cfe5e..7169e351d 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -104,13 +104,13 @@ static const UT_TaskPipeDispatchId_t UT_TPID_CFE_EVS_CMD_INVALID_CC = { .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_CMD_MID), .CommandCode = 0x7F}; static const UT_TaskPipeDispatchId_t UT_TPID_CFE_EVS_SEND_HK = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_SEND_HK_MID)}; -static const UT_SoftwareBusSnapshot_Entry_t UT_EVS_LONGFMT_SNAPSHOTDATA = { - .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID), +static UT_SoftwareBusSnapshot_Entry_t UT_EVS_LONGFMT_SNAPSHOTDATA = { + .MsgId = CFE_SB_MSGID_WRAP_VALUE(0), .SnapshotOffset = offsetof(CFE_EVS_LongEventTlm_t, Payload.PacketID.EventID), .SnapshotSize = sizeof(uint16)}; -static const UT_SoftwareBusSnapshot_Entry_t UT_EVS_SHORTFMT_SNAPSHOTDATA = { - .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_SHORT_EVENT_MSG_MID), +static UT_SoftwareBusSnapshot_Entry_t UT_EVS_SHORTFMT_SNAPSHOTDATA = { + .MsgId = CFE_SB_MSGID_WRAP_VALUE(0), .SnapshotOffset = offsetof(CFE_EVS_ShortEventTlm_t, Payload.PacketID.EventID), .SnapshotSize = sizeof(uint16)}; @@ -140,6 +140,9 @@ void UT_InitData_EVS(void) { UT_InitData(); + UT_EVS_LONGFMT_SNAPSHOTDATA.MsgId = CFE_SB_MSGID_C(CFE_EVS_LONG_EVENT_MSG_MID); + UT_EVS_SHORTFMT_SNAPSHOTDATA.MsgId = CFE_SB_MSGID_C(CFE_EVS_SHORT_EVENT_MSG_MID); + UT_SetHandlerFunction(UT_KEY(CFE_MSG_GetMsgTime), UT_CFE_MSG_GetMsgTime_CustomHandler, NULL); } diff --git a/modules/sb/arch_build.cmake b/modules/sb/arch_build.cmake index 10f7372f0..57e38509e 100644 --- a/modules/sb/arch_build.cmake +++ b/modules/sb/arch_build.cmake @@ -21,12 +21,12 @@ set(SB_PLATFORM_CONFIG_FILE_LIST foreach(SB_CFGFILE ${SB_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${SB_CFGFILE}" NAME_WE) if (DEFINED SB_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE "${SB_CFGFILE_SRC_${CFGKEY}}") + set(DEFAULT_SOURCE GENERATED_FILE "${SB_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SB_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SB_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${SB_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/sb/config/default_cfe_sb_msgids.h b/modules/sb/config/default_cfe_sb_msgids.h index 21fce9c10..338684d62 100644 --- a/modules/sb/config/default_cfe_sb_msgids.h +++ b/modules/sb/config/default_cfe_sb_msgids.h @@ -29,16 +29,16 @@ /* ** cFE Command Message Id's */ -#define CFE_SB_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_CMD_MSG /* 0x1803 */ -#define CFE_SB_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_SEND_HK_MSG /* 0x180B */ -#define CFE_SB_SUB_RPT_CTRL_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_SUB_RPT_CTRL_MSG /* 0x180E */ +#define CFE_SB_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_SB_CMD_TOPICID) /* 0x1803 */ +#define CFE_SB_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_SB_SEND_HK_TOPICID) /* 0x180B */ +#define CFE_SB_SUB_RPT_CTRL_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_SB_SUB_RPT_CTRL_TOPICID) /* 0x180E */ /* ** CFE Telemetry Message Id's */ -#define CFE_SB_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_HK_TLM_MSG /* 0x0803 */ -#define CFE_SB_STATS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_STATS_TLM_MSG /* 0x080A */ -#define CFE_SB_ALLSUBS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_ALLSUBS_TLM_MSG /* 0x080D */ -#define CFE_SB_ONESUB_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_ONESUB_TLM_MSG /* 0x080E */ +#define CFE_SB_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_SB_HK_TLM_TOPICID) /* 0x0803 */ +#define CFE_SB_STATS_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_SB_STATS_TLM_TOPICID) /* 0x080A */ +#define CFE_SB_ALLSUBS_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_SB_ALLSUBS_TLM_TOPICID) /* 0x080D */ +#define CFE_SB_ONESUB_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_SB_ONESUB_TLM_TOPICID) /* 0x080E */ #endif diff --git a/modules/sb/config/default_cfe_sb_topicids.h b/modules/sb/config/default_cfe_sb_topicids.h index 3c3e7be37..1009385ca 100644 --- a/modules/sb/config/default_cfe_sb_topicids.h +++ b/modules/sb/config/default_cfe_sb_topicids.h @@ -32,9 +32,9 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_SB_CMD_MSG 3 -#define CFE_MISSION_SB_SEND_HK_MSG 11 -#define CFE_MISSION_SB_SUB_RPT_CTRL_MSG 14 +#define CFE_MISSION_SB_CMD_TOPICID 3 +#define CFE_MISSION_SB_SEND_HK_TOPICID 11 +#define CFE_MISSION_SB_SUB_RPT_CTRL_TOPICID 14 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -45,9 +45,9 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_SB_HK_TLM_MSG 3 -#define CFE_MISSION_SB_STATS_TLM_MSG 10 -#define CFE_MISSION_SB_ALLSUBS_TLM_MSG 13 -#define CFE_MISSION_SB_ONESUB_TLM_MSG 14 +#define CFE_MISSION_SB_HK_TLM_TOPICID 3 +#define CFE_MISSION_SB_STATS_TLM_TOPICID 10 +#define CFE_MISSION_SB_ALLSUBS_TLM_TOPICID 13 +#define CFE_MISSION_SB_ONESUB_TLM_TOPICID 14 #endif diff --git a/modules/sb/ut-coverage/sb_UT.h b/modules/sb/ut-coverage/sb_UT.h index 45e15fcf3..bf72d1055 100644 --- a/modules/sb/ut-coverage/sb_UT.h +++ b/modules/sb/ut-coverage/sb_UT.h @@ -79,8 +79,8 @@ typedef struct uint16 Tlm16Param2; } SB_UT_TstPktWoSecHdr_t; -#define SB_UT_CMD_MID_VALUE_BASE CFE_PLATFORM_CMD_MID_BASE + 1 -#define SB_UT_TLM_MID_VALUE_BASE CFE_PLATFORM_TLM_MID_BASE + 1 +#define SB_UT_CMD_MID_VALUE_BASE 0x100 +#define SB_UT_TLM_MID_VALUE_BASE 0x200 /* SB unit test functions */ /*****************************************************************************/ diff --git a/modules/tbl/arch_build.cmake b/modules/tbl/arch_build.cmake index 25495554c..40c771288 100644 --- a/modules/tbl/arch_build.cmake +++ b/modules/tbl/arch_build.cmake @@ -21,12 +21,12 @@ set(TBL_PLATFORM_CONFIG_FILE_LIST foreach(TBL_CFGFILE ${TBL_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${TBL_CFGFILE}" NAME_WE) if (DEFINED TBL_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE "${TBL_CFGFILE_SRC_${CFGKEY}}") + set(DEFAULT_SOURCE GENERATED_FILE "${TBL_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TBL_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TBL_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${TBL_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/tbl/config/default_cfe_tbl_msgids.h b/modules/tbl/config/default_cfe_tbl_msgids.h index 58d492c9f..54b93261d 100644 --- a/modules/tbl/config/default_cfe_tbl_msgids.h +++ b/modules/tbl/config/default_cfe_tbl_msgids.h @@ -29,13 +29,13 @@ /* ** cFE Command Message Id's */ -#define CFE_TBL_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TBL_CMD_MSG /* 0x1804 */ -#define CFE_TBL_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TBL_SEND_HK_MSG /* 0x180C */ +#define CFE_TBL_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TBL_CMD_TOPICID) /* 0x1804 */ +#define CFE_TBL_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TBL_SEND_HK_TOPICID) /* 0x180C */ /* ** CFE Telemetry Message Id's */ -#define CFE_TBL_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TBL_HK_TLM_MSG /* 0x0804 */ -#define CFE_TBL_REG_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TBL_REG_TLM_MSG /* 0x080C */ +#define CFE_TBL_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TBL_HK_TLM_TOPICID) /* 0x0804 */ +#define CFE_TBL_REG_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TBL_REG_TLM_TOPICID) /* 0x080C */ #endif diff --git a/modules/tbl/config/default_cfe_tbl_topicids.h b/modules/tbl/config/default_cfe_tbl_topicids.h index 207cff719..03b285fa5 100644 --- a/modules/tbl/config/default_cfe_tbl_topicids.h +++ b/modules/tbl/config/default_cfe_tbl_topicids.h @@ -32,8 +32,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TBL_CMD_MSG 4 -#define CFE_MISSION_TBL_SEND_HK_MSG 12 +#define CFE_MISSION_TBL_CMD_TOPICID 4 +#define CFE_MISSION_TBL_SEND_HK_TOPICID 12 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -44,7 +44,7 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TBL_HK_TLM_MSG 4 -#define CFE_MISSION_TBL_REG_TLM_MSG 12 +#define CFE_MISSION_TBL_HK_TLM_TOPICID 4 +#define CFE_MISSION_TBL_REG_TLM_TOPICID 12 #endif diff --git a/modules/time/arch_build.cmake b/modules/time/arch_build.cmake index 534ca265f..14cf68ead 100644 --- a/modules/time/arch_build.cmake +++ b/modules/time/arch_build.cmake @@ -21,12 +21,12 @@ set(TIME_PLATFORM_CONFIG_FILE_LIST foreach(TIME_CFGFILE ${TIME_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${TIME_CFGFILE}" NAME_WE) if (DEFINED TIME_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE "${TIME_CFGFILE_SRC_${CFGKEY}}") + set(DEFAULT_SOURCE GENERATED_FILE "${TIME_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TIME_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TIME_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${TIME_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/time/config/default_cfe_time_fcncodes.h b/modules/time/config/default_cfe_time_fcncodes.h index 6fe06e1f8..4b396f173 100644 --- a/modules/time/config/default_cfe_time_fcncodes.h +++ b/modules/time/config/default_cfe_time_fcncodes.h @@ -515,8 +515,8 @@ ** Inappropriately setting the clock may result in other sub-systems performing incorrect ** time based calculations. The specific risk is dependent upon the behavior of those sub-systems. ** -** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_ADD_1HZ_ADJUSTMENT_CC, -*#CFE_TIME_SUB_1HZ_ADJUSTMENT_CC +** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC, +*#CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC */ #define CFE_TIME_ADD_ADJUST_CC 11 /* add one time STCF adjustment */ @@ -550,7 +550,7 @@ ** Inappropriately setting the clock may result in other sub-systems performing incorrect ** time based calculations. The specific risk is dependent upon the behavior of those sub-systems. ** -** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_ADD_1HZ_ADJUSTMENT_CC, #CFE_TIME_SUB_1HZ_ADJUSTMENT_CC +** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC, #CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC */ #define CFE_TIME_SUB_ADJUST_CC 12 /* subtract one time STCF adjustment */ @@ -584,21 +584,21 @@ ** - \b \c \TIME_CMDPC - command execution counter will increment ** - \b \c \TIME_STCFSECS - Housekeeping Telemetry point indicating new STCF seconds value ** - \b \c \TIME_STCFSUBSECS - Housekeeping Telemetry point indicating new STCF subseconds value -** - The #CFE_TIME_1HZ_EID informational event message will be generated +** - The #CFE_TIME_ONEHZ_EID informational event message will be generated ** ** \par Error Conditions ** - Platform receiving the command is not a Time Server **

Evidence of Failure may be found in the following telemetry: ** - \b \c \TIME_CMDEC - command error counter will increment -** - Error specific event message will be issued (#CFE_TIME_1HZ_CFG_EID) +** - Error specific event message will be issued (#CFE_TIME_ONEHZ_CFG_EID) ** ** \par Criticality ** Inappropriately setting the clock may result in other sub-systems performing incorrect ** time based calculations. The specific risk is dependent upon the behavior of those sub-systems. ** -** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_SUB_1HZ_ADJUSTMENT_CC +** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC */ -#define CFE_TIME_ADD_1HZ_ADJUSTMENT_CC 13 /* add 1Hz STCF adjustment */ +#define CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC 13 /* add 1Hz STCF adjustment */ /** \cfetimecmd Subtract Delta from Spacecraft Time Correlation Factor each 1Hz ** @@ -632,21 +632,21 @@ ** - \b \c \TIME_CMDPC - command execution counter will increment ** - \b \c \TIME_STCFSECS - Housekeeping Telemetry point indicating new STCF seconds value ** - \b \c \TIME_STCFSUBSECS - Housekeeping Telemetry point indicating new STCF subseconds value -** - The #CFE_TIME_1HZ_EID informational event message will be generated +** - The #CFE_TIME_ONEHZ_EID informational event message will be generated ** ** \par Error Conditions ** - Platform receiving the command is not a Time Server **

Evidence of Failure may be found in the following telemetry: ** - \b \c \TIME_CMDEC - command error counter will increment -** - Error specific event message will be issued (#CFE_TIME_1HZ_CFG_EID) +** - Error specific event message will be issued (#CFE_TIME_ONEHZ_CFG_EID) ** ** \par Criticality ** Inappropriately setting the clock may result in other sub-systems performing incorrect ** time based calculations. The specific risk is dependent upon the behavior of those sub-systems. ** -** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_ADD_1HZ_ADJUSTMENT_CC +** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC */ -#define CFE_TIME_SUB_1HZ_ADJUSTMENT_CC 14 /* subtract 1Hz STCF adjustment */ +#define CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC 14 /* subtract 1Hz STCF adjustment */ /** \cfetimecmd Set Tone Signal Source ** diff --git a/modules/time/config/default_cfe_time_internal_cfg.h b/modules/time/config/default_cfe_time_internal_cfg.h index 3d284a24c..f00c25e7c 100644 --- a/modules/time/config/default_cfe_time_internal_cfg.h +++ b/modules/time/config/default_cfe_time_internal_cfg.h @@ -219,7 +219,7 @@ */ #define CFE_PLATFORM_TIME_START_TASK_PRIORITY 60 #define CFE_PLATFORM_TIME_TONE_TASK_PRIORITY 25 -#define CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY 25 +#define CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY 25 /** ** \cfetimecfg Define TIME Task Stack Sizes @@ -238,6 +238,6 @@ */ #define CFE_PLATFORM_TIME_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE #define CFE_PLATFORM_TIME_TONE_TASK_STACK_SIZE 4096 -#define CFE_PLATFORM_TIME_1HZ_TASK_STACK_SIZE 8192 +#define CFE_PLATFORM_TIME_ONEHZ_TASK_STACK_SIZE 8192 #endif diff --git a/modules/time/config/default_cfe_time_msgids.h b/modules/time/config/default_cfe_time_msgids.h index b2ef0aa32..4421c4836 100644 --- a/modules/time/config/default_cfe_time_msgids.h +++ b/modules/time/config/default_cfe_time_msgids.h @@ -29,21 +29,30 @@ /* ** cFE Command Message Id's */ -#define CFE_TIME_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_CMD_MSG /* 0x1805 */ -#define CFE_TIME_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_SEND_HK_MSG /* 0x180D */ -#define CFE_TIME_TONE_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_TONE_CMD_MSG /* 0x1810 */ -#define CFE_TIME_1HZ_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_1HZ_CMD_MSG /* 0x1811 */ +#define CFE_TIME_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_CMD_TOPICID) /* 0x1805 */ +#define CFE_TIME_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_SEND_HK_TOPICID) /* 0x180D */ +#define CFE_TIME_TONE_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_TONE_CMD_TOPICID) /* 0x1810 */ +#define CFE_TIME_ONEHZ_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_ONEHZ_CMD_TOPICID) /* 0x1811 */ /* ** cFE Global Command Message Id's */ -#define CFE_TIME_DATA_CMD_MID CFE_PLATFORM_CMD_MID_BASE_GLOB + CFE_MISSION_TIME_DATA_CMD_MSG /* 0x1860 */ -#define CFE_TIME_SEND_CMD_MID CFE_PLATFORM_CMD_MID_BASE_GLOB + CFE_MISSION_TIME_SEND_CMD_MSG /* 0x1862 */ +#define CFE_TIME_DATA_CMD_MID CFE_GLOBAL_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_DATA_CMD_TOPICID) /* 0x1860 */ +#define CFE_TIME_SEND_CMD_MID CFE_GLOBAL_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_SEND_CMD_TOPICID) /* 0x1862 */ /* ** CFE Telemetry Message Id's */ -#define CFE_TIME_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TIME_HK_TLM_MSG /* 0x0805 */ -#define CFE_TIME_DIAG_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TIME_DIAG_TLM_MSG /* 0x0806 */ +#define CFE_TIME_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TIME_HK_TLM_TOPICID) /* 0x0805 */ +#define CFE_TIME_DIAG_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TIME_DIAG_TLM_TOPICID) /* 0x0806 */ + +#ifndef CFE_OMIT_DEPRECATED +/* + * This name was changed/deprecated because technically it constitutes an + * identifier that starts with a digit (1) when the CFE_TIME_ namespace + * qualifier is removed. This matters in some circumstances. + */ +#define CFE_TIME_1HZ_CMD_MID CFE_TIME_ONEHZ_CMD_MID +#endif #endif diff --git a/modules/time/config/default_cfe_time_topicids.h b/modules/time/config/default_cfe_time_topicids.h index a3c2ec1ef..96b165d57 100644 --- a/modules/time/config/default_cfe_time_topicids.h +++ b/modules/time/config/default_cfe_time_topicids.h @@ -32,10 +32,10 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TIME_CMD_MSG 5 -#define CFE_MISSION_TIME_SEND_HK_MSG 13 -#define CFE_MISSION_TIME_TONE_CMD_MSG 16 -#define CFE_MISSION_TIME_1HZ_CMD_MSG 17 +#define CFE_MISSION_TIME_CMD_TOPICID 5 +#define CFE_MISSION_TIME_SEND_HK_TOPICID 13 +#define CFE_MISSION_TIME_TONE_CMD_TOPICID 16 +#define CFE_MISSION_TIME_ONEHZ_CMD_TOPICID 17 /** ** \cfemissioncfg cFE Portable Message Numbers for Global Messages @@ -46,8 +46,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TIME_DATA_CMD_MSG 0 -#define CFE_MISSION_TIME_SEND_CMD_MSG 2 +#define CFE_MISSION_TIME_DATA_CMD_TOPICID 0 +#define CFE_MISSION_TIME_SEND_CMD_TOPICID 2 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -58,7 +58,7 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TIME_HK_TLM_MSG 5 -#define CFE_MISSION_TIME_DIAG_TLM_MSG 6 +#define CFE_MISSION_TIME_HK_TLM_TOPICID 5 +#define CFE_MISSION_TIME_DIAG_TLM_TOPICID 6 #endif diff --git a/modules/time/eds/cfe_time.xml b/modules/time/eds/cfe_time.xml index 5a3536b87..f26994629 100644 --- a/modules/time/eds/cfe_time.xml +++ b/modules/time/eds/cfe_time.xml @@ -1126,14 +1126,14 @@ - \b \c \TIME_CMDPC - command execution counter will increment - \b \c \TIME_STCFSECS - Housekeeping Telemetry point indicating new STCF seconds value - \b \c \TIME_STCFSUBSECS - Housekeeping Telemetry point indicating new STCF subseconds value - - The #CFE_TIME_1HZ_EID informational event message will be generated + - The #CFE_TIME_ONEHZ_EID informational event message will be generated \par Error Conditions - Platform receiving the command is not a Time Server Evidence of Failure may be found in the following telemetry: - \b \c \TIME_CMDEC - command error counter will increment - - Error specific event message will be issued (#CFE_TIME_1HZ_CFG_EID) + - Error specific event message will be issued (#CFE_TIME_ONEHZ_CFG_EID) \par Criticality Inappropriately setting the clock may result in other sub-systems performing incorrect @@ -1182,14 +1182,14 @@ - \b \c \TIME_CMDPC - command execution counter will increment - \b \c \TIME_STCFSECS - Housekeeping Telemetry point indicating new STCF seconds value - \b \c \TIME_STCFSUBSECS - Housekeeping Telemetry point indicating new STCF subseconds value - - The #CFE_TIME_1HZ_EID informational event message will be generated + - The #CFE_TIME_ONEHZ_EID informational event message will be generated \par Error Conditions - Platform receiving the command is not a Time Server Evidence of Failure may be found in the following telemetry: - \b \c \TIME_CMDEC - command error counter will increment - - Error specific event message will be issued (#CFE_TIME_1HZ_CFG_EID) + - Error specific event message will be issued (#CFE_TIME_ONEHZ_CFG_EID) \par Criticality Inappropriately setting the clock may result in other sub-systems performing incorrect diff --git a/modules/time/fsw/inc/cfe_time_eventids.h b/modules/time/fsw/inc/cfe_time_eventids.h index 9ea5eb239..5a91add9e 100644 --- a/modules/time/fsw/inc/cfe_time_eventids.h +++ b/modules/time/fsw/inc/cfe_time_eventids.h @@ -171,10 +171,10 @@ * * \par Cause: * - * \link #CFE_TIME_ADD_1HZ_ADJUSTMENT_CC TIME Add STCF Adjustment Each Second Command \endlink OR - * \link #CFE_TIME_SUB_1HZ_ADJUSTMENT_CC TIME Subtract STCF Adjustment Each Second Command \endlink success. + * \link #CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC TIME Add STCF Adjustment Each Second Command \endlink OR + * \link #CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC TIME Subtract STCF Adjustment Each Second Command \endlink success. */ -#define CFE_TIME_1HZ_EID 16 +#define CFE_TIME_ONEHZ_EID 16 /** * \brief TIME Set Leap Seconds Command Success Event ID @@ -431,11 +431,11 @@ * * \par Cause: * - * \link #CFE_TIME_ADD_1HZ_ADJUSTMENT_CC TIME Add STCF Adjustment Each Second Command \endlink OR - * \link #CFE_TIME_SUB_1HZ_ADJUSTMENT_CC TIME Subtract STCF Adjustment Each Second Command \endlink + * \link #CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC TIME Add STCF Adjustment Each Second Command \endlink OR + * \link #CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC TIME Subtract STCF Adjustment Each Second Command \endlink * failure due to being in an incompatible mode. */ -#define CFE_TIME_1HZ_CFG_EID 48 +#define CFE_TIME_ONEHZ_CFG_EID 48 /** * \brief TIME Invalid Command Length Event ID diff --git a/modules/time/fsw/src/cfe_time_dispatch.c b/modules/time/fsw/src/cfe_time_dispatch.c index fcd6e08fd..758200293 100644 --- a/modules/time/fsw/src/cfe_time_dispatch.c +++ b/modules/time/fsw/src/cfe_time_dispatch.c @@ -101,7 +101,7 @@ void CFE_TIME_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr) /* ** Run time state machine at 1Hz... */ - case CFE_TIME_1HZ_CMD_MID: + case CFE_TIME_ONEHZ_CMD_MID: CFE_TIME_OneHzCmd((const CFE_TIME_1HzCmd_t *)SBBufPtr); break; @@ -226,14 +226,14 @@ void CFE_TIME_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr) } break; - case CFE_TIME_ADD_1HZ_ADJUSTMENT_CC: + case CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC: if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_Add1HZAdjustmentCmd_t))) { CFE_TIME_Add1HZAdjustmentCmd((const CFE_TIME_Add1HZAdjustmentCmd_t *)SBBufPtr); } break; - case CFE_TIME_SUB_1HZ_ADJUSTMENT_CC: + case CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC: if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_Sub1HZAdjustmentCmd_t))) { CFE_TIME_Sub1HZAdjustmentCmd((const CFE_TIME_Sub1HZAdjustmentCmd_t *)SBBufPtr); diff --git a/modules/time/fsw/src/cfe_time_task.c b/modules/time/fsw/src/cfe_time_task.c index f392e6627..2453a5044 100644 --- a/modules/time/fsw/src/cfe_time_task.c +++ b/modules/time/fsw/src/cfe_time_task.c @@ -143,7 +143,7 @@ int32 CFE_TIME_TaskInit(void) return CFE_STATUS_EXTERNAL_RESOURCE_FAIL; } - OsStatus = OS_BinSemCreate(&CFE_TIME_Global.LocalSemaphore, CFE_TIME_SEM_1HZ_NAME, CFE_TIME_SEM_VALUE, + OsStatus = OS_BinSemCreate(&CFE_TIME_Global.LocalSemaphore, CFE_TIME_SEM_ONEHZ_NAME, CFE_TIME_SEM_VALUE, CFE_TIME_SEM_OPTIONS); if (OsStatus != OS_SUCCESS) { @@ -160,9 +160,9 @@ int32 CFE_TIME_TaskInit(void) return Status; } - Status = CFE_ES_CreateChildTask(&CFE_TIME_Global.LocalTaskID, CFE_TIME_TASK_1HZ_NAME, CFE_TIME_Local1HzTask, - CFE_TIME_TASK_STACK_PTR, CFE_PLATFORM_TIME_1HZ_TASK_STACK_SIZE, - CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY, CFE_TIME_TASK_FLAGS); + Status = CFE_ES_CreateChildTask(&CFE_TIME_Global.LocalTaskID, CFE_TIME_TASK_ONEHZ_NAME, CFE_TIME_Local1HzTask, + CFE_TIME_TASK_STACK_PTR, CFE_PLATFORM_TIME_ONEHZ_TASK_STACK_SIZE, + CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY, CFE_TIME_TASK_FLAGS); if (Status != CFE_SUCCESS) { CFE_ES_WriteToSysLog("%s: Error creating local 1Hz child task:RC=0x%08X\n", __func__, (unsigned int)Status); @@ -221,11 +221,11 @@ int32 CFE_TIME_TaskInit(void) ** Subscribe to 1Hz signal commands... */ #if (CFE_PLATFORM_TIME_CFG_CLIENT == true) - Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CFE_TIME_1HZ_CMD_MID), CFE_TIME_Global.CmdPipe); + Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CFE_TIME_ONEHZ_CMD_MID), CFE_TIME_Global.CmdPipe); #endif #if (CFE_PLATFORM_TIME_CFG_SERVER == true) - Status = CFE_SB_SubscribeLocal(CFE_SB_ValueToMsgId(CFE_TIME_1HZ_CMD_MID), CFE_TIME_Global.CmdPipe, + Status = CFE_SB_SubscribeLocal(CFE_SB_ValueToMsgId(CFE_TIME_ONEHZ_CMD_MID), CFE_TIME_Global.CmdPipe, CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT); #endif @@ -1051,7 +1051,7 @@ void CFE_TIME_1HzAdjImpl(const CFE_TIME_OneHzAdjustmentCmd_Payload_t *CommandPtr CFE_TIME_Set1HzAdj(Adjust, Direction); CFE_TIME_Global.CommandCounter++; - CFE_EVS_SendEvent(CFE_TIME_1HZ_EID, CFE_EVS_EventType_INFORMATION, + CFE_EVS_SendEvent(CFE_TIME_ONEHZ_EID, CFE_EVS_EventType_INFORMATION, "STCF 1Hz Adjust -- secs = %d, ssecs = 0x%X, dir[1=Pos, 2=Neg] = %d", (int)CommandPtr->Seconds, (unsigned int)CommandPtr->Subseconds, (int)Direction); @@ -1061,7 +1061,7 @@ void CFE_TIME_1HzAdjImpl(const CFE_TIME_OneHzAdjustmentCmd_Payload_t *CommandPtr */ CFE_TIME_Global.CommandErrorCounter++; - CFE_EVS_SendEvent(CFE_TIME_1HZ_CFG_EID, CFE_EVS_EventType_ERROR, + CFE_EVS_SendEvent(CFE_TIME_ONEHZ_CFG_EID, CFE_EVS_EventType_ERROR, "1Hz Adjust commands invalid without CFE_PLATFORM_TIME_CFG_SERVER set to TRUE"); #endif /* CFE_PLATFORM_TIME_CFG_SERVER */ diff --git a/modules/time/fsw/src/cfe_time_utils.c b/modules/time/fsw/src/cfe_time_utils.c index d0cdb3bc5..b0719d8ec 100644 --- a/modules/time/fsw/src/cfe_time_utils.c +++ b/modules/time/fsw/src/cfe_time_utils.c @@ -351,7 +351,7 @@ void CFE_TIME_InitData(void) /* ** Initialize local 1Hz "wake-up" command packet (optional)... */ - CFE_MSG_Init(CFE_MSG_PTR(CFE_TIME_Global.Local1HzCmd.CommandHeader), CFE_SB_ValueToMsgId(CFE_TIME_1HZ_CMD_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_TIME_Global.Local1HzCmd.CommandHeader), CFE_SB_ValueToMsgId(CFE_TIME_ONEHZ_CMD_MID), sizeof(CFE_TIME_Global.Local1HzCmd)); } diff --git a/modules/time/fsw/src/cfe_time_utils.h b/modules/time/fsw/src/cfe_time_utils.h index 8c9502bac..31ef1283b 100644 --- a/modules/time/fsw/src/cfe_time_utils.h +++ b/modules/time/fsw/src/cfe_time_utils.h @@ -49,18 +49,18 @@ /* ** Interrupt task definitions... */ -#define CFE_TIME_TASK_TONE_NAME "TIME_TONE_TASK" -#define CFE_TIME_TASK_1HZ_NAME "TIME_1HZ_TASK" -#define CFE_TIME_TASK_STACK_PTR CFE_ES_TASK_STACK_ALLOCATE -#define CFE_TIME_TASK_FLAGS 0 +#define CFE_TIME_TASK_TONE_NAME "TIME_TONE_TASK" +#define CFE_TIME_TASK_ONEHZ_NAME "TIME_ONEHZ_TASK" +#define CFE_TIME_TASK_STACK_PTR CFE_ES_TASK_STACK_ALLOCATE +#define CFE_TIME_TASK_FLAGS 0 /* ** Interrupt semaphore definitions... */ -#define CFE_TIME_SEM_TONE_NAME "TIME_TONE_SEM" -#define CFE_TIME_SEM_1HZ_NAME "TIME_1HZ_SEM" -#define CFE_TIME_SEM_VALUE 0 -#define CFE_TIME_SEM_OPTIONS 0 +#define CFE_TIME_SEM_TONE_NAME "TIME_TONE_SEM" +#define CFE_TIME_SEM_ONEHZ_NAME "TIME_ONEHZ_SEM" +#define CFE_TIME_SEM_VALUE 0 +#define CFE_TIME_SEM_OPTIONS 0 /* ** Main Task Pipe definitions... diff --git a/modules/time/fsw/src/cfe_time_verify.h b/modules/time/fsw/src/cfe_time_verify.h index c8602fc9f..f0edc8416 100644 --- a/modules/time/fsw/src/cfe_time_verify.h +++ b/modules/time/fsw/src/cfe_time_verify.h @@ -159,10 +159,10 @@ #elif CFE_PLATFORM_TIME_TONE_TASK_PRIORITY > 255 #error CFE_PLATFORM_TIME_TONE_TASK_PRIORITY must be less than or equal to 255 #endif -#if CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY < 0 -#error CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY must be greater than or equal to zero -#elif CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY > 255 -#error CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY must be less than or equal to 255 +#if CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY < 0 +#error CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY must be greater than or equal to zero +#elif CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY > 255 +#error CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY must be less than or equal to 255 #endif /* @@ -176,8 +176,8 @@ #error CFE_PLATFORM_TIME_TONE_TASK_STACK_SIZE must be greater than or equal to 2048 #endif -#if CFE_PLATFORM_TIME_1HZ_TASK_STACK_SIZE < 2048 -#error CFE_PLATFORM_TIME_1HZ_TASK_STACK_SIZE must be greater than or equal to 2048 +#if CFE_PLATFORM_TIME_ONEHZ_TASK_STACK_SIZE < 2048 +#error CFE_PLATFORM_TIME_ONEHZ_TASK_STACK_SIZE must be greater than or equal to 2048 #endif /*************************************************************************/ diff --git a/modules/time/ut-coverage/time_UT.c b/modules/time/ut-coverage/time_UT.c index bdfdbeae3..c82993556 100644 --- a/modules/time/ut-coverage/time_UT.c +++ b/modules/time/ut-coverage/time_UT.c @@ -49,14 +49,14 @@ const char *TIME_SYSLOG_MSGS[] = {NULL, "%s: Application Init Failed,RC=0x%08X\n", "%s: Failed invalid arguments\n"}; -static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_SEND_HK = {.MsgId = +static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_SEND_HK = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_SEND_HK_MID)}; -static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_TONE_CMD = {.MsgId = +static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_TONE_CMD = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_TONE_CMD_MID)}; -static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_DATA_CMD = {.MsgId = +static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_DATA_CMD = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_DATA_CMD_MID)}; -static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_1HZ_CMD = {.MsgId = - CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_1HZ_CMD_MID)}; +static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_ONEHZ_CMD = {.MsgId = + CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_ONEHZ_CMD_MID)}; #if (CFE_PLATFORM_TIME_CFG_SERVER == true) static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_SEND_CMD = {.MsgId = @@ -91,10 +91,10 @@ static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_CMD_ADD_ADJUST_CC = { .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_CMD_MID), .CommandCode = CFE_TIME_ADD_ADJUST_CC}; static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_CMD_SUB_ADJUST_CC = { .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_CMD_MID), .CommandCode = CFE_TIME_SUB_ADJUST_CC}; -static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_CMD_ADD_1HZ_ADJUSTMENT_CC = { - .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_CMD_MID), .CommandCode = CFE_TIME_ADD_1HZ_ADJUSTMENT_CC}; -static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_CMD_SUB_1HZ_ADJUSTMENT_CC = { - .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_CMD_MID), .CommandCode = CFE_TIME_SUB_1HZ_ADJUSTMENT_CC}; +static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_CMD_ADD_ONEHZ_ADJUSTMENT_CC = { + .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_CMD_MID), .CommandCode = CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC}; +static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_CMD_SUB_ONEHZ_ADJUSTMENT_CC = { + .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_CMD_MID), .CommandCode = CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC}; static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_INVALID_MID = {.MsgId = CFE_SB_MSGID_RESERVED, .CommandCode = 0}; static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_CMD_INVALID_CC = { .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_CMD_MID), .CommandCode = 0x7F}; @@ -1799,14 +1799,14 @@ void Test_PipeCmds(void) CFE_TIME_Global.CommandCounter = 0; CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, sizeof(CmdBuf.add1hzadjcmd), - UT_TPID_CFE_TIME_CMD_ADD_1HZ_ADJUSTMENT_CC); + UT_TPID_CFE_TIME_CMD_ADD_ONEHZ_ADJUSTMENT_CC); #if (CFE_PLATFORM_TIME_CFG_SERVER == true) - CFE_UtAssert_EVENTSENT(CFE_TIME_1HZ_EID); + CFE_UtAssert_EVENTSENT(CFE_TIME_ONEHZ_EID); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 1); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 0); #else - CFE_UtAssert_EVENTSENT(CFE_TIME_1HZ_CFG_EID); + CFE_UtAssert_EVENTSENT(CFE_TIME_ONEHZ_CFG_EID); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); #endif @@ -1816,7 +1816,7 @@ void Test_PipeCmds(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); CFE_TIME_Global.CommandCounter = 0; CFE_TIME_Global.CommandErrorCounter = 0; - UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_ADD_1HZ_ADJUSTMENT_CC); + UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_ADD_ONEHZ_ADJUSTMENT_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); @@ -1827,14 +1827,14 @@ void Test_PipeCmds(void) CFE_TIME_Global.CommandCounter = 0; CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, sizeof(CmdBuf.sub1hzadjcmd), - UT_TPID_CFE_TIME_CMD_SUB_1HZ_ADJUSTMENT_CC); + UT_TPID_CFE_TIME_CMD_SUB_ONEHZ_ADJUSTMENT_CC); #if (CFE_PLATFORM_TIME_CFG_SERVER == true) - CFE_UtAssert_EVENTSENT(CFE_TIME_1HZ_EID); + CFE_UtAssert_EVENTSENT(CFE_TIME_ONEHZ_EID); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 1); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 0); #else - CFE_UtAssert_EVENTSENT(CFE_TIME_1HZ_CFG_EID); + CFE_UtAssert_EVENTSENT(CFE_TIME_ONEHZ_CFG_EID); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); #endif @@ -1844,7 +1844,7 @@ void Test_PipeCmds(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); CFE_TIME_Global.CommandCounter = 0; CFE_TIME_Global.CommandErrorCounter = 0; - UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SUB_1HZ_ADJUSTMENT_CC); + UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SUB_ONEHZ_ADJUSTMENT_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); @@ -1929,7 +1929,7 @@ void Test_PipeCmds(void) /* In the 1Hz state machine it should call PSP GetTime as part, of latching the clock. This is tested only to see that the latch executed. */ UT_InitData(); - UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, sizeof(CmdBuf.onehzcmd), UT_TPID_CFE_TIME_1HZ_CMD); + UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, sizeof(CmdBuf.onehzcmd), UT_TPID_CFE_TIME_ONEHZ_CMD); UtAssert_NONZERO(UT_GetStubCount(UT_KEY(CFE_PSP_GetTime))); }