From 9a9d294a0d728fcfb2a47b0f1ef0462410e46e87 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Tue, 7 Jul 2015 10:25:12 +0200 Subject: [PATCH 1/2] tests: remove sleep from hwtimer test Instead set hwtimer_wait delay long enough. --- tests/hwtimer/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/hwtimer/main.c b/tests/hwtimer/main.c index 3a2d78684b..52ae2f28f4 100644 --- a/tests/hwtimer/main.c +++ b/tests/hwtimer/main.c @@ -23,9 +23,9 @@ #include #include "hwtimer.h" -#include "thread.h" #define BASE_DELAY (1000UL * 1000UL) +#define END_DELAY (BASE_DELAY + ((HWTIMER_MAXTIMERS - 1) * DELTA_DELAY)) #define DELTA_DELAY (10UL * 1000UL) #define MSGLEN 12 // == strlen("callback %2i") char msg[MSGLEN * HWTIMER_MAXTIMERS]; // == [callback 1\0callback 2\0...] @@ -70,9 +70,8 @@ int main(void) puts("All timers set."); puts(""); - hwtimer_wait(HWTIMER_TICKS(BASE_DELAY)); + hwtimer_wait(HWTIMER_TICKS(END_DELAY)); puts("hwtimer set."); - thread_sleep(); return 0; } From 50fce32ea12d70b54d73a26ab37bffa76a9e5d08 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Tue, 7 Jul 2015 10:25:25 +0200 Subject: [PATCH 2/2] tests: some hwtimer cosmetics --- tests/hwtimer/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/hwtimer/main.c b/tests/hwtimer/main.c index 52ae2f28f4..bfa52ce4d4 100644 --- a/tests/hwtimer/main.c +++ b/tests/hwtimer/main.c @@ -24,11 +24,12 @@ #include "hwtimer.h" -#define BASE_DELAY (1000UL * 1000UL) +#define BASE_DELAY (1000UL * 1000UL) #define END_DELAY (BASE_DELAY + ((HWTIMER_MAXTIMERS - 1) * DELTA_DELAY)) #define DELTA_DELAY (10UL * 1000UL) -#define MSGLEN 12 // == strlen("callback %2i") -char msg[MSGLEN * HWTIMER_MAXTIMERS]; // == [callback 1\0callback 2\0...] +#define MSGLEN (12) /* == strlen("callback %2i") */ + +char msg[MSGLEN * HWTIMER_MAXTIMERS]; /* == [callback 1\0callback 2\0...] */ void callback(void *ptr) {