Skip to content
Commit 357ec64b authored by Berend Ozceri's avatar Berend Ozceri Committed by Christopher Friedt
Browse files

drivers: timer: Fix RISC-V machine timer count drift due integer math

If CYC_PER_TICK does not divide the (now - last_count) quantity exactly with integer math, the subsequent multiplication before incrementing last_count causes a drift. This commit eliminates the redundant division-followed-by-multiplication and fixes https://github.com/zephyrproject-rtos/zephyr/issues/37852



Signed-off-by: default avatarBerend Ozceri <berend@recogni.com>
parent 123be4f1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment