diff --git a/cmake/sample_defs/targets.cmake b/cmake/sample_defs/targets.cmake index d43dcac02..9ba78bbbb 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 35935cb4a..309981d78 100644 --- a/cmake/target/CMakeLists.txt +++ b/cmake/target/CMakeLists.txt @@ -40,7 +40,11 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) # 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})