mirror of
https://github.com/apache/nuttx.git
synced 2026-09-20 21:06:58 +08:00
Add serial method so that lower half driver can provide RX flow control information. From Jussi Kivilinna
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user