mirror of
https://github.com/Dasharo/zephyr.git
synced 2026-03-06 14:57:20 -08:00
shell: added SHELL_AUTOSTART configuration option
In some applications, there is a need to don't start the shell by default, but run it later on some special condition. When SHELL_AUTOSTART is set to n, the shell is not started after boot but can be enabled later from the application code. Signed-off-by: Wojciech Slenska <wsl@trackunit.com>
This commit is contained in:
committed by
Carles Cufí
parent
1675d49b4c
commit
4b2fffc7f9
@@ -245,6 +245,11 @@ config SHELL_LOG_FORMAT_TIMESTAMP
|
||||
help
|
||||
Enable timestamp formatting.
|
||||
|
||||
config SHELL_AUTOSTART
|
||||
bool "Auto-start shell at boot"
|
||||
default y
|
||||
help
|
||||
If enabled, shell will be automatically started.
|
||||
|
||||
source "subsys/shell/modules/Kconfig"
|
||||
|
||||
|
||||
@@ -1321,10 +1321,12 @@ void shell_thread(void *shell_handle, void *arg_log_backend,
|
||||
log_level);
|
||||
}
|
||||
|
||||
/* Enable shell and print prompt. */
|
||||
err = shell_start(shell);
|
||||
if (err != 0) {
|
||||
return;
|
||||
if (IS_ENABLED(CONFIG_SHELL_AUTOSTART)) {
|
||||
/* Enable shell and print prompt. */
|
||||
err = shell_start(shell);
|
||||
if (err != 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
while (true) {
|
||||
|
||||
Reference in New Issue
Block a user