File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 2222 * 2023-09-15 xqyjlj perf rt_hw_interrupt_disable/enable
2323 * 2024-01-25 Shell add RT_TIMER_FLAG_THREAD_TIMER for timer to sync with sched
2424 * 2024-05-01 wdfk-prog The rt_timer_check and _soft_timer_check functions are merged
25+ * 2025-06-01 htl5241 remove redundancy
26+ * fix timer overflow
2527 */
2628
2729#include <rtthread.h>
@@ -494,8 +496,6 @@ static void _timer_check(rt_list_t *timer_list, struct rt_spinlock *lock)
494496
495497 level = rt_spin_lock_irqsave (lock );
496498
497- current_tick = rt_tick_get ();
498-
499499 rt_list_init (& list );
500500
501501 while (!rt_list_isempty (& timer_list [RT_TIMER_SKIP_LIST_LEVEL - 1 ]))
@@ -762,7 +762,7 @@ void rt_timer_check(void)
762762 rt_tick_t next_timeout ;
763763
764764 ret = _timer_list_next_timeout (_soft_timer_list , & next_timeout );
765- if ((ret == RT_EOK ) && (next_timeout <= rt_tick_get () ))
765+ if ((ret == RT_EOK ) && (( rt_tick_get () - next_timeout ) < RT_TICK_MAX / 2 ))
766766 {
767767 rt_sem_release (& _soft_timer_sem );
768768 }
You can’t perform that action at this time.
0 commit comments