Skip to content
Commit 9f34d17c authored by Robert Lubos's avatar Robert Lubos Committed by Carles Cufí
Browse files

drivers: timer: nrf_rtc_timer: Fix set_comparator corner case



Update the logic in a corner case, when the target comparator value is
one cycle ahead of the counter value.

Experiments have shown, that `set_comparator(cyc + 1);` might be not
enough in that case, and we still may (rarely) miss the interrupt.
This could happen when the counter incremented its value after the `dt`
variable was set. As we should set the comparator value two cycles
ahead to be on the safe side, increment the target comparator value
by 2 instead of 1.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent e9cdcc23
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment