Skip to content

Commit

Permalink
Merge remote-tracking branch 'github-nasa/main' into techdev-sois-eds
Browse files Browse the repository at this point in the history
PRELIMINARY: May need update to TBL for DumpTable
  • Loading branch information
jphickey committed Aug 7, 2024
2 parents 1c1d8f5 + dab2f42 commit 9b4b6d5
Show file tree
Hide file tree
Showing 106 changed files with 3,359 additions and 1,093 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
cp ./cfe/cmake/Makefile.sample Makefile
cp -r ./cfe/cmake/sample_defs sample_defs
make prep
make -C build mission-prebuild
# Build the code
- name: Build
Expand Down Expand Up @@ -104,8 +105,8 @@ jobs:
- name: Confirm Minimum Coverage
run: |
missed_branches=50
missed_lines=17
missed_branches=39
missed_lines=19
branch_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep branches | grep -oP "[0-9]+[0-9]*")
line_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep lines | grep -oP "[0-9]+[0-9]*")
Expand Down
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Changelog

## Development Build: equuleus-rc1+dev183
- Runtime Error in coverage-es-ALL, TestApps
- add config tool for platform-specific settings
- Adding bytes read check
- Cast to unsigned int
- Update comment re. limit of CFE_PLATFORM_SB_HIGHEST_VALID_MSGID
- Add element to write error event in CFE_EVS_WriteAppDataFileCmd()
- See <https://github.com/nasa/cFE/pull/2579>, <https://github.com/nasa/cFE/pull/2565>, <https://github.com/nasa/cFE/pull/2584>, <https://github.com/nasa/cFE/pull/2585>, <https://github.com/nasa/cFE/pull/2586>, and <https://github.com/nasa/cFE/pull/2326>

## Development Build: equuleus-rc1+dev167
- CFE_TIME unit test failure when CFE_MISSION_TIME_AT_TONE_WILL_BE set to true
- See <https://github.com/nasa/cFE/pull/2573>

## Development Build: equuleus-rc1+dev163
- Improve CFE_SB_AllocateMessageBuffer error report
- Update CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE macro in es_verify.h
- Update comment re. limits of CFE_PLATFORM_SB_HIGHEST_VALID_MSGID
- Use size_t for variables/parameters representing size
- Remove superfluous status assignment in CFE_SB_CreatePipe
- null value in vsnprintf
- Adds JSC 2.1 Static Analysis comments
- Reduces CFE_EVS_MAX_PORT_MSG_LENGTH to prevent new line character truncation
- See <https://github.com/nasa/cFE/pull/2560>, <https://github.com/nasa/cFE/pull/2344>, <https://github.com/nasa/cFE/pull/2359>, <https://github.com/nasa/cFE/pull/2376>, <https://github.com/nasa/cFE/pull/2496>, <https://github.com/nasa/cFE/pull/2554>, <https://github.com/nasa/cFE/pull/2568>, and <https://github.com/nasa/cFE/pull/2566>

## Development Build: equuleus-rc1+dev141
- use resourceids for internal table validation and dump control blocks
- refactor SB to support additional use cases
- msg api test buffer overrun
- See <2551>, <2381>, and <2537>

## Development Build: equuleus-rc1+dev137
- msg api test buffer overrun
- send CMake message to stdout instead of stderr
- See <https://github.com/nasa/cFE/pull/2537> and <https://github.com/nasa/cFE/pull/2525>

## Development Build: equuleus-rc1+dev131
- add handle list operation routines
- See <https://github.com/nasa/cFE/pull/2548>
Expand Down
2 changes: 1 addition & 1 deletion cmake/arch_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ function(process_arch SYSVAR)
if (FILESRC)
# In case the file is a symlink, follow it to get to the actual file
get_filename_component(FILESRC "${FILESRC}" REALPATH)
message("NOTE: Selected ${FILESRC} as source for ${INSTFILE} on ${TGTNAME}")
message(STATUS "NOTE: Selected ${FILESRC} as source for ${INSTFILE} on ${TGTNAME}")
install(FILES ${FILESRC} DESTINATION ${TGTNAME}/${INSTALL_SUBDIR} RENAME ${INSTFILE})
else(FILESRC)
message("WARNING: Install file ${INSTFILE} for ${TGTNAME} not found")
Expand Down
44 changes: 38 additions & 6 deletions cmake/mission_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,38 @@ function(export_variable_cache USER_VARLIST)

