File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
hardware/arduino/sam/cores/arduino Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -79,14 +79,12 @@ void UARTClass::end( void )
79
79
// clear any received data
80
80
_rx_buffer->_iHead = _rx_buffer->_iTail ;
81
81
82
- while (_tx_buffer->_iHead != _tx_buffer->_iTail ); // wait for transmit data to be sent
82
+ // Wait for any outstanding data to be sent
83
+ flush ();
83
84
84
85
// Disable UART interrupt in NVIC
85
86
NVIC_DisableIRQ ( _dwIrq ) ;
86
87
87
- // Wait for any outstanding data to be sent
88
- flush ();
89
-
90
88
pmc_disable_periph_clk ( _dwId ) ;
91
89
}
92
90
@@ -134,6 +132,7 @@ int UARTClass::read( void )
134
132
135
133
void UARTClass::flush ( void )
136
134
{
135
+ while (_tx_buffer->_iHead != _tx_buffer->_iTail ); // wait for transmit data to be sent
137
136
// Wait for transmission to complete
138
137
while ((_pUart->UART_SR & UART_SR_TXRDY) != UART_SR_TXRDY)
139
138
;
You can’t perform that action at this time.
0 commit comments