fix:Provide a CPU delay interface
Close #I3NT3Y Change-Id: I30c984a95a77cbddabdae2900ab8fcf9d7eac1ac
This commit is contained in:
parent
18aa697589
commit
583d177de0
|
@ -639,7 +639,7 @@ osStatus_t osDelay(uint32_t ticks)
|
|||
return osOK;
|
||||
}
|
||||
if (osKernelGetState() != osKernelRunning) {
|
||||
HalDelay(ticks);
|
||||
LOS_SysDelay(ticks);
|
||||
} else {
|
||||
uwRet = LOS_TaskDelay(ticks);
|
||||
}
|
||||
|
|
|
@ -1296,3 +1296,17 @@ LITE_OS_SEC_TEXT_MINOR VOID LOS_Msleep(UINT32 mSecs)
|
|||
(VOID)LOS_TaskDelay(interval);
|
||||
}
|
||||
|
||||
VOID LOS_SysDelay(UINT32 ticks)
|
||||
{
|
||||
UINT64 endTime;
|
||||
|
||||
if (ticks == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
endTime = LOS_SysCycleGet() + ticks * OS_CYCLE_PER_TICK;
|
||||
while (LOS_SysCycleGet() < endTime) {
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue