From 1261444de456e9eaebcf0a721d650c5b2e5802c7 Mon Sep 17 00:00:00 2001 From: Ziemas Date: Sat, 25 Nov 2023 23:20:07 +0100 Subject: [PATCH] timer: Fix TimerBusClock2USec --- ee/kernel/include/timer_alarm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/kernel/include/timer_alarm.h b/ee/kernel/include/timer_alarm.h index 195f7143424..771e66ab28c 100644 --- a/ee/kernel/include/timer_alarm.h +++ b/ee/kernel/include/timer_alarm.h @@ -67,7 +67,7 @@ static inline u64 Sec2TimerBusClock(u64 sec) { static inline void TimerBusClock2USec (u64 ulClock, u32 *pSec, u32 *pUsec) { u64 sec = ulClock/kBUSCLK; *pSec = (u32)sec; - *pUsec = ulClock - (sec * kBUSCLK); + *pUsec = (1000000 * (ulClock - (sec * kBUSCLK))) / kBUSCLK; } static inline u64 TimerUSec2BusClock (u32 sec, u32 usec) {