1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #1626 from LudwigOrtmann/hwtimer_wait_fixup

tests: remove need for pow,log2 in hwtimer_wait
This commit is contained in:
Martine Lenders 2014-08-29 14:01:56 +02:00
commit 741536a82d

View File

@ -34,12 +34,18 @@ int main(void)
puts("When the race condition is hit, the timer will wait for a very very long time.");
int iterations = 10000;
/* `#define I_CHANGED_START_DURATION 1` or update the constant if
* you change start_duration */
int start_duration = 256;
long duration = iterations * (
/* geometric series */
#if I_CHANGED_START_DURATION
(1 - pow(2,(log2(start_duration) + 1)))
/ (1 - 2)
#else
511.0
#endif
);
printf("The test should take about %li sec.\n", (HWTIMER_TICKS_TO_US(duration)/1000000));