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:
parent
6deb89f887
commit
a6dc9bdb2d
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user