From 5a6bc9900689ba2d21850cc520c3621c57037025 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 2 Jun 2021 15:30:32 +0800 Subject: [PATCH] =?UTF-8?q?[bug][kernel]=20=E4=BF=9D=E6=8C=81=E7=A9=BA?= =?UTF-8?q?=E9=97=B2=E4=BB=BB=E5=8A=A1=E9=92=A9=E5=AD=90=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E7=9A=84=E5=8E=9F=E5=AD=90=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clock.c | 3 ++- src/idle.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/clock.c b/src/clock.c index 045555933d..191525411a 100644 --- a/src/clock.c +++ b/src/clock.c @@ -13,7 +13,8 @@ * 2010-07-13 Bernard fix rt_tick_from_millisecond issue found by kuronca * 2011-06-26 Bernard add rt_tick_set function. * 2018-11-22 Jesven add per cpu tick - * 2020-12-29 Meco Man add function rt_tick_get_millisecond() + * 2020-12-29 Meco Man implement rt_tick_get_millisecond() + * 2021-06-01 Meco Man add critical section projection for rt_tick_increase() */ #include diff --git a/src/idle.c b/src/idle.c index 59868352d8..e73a78be9c 100644 --- a/src/idle.c +++ b/src/idle.c @@ -202,12 +202,14 @@ static void rt_thread_idle_entry(void *parameter) { #ifdef RT_USING_IDLE_HOOK rt_size_t i; + void (*idle_hook)(void); for (i = 0; i < RT_IDLE_HOOK_LIST_SIZE; i++) { - if (idle_hook_list[i] != RT_NULL) + idle_hook = idle_hook_list[i]; + if (idle_hook != RT_NULL) { - idle_hook_list[i](); + idle_hook(); } } #endif