File tree 1 file changed +1
-3
lines changed
hardware/arduino/avr/cores/arduino
1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -213,14 +213,14 @@ void HardwareSerial::flush()
213
213
214
214
size_t HardwareSerial::write (uint8_t c)
215
215
{
216
+ _written = true ;
216
217
// If the buffer and the data register is empty, just write the byte
217
218
// to the data register and be done. This shortcut helps
218
219
// significantly improve the effective datarate at high (>
219
220
// 500kbit/s) bitrates, where interrupt overhead becomes a slowdown.
220
221
if (_tx_buffer_head == _tx_buffer_tail && bit_is_set (*_ucsra, UDRE0)) {
221
222
*_udr = c;
222
223
sbi (*_ucsra, TXC0);
223
- _written = true ;
224
224
return 1 ;
225
225
}
226
226
tx_buffer_index_t i = (_tx_buffer_head + 1 ) % SERIAL_TX_BUFFER_SIZE;
@@ -244,10 +244,8 @@ size_t HardwareSerial::write(uint8_t c)
244
244
_tx_buffer_head = i;
245
245
246
246
sbi (*_ucsrb, UDRIE0);
247
- _written = true ;
248
247
249
248
return 1 ;
250
249
}
251
250
252
-
253
251
#endif // whole file
You can’t perform that action at this time.
0 commit comments