Unfortunately, 32-bit cycle counter overflows ≈ twice a minute, so some code is needed to distinguish between meaningful overflow (just add 1<<32 and get the result) and hardly-meaningful (do some math to get the result).
The code might be extended to get rid of timer_inf altogether, but it needs clock counter frequency accounting at a timer level and I'm somewhat reluctant to implementing that as this code seems to be good enough.
Unfortunately, 32-bit cycle counter overflows ≈ twice a minute, so some code is needed to distinguish between meaningful overflow (just add
1<<32
and get the result) and hardly-meaningful (do some math to get the result).The code might be extended to get rid of
timer_inf
altogether, but it needs clock counter frequency accounting at a timer level and I'm somewhat reluctant to implementing that as this code seems to be good enough.