You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2018/02/08 23:39:05 UTC
[mynewt-mcumgr] 09/25: Reboot in system workqueue, not ISR.
This is an automated email from the ASF dual-hosted git repository.
ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-mcumgr.git
commit 7f40df230449b15ca4777e73e720b52238152c7a
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Fri Jan 26 15:47:32 2018 -0800
Reboot in system workqueue, not ISR.
---
cmd/os_mgmt/port/zephyr/src/zephyr_os_mgmt.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/cmd/os_mgmt/port/zephyr/src/zephyr_os_mgmt.c b/cmd/os_mgmt/port/zephyr/src/zephyr_os_mgmt.c
index 221da97..df996a8 100644
--- a/cmd/os_mgmt/port/zephyr/src/zephyr_os_mgmt.c
+++ b/cmd/os_mgmt/port/zephyr/src/zephyr_os_mgmt.c
@@ -26,10 +26,13 @@
#include "os_mgmt/os_mgmt_impl.h"
static void zephyr_os_mgmt_reset_cb(struct k_timer *timer);
+static void zephyr_os_mgmt_reset_work_handler(struct k_work *work);
static K_TIMER_DEFINE(zephyr_os_mgmt_reset_timer,
zephyr_os_mgmt_reset_cb, NULL);
+K_WORK_DEFINE(zephyr_os_mgmt_reset_work, zephyr_os_mgmt_reset_work_handler);
+
#ifdef CONFIG_THREAD_MONITOR
static const struct k_thread *
zephyr_os_mgmt_task_at(int idx)
@@ -72,11 +75,18 @@ os_mgmt_impl_task_info(int idx, struct os_mgmt_task_info *out_info)
#endif /* CONFIG_THREAD_MONITOR */
static void
-zephyr_os_mgmt_reset_cb(struct k_timer *timer)
+zephyr_os_mgmt_reset_work_handler(struct k_work *work)
{
sys_reboot(SYS_REBOOT_WARM);
}
+static void
+zephyr_os_mgmt_reset_cb(struct k_timer *timer)
+{
+ /* Reboot the system from the system workqueue thread. */
+ k_work_submit(&zephyr_os_mgmt_reset_work);
+}
+
int
os_mgmt_impl_reset(unsigned int delay_ms)
{
--
To stop receiving notification emails like this one, please contact
ccollins@apache.org.