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

sys/ztimer: assert() successful initialized

Use an `assert()` to make sure that `periph_timer` was successfully initialized.
This commit is contained in:
Marian Buschsieweke 2020-09-29 10:42:15 +02:00
parent 6deb89f887
commit a6dc9bdb2d
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -20,6 +20,7 @@
* @}
*/
#include "assert.h"
#include "irq.h"
#include "ztimer/periph_timer.h"
@ -79,6 +80,8 @@ void ztimer_periph_timer_init(ztimer_periph_timer_t *clock, tim_t dev,
clock->dev = dev;
clock->super.ops = &_ztimer_periph_timer_ops;
clock->super.max_value = max_val;
timer_init(dev, freq, _ztimer_periph_timer_callback, clock);
int ret = timer_init(dev, freq, _ztimer_periph_timer_callback, clock);
(void)ret;
assert(ret == 0);
ztimer_init_extend(&clock->super);
}