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

Function rt_ktime_hrtimer_sleep

components/drivers/ktime/src/hrtimer.c:354–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354rt_err_t rt_ktime_hrtimer_sleep(struct rt_ktime_hrtimer *timer, unsigned long cnt)
355{
356 rt_err_t err;
357
358 if (cnt == 0)
359 return -RT_EINVAL;
360
361 err = rt_ktime_hrtimer_start(timer, cnt);
362 if (err)
363 return err;
364
365 err = rt_completion_wait_flags(&(timer->completion), RT_WAITING_FOREVER,
366 RT_INTERRUPTIBLE);
367 rt_ktime_hrtimer_keep_errno(timer, err);
368
369 return err;
370}
371
372rt_err_t rt_ktime_hrtimer_ndelay(struct rt_ktime_hrtimer *timer, unsigned long ns)
373{

Callers 1

rt_ktime_hrtimer_ndelayFunction · 0.85

Calls 3

rt_ktime_hrtimer_startFunction · 0.85
rt_completion_wait_flagsFunction · 0.50

Tested by

no test coverage detected