From f29d46ac4aea2633c41730208b93b63fe6edf003 Mon Sep 17 00:00:00 2001 From: Jakub Rzeszutko Date: Fri, 1 Oct 2021 10:53:29 +0200 Subject: [PATCH] shell: add a directory for backends This change organizes the file structure for the shell. Files implementing backends are moved to a separate folder. Signed-off-by: Jakub Rzeszutko --- subsys/shell/CMakeLists.txt | 33 ++++--------------- subsys/shell/Kconfig | 2 +- subsys/shell/backends/CMakeLists.txt | 21 ++++++++++++ subsys/shell/{ => backends}/Kconfig.backends | 0 subsys/shell/{ => backends}/shell_dummy.c | 0 subsys/shell/{ => backends}/shell_rtt.c | 0 subsys/shell/{ => backends}/shell_telnet.c | 0 .../{ => backends}/shell_telnet_protocol.h | 0 subsys/shell/{ => backends}/shell_uart.c | 0 9 files changed, 29 insertions(+), 27 deletions(-) create mode 100644 subsys/shell/backends/CMakeLists.txt rename subsys/shell/{ => backends}/Kconfig.backends (100%) rename subsys/shell/{ => backends}/shell_dummy.c (100%) rename subsys/shell/{ => backends}/shell_rtt.c (100%) rename subsys/shell/{ => backends}/shell_telnet.c (100%) rename subsys/shell/{ => backends}/shell_telnet_protocol.h (100%) rename subsys/shell/{ => backends}/shell_uart.c (100%) diff --git a/subsys/shell/CMakeLists.txt b/subsys/shell/CMakeLists.txt index 442ab2b7c59..cd6e4c86e82 100644 --- a/subsys/shell/CMakeLists.txt +++ b/subsys/shell/CMakeLists.txt @@ -1,6 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 add_subdirectory(modules) +add_subdirectory(backends) zephyr_sources_ifdef( CONFIG_SHELL @@ -11,24 +12,9 @@ zephyr_sources_ifdef( ) zephyr_sources_ifdef( - CONFIG_SHELL_BACKEND_SERIAL - shell_uart.c -) - -zephyr_sources_ifdef( - CONFIG_SHELL_BACKEND_DUMMY - shell_dummy.c -) - -zephyr_sources_ifdef( - CONFIG_SHELL_BACKEND_RTT - shell_rtt.c -) - -zephyr_sources_ifdef( - CONFIG_SHELL_BACKEND_TELNET - shell_telnet.c -) + CONFIG_SHELL_LOG_BACKEND + shell_log_backend.c + ) zephyr_sources_ifdef( CONFIG_SHELL_HELP @@ -43,19 +29,14 @@ zephyr_sources_ifdef( zephyr_sources_ifdef( CONFIG_SHELL_CMDS shell_cmds.c -) + ) zephyr_sources_ifdef( CONFIG_SHELL_HISTORY shell_history.c -) - -zephyr_sources_ifdef( - CONFIG_SHELL_LOG_BACKEND - shell_log_backend.c -) + ) zephyr_sources_ifdef( CONFIG_SHELL_WILDCARD shell_wildcard.c -) + ) diff --git a/subsys/shell/Kconfig b/subsys/shell/Kconfig index 79593b5f462..30d0b0a23f2 100644 --- a/subsys/shell/Kconfig +++ b/subsys/shell/Kconfig @@ -15,7 +15,7 @@ if SHELL module = SHELL module-str = Shell source "subsys/logging/Kconfig.template.log_config" -source "subsys/shell/Kconfig.backends" +source "subsys/shell/backends/Kconfig.backends" config SHELL_MINIMAL bool "Default config to reduce flash and memory requirements" diff --git a/subsys/shell/backends/CMakeLists.txt b/subsys/shell/backends/CMakeLists.txt new file mode 100644 index 00000000000..e38d091c895 --- /dev/null +++ b/subsys/shell/backends/CMakeLists.txt @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: Apache-2.0 + +zephyr_sources_ifdef( + CONFIG_SHELL_BACKEND_SERIAL + shell_uart.c +) + +zephyr_sources_ifdef( + CONFIG_SHELL_BACKEND_DUMMY + shell_dummy.c +) + +zephyr_sources_ifdef( + CONFIG_SHELL_BACKEND_RTT + shell_rtt.c +) + +zephyr_sources_ifdef( + CONFIG_SHELL_BACKEND_TELNET + shell_telnet.c +) diff --git a/subsys/shell/Kconfig.backends b/subsys/shell/backends/Kconfig.backends similarity index 100% rename from subsys/shell/Kconfig.backends rename to subsys/shell/backends/Kconfig.backends diff --git a/subsys/shell/shell_dummy.c b/subsys/shell/backends/shell_dummy.c similarity index 100% rename from subsys/shell/shell_dummy.c rename to subsys/shell/backends/shell_dummy.c diff --git a/subsys/shell/shell_rtt.c b/subsys/shell/backends/shell_rtt.c similarity index 100% rename from subsys/shell/shell_rtt.c rename to subsys/shell/backends/shell_rtt.c diff --git a/subsys/shell/shell_telnet.c b/subsys/shell/backends/shell_telnet.c similarity index 100% rename from subsys/shell/shell_telnet.c rename to subsys/shell/backends/shell_telnet.c diff --git a/subsys/shell/shell_telnet_protocol.h b/subsys/shell/backends/shell_telnet_protocol.h similarity index 100% rename from subsys/shell/shell_telnet_protocol.h rename to subsys/shell/backends/shell_telnet_protocol.h diff --git a/subsys/shell/shell_uart.c b/subsys/shell/backends/shell_uart.c similarity index 100% rename from subsys/shell/shell_uart.c rename to subsys/shell/backends/shell_uart.c