From a02f1f23af297c83a6ca525700381094c81b50bf Mon Sep 17 00:00:00 2001 From: klassents Date: Sun, 13 Oct 2024 15:20:57 +0700 Subject: [PATCH] =?UTF-8?q?=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB?= =?UTF-8?q?=D0=B0=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BC=D0=B0=D0=BA=D1=80=D0=BE=D1=81=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cores/arduino/HardwareSerial.cpp | 6 +++--- cores/arduino/HardwareSerial.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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;