From 7b28bc6edee6480559d5fc28c7addf2f0664426d Mon Sep 17 00:00:00 2001 From: guozhanxin Date: Fri, 27 Nov 2020 10:33:36 +0800 Subject: Fixed an issue with rt_timer_start being broken and destroying the timer list --- src/timer.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/timer.c') diff --git a/src/timer.c b/src/timer.c index 4b9003794c..4d021ab367 100644 --- a/src/timer.c +++ b/src/timer.c @@ -331,7 +331,6 @@ rt_err_t rt_timer_start(rt_timer_t timer) _rt_timer_remove(timer); /* change status of timer */ timer->parent.flag &= ~RT_TIMER_FLAG_ACTIVATED; - rt_hw_interrupt_enable(level); 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); timer->timeout_tick = rt_tick_get() + timer->init_tick; - /* disable interrupt */ - level = rt_hw_interrupt_disable(); - #ifdef RT_USING_TIMER_SOFT if (timer->parent.flag & RT_TIMER_FLAG_SOFT_TIMER) { -- cgit v1.3.1 From 014105025a5c73a2aa58cd703ad157d29d5c6aff Mon Sep 17 00:00:00 2001 From: tangyuxin <462747508@qq.com> Date: Thu, 3 Dec 2020 09:43:09 +0800 Subject: [timer] Fix the bug that the linked list is still mounted when the single timer is not modified --- src/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/timer.c') diff --git a/src/timer.c b/src/timer.c index 4b9003794c..fc8053e90e 100644 --- a/src/timer.c +++ b/src/timer.c @@ -579,7 +579,7 @@ void rt_timer_check(void) { continue; } - + rt_list_remove(&(t->row[RT_TIMER_SKIP_LIST_LEVEL - 1])); if ((t->parent.flag & RT_TIMER_FLAG_PERIODIC) && (t->parent.flag & RT_TIMER_FLAG_ACTIVATED)) { @@ -667,7 +667,7 @@ void rt_soft_timer_check(void) { continue; } - + rt_list_remove(&(t->row[RT_TIMER_SKIP_LIST_LEVEL - 1])); if ((t->parent.flag & RT_TIMER_FLAG_PERIODIC) && (t->parent.flag & RT_TIMER_FLAG_ACTIVATED)) { -- cgit v1.3.1