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

sys/ztimer: add some best practices

This commit is contained in:
Kaspar Schleiser 2021-12-09 14:27:19 +01:00
parent ccc97db715
commit b07b11b431

View File

@ -68,6 +68,23 @@
* ```
*
*
* # ztimer best practices
*
* 1. Don't use ZTIMER_USEC unless the increased resolution is really needed.
* ZTIMER_USEC will, on most platforms, prevent low-power sleep modes.
*
* 2. Clear ztimer_t structs before use. Example:
*
* ztimer_t foo = { 0 };
*
* This ensures ztimer knows the timer is not already set, possibly preventing
* an unnecessary full ztimer list traversal.
* (ztimer will ensure that a removed timer is sufficiently cleared.)
*
* 3. Don't compare ztimer_now() values from different clocks. The clocks are
* almost certainly not synchronized.
*
*
* # Design
*
* ## clocks, virtual timers, chaining