1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/sys/xtimer_drift
Hugues Larrive 3c465836f2 examples and tests: add atmega8 to relevent Makefile.ci
using dist/tools/insufficient_memory/add_insufficient_memory_board.sh
2023-07-11 21:22:02 +02:00
..
app.config.test tests: move sys related applications to tests/sys/ subdirectory 2023-05-10 12:02:58 +02:00
main.c tests: move sys related applications to tests/sys/ subdirectory 2023-05-10 12:02:58 +02:00
Makefile tests: move sys related applications to tests/sys/ subdirectory 2023-05-10 12:02:58 +02:00
Makefile.ci examples and tests: add atmega8 to relevent Makefile.ci 2023-07-11 21:22:02 +02:00
README.md tests: move sys related applications to tests/sys/ subdirectory 2023-05-10 12:02:58 +02: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.