1
0
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:
MrKevinWeiss 2023-03-17 12:11:52 +01:00
parent c309f21e97
commit 3e3dc7698a
No known key found for this signature in database
GPG Key ID: 4B69974722CBEEAE
2 changed files with 2 additions and 9 deletions

View File

@ -1,6 +1,7 @@
include ../Makefile.tests_common
USEMODULE += trickle
USEMODULE += ztimer_msec
# microbit qemu lacks rtt
TEST_ON_CI_BLACKLIST += microbit

View File

@ -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).