diff --git a/tests/test_hwtimer_spin/main.c b/tests/test_hwtimer_spin/main.c index 87a4c9501a..1677f5ae54 100644 --- a/tests/test_hwtimer_spin/main.c +++ b/tests/test_hwtimer_spin/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Ludwig Ortmann + * Copyright (C) 2014 Ludwig Ortmann * * 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 0000000000..35d1ec16fc --- /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 0000000000..93d9d69214 --- /dev/null +++ b/tests/test_hwtimer_wait/main.c @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2014 Ludwig Ortmann + * + * 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 + * + * @} + */ + +#include +#include +#include + +#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); + } + } +}