shell: kernel: fix reset command echo abrupt termination
Allow time for the shell to successfully echo the reboot command input before the reboot abruptly terminates it. n This can help external systems that interact with the shell and require the reboot command's echo to successfully complete to synchronise with the device. Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/35325 Signed-off-by: Nick Ward <nick.ward@setec.com.au>
This commit is contained in:
parent
8039ab4887
commit
3cad7f3a19
2 changed files with 18 additions and 0 deletions
|
@ -220,6 +220,9 @@ static int cmd_kernel_reboot_warm(const struct shell *shell,
|
|||
{
|
||||
ARG_UNUSED(argc);
|
||||
ARG_UNUSED(argv);
|
||||
#if (CONFIG_KERNEL_SHELL_REBOOT_DELAY > 0)
|
||||
k_sleep(K_MSEC(CONFIG_KERNEL_SHELL_REBOOT_DELAY));
|
||||
#endif
|
||||
sys_reboot(SYS_REBOOT_WARM);
|
||||
return 0;
|
||||
}
|
||||
|
@ -229,6 +232,9 @@ static int cmd_kernel_reboot_cold(const struct shell *shell,
|
|||
{
|
||||
ARG_UNUSED(argc);
|
||||
ARG_UNUSED(argv);
|
||||
#if (CONFIG_KERNEL_SHELL_REBOOT_DELAY > 0)
|
||||
k_sleep(K_MSEC(CONFIG_KERNEL_SHELL_REBOOT_DELAY));
|
||||
#endif
|
||||
sys_reboot(SYS_REBOOT_COLD);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue