From 347d10497c678dbe82122a86e8738fce74e9193e Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Wed, 29 Aug 2018 05:44:05 -0600 Subject: [PATCH] sched/irq/irq_dispatch.c: Fix error 'ndx undeclared' --- sched/irq/irq_dispatch.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sched/irq/irq_dispatch.c b/sched/irq/irq_dispatch.c index edda4849cc..61a6dbf869 100644 --- a/sched/irq/irq_dispatch.c +++ b/sched/irq/irq_dispatch.c @@ -120,12 +120,13 @@ void irq_dispatch(int irq, FAR void *context) { xcpt_t vector = irq_unexpected_isr; FAR void *arg = NULL; + unsigned intx ndx = irq; #if NR_IRQS > 0 if ((unsigned)irq < NR_IRQS) { #ifdef CONFIG_ARCH_MINIMAL_VECTORTABLE - irq_mapped_t ndx = g_irqmap[irq]; + ndx = g_irqmap[irq]; if (ndx < CONFIG_ARCH_NUSER_INTERRUPTS) { if (g_irqvector[ndx].handler) @@ -137,13 +138,13 @@ void irq_dispatch(int irq, FAR void *context) INCR_COUNT(ndx); } #else - if (g_irqvector[irq].handler) + if (g_irqvector[ndx].handler) { - vector = g_irqvector[irq].handler; - arg = g_irqvector[irq].arg; + vector = g_irqvector[ndx].handler; + arg = g_irqvector[ndx].arg; } - INCR_COUNT(irq); + INCR_COUNT(ndx); #endif } #endif