You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/12/27 22:50:45 UTC

incubator-mynewt-core git commit: nmgr_os; add syscfg knob to turn off soft reboot logging.

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop d766b1ca8 -> f4504a5ba


nmgr_os; add syscfg knob to turn off soft reboot logging.


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/f4504a5b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/f4504a5b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/f4504a5b

Branch: refs/heads/develop
Commit: f4504a5ba9ca89d3d353f8c67f66ba0e4a7928cf
Parents: d766b1c
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Dec 27 14:49:54 2016 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Tue Dec 27 14:49:54 2016 -0800

----------------------------------------------------------------------
 mgmt/newtmgr/nmgr_os/pkg.yml          |  4 +++-
 mgmt/newtmgr/nmgr_os/src/newtmgr_os.c |  6 ++++++
 mgmt/newtmgr/nmgr_os/syscfg.yml       | 23 +++++++++++++++++++++++
 3 files changed, 32 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f4504a5b/mgmt/newtmgr/nmgr_os/pkg.yml
----------------------------------------------------------------------
diff --git a/mgmt/newtmgr/nmgr_os/pkg.yml b/mgmt/newtmgr/nmgr_os/pkg.yml
index 4e0d480..e02d44d 100644
--- a/mgmt/newtmgr/nmgr_os/pkg.yml
+++ b/mgmt/newtmgr/nmgr_os/pkg.yml
@@ -27,10 +27,12 @@ pkg.deps:
     - hw/hal
     - time/datetime
     - kernel/os
-    - sys/reboot
     - mgmt/mgmt
     - encoding/tinycbor
     - encoding/cborattr
 
+pkg.deps.LOG_SOFT_RESET:
+    - sys/reboot
+
 pkg.req_apis:
     - newtmgr

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f4504a5b/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
----------------------------------------------------------------------
diff --git a/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c b/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
index 4a02c30..1e01b24 100644
--- a/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
+++ b/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
@@ -16,6 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+#include <syscfg/syscfg.h>
 
 #include <os/os.h>
 #include <os/endian.h>
@@ -29,7 +30,10 @@
 
 #include <console/console.h>
 #include <datetime/datetime.h>
+
+#if MYNEWT_VAL(LOG_SOFT_RESET)
 #include <reboot/log_reboot.h>
+#endif
 
 #include "nmgr_os/nmgr_os.h"
 
@@ -325,7 +329,9 @@ nmgr_reset(struct mgmt_cbuf *cb)
 {
     os_callout_init(&nmgr_reset_callout, mgmt_evq_get(), nmgr_reset_tmo, NULL);
 
+#if MYNEWT_VAL(LOG_SOFT_RESET)
     log_reboot(HAL_RESET_SOFT);
+#endif
     os_callout_reset(&nmgr_reset_callout, OS_TICKS_PER_SEC / 4);
 
     mgmt_cbuf_setoerr(cb, OS_OK);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f4504a5b/mgmt/newtmgr/nmgr_os/syscfg.yml
----------------------------------------------------------------------
diff --git a/mgmt/newtmgr/nmgr_os/syscfg.yml b/mgmt/newtmgr/nmgr_os/syscfg.yml
new file mode 100644
index 0000000..78caaf0
--- /dev/null
+++ b/mgmt/newtmgr/nmgr_os/syscfg.yml
@@ -0,0 +1,23 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+syscfg.defs:
+    LOG_SOFT_RESET:
+        description: 'Log soft restarts'
+        value: 1