drivers: counter: improved guard period doc
The previous counter documentation said:
> Absolute alarm cannot be set further in future than top_value
> decremented by the guard period. Relative alarm ticks cannot
> exceed current top value (see @ref counter_get_top_value).
And further down:
> Absolute value cannot exceed: (now + top_value - guard_period)
> % top_value.
The first documentation snippet is not wrong but may be confusing.
On casual reading one might assume that the absolute tick value
should not be set above top minus guard. Users have to understand
driver internals to follow that explanation.
The second documentation snippet is only correct when counting
downwards (which several drivers don't). When counting upwards,
the given formula is wrong.
This commit improves and corrects the documentation.
Fixes: #57594
Signed-off-by:
Florian Grandel <fgrandel@code-for-humans.de>
Loading
Please sign in to comment