drivers/serial: Echo CR if NL is detected if console

Echoing console's input is now performed by the serial driver
(https://github.com/apache/nuttx/pull/8691). In order to keep old
behavior of CR being echoed by the device, it's needed to detected
whenever NL is being echoed and send CR before sending it.
This commit is contained in:
Tiago Medicci Serrano 2023-03-04 16:10:17 -03:00 committed by Xiang Xiao
parent 99b0bad94e
commit a3badd26a0

View File

@ -918,9 +918,12 @@ static ssize_t uart_read(FAR struct file *filep,
if ((!iscntrl(ch & 0xff) || (ch == '\n')) && dev->escape == 0)
{
if (ch == '\n')
{
uart_putxmitchar(dev, ch, true);
uart_putxmitchar(dev, '\r', true);
}
uart_putxmitchar(dev, ch, true);
}
/* Skipping character count down */