1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests/trickle: use ztimer instead of xtimer

This commit is contained in:
Hauke Petersen 2021-04-13 14:20:11 +02:00
parent c5d1a34b83
commit ef8753a37f

View File

@ -23,6 +23,11 @@
#include "trickle.h"
#include "thread.h"
#include "msg.h"
#if IS_USED(MODULE_ZTIMER_MSEC)
#include "ztimer.h"
#else
#include "xtimer.h"
#endif
#define TRICKLE_MSG (0xfeef)
#define TR_IMIN (8)
@ -45,7 +50,11 @@ static trickle_t trickle = { .callback = { .func = &callback,
static void callback(void *args)
{
(void) args;
#if IS_USED(MODULE_ZTIMER_MSEC)
uint32_t now = ztimer_now(ZTIMER_MSEC);
#else
uint32_t now = xtimer_now_usec();
#endif
printf("now = %" PRIu32 ", t = %" PRIu32 "\n", now, trickle.t);