mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-18 07:52:14 +01:00
Check TXEMPTY flag instead of TXRDY flag on Serial.flush()
As suggested by @borisff in #4128.
This commit is contained in:
parent
d0bd09c8d3
commit
435f6790da
@ -138,7 +138,7 @@ void UARTClass::flush( void )
|
|||||||
{
|
{
|
||||||
while (_tx_buffer->_iHead != _tx_buffer->_iTail); //wait for transmit data to be sent
|
while (_tx_buffer->_iHead != _tx_buffer->_iTail); //wait for transmit data to be sent
|
||||||
// Wait for transmission to complete
|
// Wait for transmission to complete
|
||||||
while ((_pUart->UART_SR & UART_SR_TXRDY) != UART_SR_TXRDY)
|
while ((_pUart->UART_SR & UART_SR_TXEMPTY) != UART_SR_TXEMPTY)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user