mirror of
https://github.com/apache/nuttx.git
synced 2025-12-11 12:57:57 +08:00
drivers/serial: Add a timeout to uart_tcdrain(). Even if tcflush() is used to discard buffered data, the close() can still hang if (a) hardware flow control is enabled, (b) CTS == 1, and (c) there is data stuck in the hardware Tx FIFO. tcflush() does not currently clear the MCU serial drivers' hardware Tx FIFOs. This is a workaround for that.
This commit is contained in:
@@ -222,9 +222,8 @@
|
||||
|
||||
/* Line Control (used with tcflush()) */
|
||||
|
||||
#define TCIFLUSH 0 /* Flush pending input. Flush untransmitted
|
||||
* output */
|
||||
#define TCIOFLUSH 1 /* Flush both pending input and untransmitte
|
||||
#define TCIFLUSH 0 /* Flush pending input */
|
||||
#define TCIOFLUSH 1 /* Flush both pending input and untransmitted
|
||||
* output */
|
||||
#define TCOFLUSH 2 /* Flush untransmitted output */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user