diff --git a/cores/arduino/trap_handler.c b/cores/arduino/trap_handler.c index 5754182..e3c5901 100644 --- a/cores/arduino/trap_handler.c +++ b/cores/arduino/trap_handler.c @@ -25,13 +25,16 @@ void __attribute__((weak)) ISR(void) In the project, you need to create a function of the form: extern "C" void ISR() { - // timer16 is taken as an example - if (TIM16_GET_ARRM_INT_STATUS(htimer16_1_)) + if (EPIC_CHECK_TIMER16_1()) { - // necessary actions + // timer16 is taken as an example + if (TIM16_GET_ARRM_INT_STATUS(htimer16_1_)) + { + // necessary actions + } + // reset timer interrupt flags + TIM16_CLEAR_INT_MASK(htimer16_1_, 0xFFFFFFFF); } - // reset timer interrupt flags - TIM16_CLEAR_INT_MASK(htimer16_1_, 0xFFFFFFFF); } libraries required to use this example: #include "mik32_hal_timer16.h"