diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-05-08 09:01:14 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-05-08 09:01:14 -0600 |
commit | 7341f2e2f4986c8c0efe55f3b11875bc9d83fa3c (patch) | |
tree | 824454d717ad800fc3174afa97c2e5bccc9c16dc | |
parent | 3c423e7dff566512144a1ce15501512ad5426360 (diff) | |
download | nuttx-7341f2e2f4986c8c0efe55f3b11875bc9d83fa3c.tar.gz nuttx-7341f2e2f4986c8c0efe55f3b11875bc9d83fa3c.tar.bz2 nuttx-7341f2e2f4986c8c0efe55f3b11875bc9d83fa3c.zip |
Add serial method so that lower half driver can provide RX flow control information. From Jussi Kivilinna
-rw-r--r-- | nuttx/drivers/serial/serial.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/nuttx/drivers/serial/serial.c b/nuttx/drivers/serial/serial.c index be9219cb1..9754bf391 100644 --- a/nuttx/drivers/serial/serial.c +++ b/nuttx/drivers/serial/serial.c @@ -763,6 +763,17 @@ static ssize_t uart_read(FAR struct file *filep, FAR char *buffer, size_t buflen } } +#ifdef CONFIG_SERIAL_IFLOWCONTROL + if (dev->recv.head == dev->recv.tail) + { + /* We might leave Rx interrupt disabled if full recv buffer was read + * empty. Enable Rx interrupt to make sure that more input is received. + */ + + uart_enablerxint(dev); + } +#endif + uart_givesem(&dev->recv.sem); return recvd; } |