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

Function rt_ktime_hrtimer_stop

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

Source from the content-addressed store, hash-verified

221}
222
223rt_err_t rt_ktime_hrtimer_stop(rt_ktime_hrtimer_t timer)
224{
225 rt_base_t level;
226
227 RT_ASSERT(timer != RT_NULL); /* timer check */
228
229 level = rt_spin_lock_irqsave(&_spinlock);
230
231 if (!(timer->flag & RT_TIMER_FLAG_ACTIVATED))
232 {
233 rt_spin_unlock_irqrestore(&_spinlock, level);
234 return -RT_ERROR;
235 }
236
237 rt_list_remove(&timer->node);
238 timer->flag &= ~RT_TIMER_FLAG_ACTIVATED;
239 _set_next_timeout_locked();
240
241 rt_spin_unlock_irqrestore(&_spinlock, level);
242
243 return RT_EOK;
244}
245
246rt_err_t rt_ktime_hrtimer_control(rt_ktime_hrtimer_t timer, int cmd, void *arg)
247{

Callers 2

timer_deleteFunction · 0.85
timer_settimeFunction · 0.85

Calls 4

rt_list_removeFunction · 0.85
_set_next_timeout_lockedFunction · 0.85
rt_spin_lock_irqsaveFunction · 0.50

Tested by

no test coverage detected