[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.
This commit is contained in:
Olaf Bergmann committed 2021-09-01 09:34:47 +02:00
1 parent 05e7f12d7c
commit 54dbc3eeb8
1 file changed
+4
+4
View File
@@ -88,7 +88,11 @@ COAP_STATIC_INLINE uint64_t coap_ticks_to_rt_us(coap_tick_t t) {
#elif defined(RIOT_VERSION)
#include <xtimer.h>
#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;