Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #146, Include PRID and SCID in table files #147

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions scripts/add_cfe_tables_impl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,24 @@ function(do_add_cfe_tables_impl TABLE_FQNAME)
set(TABLE_GENSCRIPT "${CFS_TABLETOOL_SCRIPT_DIR}/generate_elf_table_rules.cmake")
set(TABLE_LIBNAME "tblobj_${ADDTBL_ARG_TARGET_NAME}_${TABLE_FQNAME}")

# determine processor ID and spacecraft ID to use for table.
# If these are not defined, pass 0 instead of a blank (elf2cfetbl will error on non-integer)
if (DEFINED ${ADDTBL_ARG_TARGET_NAME}_PROCESSORID)
set(TABLE_PRID ${${ADDTBL_ARG_TARGET_NAME}_PROCESSORID})
else()
set(TABLE_PRID 0)
endif()

if (DEFINED SPACECRAFT_ID)
set(TABLE_SCID ${SPACECRAFT_ID})
else()
set(TABLE_SCID 0)
endif()

set(TABLE_CMD_OPTS
-DTEMPLATE_FILE="${TEMPLATE_FILE}"
-DTARGET_SCID="${TABLE_SCID}"
-DTARGET_PRID="${TABLE_PRID}"
-DAPP_NAME="${ADDTBL_ARG_APP_NAME}"
-DTARGET_NAME="${ADDTBL_ARG_TARGET_NAME}"
-DARCHIVE_FILE="\"$<TARGET_FILE:${TABLE_LIBNAME}>\""
Expand Down
2 changes: 2 additions & 0 deletions scripts/table_rule_template.d.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

cfetables: ${TABLE_BINARY}

${TABLE_BINARY}: CFE_TABLE_SCID := ${TARGET_SCID}
${TABLE_BINARY}: CFE_TABLE_PRID := ${TARGET_PRID}
${TABLE_BINARY}: CFE_TABLE_CPUNAME := ${TARGET_NAME}
${TABLE_BINARY}: CFE_TABLE_APPNAME := ${APP_NAME}
${TABLE_BINARY}: CFE_TABLE_BASENAME := ${TABLE_NAME}
Expand Down
2 changes: 1 addition & 1 deletion scripts/tabletool_rule.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ cfetables:
# As a workaround, $CURDIR is used.
staging/%.tbl:
@mkdir -pv "$(dir $(@))"
cd "$(dir $(@))" && $(TBLTOOL) $(TBLTOOL_FLAGS) "$(CURDIR)/$(<)"
cd "$(dir $(@))" && $(TBLTOOL) -p$(CFE_TABLE_PRID) -s$(CFE_TABLE_SCID) "$(CURDIR)/$(<)"
Loading