This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 061e98aa98 drivers/serial: Fix wrong ECHO flag
061e98aa98 is described below
commit 061e98aa98504f6903508913b751257141d47ef5
Author: Huang Qi <[email protected]>
AuthorDate: Mon Mar 13 17:20:27 2023 +0800
drivers/serial: Fix wrong ECHO flag
There is a rookie mistake introduced by
https://github.com/apache/nuttx/pull/8691,
ECHO flag is a part of Local Mode (c_lflags) instead of c_iflags.
nuttx-apps should do the same change in nsh_login and termcurse_vt100.
Signed-off-by: Huang Qi <[email protected]>
---
drivers/serial/serial.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index 825e233601..2a24f5dac3 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -893,7 +893,7 @@ static ssize_t uart_read(FAR struct file *filep,
if (
#ifdef CONFIG_SERIAL_TERMIOS
- dev->tc_iflag & ECHO
+ dev->tc_lflag & ECHO
#else
dev->isconsole
#endif
@@ -1822,9 +1822,9 @@ int uart_register(FAR const char *path, FAR uart_dev_t
*dev)
if (dev->isconsole)
{
- /* Enable signals by default */
+ /* Enable signals and echo by default */
- dev->tc_lflag |= ISIG;
+ dev->tc_lflag |= ISIG | ECHO;
/* Enable \n -> \r\n translation for the console */
@@ -1832,7 +1832,7 @@ int uart_register(FAR const char *path, FAR uart_dev_t
*dev)
/* Convert CR to LF by default for console */
- dev->tc_iflag |= ICRNL | ECHO;
+ dev->tc_iflag |= ICRNL;
/* Clear escape counter */