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); + } + } +}