From 0cce6c47279c06a2fbec56d808e2e79522cc4f0f Mon Sep 17 00:00:00 2001 From: likailong Date: Thu, 3 Dec 2020 10:22:39 +0800 Subject: [PATCH] Description: liteos-m refactoring use posix api Reviewed-by: caoruihong and wangmihu --- samgr/adapter/cmsis/time_adapter.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/samgr/adapter/cmsis/time_adapter.c b/samgr/adapter/cmsis/time_adapter.c index d3e0f32..f8f51f5 100755 --- a/samgr/adapter/cmsis/time_adapter.c +++ b/samgr/adapter/cmsis/time_adapter.c @@ -15,7 +15,6 @@ #include "time_adapter.h" #include #include -#include int32 WDT_Start(uint32 ms) { @@ -36,5 +35,9 @@ int32 WDT_Stop(void) uint64 SAMGR_GetProcessTime(void) { uint32 tick = osKernelGetTickCount(); - return KalTickToMs(tick); + uint32 ticksPerSecond = osKernelGetTickFreq(); + if (ticksPerSecond == 0) { + return 0; + } + return (uint64)tick * 1000 / ticksPerSecond; } -- Gitee