Skip to content

Commit ba1beeb

Browse files
committed
Check TXEMPTY flag instead of TXRDY flag on Serial.flush()
As suggested by @borisff in arduino#4128.
1 parent 4e75c01 commit ba1beeb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/UARTClass.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void UARTClass::flush( void )
138138
{
139139
while (_tx_buffer->_iHead != _tx_buffer->_iTail); //wait for transmit data to be sent
140140
// Wait for transmission to complete
141-
while ((_pUart->UART_SR & UART_SR_TXRDY) != UART_SR_TXRDY)
141+
while ((_pUart->UART_SR & UART_SR_TXEMPTY) != UART_SR_TXEMPTY)
142142
;
143143
}
144144

0 commit comments

Comments
 (0)