From 14cbec41bb09996eb6129576cd3e3ee542677a23 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 3 Sep 2015 18:47:43 +0200 Subject: [PATCH] tests: bitarithm_timings: convert to xtimer --- tests/bitarithm_timings/Makefile | 2 ++ tests/bitarithm_timings/main.c | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/bitarithm_timings/Makefile b/tests/bitarithm_timings/Makefile index db6ae0522..4bbb98f20 100644 --- a/tests/bitarithm_timings/Makefile +++ b/tests/bitarithm_timings/Makefile @@ -1,4 +1,6 @@ APPLICATION = bitarithm_timings include ../Makefile.tests_common +USEMODULE += xtimer + include $(RIOTBASE)/Makefile.include diff --git a/tests/bitarithm_timings/main.c b/tests/bitarithm_timings/main.c index 032989694..037301624 100644 --- a/tests/bitarithm_timings/main.c +++ b/tests/bitarithm_timings/main.c @@ -32,12 +32,10 @@ #include #include "bitarithm.h" -#include "hwtimer.h" -#include "timex.h" +#include "xtimer.h" #define TIMEOUT_S (5ul) -#define TIMEOUT_US (TIMEOUT_S * SEC_IN_USEC) -#define TIMEOUT (HWTIMER_TICKS(TIMEOUT_US)) +#define TIMEOUT (TIMEOUT_S * SEC_IN_USEC) #define PER_ITERATION (4) static void callback(void *done_) @@ -52,7 +50,12 @@ static void run_test(const char *name, unsigned (*test)(unsigned)) unsigned i = 0; unsigned long count = 0; - hwtimer_set(TIMEOUT, callback, (void *) &done); + xtimer_t xtimer; + xtimer.callback = callback; + xtimer.arg = (void *) &done; + + xtimer_set(&xtimer, TIMEOUT); + do { if (i++ == -1u) { i = 1;