mynewt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject [2/2] incubator-mynewt-core git commit: sys/reboot; add config option to control whether logging to console is an option.
Date Sat, 28 Jan 2017 02:16:09 GMT
sys/reboot; add config option to control whether logging to console
is an option.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/0373ef39
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/0373ef39
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/0373ef39

Branch: refs/heads/develop
Commit: 0373ef399d947e286751f3dae9af5fc89fc7663a
Parents: 3a108c8
Author: Marko Kiiskila <marko@runtime.io>
Authored: Fri Jan 27 17:54:56 2017 -0800
Committer: Marko Kiiskila <marko@runtime.io>
Committed: Fri Jan 27 18:15:08 2017 -0800

----------------------------------------------------------------------
 sys/reboot/pkg.yml          | 1 -
 sys/reboot/src/log_reboot.c | 7 +++++--
 sys/reboot/syscfg.yml       | 6 ++++++
 3 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0373ef39/sys/reboot/pkg.yml
----------------------------------------------------------------------
diff --git a/sys/reboot/pkg.yml b/sys/reboot/pkg.yml
index cc22051..39bcdeb 100644
--- a/sys/reboot/pkg.yml
+++ b/sys/reboot/pkg.yml
@@ -34,7 +34,6 @@ pkg.deps.REBOOT_LOG_FCB:
     - fs/fcb
 pkg.req_apis:
     - log
-    - console
 
 pkg.init:
     log_reboot_pkg_init: 200

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0373ef39/sys/reboot/src/log_reboot.c
----------------------------------------------------------------------
diff --git a/sys/reboot/src/log_reboot.c b/sys/reboot/src/log_reboot.c
index 7a02414..952def6 100644
--- a/sys/reboot/src/log_reboot.c
+++ b/sys/reboot/src/log_reboot.c
@@ -23,7 +23,6 @@
 #include "syscfg/syscfg.h"
 #include "sysflash/sysflash.h"
 #include "os/os.h"
-#include "console/console.h"
 #include "log/log.h"
 #include "bootutil/image.h"
 #include "bootutil/bootutil.h"
@@ -106,10 +105,12 @@ reboot_init_handler(int log_store_type, uint8_t entries)
             arg = &reboot_log_fcb;
             break;
 #endif
+#if MYNEWT_VAL(REBOOT_LOG_CONSOLE)
        case LOG_STORE_CONSOLE:
             reboot_log_handler = (struct log_handler *)&log_console_handler;
             arg = NULL;
             break;
+#endif
        default:
             assert(0);
     }
@@ -244,8 +245,10 @@ log_reboot_pkg_init(void)
 #if MYNEWT_VAL(REBOOT_LOG_ENTRY_COUNT)
 #if MYNEWT_VAL(REBOOT_LOG_FCB)
     type = LOG_STORE_FCB;
-#else
+#elif MYNEWT_VAL(REBOOT_LOG_CONSOLE)
     type = LOG_STORE_CONSOLE;
+#else
+#error "sys/reboot included, but no log target"
 #endif
     rc = reboot_init_handler(type, MYNEWT_VAL(REBOOT_LOG_ENTRY_COUNT));
     SYSINIT_PANIC_ASSERT(rc == 0);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0373ef39/sys/reboot/syscfg.yml
----------------------------------------------------------------------
diff --git a/sys/reboot/syscfg.yml b/sys/reboot/syscfg.yml
index a71aa92..a1884ca 100644
--- a/sys/reboot/syscfg.yml
+++ b/sys/reboot/syscfg.yml
@@ -26,6 +26,12 @@ syscfg.defs:
             - LOG_FCB
             - REBOOT_LOG_FLASH_AREA
 
+    REBOOT_LOG_CONSOLE:
+        description: 'TBD'
+        value: 1
+        restrictions:
+            - LOG_CONSOLE
+
     REBOOT_LOG_FLASH_AREA:
         description: 'TBD'
         type: flash_owner


Mime
View raw message