Skip to content

Commit 435f679

Browse files
committed
Check TXEMPTY flag instead of TXRDY flag on Serial.flush()
As suggested by @borisff in #4128.
1 parent d0bd09c commit 435f679

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hardware/arduino/sam/cores/arduino/UARTClass.cpp

Lines changed: 1 addition & 1 deletion
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)