Merge pull request #4094 from Guozhanxin/timer_fix
Fixed an issue with rt_timer_start being broken and destroying the ti…
This commit is contained in:
commit
8860f02c34
|
@ -331,7 +331,6 @@ rt_err_t rt_timer_start(rt_timer_t timer)
|
||||||
_rt_timer_remove(timer);
|
_rt_timer_remove(timer);
|
||||||
/* change status of timer */
|
/* change status of timer */
|
||||||
timer->parent.flag &= ~RT_TIMER_FLAG_ACTIVATED;
|
timer->parent.flag &= ~RT_TIMER_FLAG_ACTIVATED;
|
||||||
rt_hw_interrupt_enable(level);
|
|
||||||
|
|
||||||
RT_OBJECT_HOOK_CALL(rt_object_take_hook, (&(timer->parent)));
|
RT_OBJECT_HOOK_CALL(rt_object_take_hook, (&(timer->parent)));
|
||||||
|
|
||||||
|
@ -342,9 +341,6 @@ rt_err_t rt_timer_start(rt_timer_t timer)
|
||||||
RT_ASSERT(timer->init_tick < RT_TICK_MAX / 2);
|
RT_ASSERT(timer->init_tick < RT_TICK_MAX / 2);
|
||||||
timer->timeout_tick = rt_tick_get() + timer->init_tick;
|
timer->timeout_tick = rt_tick_get() + timer->init_tick;
|
||||||
|
|
||||||
/* disable interrupt */
|
|
||||||
level = rt_hw_interrupt_disable();
|
|
||||||
|
|
||||||
#ifdef RT_USING_TIMER_SOFT
|
#ifdef RT_USING_TIMER_SOFT
|
||||||
if (timer->parent.flag & RT_TIMER_FLAG_SOFT_TIMER)
|
if (timer->parent.flag & RT_TIMER_FLAG_SOFT_TIMER)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue