mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests: add test_hwtimer_wait
It contains the old test functionality of test_hwtimer_spin.
This commit is contained in:
parent
19d9d67f4e
commit
c52105f696
6
tests/test_hwtimer_wait/Makefile
Normal file
6
tests/test_hwtimer_wait/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
export PROJECT = test_hwtimer_wait
|
||||
include ../Makefile.tests_common
|
||||
|
||||
DISABLE_MODULE += auto_init
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
41
tests/test_hwtimer_wait/main.c
Normal file
41
tests/test_hwtimer_wait/main.c
Normal file
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user