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

tests: remove need for pow,log2 in hwtimer_wait

Default to precalculated value for geometric series, so pow and log2
are not needed.
This commit is contained in:
Ludwig Ortmann 2014-08-28 18:37:10 +02:00
parent 872f8ecfea
commit 377c7a4136

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