mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #15111 from maribu/xtimer-assert
sys/{x,z}timer: assert() successful initialization of periph_timer
This commit is contained in:
commit
2dab6c7b30
@ -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 */
|
||||
|
@ -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