From bc406f11491f785a80aa2f94c40a3ef993292252 Mon Sep 17 00:00:00 2001 From: matpala Date: Wed, 14 Oct 2026 17:45:31 -0300 Subject: [PATCH] drivers: multiply in u64 in sleep_ms --- drivers/src/base/ClockDevice.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/src/base/ClockDevice.zig b/drivers/src/base/ClockDevice.zig index 5c3139c9f..13dcf1f30 100644 --- a/drivers/src/base/ClockDevice.zig +++ b/drivers/src/base/ClockDevice.zig @@ -46,9 +46,7 @@ pub fn make_timeout(td: ClockDevice, timeout: mdf.time.Duration) Timeout { } pub fn sleep_ms(td: ClockDevice, time_ms: u32) void { - // 1000 = 1024 - 16 - 8, in u64 so that it doesn't overflow. - const ms: u64 = time_ms; - td.sleep_us((ms << 10) - (ms << 4) - (ms << 3)); + td.sleep_us(@as(u64, time_ms) * 1000); } pub fn sleep_us(td: ClockDevice, time_us: u64) void {