File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
subsys/mgmt/mcumgr/grp/os_mgmt Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -25,15 +25,14 @@ if REBOOT
2525config MCUMGR_GRP_OS_RESET_MS
2626 int "Delay before executing reset command (ms)"
2727 default 250
28- depends on REBOOT
28+ depends on MULTITHREADING
2929 help
3030 When a reset command is received, the system waits this many milliseconds
3131 before performing the reset. This delay allows time for the MCUmgr
3232 response to be delivered.
3333
3434config MCUMGR_GRP_OS_RESET_HOOK
3535 bool "Reset hook"
36- depends on REBOOT
3736 depends on MCUMGR_MGMT_NOTIFICATION_HOOKS
3837 help
3938 Allows applications to control and get notifications of when a reset
Original file line number Diff line number Diff line change 5757
5858LOG_MODULE_REGISTER (mcumgr_os_grp , CONFIG_MCUMGR_GRP_OS_LOG_LEVEL );
5959
60- #ifdef CONFIG_REBOOT
60+ #if defined( CONFIG_REBOOT ) && defined( CONFIG_MULTITHREADING )
6161static void os_mgmt_reset_work_handler (struct k_work * work );
6262
6363K_WORK_DELAYABLE_DEFINE (os_mgmt_reset_work , os_mgmt_reset_work_handler );
@@ -354,12 +354,14 @@ static int os_mgmt_taskstat_read(struct smp_streamer *ctxt)
354354/**
355355 * Command handler: os reset
356356 */
357+ #ifdef CONFIG_MULTITHREADING
357358static void os_mgmt_reset_work_handler (struct k_work * work )
358359{
359360 ARG_UNUSED (work );
360361
361362 sys_reboot (SYS_REBOOT_WARM );
362363}
364+ #endif
363365
364366static int os_mgmt_reset (struct smp_streamer * ctxt )
365367{
@@ -398,8 +400,12 @@ static int os_mgmt_reset(struct smp_streamer *ctxt)
398400 }
399401#endif
400402
403+ #ifdef CONFIG_MULTITHREADING
401404 /* Reboot the system from the system workqueue thread. */
402405 k_work_schedule (& os_mgmt_reset_work , K_MSEC (CONFIG_MCUMGR_GRP_OS_RESET_MS ));
406+ #else
407+ sys_reboot (SYS_REBOOT_WARM );
408+ #endif
403409
404410 return 0 ;
405411}
You can’t perform that action at this time.
0 commit comments