Skip to content
Commit 4592ac8c authored by Peter Bigot's avatar Peter Bigot Committed by Anas Nashif
Browse files

drivers: timer: nrf_rtc_timer: fix lost ticks from unannounced elapsed



The original code assumed that limiting the tick count to the maximum
cycle value representable without wrapping would guarantee that adding
the resulting cycle offset to last_count would not lap the counter.
This is not true when elapsed time, which is also added to the cycle
offset, exceeds one tick.  Cap the maximum offset at the number of
cycles corresponding to the maximum number of ticks without wrapping.

Signed-off-by: default avatarPeter Bigot <peter.bigot@nordicsemi.no>
parent bb40f9b0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment