MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / cpu_us_delay

Function cpu_us_delay

libcpu/aarch64/common/setup.c:123–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123static void cpu_us_delay(rt_uint32_t us)
124{
125 volatile rt_base_t start = cpu_get_cycles(), cycles;
126
127 cycles = ((us * 0x10c7UL) * loops_per_tick[rt_hw_cpu_id()] * RT_TICK_PER_SECOND) >> 32;
128
129 while ((cpu_get_cycles() - start) < cycles)
130 {
131 rt_hw_cpu_relax();
132 }
133}
134#endif /* RT_USING_HWTIMER */
135
136rt_weak void rt_hw_idle_wfi(void)

Callers

nothing calls this directly

Calls 2

cpu_get_cyclesFunction · 0.85
rt_hw_cpu_idFunction · 0.50

Tested by

no test coverage detected