Skip to content

Commit 9454a50

Browse files
committed
sys/xtimer: improve documentation
- Add a deprecation note to xtimer, so that new code hopefully starts using ztimer - Add a hint that `ztimer_xtimer_compat` can be used even after `xtimer` is gone
1 parent e690ef4 commit 9454a50

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

sys/include/xtimer.h

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,31 @@
88
*/
99

1010
/**
11-
* @defgroup sys_xtimer Timers
12-
* @ingroup sys
13-
* @brief Provides a high level timer module to register
14-
* timers, get current system time, and let a thread sleep for
15-
* a certain amount of time.
11+
* @defgroup sys_xtimer xtimer high level timer abstraction layer (deprecated)
12+
* @ingroup sys
13+
* @brief Provides a high level timer module to register
14+
* timers, get current system time, and let a thread sleep for
15+
* a certain amount of time.
1616
*
1717
* The implementation takes one low-level timer and multiplexes it.
1818
*
1919
* Insertion and removal of timers has O(n) complexity with (n) being the
2020
* number of active timers. The reason for this is that multiplexing is
2121
* realized by next-first singly linked lists.
2222
*
23+
* @deprecated xtimer has been deprecated in favor of the @ref sys_ztimer
24+
* @note With @ref sys_ztimer_xtimer_compat a compatibility wrapper is
25+
* provided that in the vast majority of cases can function as a
26+
* drop-in replacement. This compatibility wrapper is expected to
27+
* replace `xtimer` in the near future and ensure that code still
28+
* depending on the `xtimer` API continues to function.
29+
* @details Note that at least for long running timers, using
30+
* @ref sys_ztimer instead of the compatibility layer can yield
31+
* lower clock drift and lower power consumption compared to
32+
* using the compatibility layer. For details on how to achieve
33+
* lower clock drift and lower power consumption please consult the
34+
* @ref sys_ztimer documentation.
35+
*
2336
* @{
2437
* @file
2538
* @brief xtimer interface definitions

0 commit comments

Comments
 (0)