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 <andrew.p.boie@intel.com>
This commit is contained in:
parent
d6d3f152b3
commit
a7787c8519
3 changed files with 5 additions and 5 deletions
|
@ -64,7 +64,7 @@ int shell_log_backend_output_func(u8_t *data, size_t length, void *ctx);
|
||||||
*
|
*
|
||||||
* @param _name Shell name.
|
* @param _name Shell name.
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_LOG
|
#ifdef CONFIG_SHELL_LOG_BACKEND
|
||||||
#define SHELL_LOG_BACKEND_DEFINE(_name, _buf, _size, _queue_size, _timeout) \
|
#define SHELL_LOG_BACKEND_DEFINE(_name, _buf, _size, _queue_size, _timeout) \
|
||||||
LOG_BACKEND_DEFINE(_name##_backend, log_backend_shell_api, false); \
|
LOG_BACKEND_DEFINE(_name##_backend, log_backend_shell_api, false); \
|
||||||
K_MSGQ_DEFINE(_name##_msgq, sizeof(struct shell_log_backend_msg), \
|
K_MSGQ_DEFINE(_name##_msgq, sizeof(struct shell_log_backend_msg), \
|
||||||
|
|
|
@ -150,8 +150,8 @@ config SHELL_CMDS_SELECT
|
||||||
|
|
||||||
config SHELL_LOG_BACKEND
|
config SHELL_LOG_BACKEND
|
||||||
bool
|
bool
|
||||||
|
depends on !LOG_MINIMAL
|
||||||
default y if LOG
|
default y if LOG
|
||||||
default n if !LOG
|
|
||||||
|
|
||||||
source "subsys/shell/modules/Kconfig"
|
source "subsys/shell/modules/Kconfig"
|
||||||
|
|
||||||
|
|
|
@ -1120,7 +1120,7 @@ static int instance_uninit(const struct shell *shell)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_LOG)) {
|
if (IS_ENABLED(CONFIG_SHELL_LOG_BACKEND)) {
|
||||||
/* todo purge log queue */
|
/* todo purge log queue */
|
||||||
shell_log_backend_disable(shell->log_backend);
|
shell_log_backend_disable(shell->log_backend);
|
||||||
}
|
}
|
||||||
|
@ -1174,7 +1174,7 @@ void shell_thread(void *shell_handle, void *arg_log_backend,
|
||||||
return;
|
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,
|
shell_log_backend_enable(shell->log_backend, (void *)shell,
|
||||||
log_level);
|
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_KILL, kill_handler);
|
||||||
shell_signal_handle(shell, SHELL_SIGNAL_RXRDY, shell_process);
|
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_signal_handle(shell, SHELL_SIGNAL_LOG_MSG,
|
||||||
shell_log_process);
|
shell_log_process);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue