From 7c266d652170052be77812a58c15937ece1ed525 Mon Sep 17 00:00:00 2001 From: klassents Date: Sun, 13 Oct 2024 15:22:12 +0700 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=D0=B0=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B5=20=D0=BC=D0=B0=D0=BA?= =?UTF-8?q?=D1=80=D0=BE=D1=81=D1=8B,=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=D0=B0=20=D1=83=D1=80=D0=BE=D0=B2=D0=B5=D0=BD=D1=8C?= =?UTF-8?q?=20=D0=BE=D0=BF=D1=82=D0=B8=D0=BC=D0=B8=D0=B7=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cores/arduino/trap_handler.c | 2 +- cores/arduino/wiring_LL.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cores/arduino/trap_handler.c b/cores/arduino/trap_handler.c index 4b709df..bf16dbf 100644 --- a/cores/arduino/trap_handler.c +++ b/cores/arduino/trap_handler.c @@ -11,7 +11,7 @@ void __attribute__((weak)) wire_interrupt_handler(void) } // ---------------------------------------------- // -void __attribute__((noinline, section(".ram_text"))) trap_handler(void) +void __attribute__((noinline, section(".ram_text"), optimize("O3"))) trap_handler (void) { // gpio interrupt if (EPIC_CHECK_GPIO_IRQ()) diff --git a/cores/arduino/wiring_LL.h b/cores/arduino/wiring_LL.h index a635e5f..3649ee9 100644 --- a/cores/arduino/wiring_LL.h +++ b/cores/arduino/wiring_LL.h @@ -21,6 +21,10 @@ // get ticks from systick #define SYSTICK_GET_TICKS() ((uint64_t)(SCR1_TIMER->MTIMEH)<<32 | SCR1_TIMER->MTIME) +// ----------------- UART ----------------- // +#define UART_READ_BYTE(pUart) ((uint16_t)pUart->RXDATA) +#define UART_IS_RX_FIFO_EMPTY(pUart) ((pUart->FLAGS & UART_FLAGS_RXNE_M) == 0) + // ----------------- TIMER16 ----------------- // #define TIM16_DISABLE(htim16) (htim16.Instance->CR &= ~TIMER16_CR_ENABLE_M) #define TIM16_CLEAR_INT_MASK(htim16, intMask) (htim16.Instance->ICR = intMask)