From b5efb9dd772cac81172755b68ae9b7a93d9d9fa7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 8 May 2014 09:01:14 -0600 Subject: [PATCH] Add serial method so that lower half driver can provide RX flow control information. From Jussi Kivilinna --- drivers/serial/serial.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index be9219cb16..9754bf391b 100644 --- a/drivers/serial/serial.c +++ b/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; }