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

Function rt_ktime_hrtimer_detach

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

Source from the content-addressed store, hash-verified

313}
314
315rt_err_t rt_ktime_hrtimer_detach(rt_ktime_hrtimer_t timer)
316{
317 rt_base_t level;
318
319 /* parameter check */
320 RT_ASSERT(timer != RT_NULL);
321
322 /* notify the timer stop event */
323 rt_completion_wakeup_by_errno(&timer->completion, RT_ERROR);
324
325 level = rt_spin_lock_irqsave(&_spinlock);
326
327 /* stop timer */
328 timer->flag &= ~RT_TIMER_FLAG_ACTIVATED;
329 /* when interrupted */
330 if (timer->error == -RT_EINTR || timer->error == RT_EINTR)
331 {
332 rt_list_remove(&timer->node);
333 _set_next_timeout_locked();
334 }
335
336 rt_spin_unlock_irqrestore(&_spinlock, level);
337
338 return RT_EOK;
339}
340
341/************************** delay ***************************/
342

Callers 3

timer_createFunction · 0.85
timer_deleteFunction · 0.85

Calls 5

rt_list_removeFunction · 0.85
_set_next_timeout_lockedFunction · 0.85
rt_spin_lock_irqsaveFunction · 0.50

Tested by

no test coverage detected