1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/xtimer_drift
josar ccbb294f9d tests/xtimer_drift: increase priority of worker
When the slacker threads and the worker thread have the same priority
the drift and jitter depend on the workload.
Timer set before the worker thread will be fired before the worker and so
the result is not the timings the system might reach when proper priority
is set. Increasing the priority of the worker thread ensures that the
measureed timings are the achievable timings.
2018-11-15 12:36:02 +01:00
..
main.c tests/xtimer_drift: increase priority of worker 2018-11-15 12:36:02 +01:00
Makefile tests/xtimer: blacklist arduino boards based on ROM/RAM overflow 2018-09-05 12:08:27 +02:00
README.md tests: add README for xtimer_drift 2017-02-27 18:05:53 +01:00

xtimer_drift test application

Make note of the PC clock when starting this test. Let it run for a while, and compare the printed time against the expected time from the PC clock. The difference is the RIOT timer drift, this is likely caused by either:

  • an inaccurate hardware timer, or
  • bugs in the software (xtimer or periph/timer)

This test will run a periodic timer every TEST_INTERVAL microseconds (TEST_HZ). The current time will be printed once per second, along with the difference between the actual and expected xtimer_now value. The first output variable drift, represents the total offset since start between xtimer_now and the expected time. The second output variable jitter, represents the difference in drift from the last printout. Two other threads are also running only to cause CPU load with extra interrupts and context switches.