Skip to content

Commit e79ede8

Browse files
committed
Add ability to override number of vtor IRQs
Adds PICO_VECTOR_TABLE_NUM_IRQS to allow overriding the number of IRQ vectors in the vector table. This is useful to reduce the size of the vector table when not using some IRQs
1 parent c54475d commit e79ede8

File tree

1 file changed

+6
-2
lines changed
  • src/rp2_common/pico_crt0

1 file changed

+6
-2
lines changed

src/rp2_common/pico_crt0/crt0.S

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ __vectors:
5252
// we don't include any IRQ vectors; we will initialize them during runtime_init in the RAM vector table
5353
#else
5454

55+
#ifndef PICO_VECTOR_TABLE_NUM_IRQS
56+
#define PICO_VECTOR_TABLE_NUM_IRQS NUM_IRQS
57+
#endif
58+
5559
.macro if_irq_word num func
56-
.if \num < NUM_IRQS
60+
.if \num < PICO_VECTOR_TABLE_NUM_IRQS
5761
.word \func
5862
.endif
5963
.endm
@@ -142,7 +146,7 @@ if_irq_word 76 isr_irq76
142146
if_irq_word 77 isr_irq77
143147
if_irq_word 78 isr_irq78
144148
if_irq_word 79 isr_irq79
145-
#if NUM_IRQS > 80
149+
#if PICO_VECTOR_TABLE_NUM_IRQS > 80
146150
#error more IRQ entries required
147151
#endif
148152
#endif

0 commit comments

Comments
 (0)