Skip to content
Commit 141299fb authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Fabio Baltieri
Browse files

tests: timer_behavior: better cope with timer wrap-arounds



Commit a1d21ca6 ("tests: timer_behavior: don't fail the test with
timer wrap-arounds") simply ignored the total time validation whenever
any rollover was detected. Let's adjust the end timestamp according
to the number of rollovers instead.

Documentation for sys_clock_cycle_get_32() says it should count up
monotonically through the full 32 bit space, wrapping at 0xffffffff.
Therefore we just need to add 2^32 times the number of rollovers to
the end timestamp.

Signed-off-by: default avatarNicolas Pitre <npitre@baylibre.com>
parent 43c54930
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment