Skip to content

Commit 4a74224

Browse files
committed
fix(src): Use interrupt nest accessor and export IRQ hook pointers
1 parent 11a1348 commit 4a74224

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
#if defined(RT_USING_HOOK) && defined(RT_HOOK_USING_FUNC_PTR)
2828

29-
static void (*rt_interrupt_enter_hook)(void);
30-
static void (*rt_interrupt_leave_hook)(void);
29+
void (*rt_interrupt_enter_hook)(void);
30+
void (*rt_interrupt_leave_hook)(void);
3131

3232
/**
3333
* @ingroup group_hook

src/scheduler_up.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ rt_uint32_t rt_thread_ready_priority_group;
5050
rt_uint8_t rt_thread_ready_table[32];
5151
#endif /* RT_THREAD_PRIORITY_MAX > 32 */
5252

53-
extern volatile rt_atomic_t rt_interrupt_nest;
5453
static rt_atomic_t rt_scheduler_lock_nest;
5554
rt_uint8_t rt_current_priority;
5655

@@ -347,13 +346,13 @@ void rt_schedule(void)
347346
LOG_D("[%d]switch to priority#%d "
348347
"thread:%.*s(sp:0x%08x), "
349348
"from thread:%.*s(sp: 0x%08x)",
350-
rt_interrupt_nest, highest_ready_priority,
349+
rt_interrupt_get_nest(), highest_ready_priority,
351350
RT_NAME_MAX, to_thread->parent.name, to_thread->sp,
352351
RT_NAME_MAX, from_thread->parent.name, from_thread->sp);
353352

354353
RT_SCHEDULER_STACK_CHECK(to_thread);
355354

356-
if (rt_interrupt_nest == 0)
355+
if (rt_interrupt_get_nest() == 0)
357356
{
358357
extern void rt_thread_handle_sig(rt_bool_t clean_state);
359358

0 commit comments

Comments
 (0)