75#define OS_MAX_VALUE 0xFFFFFFFFUL
93 return g_sysClock / LOSCFG_BASE_CORE_TICK_PER_SECOND;
103 if (millisec == OS_MAX_VALUE) {
107 return ((
UINT64)millisec * LOSCFG_BASE_CORE_TICK_PER_SECOND) / OS_SYS_MS_PER_SECOND;
117 return ((
UINT64)tick * OS_SYS_MS_PER_SECOND) / LOSCFG_BASE_CORE_TICK_PER_SECOND;
127 const UINT32 nsPerTick = OS_SYS_NS_PER_SECOND / LOSCFG_BASE_CORE_TICK_PER_SECOND;
129 UINT64 ticks = (nanoseconds + nsPerTick - 1) / nsPerTick;
130 if (ticks > OS_MAX_VALUE) {
131 ticks = OS_MAX_VALUE;
LITE_OS_SEC_DATA_INIT UINT32 g_sysClock
系统时钟,是绝大部分部件工作的时钟源,也是其他所有外设的时钟的来源
LITE_OS_SEC_TEXT_MINOR UINT32 LOS_Tick2MS(UINT32 tick)
Tick转化为毫秒
LITE_OS_SEC_TEXT_MINOR UINT32 LOS_MS2Tick(UINT32 millisec)
毫秒转换成Tick
LITE_OS_SEC_TEXT_MINOR UINT32 OsNS2Tick(UINT64 nanoseconds)
纳秒转化成 tick
LITE_OS_SEC_TEXT_MINOR UINT64 LOS_TickCountGet(VOID)
获取自系统启动以来的Tick数
LITE_OS_SEC_TEXT_MINOR UINT32 LOS_CyclePerTickGet(VOID)
每个Tick多少Cycle数
STATIC INLINE UINT64 OsGetCurrSchedTimeCycle(VOID)