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:
parent
ccc97db715
commit
b07b11b431
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user