diff --git a/src/irq.c b/src/irq.c index 121f18260b..9670a809e3 100644 --- a/src/irq.c +++ b/src/irq.c @@ -26,8 +26,8 @@ #if defined(RT_USING_HOOK) && defined(RT_HOOK_USING_FUNC_PTR) -static void (*rt_interrupt_enter_hook)(void); -static void (*rt_interrupt_leave_hook)(void); +void (*rt_interrupt_enter_hook)(void); +void (*rt_interrupt_leave_hook)(void); /** * @ingroup group_hook diff --git a/src/scheduler_up.c b/src/scheduler_up.c index 4db27104cd..e2d90d14c5 100644 --- a/src/scheduler_up.c +++ b/src/scheduler_up.c @@ -50,7 +50,6 @@ rt_uint32_t rt_thread_ready_priority_group; rt_uint8_t rt_thread_ready_table[32]; #endif /* RT_THREAD_PRIORITY_MAX > 32 */ -extern volatile rt_atomic_t rt_interrupt_nest; static rt_atomic_t rt_scheduler_lock_nest; rt_uint8_t rt_current_priority; @@ -347,13 +346,13 @@ void rt_schedule(void) LOG_D("[%d]switch to priority#%d " "thread:%.*s(sp:0x%08x), " "from thread:%.*s(sp: 0x%08x)", - rt_interrupt_nest, highest_ready_priority, + rt_interrupt_get_nest(), highest_ready_priority, RT_NAME_MAX, to_thread->parent.name, to_thread->sp, RT_NAME_MAX, from_thread->parent.name, from_thread->sp); RT_SCHEDULER_STACK_CHECK(to_thread); - if (rt_interrupt_nest == 0) + if (rt_interrupt_get_nest() == 0) { extern void rt_thread_handle_sig(rt_bool_t clean_state);