1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:32:45 +01:00

sys/xtimer: 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:40:00 +02:00
parent 4243c180cb
commit 6deb89f887
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -31,6 +31,7 @@
#include "periph_conf.h"
#endif
#include "assert.h"
#include "xtimer.h"
#include "irq.h"
@ -65,7 +66,9 @@ void xtimer_init(void)
{
#ifndef MODULE_XTIMER_ON_ZTIMER
/* initialize low-level timer */
timer_init(XTIMER_DEV, XTIMER_HZ, _periph_timer_callback, NULL);
int ret = timer_init(XTIMER_DEV, XTIMER_HZ, _periph_timer_callback, NULL);
(void)ret;
assert(ret == 0);
#endif
/* register initial overflow tick */