We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c95abf commit 766ac46Copy full SHA for 766ac46
cores/arduino/UARTClass.cpp
@@ -79,14 +79,12 @@ void UARTClass::end( void )
79
// clear any received data
80
_rx_buffer->_iHead = _rx_buffer->_iTail ;
81
82
- while (_tx_buffer->_iHead != _tx_buffer->_iTail); //wait for transmit data to be sent
+ // Wait for any outstanding data to be sent
83
+ flush();
84
85
// Disable UART interrupt in NVIC
86
NVIC_DisableIRQ( _dwIrq ) ;
87
- // Wait for any outstanding data to be sent
88
- flush();
89
-
90
pmc_disable_periph_clk( _dwId ) ;
91
}
92
@@ -134,6 +132,7 @@ int UARTClass::read( void )
134
132
135
133
void UARTClass::flush( void )
136
{
+ while (_tx_buffer->_iHead != _tx_buffer->_iTail); //wait for transmit data to be sent
137
// Wait for transmission to complete
138
while ((_pUart->UART_SR & UART_SR_TXRDY) != UART_SR_TXRDY)
139
;
0 commit comments