tests/hwtimer_wait: test smallest value possible

By selecting the start value as a multiple of HWTIMER_SPIN_BARRIER+1, the
test now includes the smallest non-spinning value.
This commit is contained in:
Ludwig Ortmann 2014-11-28 13:48:25 +01:00
parent c4e961c082
commit ac8f51cb52

View File

@ -30,7 +30,7 @@ int main(void)
puts("When the race condition is hit, the timer will wait for a very very long time."); puts("When the race condition is hit, the timer will wait for a very very long time.");
long iterations = 10000; long iterations = 10000;
long start_duration = 256; long start_duration = (HWTIMER_SPIN_BARRIER + 1) << 5;
long duration = iterations * start_duration * 2L; long duration = iterations * start_duration * 2L;
printf("The test should take about %li sec.\n", (HWTIMER_TICKS_TO_US(duration)/1000000)); printf("The test should take about %li sec.\n", (HWTIMER_TICKS_TO_US(duration)/1000000));