mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 04:52:02 +08:00
drivers/serial/serial.c: Don't reset the circular buffer on close since DMA may still be transferring data in the background if the user closes the handle too quickly and the handle is opened with O_NONBLOCK.
This commit is contained in:
@@ -691,13 +691,6 @@ static int uart_close(FAR struct file *filep)
|
||||
(void)uart_tcdrain(dev, 4 * TICK_PER_SEC);
|
||||
}
|
||||
|
||||
/* Mark the I/O buffers empty */
|
||||
|
||||
dev->xmit.head = 0;
|
||||
dev->xmit.tail = 0;
|
||||
dev->recv.head = 0;
|
||||
dev->recv.tail = 0;
|
||||
|
||||
/* Free the IRQ and disable the UART */
|
||||
|
||||
flags = enter_critical_section(); /* Disable interrupts */
|
||||
|
||||
Reference in New Issue
Block a user