/* This function will detach a timer from timer management. */
rt_err_t rt_timer_detach(rt_timer_t timer)
/* This function will detach a timer from timer management. */
rt_err_t rt_timer_detach(rt_timer_t timer)
{
    register rt_base_t level;
    RT_ASSERT(timer != RT_NULL);
    level = rt_hw_interrupt_disable();
    _rt_timer_remove(timer);
    rt_hw_interrupt_enable(level);
    rt_object_detach((rt_object_t)timer);
    return -RT_EOK;
}