summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-11-18 23:24:53 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-11-18 23:24:53 +0000
commit1662fe2b9a8d4d6b9241949dd14f980de45c0b2f (patch)
treeeff59bdf7f142460de633ee4ba00f7371af048be /nuttx
parent4c9dba435f3e93077bd3c9d68894f025db83e1cb (diff)
downloadpx4-nuttx-1662fe2b9a8d4d6b9241949dd14f980de45c0b2f.tar.gz
px4-nuttx-1662fe2b9a8d4d6b9241949dd14f980de45c0b2f.tar.bz2
px4-nuttx-1662fe2b9a8d4d6b9241949dd14f980de45c0b2f.zip
More PIC32 nested interrupt work-around
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4102 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/arch/mips/src/pic32mx/pic32mx-decodeirq.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-decodeirq.c b/nuttx/arch/mips/src/pic32mx/pic32mx-decodeirq.c
index a7b55e06f..de7c9ab7a 100644
--- a/nuttx/arch/mips/src/pic32mx/pic32mx-decodeirq.c
+++ b/nuttx/arch/mips/src/pic32mx/pic32mx-decodeirq.c
@@ -85,7 +85,9 @@
uint32_t *pic32mx_decodeirq(uint32_t *regs)
{
+#ifdef CONFIG_PIC32MX_NESTED_INTERRUPTS
uint32_t *savestate;
+#endif
uint32_t regval;
int irq;
@@ -100,7 +102,11 @@ uint32_t *pic32mx_decodeirq(uint32_t *regs)
* 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;
/* 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.
*/
+#ifdef CONFIG_PIC32MX_NESTED_INTERRUPTS
current_regs = savestate;
if (current_regs == NULL)
{
up_ledoff(LED_INIRQ);
}
+#else
+ current_regs = savestate;
+ up_ledoff(LED_INIRQ);
+#endif
return regs;
}