From 1ac3842a7609e2b72a2b2bc2fbbe3e06b711912a Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Fri, 6 Dec 2019 20:27:35 +0100 Subject: [PATCH] fixup! tests: add ztimer test applications --- .../{ztimer_diff => ztimer_overhead}/Makefile | 2 +- tests/{ztimer_diff => ztimer_overhead}/main.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) rename tests/{ztimer_diff => ztimer_overhead}/Makefile (58%) rename tests/{ztimer_diff => ztimer_overhead}/main.c (64%) diff --git a/tests/ztimer_diff/Makefile b/tests/ztimer_overhead/Makefile similarity index 58% rename from tests/ztimer_diff/Makefile rename to tests/ztimer_overhead/Makefile index 907adaff567cf..3f8bff7a3b9ae 100644 --- a/tests/ztimer_diff/Makefile +++ b/tests/ztimer_overhead/Makefile @@ -1,6 +1,6 @@ DEVELHELP ?= 0 include ../Makefile.tests_common -USEMODULE += ztimer ztimer_periph ztimer_convert ztimer_extend +USEMODULE += ztimer ztimer_periph ztimer_overhead include $(RIOTBASE)/Makefile.include diff --git a/tests/ztimer_diff/main.c b/tests/ztimer_overhead/main.c similarity index 64% rename from tests/ztimer_diff/main.c rename to tests/ztimer_overhead/main.c index 5f9490a719394..bdfc7a0e3becf 100644 --- a/tests/ztimer_diff/main.c +++ b/tests/ztimer_overhead/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Kaspar Schleiser + * Copyright (C) 2019 Kaspar Schleiser * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level @@ -11,7 +11,7 @@ * @{ * * @file - * @brief ztimer diff test application + * @brief ztimer overhead test application * * @author Kaspar Schleiser * @@ -31,7 +31,7 @@ static ztimer_periph_t _ztimer_periph; int main(void) { - ztimer_periph_init(&_ztimer_periph, 0, 1000000LU); + ztimer_periph_init(&_ztimer_periph, 0, 1000000LU, 0xffffffff); uint32_t total = 0; @@ -40,13 +40,13 @@ int main(void) unsigned n = SAMPLES; while (n--) { - unsigned diff = ztimer_diff((ztimer_dev_t *)&_ztimer_periph, 1000); - total += diff; - if (diff < min) { - min = diff; + unsigned overhead = ztimer_overhead(&_ztimer_periph.super, 1000); + total += overhead; + if (overhead < min) { + min = overhead; } - else if (diff > max) { - max = diff; + else if (overhead > max) { + max = overhead; } }