You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/12/11 00:41:06 UTC
[GitHub] ccollins476ad closed pull request #1556: Export `id/target` setting
if configured
ccollins476ad closed pull request #1556: Export `id/target` setting if configured
URL: https://github.com/apache/mynewt-core/pull/1556
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/sys/id/src/id.c b/sys/id/src/id.c
index c43c67dd8f..f1dfe3e62a 100644
--- a/sys/id/src/id.c
+++ b/sys/id/src/id.c
@@ -93,6 +93,10 @@ id_conf_get(int argc, char **argv, char *val, int val_len_max)
#if MYNEWT_VAL(ID_MODEL_PRESENT)
} else if (!strcmp(argv[0], "model")) {
return (char *)id_model;
+#endif
+#if MYNEWT_VAL(ID_TARGET_PRESENT)
+ } else if (!strcmp(argv[0], "target")) {
+ return MYNEWT_VAL(TARGET_NAME);
#endif
} else if (!strcmp(argv[0], "mfghash")) {
return id_mfghash;
@@ -141,6 +145,9 @@ id_conf_export(void (*export_func)(char *name, char *val),
export_func("id/bsp", (char *)id_bsp_str);
export_func("id/app", (char *)id_app_str);
export_func("id/mfghash", (char *)id_mfghash);
+#if MYNEWT_VAL(ID_TARGET_PRESENT)
+ export_func("id/target", MYNEWT_VAL(TARGET_NAME));
+#endif
}
#if MYNEWT_VAL(ID_SERIAL_PRESENT)
export_func("id/serial", id_serial);
diff --git a/sys/id/syscfg.yml b/sys/id/syscfg.yml
index 09cd34deed..8e5f29b866 100644
--- a/sys/id/syscfg.yml
+++ b/sys/id/syscfg.yml
@@ -45,3 +45,10 @@ syscfg.defs:
value: 0
restrictions:
- 'ID_MODEL_PRESENT'
+
+ ID_TARGET_PRESENT:
+ description: 'Target name string exported as `id/target`.'
+ value: 0
+ restrictions:
+ # Older versions of newt don't export the target name.
+ - 'TARGET_NAME'
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services