Skip to content

Commit da984c9

Browse files
Use bit_is_clear in HardwareSerial::flush()
This is slightly more clear than the previous explicit comparison.
1 parent 91a405c commit da984c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hardware/arduino/avr/cores/arduino/HardwareSerial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ int HardwareSerial::read(void)
337337
void HardwareSerial::flush()
338338
{
339339
// UDR is kept full while the buffer is not empty, so TXC triggers when EMPTY && SENT
340-
while (transmitting && ! (*_ucsra & _BV(TXC0)));
340+
while (transmitting && bit_is_clear(*_ucsra, TXC0));
341341
transmitting = false;
342342
}
343343

0 commit comments

Comments
 (0)