Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions drivers/serial/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,9 +1031,11 @@ static ssize_t uart_readv(FAR struct file *filep, FAR struct uio *uio)
recvd--;
if (dev->tc_lflag & ECHO)
{
nxmutex_lock(&dev->xmit.lock);
uart_putxmitchar(dev, '\b', true);
uart_putxmitchar(dev, ' ', true);
uart_putxmitchar(dev, '\b', true);
nxmutex_unlock(&dev->xmit.lock);

#ifdef CONFIG_SERIAL_TXDMA
uart_dmatxavail(dev);
Expand Down Expand Up @@ -1088,12 +1090,14 @@ static ssize_t uart_readv(FAR struct file *filep, FAR struct uio *uio)

if (!iscntrl(ch & 0xff) || ch == '\n')
{
nxmutex_lock(&dev->xmit.lock);
if (ch == '\n')
{
uart_putxmitchar(dev, '\r', true);
}

uart_putxmitchar(dev, ch, true);
nxmutex_unlock(&dev->xmit.lock);

/* Mark the tx buffer have echoed content here,
* to avoid the tx buffer is empty such as special escape
Expand Down
Loading