Skip to content
Commit 2cd2d5fe authored by Adam Kondraciuk's avatar Adam Kondraciuk Committed by Henrik Brix Andersen
Browse files

tests: drivers: timer: grtc: Fix GRTC test



The `z_nrf_grtc_timer_get_ticks()` function converts system ticks
to GRTC ticks. It gets the current system tick to calculate an
absolute GRTC value. The same does the test function to provide
an argument to be converted. If the system tick occurs between those
`sys_clock_tick_get()` calls the `z_nrf_grtc_timer_get_ticks()` will
take into account the newer tick while the test estimate bases on
the old tick value. Due to that the maximum result error is 1 system
tick minus 1 GRTC tick which equals (`CYC_PER_TICK` - 1) for GRTC
ticks.

Signed-off-by: default avatarAdam Kondraciuk <adam.kondraciuk@nordicsemi.no>
parent cac0da31
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment