File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ void rt_tick_set(rt_tick_t tick)
6262void rt_tick_increase (void )
6363{
6464 struct rt_thread * thread ;
65+ rt_base_t level ;
66+
67+ level = rt_hw_interrupt_disable ();
6568
6669 /* increase the global tick */
6770#ifdef RT_USING_SMP
@@ -76,17 +79,17 @@ void rt_tick_increase(void)
7679 -- thread -> remaining_tick ;
7780 if (thread -> remaining_tick == 0 )
7881 {
79- rt_base_t level ;
80-
8182 /* change to initialized tick */
8283 thread -> remaining_tick = thread -> init_tick ;
83-
84- level = rt_hw_interrupt_disable ();
8584 thread -> stat |= RT_THREAD_STAT_YIELD ;
86- rt_hw_interrupt_enable (level );
8785
86+ rt_hw_interrupt_enable (level );
8887 rt_schedule ();
8988 }
89+ else
90+ {
91+ rt_hw_interrupt_enable (level );
92+ }
9093
9194 /* check timer */
9295 rt_timer_check ();
You can’t perform that action at this time.
0 commit comments