summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwdfk-prog <[email protected]>2026-04-06 09:09:45 +0800
committerRbb666 <[email protected]>2026-04-08 18:58:33 +0800
commit2548bdb9c2d617523ce5c0b7e489ed815630f0c7 (patch)
treedeb9f7ac4c81ea9adf71eef76b0ea91d2f3f2df1 /src
parentc6cfed353f16f7c47ad62a237c27a478e0e7e8cc (diff)
fix(src): Use interrupt nest accessor and export IRQ hook pointers
Diffstat (limited to 'src')
-rw-r--r--src/irq.c4
-rw-r--r--src/scheduler_up.c5
2 files changed, 4 insertions, 5 deletions
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);