!8 liteos-m refactoring

Merge pull request !8 from likailong/master
This commit is contained in:
openharmony_ci 2020-12-03 15:34:41 +08:00 committed by Gitee
commit 996939cacc
1 changed files with 5 additions and 2 deletions

View File

@ -15,7 +15,6 @@
#include "time_adapter.h"
#include <ohos_errno.h>
#include <cmsis_os.h>
#include <kal.h>
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;
}