endfunction(export_variable_cache)

##################################################################
#
# FUNCTION: decode_targetsystem
#
#
function(decode_targetsystem TARGETSYSTEM)
# The "BUILD_CONFIG" is a list of items to uniquely identify this build
# The first element in the list is the toolchain name, followed by config name(s)

set(ONE_VAL_ARGS OUTPUT_ARCH_BINARY_DIR OUTPUT_ARCH_TOOLCHAIN_NAME OUTPUT_ARCH_CONFIG_NAME)
cmake_parse_arguments(DT "" "${ONE_VAL_ARGS}" "" ${ARGN})

set(BUILD_CONFIG ${BUILD_CONFIG_${TARGETSYSTEM}})
list(GET BUILD_CONFIG 0 ARCH_TOOLCHAIN_NAME)
list(REMOVE_AT BUILD_CONFIG 0)
# convert to a string which is safe for a directory name
string(REGEX REPLACE "[^A-Za-z0-9]" "_" ARCH_CONFIG_NAME "${BUILD_CONFIG}")

# Export values to parent
if (DT_OUTPUT_ARCH_BINARY_DIR)
set(${DT_OUTPUT_ARCH_BINARY_DIR} "${CMAKE_BINARY_DIR}/${ARCH_TOOLCHAIN_NAME}/${ARCH_CONFIG_NAME}" PARENT_SCOPE)
endif()
if (DT_OUTPUT_ARCH_TOOLCHAIN_NAME)
set(${DT_OUTPUT_ARCH_TOOLCHAIN_NAME} "${ARCH_TOOLCHAIN_NAME}" PARENT_SCOPE)
endif()
if (DT_OUTPUT_ARCH_CONFIG_NAME)
set(${DT_OUTPUT_ARCH_CONFIG_NAME} "${ARCH_CONFIG_NAME}" PARENT_SCOPE)
endif()

endfunction(decode_targetsystem)


##################################################################
#
# FUNCTION: prepare
Expand Down Expand Up @@ -536,12 +568,12 @@ function(process_arch TARGETSYSTEM)

# The "BUILD_CONFIG" is a list of items to uniquely identify this build
# The first element in the list is the toolchain name, followed by config name(s)
set(BUILD_CONFIG ${BUILD_CONFIG_${TARGETSYSTEM}})
list(GET BUILD_CONFIG 0 ARCH_TOOLCHAIN_NAME)
list(REMOVE_AT BUILD_CONFIG 0)
# convert to a string which is safe for a directory name
string(REGEX REPLACE "[^A-Za-z0-9]" "_" ARCH_CONFIG_NAME "${BUILD_CONFIG}")
set(ARCH_BINARY_DIR "${CMAKE_BINARY_DIR}/${ARCH_TOOLCHAIN_NAME}/${ARCH_CONFIG_NAME}")
decode_targetsystem(${TARGETSYSTEM}
OUTPUT_ARCH_BINARY_DIR ARCH_BINARY_DIR
OUTPUT_ARCH_TOOLCHAIN_NAME ARCH_TOOLCHAIN_NAME
OUTPUT_ARCH_CONFIG_NAME ARCH_CONFIG_NAME
)

file(MAKE_DIRECTORY "${ARCH_BINARY_DIR}")

message(STATUS "Configuring for system arch: ${ARCH_TOOLCHAIN_NAME}/${ARCH_CONFIG_NAME}")
Expand Down
3 changes: 1 addition & 2 deletions cmake/sample_defs/example_platform_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1145,8 +1145,7 @@
** this value is set the same across all mission platforms to avoid this complexity.
**
** \par Limits
** CFE_SB_INVALID_MSG is set to the maximum representable number of type CFE_SB_MsgId_t.
** CFE_PLATFORM_SB_HIGHEST_VALID_MSGID lower limit is 1, up to CFE_SB_INVALID_MSG_ID - 1.
** This parameter has a lower limit is 1, and an upper limit of 0xFFFFFFFE.
**
** When using the direct message map implementation for software bus routing, this
** value is used to size the map where a value of 0x1FFF results in a 16 KBytes map
Expand Down
124 changes: 77 additions & 47 deletions modules/cfe_testcase/src/msg_api_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,88 +176,118 @@ void TestMsgHeaderSecondaryApi(void)
"CFE_MSG_GetFcnCode, CFE_MSG_GetMsgTime, CFE_MSG_SetMsgTime ");

