From 44857ab30eb19a7854ef0c00fd02308cc0cec6be Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Fri, 3 Mar 2023 13:01:33 +0800 Subject: [PATCH] driver/serial: Echo only determined by ECHO flag with termios enabled Fix a bug that can not disable echo even if termios is enabled. Signed-off-by: Huang Qi --- drivers/serial/serial.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index fef5a61e53..ddaeb20112 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -890,9 +890,11 @@ static ssize_t uart_read(FAR struct file *filep, *buffer++ = ch; recvd++; - if (dev->isconsole + if ( #ifdef CONFIG_SERIAL_TERMIOS - || (dev->tc_iflag & ECHO) + dev->tc_iflag & ECHO +#else + dev->isconsole #endif ) {