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
25
25
config MCUMGR_GRP_OS_RESET_MS
26
26
int "Delay before executing reset command (ms)"
27
27
default 250
28
- depends on REBOOT
28
+ depends on MULTITHREADING
29
29
help
30
30
When a reset command is received, the system waits this many milliseconds
31
31
before performing the reset. This delay allows time for the MCUmgr
32
32
response to be delivered.
33
33
34
34
config MCUMGR_GRP_OS_RESET_HOOK
35
35
bool "Reset hook"
36
- depends on REBOOT
37
36
depends on MCUMGR_MGMT_NOTIFICATION_HOOKS
38
37
help
39
38
Allows applications to control and get notifications of when a reset
Original file line number Diff line number Diff line change 57
57
58
58
LOG_MODULE_REGISTER (mcumgr_os_grp , CONFIG_MCUMGR_GRP_OS_LOG_LEVEL );
59
59
60
- #ifdef CONFIG_REBOOT
60
+ #if defined( CONFIG_REBOOT ) && defined( CONFIG_MULTITHREADING )
61
61
static void os_mgmt_reset_work_handler (struct k_work * work );
62
62
63
63
K_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)
354
354
/**
355
355
* Command handler: os reset
356
356
*/
357
+ #ifdef CONFIG_MULTITHREADING
357
358
static void os_mgmt_reset_work_handler (struct k_work * work )
358
359
{
359
360
ARG_UNUSED (work );
360
361
361
362
sys_reboot (SYS_REBOOT_WARM );
362
363
}
364
+ #endif
363
365
364
366
static int os_mgmt_reset (struct smp_streamer * ctxt )
365
367
{
@@ -398,8 +400,12 @@ static int os_mgmt_reset(struct smp_streamer *ctxt)
398
400
}
399
401
#endif
400
402
403
+ #ifdef CONFIG_MULTITHREADING
401
404
/* Reboot the system from the system workqueue thread. */
402
405
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
403
409
404
410
return 0 ;
405
411
}
You can’t perform that action at this time.
0 commit comments