File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
hardware/arduino/cores/arduino Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -359,16 +359,8 @@ int HardwareSerial::read(void)
359
359
360
360
void HardwareSerial::flush ()
361
361
{
362
- // don't reverse this or there may be problems if the RX interrupt
363
- // occurs after reading the value of rx_buffer_head but before writing
364
- // the value to rx_buffer_tail; the previous value of rx_buffer_head
365
- // may be written to rx_buffer_tail, making it appear as if the buffer
366
- // don't reverse this or there may be problems if the RX interrupt
367
- // occurs after reading the value of rx_buffer_head but before writing
368
- // the value to rx_buffer_tail; the previous value of rx_buffer_head
369
- // may be written to rx_buffer_tail, making it appear as if the buffer
370
- // were full, not empty.
371
- _rx_buffer->head = _rx_buffer->tail ;
362
+ while (_tx_buffer->head != _tx_buffer->tail )
363
+ ;
372
364
}
373
365
374
366
void HardwareSerial::write (uint8_t c)
You can’t perform that action at this time.
0 commit comments