MCPcopy Index your code
hub / github.com/RT-Thread/rt-thread / rt_timer_delete

Function rt_timer_delete

src/timer.c:377–398  ·  view source on GitHub ↗

* @brief This function will delete a timer and release timer memory * * @param timer the timer to be deleted * * @return the operation status, RT_EOK on OK; -RT_ERROR on error */

Source from the content-addressed store, hash-verified

375 * @return the operation status, RT_EOK on OK; -RT_ERROR on error
376 */
377rt_err_t rt_timer_delete(rt_timer_t timer)
378{
379 rt_base_t level;
380 struct rt_spinlock *spinlock;
381
382 /* parameter check */
383 RT_ASSERT(timer != RT_NULL);
384 RT_ASSERT(rt_object_get_type(&timer->parent) == RT_Object_Class_Timer);
385 RT_ASSERT(rt_object_is_systemobject(&timer->parent) == RT_FALSE);
386
387 spinlock = _timerlock_idx(timer);
388
389 level = rt_spin_lock_irqsave(spinlock);
390
391 _timer_remove(timer);
392 /* stop timer */
393 timer->parent.flag &= ~RT_TIMER_FLAG_ACTIVATED;
394 rt_spin_unlock_irqrestore(spinlock, level);
395 rt_object_delete(&(timer->parent));
396
397 return RT_EOK;
398}
399RTM_EXPORT(rt_timer_delete);
400#endif /* RT_USING_HEAP */
401

Callers 15

_object_node_deleteFunction · 0.85
sys_rt_timer_createFunction · 0.85
rt_sdhci_uninit_hostFunction · 0.85
usb_osal_timer_deleteFunction · 0.85
dlmodule_destroyFunction · 0.85
timerfd_closeFunction · 0.85
timerfd_timeoutFunction · 0.85
timerfd_do_settimeFunction · 0.85
sdhci_remove_hostFunction · 0.85
OS_TimerDeleteFunction · 0.85
osal_timer_deleteFunction · 0.85
efm_spiSd_deinitFunction · 0.85

Calls 7

rt_object_get_typeFunction · 0.85
_timerlock_idxFunction · 0.85
_timer_removeFunction · 0.85
rt_object_deleteFunction · 0.85
rt_spin_lock_irqsaveFunction · 0.70