заменила функции на макросы

This commit is contained in:
klassents committed 2024-10-13 15:20:57 +07:00
1 parent 6a67d9fd61
commit a02f1f23af
2 files changed
+4 -4

No files matched your search

+3 -3
View File
@@ -5,7 +5,7 @@
#include "HardwareSerial.h" #include "HardwareSerial.h"
#include <uart_lib.h> #include <uart_lib.h>
#include "mik32_hal_irq.h" #include "mik32_hal_irq.h"
#include "wiring_LL.h"
// HardwareSerial class objects for use in Arduino IDE // HardwareSerial class objects for use in Arduino IDE
HardwareSerial Serial(0); HardwareSerial Serial(0);
@@ -127,9 +127,9 @@ void HardwareSerial::rx_complete_irq(void)
unsigned char c; unsigned char c;
// while there is something to receive, put the data into the buffer // while there is something to receive, put the data into the buffer
// and edit the buffer index // 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) if (i != _rx_buffer_tail)
{ {
// write if there is space in the buffer // write if there is space in the buffer
+1 -1
View File
@@ -100,7 +100,7 @@ class HardwareSerial : public Stream
using Print::write; // pull in write(str) using Print::write; // pull in write(str)
operator bool() { return isInited; } 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; extern HardwareSerial Serial;