From 737d58fbb9516674939f08bd495fcba3ee2b73ba Mon Sep 17 00:00:00 2001 From: shaojinchun Date: Fri, 10 May 2019 10:36:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=5Fget=5Fhighest=5Fpriority?= =?UTF-8?q?=5Fthread=E4=B8=AD=E5=AF=B9=E2=80=9C=E6=98=AF=E5=90=A6=E5=8F=AA?= =?UTF-8?q?=E6=9C=89idle=E5=8F=AF=E8=BF=90=E8=A1=8C=E2=80=9D=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E4=BD=8D=E7=BD=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scheduler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scheduler.c b/src/scheduler.c index 3da723687c..458d1e15c0 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -128,9 +128,9 @@ static struct rt_thread* _get_highest_priority_thread(rt_ubase_t *highest_prio) register struct rt_thread *highest_priority_thread; register rt_ubase_t highest_ready_priority, local_highest_ready_priority; struct rt_cpu* pcpu = rt_cpu_self(); - #if RT_THREAD_PRIORITY_MAX > 32 register rt_ubase_t number; +#endif if (rt_thread_ready_priority_group == 0 && pcpu->priority_group == 0) { @@ -139,6 +139,7 @@ static struct rt_thread* _get_highest_priority_thread(rt_ubase_t *highest_prio) return pcpu->current_thread; } +#if RT_THREAD_PRIORITY_MAX > 32 number = __rt_ffs(rt_thread_ready_priority_group) - 1; highest_ready_priority = (number << 3) + __rt_ffs(rt_thread_ready_table[number]) - 1; number = __rt_ffs(pcpu->priority_group) - 1;