1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-20 12:03:52 +01:00

Merge pull request #18971 from maribu/cpu/esp

cpu/esp{32,8266}/periph_timer: allow changing callback or freq
This commit is contained in:
Marian Buschsieweke 2022-11-25 08:22:26 +01:00 committed by GitHub
commit c89c75dbc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 10 deletions

View File

@ -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(clk_div >= 2 && clk_div <= 65536);
assert(cb != NULL); 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 */ /* initialize timer data structure */
_timers[dev].initialized = true; _timers[dev].initialized = true;
_timers[dev].started = false; _timers[dev].started = false;

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 (freq == HW_TIMER_FREQUENCY, -1);
CHECK_PARAM_RET (cb != NULL, -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].initialized = true;
timers[dev].started = false; timers[dev].started = false;
timers[dev].isr_ctx.cb = cb; timers[dev].isr_ctx.cb = cb;