diff --git a/cmake/sample_defs/targets.cmake b/cmake/sample_defs/targets.cmake index 03d72f454..37f7e5b4f 100644 --- a/cmake/sample_defs/targets.cmake +++ b/cmake/sample_defs/targets.cmake @@ -5,11 +5,15 @@ # This file indicates the architecture and configuration of the # target boards that will run core flight software. # -# The following variables are defined per board, where is the -# CPU number starting with 1: +# The following variables are defined per board, where is a +# sequential index number starting with 1: # # TGT_NAME : the user-friendly name of the cpu. Should be simple # word with no punctuation. This MUST be specified. +# TGT_PROCESSORID : the default numeric ID for this processor at +# runtime. If not specified, then the sequential index number is +# used. This translates to the numeric value returned by +# CFE_PSP_GetProcessorId() at runtime. # TGT_APPLIST : list of applications to build and install on the CPU. # These are built as dynamically-loaded applications and installed # as files in the non-volatile storage of the target, and loaded diff --git a/cmake/target/CMakeLists.txt b/cmake/target/CMakeLists.txt index d7b30c6f9..a856b92de 100644 --- a/cmake/target/CMakeLists.txt +++ b/cmake/target/CMakeLists.txt @@ -48,7 +48,11 @@ include_directories(${CMAKE_BINARY_DIR}/${CFE_CORE_TARGET}/inc) # The CPU ID and name are defined by the build scripts for this target if (DEFINED TGTID) - add_definitions(-DCFE_CPU_ID_VALUE=${TGTID}) + if (DEFINED TGT${TGTID}_PROCESSORID) + add_definitions(-DCFE_CPU_ID_VALUE=${TGT${TGTID}_PROCESSORID}) + else() + add_definitions(-DCFE_CPU_ID_VALUE=${TGTID}) + endif() endif() if (DEFINED SPACECRAFT_ID) add_definitions(-DCFE_SPACECRAFT_ID_VALUE=${SPACECRAFT_ID})