Skip to content

Commit b31c936

Browse files
authored
Add function timerAttachInterruptFlag (espressif#7809)
1 parent e881d11 commit b31c936

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

cores/esp32/esp32-hal-timer.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,15 @@ bool IRAM_ATTR timerFnWrapper(void *arg){
221221
return false;
222222
}
223223

224-
void timerAttachInterrupt(hw_timer_t *timer, void (*fn)(void), bool edge){
224+
void timerAttachInterruptFlag(hw_timer_t *timer, void (*fn)(void), bool edge, int intr_alloc_flags){
225225
if(edge){
226226
log_w("EDGE timer interrupt is not supported! Setting to LEVEL...");
227227
}
228-
timer_isr_callback_add(timer->group, timer->num, timerFnWrapper, fn, 0);
228+
timer_isr_callback_add(timer->group, timer->num, timerFnWrapper, fn, intr_alloc_flags);
229+
}
230+
231+
void timerAttachInterrupt(hw_timer_t *timer, void (*fn)(void), bool edge){
232+
timerAttachInterruptFlag(timer, fn, edge, 0);
229233
}
230234

231235
void timerDetachInterrupt(hw_timer_t *timer){

cores/esp32/esp32-hal-timer.h

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ void timerEnd(hw_timer_t *timer);
3636
void timerSetConfig(hw_timer_t *timer, uint32_t config);
3737
uint32_t timerGetConfig(hw_timer_t *timer);
3838

39+
void timerAttachInterruptFlag(hw_timer_t *timer, void (*fn)(void), bool edge, int intr_alloc_flags);
3940
void timerAttachInterrupt(hw_timer_t *timer, void (*fn)(void), bool edge);
4041
void timerDetachInterrupt(hw_timer_t *timer);
4142

0 commit comments

Comments
 (0)