Skip to content

Commit bf53c99

Browse files
authored
Append multithreding support to HardwareSerial
This fix will allow use HardwareSerial driver in simple multithreading applications.
1 parent 380241d commit bf53c99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cores/arduino/HardwareSerial.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ size_t HardwareSerial::write(uint8_t c)
261261
if(bit_is_set(*_ucsra, UDRE0))
262262
_tx_udr_empty_irq();
263263
} else {
264-
// nop, the interrupt handler will free up space for us
264+
// share CPU while buffer free waiting
265+
yield();
265266
}
266267
}
267268

0 commit comments

Comments
 (0)