From e8fd65566a2f55b40a2be59ae610149ac0828d5e Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Thu, 24 Nov 2022 20:33:35 +0100 Subject: [PATCH] cpu/esp32/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. --- cpu/esp32/periph/timer.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cpu/esp32/periph/timer.c b/cpu/esp32/periph/timer.c index 1e5783b00f..7a58973a07 100644 --- a/cpu/esp32/periph/timer.c +++ b/cpu/esp32/periph/timer.c @@ -230,11 +230,6 @@ int timer_init(tim_t dev, uint32_t freq, timer_cb_t cb, void *arg) assert(clk_div >= 2 && clk_div <= 65536); assert(cb != NULL); - if (_timers[dev].initialized) { - DEBUG("%s timer dev=%u is already initialized (used)\n", __func__, dev); - return -1; - } - /* initialize timer data structure */ _timers[dev].initialized = true; _timers[dev].started = false;