shell: Enable backends via Kconfig file

Added functionality to enable active shell backends via Kconfig
file. When there will be more backends implemented user will
have an option to select only required ones.

It is no longer needed to select SERIAL in prj.conf.

Fixes #10190

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
This commit is contained in:
Jakub Rzeszutko 2018-10-04 15:17:00 +02:00 committed by Carles Cufí
commit bc6da1c34a
4 changed files with 30 additions and 2 deletions

View file

@ -1,6 +1,5 @@
CONFIG_PRINTK=y CONFIG_PRINTK=y
CONFIG_SHELL=y CONFIG_SHELL=y
CONFIG_SERIAL=y
CONFIG_LOG=y CONFIG_LOG=y
CONFIG_LOG_BACKEND_UART=n CONFIG_LOG_BACKEND_UART=n
CONFIG_KERNEL_SHELL=y CONFIG_KERNEL_SHELL=y

View file

@ -16,6 +16,10 @@ zephyr_sources_ifdef(
shell_fprintf.c shell_fprintf.c
shell_utils.c shell_utils.c
shell_ops.c shell_ops.c
)
zephyr_sources_ifdef(
CONFIG_SHELL_BACKEND_SERIAL
shell_uart.c shell_uart.c
) )

View file

@ -38,13 +38,13 @@ menuconfig SHELL
bool "Enable shell" bool "Enable shell"
select LOG_RUNTIME_FILTERING select LOG_RUNTIME_FILTERING
select POLL select POLL
depends on SERIAL
if SHELL if SHELL
module = SHELL module = SHELL
module-str = Shell module-str = Shell
source "subsys/logging/Kconfig.template.log_config" source "subsys/logging/Kconfig.template.log_config"
source "subsys/shell/Kconfig.backends"
config SHELL_STACK_SIZE config SHELL_STACK_SIZE
int "Shell thread stack size" int "Shell thread stack size"

View file

@ -0,0 +1,25 @@
# Kconfig.backends - Shell badckends configuration options
#
# Copyright (c) 2018 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
#
menuconfig SHELL_BACKENDS
bool "Enable shell backends"
default y
help
Enable shell backends.
if SHELL_BACKENDS
config SHELL_BACKEND_SERIAL
bool "Enable serial backends."
default y
select SERIAL
help
Enable serial backends.
endif # SHELL_BACKENDS