Skip to content

Commit

Permalink
cpu/esp8266/periph_timer: allow changing callback or freq
Browse files Browse the repository at this point in the history
Allow multiple calls to timer_init(), as this is the only way to
change the timer frequency or the callback function.
  • Loading branch information
maribu committed Nov 24, 2022
1 parent bd0caf9 commit 26558c8
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions cpu/esp8266/periph/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ int timer_init (tim_t dev, uint32_t freq, timer_cb_t cb, void *arg)
CHECK_PARAM_RET (freq == HW_TIMER_FREQUENCY, -1);
CHECK_PARAM_RET (cb != NULL, -1);

if (timers[dev].initialized) {
DEBUG("%s timer dev=%u is already initialized (used)\n", __func__, dev);
return -1;
}

timers[dev].initialized = true;
timers[dev].started = false;
timers[dev].isr_ctx.cb = cb;
Expand Down

0 comments on commit 26558c8

Please sign in to comment.