From 3b23ba741957caf5926285a3b8dfcde7b0161287 Mon Sep 17 00:00:00 2001 From: Matteo Pignataro <matteo.pignataro@skywarder.eu> Date: Tue, 6 Jun 2023 19:24:08 +0200 Subject: [PATCH] [TimestampTimer] Postponed the shift outside the static_cast --- src/shared/drivers/timer/TimestampTimer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/drivers/timer/TimestampTimer.h b/src/shared/drivers/timer/TimestampTimer.h index f3da4e2c8..f2fdbee84 100644 --- a/src/shared/drivers/timer/TimestampTimer.h +++ b/src/shared/drivers/timer/TimestampTimer.h @@ -94,7 +94,7 @@ inline uint64_t TimestampTimer::getTimestamp() #else // With a timer frequency of 250KHz, the conversion from timer ticks to // microseconds only take a 2 byte shift (x4) - return static_cast<uint64_t>(timestampTimer.readCounter() << 2); + return static_cast<uint64_t>(timestampTimer.readCounter()) << 2; // If the timer frequency is not a multiple of 2 you must compute the value // this way: -- GitLab