/* declare local vars */
CFE_MSG_CommandHeader_t cmd;
CFE_MSG_CommandHeader_t cmdTlm;
CFE_MSG_CommandHeader_t cmd2;
CFE_MSG_FcnCode_t fcnCode;
CFE_TIME_SysTime_t msgTime;
bool isValid = true;
CFE_TIME_SysTime_t currentTime = {1000, 0xFFFF0000};
CFE_Status_t status;
CFE_MSG_CommandHeader_t cmd;
CFE_MSG_TelemetryHeader_t tlm;
CFE_MSG_FcnCode_t fcnCode;
CFE_TIME_SysTime_t msgTime;
bool isValid = true;
CFE_TIME_SysTime_t currentTime = {1000, 0xFFFF0000};

memset(&cmd, 0, sizeof(cmd));
memset(&cmdTlm, 0xFF, sizeof(cmdTlm));
memset(&cmd2, 0xFF, sizeof(cmd2));
memset(&tlm, 0, sizeof(tlm));

/* msg-init */
UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd), CFE_SB_ValueToMsgId(1), sizeof(cmd)), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(CFE_MSG_PTR(cmd), true), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmd), CFE_MSG_Type_Cmd), CFE_SUCCESS);

UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmdTlm), CFE_SB_ValueToMsgId(2), sizeof(cmdTlm)), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(CFE_MSG_PTR(cmdTlm), true), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmdTlm), CFE_MSG_Type_Tlm), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(tlm), CFE_SB_ValueToMsgId(2), sizeof(tlm)), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(CFE_MSG_PTR(tlm), true), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(tlm), CFE_MSG_Type_Tlm), CFE_SUCCESS);

UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd2), CFE_SB_ValueToMsgId(3), sizeof(cmd2)), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(CFE_MSG_PTR(cmd2), true), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmd2), CFE_MSG_Type_Cmd), CFE_SUCCESS);
/* test generate-checksum on commands */
CFE_Assert_STATUS_STORE(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmd), &isValid));
if (CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS))
{
UtAssert_BOOL_FALSE(isValid); /* assuming a zero'ed out struct will have an invalid checksum */

/* test generate-checksum */
status = CFE_MSG_GenerateChecksum(NULL);
if (status == CFE_MSG_NOT_IMPLEMENTED)
UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(CFE_MSG_PTR(cmd)), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmd), &isValid), CFE_SUCCESS);
UtAssert_BOOL_TRUE(isValid);
}
else if (CFE_Assert_STATUS_MAY_BE(CFE_MSG_WRONG_MSG_TYPE))
{
UtAssert_NA("CFE_MSG_GenerateChecksum not implemented");
UtAssert_NA("CFE_MSG_GenerateChecksum does not operate on commands");
}
else
{
UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(NULL), CFE_MSG_BAD_ARGUMENT);
UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(CFE_MSG_PTR(cmdTlm)), CFE_MSG_WRONG_MSG_TYPE);
UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmdTlm), &isValid), CFE_MSG_WRONG_MSG_TYPE);
UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(NULL, &isValid), CFE_MSG_BAD_ARGUMENT);
UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmdTlm), NULL), CFE_MSG_BAD_ARGUMENT);
UtAssert_NA("CFE_MSG_GenerateChecksum on commands not implemented");
CFE_Assert_STATUS_MUST_BE(CFE_MSG_NOT_IMPLEMENTED);
}

UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmd), &isValid), CFE_SUCCESS);
UtAssert_True(!isValid, "Checksum isValid (%d) = false", isValid);
UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(CFE_MSG_PTR(cmd)), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmd), &isValid), CFE_SUCCESS);
UtAssert_True(isValid, "Checksum isValid (%d) = true", isValid);
/* test generate-checksum on telemetry */
CFE_Assert_STATUS_STORE(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(tlm), &isValid));
if (CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS))
{
UtAssert_BOOL_FALSE(isValid); /* assuming a zero'ed out struct will have an invalid checksum */

UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(CFE_MSG_PTR(tlm)), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(tlm), &isValid), CFE_SUCCESS);
UtAssert_BOOL_TRUE(isValid);
}
else if (CFE_Assert_STATUS_MAY_BE(CFE_MSG_WRONG_MSG_TYPE))
{
UtAssert_NA("CFE_MSG_GenerateChecksum does not operate on telemetry");
}
else
{
UtAssert_NA("CFE_MSG_GenerateChecksum on telemetry not implemented");
CFE_Assert_STATUS_MUST_BE(CFE_MSG_NOT_IMPLEMENTED);
}

/* test get/set-fcn-code */
UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(NULL, 4), CFE_MSG_BAD_ARGUMENT);
UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(CFE_MSG_PTR(cmdTlm), 4), CFE_MSG_WRONG_MSG_TYPE);
UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(CFE_MSG_PTR(tlm), 4), CFE_MSG_WRONG_MSG_TYPE);

UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(CFE_MSG_PTR(cmd), NULL), CFE_MSG_BAD_ARGUMENT);
UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(NULL, &fcnCode), CFE_MSG_BAD_ARGUMENT);
UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(CFE_MSG_PTR(cmdTlm), &fcnCode), CFE_MSG_WRONG_MSG_TYPE);
UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(CFE_MSG_PTR(tlm), &fcnCode), CFE_MSG_WRONG_MSG_TYPE);

UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(CFE_MSG_PTR(cmd), 4), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(CFE_MSG_PTR(cmd), &fcnCode), CFE_SUCCESS);
UtAssert_INT32_EQ(fcnCode, 4);

/* test get/set-msg-time */
UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmd), CFE_MSG_Type_Tlm), CFE_SUCCESS);

UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(NULL, &msgTime), CFE_MSG_BAD_ARGUMENT);
UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(CFE_MSG_PTR(cmd), NULL), CFE_MSG_BAD_ARGUMENT);
UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(CFE_MSG_PTR(tlm), NULL), CFE_MSG_BAD_ARGUMENT);

CFE_Assert_STATUS_STORE(CFE_MSG_GetMsgTime(CFE_MSG_PTR(cmd2), &msgTime));
if (!CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS))
/* Check if GetMsgTime is implemented on commands */
CFE_Assert_STATUS_STORE(CFE_MSG_GetMsgTime(CFE_MSG_PTR(cmd), &msgTime));
if (CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS))
{
CFE_Assert_STATUS_MUST_BE(CFE_MSG_WRONG_MSG_TYPE);
memset(&msgTime, 0xff, sizeof(msgTime));
UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(CFE_MSG_PTR(cmd), currentTime), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(CFE_MSG_PTR(cmd), &msgTime), CFE_SUCCESS);
UtAssert_UINT32_EQ(CFE_TIME_Compare(msgTime, currentTime), CFE_TIME_EQUAL);
}

UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(NULL, currentTime), CFE_MSG_BAD_ARGUMENT);

CFE_Assert_STATUS_STORE(CFE_MSG_SetMsgTime(CFE_MSG_PTR(cmd2), currentTime));
if (!CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS))
else if (CFE_Assert_STATUS_MAY_BE(CFE_MSG_WRONG_MSG_TYPE))
{
UtAssert_NA("CFE_MSG_GetMsgTime does not operate on commands");
}
else
{
CFE_Assert_STATUS_MUST_BE(CFE_MSG_WRONG_MSG_TYPE);
UtAssert_NA("CFE_MSG_GetMsgTime on commands not implemented");
CFE_Assert_STATUS_MUST_BE(CFE_MSG_NOT_IMPLEMENTED);
}

UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(CFE_MSG_PTR(cmd), currentTime), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(CFE_MSG_PTR(cmd), &msgTime), CFE_SUCCESS);
UtAssert_UINT32_EQ(CFE_TIME_Compare(msgTime, currentTime), CFE_TIME_EQUAL);
/* Check if GetMsgTime is implemented on telemetry */
CFE_Assert_STATUS_STORE(CFE_MSG_GetMsgTime(CFE_MSG_PTR(tlm), &msgTime));
if (CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS))
{
memset(&msgTime, 0xff, sizeof(msgTime));
UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(CFE_MSG_PTR(tlm), currentTime), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(CFE_MSG_PTR(tlm), &msgTime), CFE_SUCCESS);
UtAssert_UINT32_EQ(CFE_TIME_Compare(msgTime, currentTime), CFE_TIME_EQUAL);
}
else if (CFE_Assert_STATUS_MAY_BE(CFE_MSG_WRONG_MSG_TYPE))
{
UtAssert_NA("CFE_MSG_GetMsgTime does not operate on telemetry");
}
else
{
UtAssert_NA("CFE_MSG_GetMsgTime on telemetry not implemented");
CFE_Assert_STATUS_MUST_BE(CFE_MSG_NOT_IMPLEMENTED);
}
}

