Skip to content

Commit 4af8b7f

Browse files
committed
added check for last_interrupt_index against PROG_IRQ_NUM
1 parent 6f6c902 commit 4af8b7f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/IRQManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ bool IRQManager::addGenericInterrupt(GenericIrqCfg_t &cfg, Irq_f fnc /*= nullptr
4545
irq_ptr += FIXED_IRQ_NUM;
4646
bool rv = false;
4747

48-
if(cfg.irq == FSP_INVALID_VECTOR) {
48+
if((cfg.irq == FSP_INVALID_VECTOR) && (last_interrupt_index < PROG_IRQ_NUM)) {
4949
if(fnc != nullptr){
5050
R_ICU->IELSR[last_interrupt_index] = cfg.event;
5151
*(irq_ptr + last_interrupt_index) = (uint32_t)fnc;

0 commit comments

Comments
 (0)