From 54dbc3eeb815b69ef034313f47983edaaa1f0e65 Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Mon, 12 Jul 2021 14:32:36 +0200 Subject: [PATCH] [RIOT] coap_time.h: fix COAP_TICKS_PER_SECOND for undefined XTIMER_HZ With ztimer usage, XTIMER_HZ is not defined anymore in xtimer.h. As a workaround, XTIMER_HZ_BASE is used. --- include/coap3/coap_time.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/coap3/coap_time.h b/include/coap3/coap_time.h index baa8650e..99d117a4 100644 --- a/include/coap3/coap_time.h +++ b/include/coap3/coap_time.h @@ -88,7 +88,11 @@ COAP_STATIC_INLINE uint64_t coap_ticks_to_rt_us(coap_tick_t t) { #elif defined(RIOT_VERSION) #include +#ifdef XTIMER_HZ #define COAP_TICKS_PER_SECOND (XTIMER_HZ) +#else /* XTIMER_HZ */ +#define COAP_TICKS_PER_SECOND (XTIMER_HZ_BASE) +#endif /* XTIMER_HZ */ typedef uint64_t coap_tick_t; typedef int64_t coap_tick_diff_t;