mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests/trickle: Remove xtimer and use ztimer
This commit is contained in:
parent
c309f21e97
commit
3e3dc7698a
@ -1,6 +1,7 @@
|
||||
include ../Makefile.tests_common
|
||||
|
||||
USEMODULE += trickle
|
||||
USEMODULE += ztimer_msec
|
||||
|
||||
# microbit qemu lacks rtt
|
||||
TEST_ON_CI_BLACKLIST += microbit
|
||||
|
@ -23,11 +23,8 @@
|
||||
#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)
|
||||
@ -50,12 +47,7 @@ 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);
|
||||
|
||||
/* previous `t` is chosen from a smaller interval [I/2, I).
|
||||
|
Loading…
Reference in New Issue
Block a user