From a7787c8519536043d4e20c13930204c9b90905c9 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Sun, 22 Sep 2019 17:19:19 -0700 Subject: [PATCH] shell: fix configuration issue These checks should be against CONFIG_SHELL_LOG_BACKEND, and not against CONFIG_LOG, since it's possible to enable logging without building this particular backend. Signed-off-by: Andrew Boie --- include/shell/shell_log_backend.h | 2 +- subsys/shell/Kconfig | 2 +- subsys/shell/shell.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/shell/shell_log_backend.h b/include/shell/shell_log_backend.h index aada0d75749..381bcc6fe39 100644 --- a/include/shell/shell_log_backend.h +++ b/include/shell/shell_log_backend.h @@ -64,7 +64,7 @@ int shell_log_backend_output_func(u8_t *data, size_t length, void *ctx); * * @param _name Shell name. */ -#ifdef CONFIG_LOG +#ifdef CONFIG_SHELL_LOG_BACKEND #define SHELL_LOG_BACKEND_DEFINE(_name, _buf, _size, _queue_size, _timeout) \ LOG_BACKEND_DEFINE(_name##_backend, log_backend_shell_api, false); \ K_MSGQ_DEFINE(_name##_msgq, sizeof(struct shell_log_backend_msg), \ diff --git a/subsys/shell/Kconfig b/subsys/shell/Kconfig index e5e71fe60c9..b037cf6f340 100644 --- a/subsys/shell/Kconfig +++ b/subsys/shell/Kconfig @@ -150,8 +150,8 @@ config SHELL_CMDS_SELECT config SHELL_LOG_BACKEND bool + depends on !LOG_MINIMAL default y if LOG - default n if !LOG source "subsys/shell/modules/Kconfig" diff --git a/subsys/shell/shell.c b/subsys/shell/shell.c index 493ebbddf90..0bf5fd177fc 100644 --- a/subsys/shell/shell.c +++ b/subsys/shell/shell.c @@ -1120,7 +1120,7 @@ static int instance_uninit(const struct shell *shell) return -EBUSY; } - if (IS_ENABLED(CONFIG_LOG)) { + if (IS_ENABLED(CONFIG_SHELL_LOG_BACKEND)) { /* todo purge log queue */ shell_log_backend_disable(shell->log_backend); } @@ -1174,7 +1174,7 @@ void shell_thread(void *shell_handle, void *arg_log_backend, return; } - if (log_backend && IS_ENABLED(CONFIG_LOG)) { + if (log_backend && IS_ENABLED(CONFIG_SHELL_LOG_BACKEND)) { shell_log_backend_enable(shell->log_backend, (void *)shell, log_level); } @@ -1204,7 +1204,7 @@ void shell_thread(void *shell_handle, void *arg_log_backend, shell_signal_handle(shell, SHELL_SIGNAL_KILL, kill_handler); shell_signal_handle(shell, SHELL_SIGNAL_RXRDY, shell_process); - if (IS_ENABLED(CONFIG_LOG)) { + if (IS_ENABLED(CONFIG_SHELL_LOG_BACKEND)) { shell_signal_handle(shell, SHELL_SIGNAL_LOG_MSG, shell_log_process); }