From 2870df77560110aa73f80dbb12efcb20f62a06b7 Mon Sep 17 00:00:00 2001 From: klassents Date: Fri, 11 Apr 2025 04:42:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D0=B0=D1=80=D0=B8=D0=B8=20=D0=BA=20=D1=84=D1=83=D0=BD=D0=BA?= =?UTF-8?q?=D1=86=D0=B8=D0=B8=20ISR()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cores/arduino/trap_handler.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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"