1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/hwtimer_spin/main.c

47 lines
1.2 KiB
C
Raw Normal View History

/*
* 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 v2.1. See the file LICENSE in the top level
* directory for more details.
*/
2014-02-03 23:03:13 +01:00
/**
* @ingroup tests
* @{
*
* @file
* @brief Hwtimer test application
*
* @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
2014-02-03 23:03:13 +01:00
*
* @}
*/
#include <stdio.h>
#include "hwtimer.h"
#include "board.h"
int main(void)
{
puts("This is just a functionality test for hwtimer_spin.");
puts("\nYou should see the message \"success\" after while if this test was successful");
puts("If you do not see this message, something went wrong.\n");
for (unsigned long r = 100; r > 0; r--) {
/* test values <= SPIN_BARRIER */
for (unsigned long i = HWTIMER_SPIN_BARRIER; i > 0; i--) {
hwtimer_wait(i);
}
/* test values that are slightly above the SPIN_BARRIER */
for (unsigned long i = (10 * HWTIMER_SPIN_BARRIER); i > HWTIMER_SPIN_BARRIER; i--) {
hwtimer_wait(i);
}
}
puts("success");
return 0;
}