Skip to content

Commit 627a3b8

Browse files
yangbolu1991kartben
authored andcommitted
arch: arm: cortex_m: handle multi-level interrupts in irq init
Multi-level interrupts should be handled in irq init. Only level1 interrupts going directly to interrupt controller need to be initialized. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
1 parent b4f2553 commit 627a3b8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/arm/core/cortex_m/irq_init.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ void z_arm_interrupt_init(void)
2727
{
2828
int irq = 0;
2929

30+
/* CONFIG_2ND_LVL_ISR_TBL_OFFSET could be treated as total number of level1 interrupts */
31+
#if defined(CONFIG_MULTI_LEVEL_INTERRUPTS) && defined(CONFIG_2ND_LVL_ISR_TBL_OFFSET)
32+
for (; irq < CONFIG_2ND_LVL_ISR_TBL_OFFSET; irq++) {
33+
#else
3034
for (; irq < CONFIG_NUM_IRQS; irq++) {
35+
#endif
3136
NVIC_SetPriority((IRQn_Type)irq, _IRQ_PRIO_OFFSET);
3237
}
3338
}

0 commit comments

Comments
 (0)