void MsgApiTestSetup(void)
Expand Down
4 changes: 2 additions & 2 deletions modules/cfe_testcase/src/tbl_content_mang_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ void TblTest_GenerateTblFiles(void)
{
osal_id_t fh1 = OS_OBJECT_ID_UNDEFINED;
osal_id_t fh2 = OS_OBJECT_ID_UNDEFINED;
uint32 PartialOffset;
uint32 PartialSize;
size_t PartialOffset;
size_t PartialSize;
union
{
uint8 u8;
Expand Down
23 changes: 19 additions & 4 deletions modules/config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,27 @@ set(config_SOURCES
)
add_library(config STATIC
${config_SOURCES}
${MISSION_BINARY_DIR}/src/cfe_config_map.c
${MISSION_BINARY_DIR}/src/cfe_configid_nametable.c
${CMAKE_BINARY_DIR}/src/cfe_platformcfg_tables.c
)

# need to include the "src" dir explicitly here, in order to compile
# the generated tables under ${MISSION_BINARY_DIR}
target_include_directories(config PRIVATE fsw/src)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/src/cfe_platformcfg_tables.c
COMMAND ${CMAKE_COMMAND}
-D LIST_FILE=${MISSION_BINARY_DIR}/src/cfeconfig_platformdata_${TARGETSYSTEM}.list
-D CONTENT_FILE=${MISSION_BINARY_DIR}/src/cfeconfig_platformdata_${TARGETSYSTEM}.c
-D OUTPUT_FILE=${CMAKE_BINARY_DIR}/src/cfe_platformcfg_tables.c
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/create_cfe_platform_cfg.cmake
WORKING_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/cmake
DEPENDS
${MISSION_BINARY_DIR}/src/cfeconfig_platformdata_${TARGETSYSTEM}.c
${MISSION_BINARY_DIR}/src/cfeconfig_platformdata_${TARGETSYSTEM}.list
${CMAKE_CURRENT_SOURCE_DIR}/cmake/create_cfe_platform_cfg.cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake/cfe_platform_cfg.c.in
)

target_include_directories(config PUBLIC fsw/inc)
target_link_libraries(config PRIVATE core_private)

# Add unit test coverage subdirectory
Expand Down
14 changes: 8 additions & 6 deletions modules/config/cmake/cfe_config_ids.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
#include "cfe_config_api_typedefs.h"
#include "cfe_resourceid.h"
#include "cfe_core_resourceid_basevalues.h"
#include "cfe_configid_offset.h"

/* Value offsets from base (needed for macros; do not use directly) */
enum CFE_ConfigIdOffset
{
@GENERATED_ENUM_OFFSET_LIST@
CFE_ConfigIdOffset_MAX
};
/*
* Macro to convert to a properly-typed config ID
* The symbol used in this macro must correlate to an offset in the enum
*/

#define CFE_CONFIGID_OFFSET_TO_RESID(x) CFE_ResourceId_FromInteger(CFE_CONFIGID_BASE + CFE_CONFIGID_OFFSETNAME(x))
#define CFE_CONFIGID_FROM_OFFSET(x) CFE_CONFIGID_C(CFE_CONFIGID_OFFSET_TO_RESID(x))

/*
* Set of actual CONFIGID constants -
Expand Down
8 changes: 0 additions & 8 deletions modules/config/cmake/cfe_config_map.c.in

This file was deleted.

11 changes: 11 additions & 0 deletions modules/config/cmake/cfe_configid_nametable.c.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* This file is auto-generated from CMake build system. Do not manually edit! */
#include "cfe_configid_offset.h"
#include "cfe_config_nametable.h"

#define CFE_CONFIGID_DEFINE(x) [CFE_CONFIGID_OFFSETNAME(x)] = { #x },

/* Map of configuration key IDs to printable names */
const CFE_Config_IdNameEntry_t CFE_CONFIGID_NAMETABLE[CFE_ConfigIdOffset_MAX] =
{
@GENERATED_ID_MACRO_LIST@
};
Loading

0 comments on commit 9b4b6d5

Please sign in to comment.