From ed0cb746bb07ee221b725d6f9156a7508f5cd968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Thu, 17 Mar 2016 21:47:57 +0100 Subject: [PATCH] tests/xtimer_drift: Clean up data types in printf loop --- tests/xtimer_drift/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/xtimer_drift/main.c b/tests/xtimer_drift/main.c index a3f9584bd379..fbd23b2ead86 100644 --- a/tests/xtimer_drift/main.c +++ b/tests/xtimer_drift/main.c @@ -87,7 +87,7 @@ void *slacker_thread(void *arg) void *worker_thread(void *arg) { (void) arg; - unsigned int loop_counter = 0; + uint32_t loop_counter = 0; uint32_t start = 0; uint32_t last = 0; @@ -105,9 +105,9 @@ void *worker_thread(void *arg) } uint32_t us, sec; - unsigned int min, hr; - us = now % 1000000; - sec = now / 1000000; + uint32_t min, hr; + us = now % SEC_IN_USEC; + sec = now / SEC_IN_USEC; min = (sec / 60) % 60; hr = sec / 3600; if ((loop_counter % TEST_HZ) == 0) { @@ -115,8 +115,9 @@ void *worker_thread(void *arg) int32_t drift = now - expected; expected = last + TEST_HZ * TEST_INTERVAL; int32_t jitter = now - expected; - printf("now=%" PRIu32 ".%06" PRIu32 " (%u hours %u min), drift=%" PRId32 " us, jitter=%" PRId32 " us\n", - sec, us, hr, min, drift, jitter); + printf("now=%" PRIu32 ".%06" PRIu32 " (%" PRIu32 " hours %" PRIu32 " min), ", + sec, us, hr, min); + printf("drift=%" PRId32 " us, jitter=%" PRId32 " us\n", drift, jitter); last = now; } ++loop_counter;