1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/esp8266/periph_timer: allow changing callback or freq

Allow multiple calls to timer_init(), as this is the only way to
change the timer frequency or the callback function.
This commit is contained in:
Marian Buschsieweke 2022-11-24 20:34:32 +01:00
parent e8fd65566a
commit 03b7fe8f0c
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -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;