Skip to content

Commit c653486

Browse files
set correct priority for timer
1 parent 733020d commit c653486

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cores/arduino/time.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ static FspTimer main_timer;
2727
#define _timer_clock_freq 24000000UL
2828
#define _timer_ticks_per_us (_timer_clock_freq / ((1 << _timer_clock_divider) * 1000000UL))
2929
#define _timer_period (_timer_ticks_per_us * 1000UL)
30+
#define TIMER_PRIORITY 8
3031

3132
static void timer_micros_callback(timer_callback_args_t __attribute((unused)) *p_args) {
3233
agt_time_ms += 1;
3334
}
3435

3536
void startAgt() {
3637
main_timer.begin(TIMER_MODE_PERIODIC, _timer_type, _timer_index, _timer_period, 1, _timer_clock_divider, timer_micros_callback);;
37-
main_timer.setup_overflow_irq();
38+
main_timer.setup_overflow_irq(TIMER_PRIORITY);
3839
main_timer.open();
3940
main_timer.start(); // bug in R4 1.0.2: calling start() is not necessary: open() starts the counter already !?
4041
}

0 commit comments

Comments
 (0)