summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwdfk-prog <[email protected]>2026-04-08 13:45:46 +0800
committerRbb666 <[email protected]>2026-04-08 18:58:33 +0800
commite74547bbb36c38bbebf8baca4d728b3db14885df (patch)
tree372ac027d38f65c39d868e3055fd7c5c0c1ec3a9 /src
parent2548bdb9c2d617523ce5c0b7e489ed815630f0c7 (diff)
feat(core): Add Cortex-M4 interrupt context helpers
Diffstat (limited to 'src')
-rw-r--r--src/scheduler_up.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/scheduler_up.c b/src/scheduler_up.c
index e2d90d14c5..8560166fd1 100644
--- a/src/scheduler_up.c
+++ b/src/scheduler_up.c
@@ -284,6 +284,7 @@ void rt_schedule(void)
struct rt_thread *to_thread;
struct rt_thread *from_thread;
struct rt_thread *curr_thread;
+ rt_base_t interrupt_nest;
/* disable interrupt */
level = rt_hw_interrupt_disable();
@@ -343,16 +344,17 @@ void rt_schedule(void)
RT_SCHED_CTX(to_thread).stat = RT_THREAD_RUNNING | (RT_SCHED_CTX(to_thread).stat & ~RT_THREAD_STAT_MASK);
/* switch to new thread */
+ interrupt_nest = rt_interrupt_get_nest();
LOG_D("[%d]switch to priority#%d "
"thread:%.*s(sp:0x%08x), "
"from thread:%.*s(sp: 0x%08x)",
- rt_interrupt_get_nest(), highest_ready_priority,
+ interrupt_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_get_nest() == 0)
+ if (interrupt_nest == 0)
{
extern void rt_thread_handle_sig(rt_bool_t clean_state);