Skip to content
Commit 693edd06 authored by Florian Grandel's avatar Florian Grandel Committed by Carles Cufí
Browse files

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: default avatarFlorian Grandel <fgrandel@code-for-humans.de>
parent fc879ffa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment