Skip to content

Commit 46653a6

Browse files
sandeepmistrycmaglie
authored andcommitted
Change IRQ handler to check if data is available before check for DRE
1 parent 610d4a8 commit 46653a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cores/arduino/Uart.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ void Uart::flush()
6262

6363
void Uart::IrqHandler()
6464
{
65+
if (sercom->availableDataUART()) {
66+
rxBuffer.store_char(sercom->readDataUART());
67+
}
68+
6569
if (sercom->isDataRegisterEmptyUART()) {
6670
if (txBuffer.available()) {
6771
uint8_t data = txBuffer.read_char();
@@ -72,10 +76,6 @@ void Uart::IrqHandler()
7276
}
7377
}
7478

75-
if (sercom->availableDataUART()) {
76-
rxBuffer.store_char(sercom->readDataUART());
77-
}
78-
7979
if (sercom->isUARTError()) {
8080
sercom->acknowledgeUARTError();
8181
// TODO: if (sercom->isBufferOverflowErrorUART()) ....

0 commit comments

Comments
 (0)