-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
Describe the bug
A clear and concise description of what the bug is.
What have you tried to diagnose or workaround this issue?
If the user disables the CONFIG_SHELL_ECHO_STATUS the code will not compile. I have changed the code of the shell.c as the diff bellow:
diff --git a/subsys/shell/shell.c b/subsys/shell/shell.c
index b72c210ca7..e0170454f8 100644
--- a/subsys/shell/shell.c
+++ b/subsys/shell/shell.c
@@ -1066,7 +1066,7 @@ static int instance_init(const struct shell *shell, const void *p_config,
}
flag_tx_rdy_set(shell, true);
- flag_echo_set(shell, CONFIG_SHELL_ECHO_STATUS);
+ flag_echo_set(shell, IS_ENABLED(CONFIG_SHELL_ECHO_STATUS));
flag_mode_delete_set(shell,
IS_ENABLED(CONFIG_SHELL_BACKSPACE_MODE_DELETE));
shell->ctx->state = SHELL_STATE_INITIALIZED;To Reproduce
Steps to reproduce the behavior:
- All as usually
- Disable the shell echo at the menuconfig
- make
- See error
Expected behavior
A clear and concise description of what you expected to happen.
It must disable the console's echo after compiling and running the code.
Impact
What impact does this issue have on your progress (e.g., annoyance, showstopper)
There no other way to disable echo from the shell.
Screenshots or console output
If applicable, add a screenshot (drag-and-drop an image), or console logs
(cut-and-paste text and put a code fence (```) before and after, to help
explain the issue.
$ west build -b nrf52_pca10040 -s .
source directory: /<path_to_zephyr>/zephyr/samples/subsys/shell/shell_module
build directory: /<path_to_zephyr>/zephyr/samples/subsys/shell/shell_module/build
BOARD: nrf52_pca10040
[1/7] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/shell/shell.c.obj
FAILED: zephyr/CMakeFiles/zephyr.dir/subsys/shell/shell.c.obj
ccache /home/rodrigopex/Tools/zephyr-sdk-0.9.5/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gcc -DBUILD_VERSION=v1.14.0-rc1-36-g68b0aa5c68 -DKERNEL -DNRF52832_XXAA -D_FORTIFY_SOURCE=2 -D__ZEPHYR__=1 -I../../../../../kernel/include -I../../../../../arch/arm/include -I../../../../../include -I../../../../../include/drivers -Izephyr/include/generated -I../../../../../soc/arm/nordic_nrf/nrf52 -I../../../../../soc/arm/nordic_nrf/include -I../../../../../lib/libc/minimal/include -I../../../../../ext/lib/fnmatch/. -I../../../../../ext/hal/cmsis/Include -I../../../../../ext/hal/nordic/nrfx -I../../../../../ext/hal/nordic/nrfx/drivers/include -I../../../../../ext/hal/nordic/nrfx/hal -I../../../../../ext/hal/nordic/nrfx/mdk -I../../../../../ext/hal/nordic/. -I../../../../../ext/debug/segger/rtt -isystem /home/rodrigopex/Tools/zephyr-sdk-0.9.5/sysroots/x86_64-pokysdk-linux/usr/lib/arm-zephyr-eabi/gcc/arm-zephyr-eabi/6.2.0/include -isystem /home/rodrigopex/Tools/zephyr-sdk-0.9.5/sysroots/x86_64-pokysdk-linux/usr/lib/arm-zephyr-eabi/gcc/arm-zephyr-eabi/6.2.0/include-fixed -Os -g -Wall -Wformat -Wformat-security -Wno-format-zero-length -imacros /<path_to_zephyr>/zephyr/samples/subsys/shell/shell_module/build/zephyr/include/generated/autoconf.h -ffreestanding -Wno-main -fno-common --sysroot /home/rodrigopex/Tools/zephyr-sdk-0.9.5/sysroots/armv5-zephyr-eabi/usr -mthumb -mcpu=cortex-m4 -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -Wno-pointer-sign -Wno-unused-but-set-variable -fno-reorder-functions -fno-defer-pop -Werror=implicit-int -Wpointer-arith -ffunction-sections -fdata-sections -mabi=aapcs -march=armv7e-m -std=c99 -MD -MT zephyr/CMakeFiles/zephyr.dir/subsys/shell/shell.c.obj -MF zephyr/CMakeFiles/zephyr.dir/subsys/shell/shell.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/subsys/shell/shell.c.obj -c /<path_to_zephyr>/zephyr/subsys/shell/shell.c
/<path_to_zephyr>/zephyr/subsys/shell/shell.c: In function ‘instance_init’:
/<path_to_zephyr>/zephyr/subsys/shell/shell.c:1069:23: error: ‘CONFIG_SHELL_ECHO_STATUS’ undeclared (first use in this function)
flag_echo_set(shell, CONFIG_SHELL_ECHO_STATUS);
^~~~~~~~~~~~~~~~~~~~~~~~
/<path_to_zephyr>/zephyr/subsys/shell/shell.c:1069:23: note: each undeclared identifier is reported only once for each function it appears in
ninja: build stopped: subcommand failed.
ERROR: command exited with status 1: /usr/local/bin/cmake --build /<path_to_zephyr>/zephyr/samples/subsys/shell/shell_module/build
run as "west -v build -b nrf52_pca10040 -s ." for a stack traceEnvironment (please complete the following information):
- OS: Ubuntu 18.04.1
- Toolchain Zephyr SDK 0.9.5
- Commit SHA: 68b0aa5c68702c6ca480169028d8d88e07fe6d2e
Additional context
Add any other context about the problem here.