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 <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi 2023-03-03 13:01:33 +08:00 committed by Petro Karashchenko
parent 392eebf5e2
commit 44857ab30e
1 changed files with 4 additions and 2 deletions

View File

@ -890,9 +890,11 @@ static ssize_t uart_read(FAR struct file *filep,
*buffer++ = ch; *buffer++ = ch;
recvd++; recvd++;
if (dev->isconsole if (
#ifdef CONFIG_SERIAL_TERMIOS #ifdef CONFIG_SERIAL_TERMIOS
|| (dev->tc_iflag & ECHO) dev->tc_iflag & ECHO
#else
dev->isconsole
#endif #endif
) )
{ {