From 5315c285cc34a3d7c46d8023e1730c99663eea6d Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Wed, 17 Nov 2021 13:37:50 +0100 Subject: [PATCH] sampes: shell: remove usage of CONFIG_USB_UART_CONSOLE Remove option CONFIG_USB_UART_CONSOLE where it has no influence or enable CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR without taking a detour through CONFIG_USB_UART_CONSOLE. Check the compatibility of chosen property instead of usage of CONFIG_USB_UART_CONSOLE option. Signed-off-by: Johann Fischer --- samples/boards/sensortile_box/prj.conf | 1 - samples/subsys/shell/shell_module/overlay-usb.conf | 2 +- samples/subsys/shell/shell_module/src/main.c | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/samples/boards/sensortile_box/prj.conf b/samples/boards/sensortile_box/prj.conf index 0ea341d2ac8..a5fa96419cb 100644 --- a/samples/boards/sensortile_box/prj.conf +++ b/samples/boards/sensortile_box/prj.conf @@ -29,7 +29,6 @@ CONFIG_USB_DEVICE_PID=0x1234 CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC SensorTile.box" -CONFIG_USB_UART_CONSOLE=y CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_LINE_CTRL=y CONFIG_CBPRINTF_FP_SUPPORT=y diff --git a/samples/subsys/shell/shell_module/overlay-usb.conf b/samples/subsys/shell/shell_module/overlay-usb.conf index 595379fe995..e107d8b0268 100644 --- a/samples/subsys/shell/shell_module/overlay-usb.conf +++ b/samples/subsys/shell/shell_module/overlay-usb.conf @@ -1,5 +1,5 @@ CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_PRODUCT="Zephyr USB shell sample" -CONFIG_USB_UART_CONSOLE=y +CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR=y CONFIG_UART_LINE_CTRL=y CONFIG_SHELL_BACKEND_SERIAL_INIT_PRIORITY=51 diff --git a/samples/subsys/shell/shell_module/src/main.c b/samples/subsys/shell/shell_module/src/main.c index f54a0fa93a8..9306e45c8ea 100644 --- a/samples/subsys/shell/shell_module/src/main.c +++ b/samples/subsys/shell/shell_module/src/main.c @@ -345,7 +345,7 @@ void main(void) login_init(); } -#if defined(CONFIG_USB_UART_CONSOLE) +#if DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_shell_uart), zephyr_cdc_acm_uart) const struct device *dev; uint32_t dtr = 0;