More PIC32 nested interrupt work-around

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4102 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2011-11-18 23:24:53 +00:00
parent fe49443cc3
commit d01965fd90
+12 -1
View File
@@ -85,7 +85,9 @@
uint32_t *pic32mx_decodeirq(uint32_t *regs) uint32_t *pic32mx_decodeirq(uint32_t *regs)
{ {
#ifdef CONFIG_PIC32MX_NESTED_INTERRUPTS
uint32_t *savestate; uint32_t *savestate;
#endif
uint32_t regval; uint32_t regval;
int irq; int irq;
@@ -100,7 +102,11 @@ uint32_t *pic32mx_decodeirq(uint32_t *regs)
* the interrupted context that is being processed now. * the interrupted context that is being processed now.
*/ */
savestate = (uint32_t*)current_regs; #ifdef CONFIG_PIC32MX_NESTED_INTERRUPTS
savestate = (uint32_t*)current_regs;
#else
DEBUGASSERT(current_regs == NULL);
#endif
current_regs = regs; current_regs = regs;
/* Loop while there are pending interrupts with priority greater than zero */ /* Loop while there are pending interrupts with priority greater than zero */
@@ -145,11 +151,16 @@ uint32_t *pic32mx_decodeirq(uint32_t *regs)
* are returning from a nested interrupt. * are returning from a nested interrupt.
*/ */
#ifdef CONFIG_PIC32MX_NESTED_INTERRUPTS
current_regs = savestate; current_regs = savestate;
if (current_regs == NULL) if (current_regs == NULL)
{ {
up_ledoff(LED_INIRQ); up_ledoff(LED_INIRQ);
} }
#else
current_regs = savestate;
up_ledoff(LED_INIRQ);
#endif
return regs; return regs;
} }