Skip to content

Commit

Permalink
Fix #710, allow setting of processor ID in targets.cmake
Browse files Browse the repository at this point in the history
Add support for a TGTx_PROCESSOR_ID directive, which allows
one to set the default value returned by CFE_PSP_GetProcessorId()
function, rather than assuming the index value from CMake.
  • Loading branch information
jphickey committed Jul 9, 2020
1 parent a47abba commit 2868acc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions cmake/sample_defs/targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 <x> is the
# CPU number starting with 1:
# The following variables are defined per board, where <x> is a
# sequential index number starting with 1:
#
# TGT<x>_NAME : the user-friendly name of the cpu. Should be simple
# word with no punctuation. This MUST be specified.
# TGT<x>_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<x>_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
Expand Down
6 changes: 5 additions & 1 deletion cmake/target/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit 2868acc

Please sign in to comment.