![]() |
BSB Developer Docs
|
Topics | |
| Coarse timers | |
| Precise timers | |
Typedefs | |
| typedef bool(* | TimerConditionCallback) (void *context) |
| Condition test function type. | |
Simple timers can be used for conveniently storing points in time and then checking whether a certain amount of time (timeout) has passed.
Coarse timers use the OS tick counter, so they can only be used when an OS is running, and the precision is limited to that of the OS ticks.
Precise timers use the CPU cycle counter and have microsecond resolution, however, the maximum timeout is limited to several seconds, depending on the underlying implementation and CPU frequency. Unlike Coarse timers, they can be used in critical sections and/or when an OS is not running.
Both timer types are only useful for measuring time and waiting. If a callback function needs to be called periodically, consider instead using FuriEventLoopTimer if there is a FuriEventLoop available, or a regular FuriTimer.
| typedef bool(* TimerConditionCallback) (void *context) |
Condition test function type.
| [in,out] | context | pointer to a user-specific object (may be NULL) |
true if the condition has been fulfilled, false otherwise