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)