Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cores/arduino/Uart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ size_t Uart::write(const uint8_t data)
if (sercom->isDataRegisterEmptyUART() && txBuffer.available() == 0) {
sercom->writeDataUART(data);
} else {
while(txBuffer.isFull()); // spin lock until a spot opens up in the buffer
while (txBuffer.isFull()) {
// Pretend an interrupt has happened and
// call the handler to free up space for us.
IrqHandler();
};

txBuffer.store_char(data);

Expand Down