diff --git a/tests/test_hwtimer_spin/main.c b/tests/test_hwtimer_spin/main.c index 87a4c9501a4d435d6c1a8ab17e87d25431adbeb9..1677f5ae5404cf5b83de876c1a0430a416f19969 100644 --- a/tests/test_hwtimer_spin/main.c +++ b/tests/test_hwtimer_spin/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Ludwig Ortmann <ludwig.ortmann@fu-berlin.de> + * Copyright (C) 2014 Ludwig Ortmann <ludwig.ortmann@fu-berlin.de> * * This file is subject to the terms and conditions of the GNU Lesser General * Public License. See the file LICENSE in the top level directory for more @@ -29,10 +29,10 @@ int main(void) { - printf("when the race condition is hit, hwtimer will wait a very very long time...\n"); + puts("This is just a functionality test for hwtimer_spin."); while (1) { - for (unsigned long i = 256; i; i = i >> 1) { + for (unsigned long i = 6; i > 0; i--) { printf("wait %lu\n", i); hwtimer_wait(i); } diff --git a/tests/test_hwtimer_wait/Makefile b/tests/test_hwtimer_wait/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..35d1ec16fceca48231cd58f0b8784f9cf9186db1 --- /dev/null +++ b/tests/test_hwtimer_wait/Makefile @@ -0,0 +1,6 @@ +export PROJECT = test_hwtimer_wait +include ../Makefile.tests_common + +DISABLE_MODULE += auto_init + +include $(RIOTBASE)/Makefile.include diff --git a/tests/test_hwtimer_wait/main.c b/tests/test_hwtimer_wait/main.c new file mode 100644 index 0000000000000000000000000000000000000000..93d9d69214855ec844b3fb4778885a72c0235980 --- /dev/null +++ b/tests/test_hwtimer_wait/main.c @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2014 Ludwig Ortmann <ludwig.ortmann@fu-berlin.de> + * + * This file is subject to the terms and conditions of the GNU Lesser General + * Public License. See the file LICENSE in the top level directory for more + * details. + */ + +/** + * @ingroup tests + * @{ + * + * @file + * @brief Hwtimer test application + * + * @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de> + * + * @} + */ + +#include <stdio.h> +#include <limits.h> +#include <stdlib.h> + +#include "board_uart0.h" +#include "posix_io.h" +#include "hwtimer.h" +#include "thread.h" + +int main(void) +{ + puts("This is a regression test for a race condition in hwtimer_wait."); + puts("When the race condition is hit, the timer will wait for a very very long time..."); + + while (1) { + for (unsigned long i = 256; i; i = i >> 1) { + printf("wait %lu\n", i); + hwtimer_wait(i); + } + } +}