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/05/15 08:46:41 UTC

[GitHub] mkiiskila closed pull request #1068: Export few key variables for direct use.

mkiiskila closed pull request #1068: Export few key variables for direct use.
URL: https://github.com/apache/mynewt-core/pull/1068
 
 
   

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/config/include/config/config.h b/sys/config/include/config/config.h
index 91604803b7..77720f005d 100644
--- a/sys/config/include/config/config.h
+++ b/sys/config/include/config/config.h
@@ -247,7 +247,7 @@ int conf_set_value(char *name, char *val_str);
  * @param name Name/key of the configuration item.
  * @param val_str Value of the configuration item.
  *
- * @return 0 on success, non-zero on failure.
+ * @return pointer to value on success, NULL on failure.
  */
 char *conf_get_value(char *name, char *buf, int buf_len);
 
diff --git a/sys/id/include/id/id.h b/sys/id/include/id/id.h
index f4d61cfaf7..8db3055dde 100644
--- a/sys/id/include/id/id.h
+++ b/sys/id/include/id/id.h
@@ -30,6 +30,8 @@ extern "C" {
 #define ID_SERIAL_MAX_LEN       64
 extern char id_serial[];
 extern char id_mfghash[];
+extern const char *id_bsp_str;
+extern const char *id_app_str;
 
 /*
  * Initialize manufacturing info storage/reporting.
diff --git a/sys/id/src/id.c b/sys/id/src/id.c
index 34eb8f7f86..e738b390f6 100644
--- a/sys/id/src/id.c
+++ b/sys/id/src/id.c
@@ -39,11 +39,11 @@ static int id_conf_export(void (*export_func)(char *name, char *val),
 #define STAMP_STR1(str) #str
 
 #ifdef BSP_NAME
-static const char *bsp_str = STAMP_STR(BSP_NAME);
-static const char *app_str = STAMP_STR(APP_NAME);
+const char *id_bsp_str = STAMP_STR(BSP_NAME);
+const char *id_app_str = STAMP_STR(APP_NAME);
 #else
-static const char *bsp_str = "";
-static const char *app_str = "";
+const char *id_bsp_str = "";
+const char *id_app_str = "";
 #endif
 
 char id_serial[ID_SERIAL_MAX_LEN];
@@ -71,9 +71,9 @@ id_conf_get(int argc, char **argv, char *val, int val_len_max)
                 return conf_str_from_bytes(src_buf, len, val, val_len_max);
             }
         } else if (!strcmp(argv[0], "bsp")) {
-            return (char *)bsp_str;
+            return (char *)id_bsp_str;
         } else if (!strcmp(argv[0], "app")) {
-            return (char *)app_str;
+            return (char *)id_app_str;
         } else if (!strcmp(argv[0], "serial")) {
             return id_serial;
         } else if (!strcmp(argv[0], "mfghash")) {
@@ -108,8 +108,8 @@ id_conf_export(void (*export_func)(char *name, char *val),
             conf_str_from_bytes(src_buf, len, str, sizeof(str));
         }
         export_func("id/hwid", str);
-        export_func("id/bsp", (char *)bsp_str);
-        export_func("id/app", (char *)app_str);
+        export_func("id/bsp", (char *)id_bsp_str);
+        export_func("id/app", (char *)id_app_str);
         export_func("id/mfghash", (char *)id_mfghash);
     }
     export_func("id/serial", id_serial);
diff --git a/sys/reboot/include/reboot/log_reboot.h b/sys/reboot/include/reboot/log_reboot.h
index fbc1f2441b..d84148d64b 100644
--- a/sys/reboot/include/reboot/log_reboot.h
+++ b/sys/reboot/include/reboot/log_reboot.h
@@ -37,6 +37,8 @@ int reboot_init_handler(int log_store_type, uint8_t entries);
 int log_reboot(enum hal_reset_reason);
 void reboot_start(enum hal_reset_reason reason);
 
+extern uint16_t reboot_cnt;
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/sys/reboot/src/log_reboot.c b/sys/reboot/src/log_reboot.c
index 106c84e673..86a3f647fd 100644
--- a/sys/reboot/src/log_reboot.c
+++ b/sys/reboot/src/log_reboot.c
@@ -36,7 +36,7 @@
 
 static struct log_handler *reboot_log_handler;
 static struct log reboot_log;
-static uint16_t reboot_cnt;
+uint16_t reboot_cnt;
 static uint16_t soft_reboot;
 static char reboot_cnt_str[12];
 static char soft_reboot_str[12];


 

----------------------------------------------------------------
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