diff --git a/tests/evtimer_underflow/Makefile b/tests/evtimer_underflow/Makefile index e9e3214d84..0c65537ed2 100644 --- a/tests/evtimer_underflow/Makefile +++ b/tests/evtimer_underflow/Makefile @@ -1,5 +1,6 @@ include ../Makefile.tests_common USEMODULE += evtimer +USEMODULE += xtimer include $(RIOTBASE)/Makefile.include diff --git a/tests/evtimer_underflow/main.c b/tests/evtimer_underflow/main.c index 7fd694ac17..89768ee4ec 100644 --- a/tests/evtimer_underflow/main.c +++ b/tests/evtimer_underflow/main.c @@ -23,6 +23,7 @@ #include "evtimer_msg.h" #include "thread.h" #include "msg.h" +#include "xtimer.h" #define WORKER_MSG_QUEUE_SIZE (8) @@ -45,7 +46,7 @@ static evtimer_msg_event_t events[] = { /* This thread will print the drift to stdout once per second */ void *worker_thread(void *arg) { - (void) arg; + (void)arg; msg_init_queue(worker_msg_queue, WORKER_MSG_QUEUE_SIZE); while (1) { @@ -58,6 +59,11 @@ void *worker_thread(void *arg) } } +void sleep_msec(uint16_t t) +{ + xtimer_msleep(t); +} + int main(void) { evtimer_init_msg(&evtimer); @@ -67,9 +73,11 @@ int main(void) THREAD_PRIORITY_MAIN - 1, THREAD_CREATE_STACKTEST, worker_thread, NULL, "worker"); + while (1) { for (unsigned i = 0; i < NEVENTS; i++) { evtimer_add_msg(&evtimer, &events[i], pid); + sleep_msec(10); } } }