tests/trickle: use ztimer instead of xtimer
This commit is contained in:
parent
c5d1a34b83
commit
ef8753a37f
@ -23,6 +23,11 @@
|
|||||||
#include "trickle.h"
|
#include "trickle.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "msg.h"
|
#include "msg.h"
|
||||||
|
#if IS_USED(MODULE_ZTIMER_MSEC)
|
||||||
|
#include "ztimer.h"
|
||||||
|
#else
|
||||||
|
#include "xtimer.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TRICKLE_MSG (0xfeef)
|
#define TRICKLE_MSG (0xfeef)
|
||||||
#define TR_IMIN (8)
|
#define TR_IMIN (8)
|
||||||
@ -45,7 +50,11 @@ static trickle_t trickle = { .callback = { .func = &callback,
|
|||||||
static void callback(void *args)
|
static void callback(void *args)
|
||||||
{
|
{
|
||||||
(void) args;
|
(void) args;
|
||||||
|
#if IS_USED(MODULE_ZTIMER_MSEC)
|
||||||
|
uint32_t now = ztimer_now(ZTIMER_MSEC);
|
||||||
|
#else
|
||||||
uint32_t now = xtimer_now_usec();
|
uint32_t now = xtimer_now_usec();
|
||||||
|
#endif
|
||||||
|
|
||||||
printf("now = %" PRIu32 ", t = %" PRIu32 "\n", now, trickle.t);
|
printf("now = %" PRIu32 ", t = %" PRIu32 "\n", now, trickle.t);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user