diff --git a/cores/arduino/HardwareSerial.cpp b/cores/arduino/HardwareSerial.cpp index 87794aa..284d8fc 100644 --- a/cores/arduino/HardwareSerial.cpp +++ b/cores/arduino/HardwareSerial.cpp @@ -5,7 +5,7 @@ #include "HardwareSerial.h" #include #include "mik32_hal_irq.h" - +#include "wiring_LL.h" // HardwareSerial class objects for use in Arduino IDE HardwareSerial Serial(0); @@ -127,9 +127,9 @@ void HardwareSerial::rx_complete_irq(void) unsigned char c; // while there is something to receive, put the data into the buffer // and edit the buffer index - while (!UART_IsRxFifoEmpty(uart)) + while(!UART_IS_RX_FIFO_EMPTY(uart)) { - c = UART_ReadByte(uart); + c = UART_READ_BYTE(uart); if (i != _rx_buffer_tail) { // write if there is space in the buffer diff --git a/cores/arduino/HardwareSerial.h b/cores/arduino/HardwareSerial.h index 7ff9700..d7f60a1 100644 --- a/cores/arduino/HardwareSerial.h +++ b/cores/arduino/HardwareSerial.h @@ -100,7 +100,7 @@ class HardwareSerial : public Stream using Print::write; // pull in write(str) operator bool() { return isInited; } - void rx_complete_irq(void) __attribute__((optimize("O3"))); + inline void rx_complete_irq(void) __attribute__((always_inline, optimize("O3"))); }; extern HardwareSerial Serial;