diff options
Diffstat (limited to 'nuttx/arch/mips/src/pic32mx/pic32mx-irq.c')
-rw-r--r-- | nuttx/arch/mips/src/pic32mx/pic32mx-irq.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-irq.c b/nuttx/arch/mips/src/pic32mx/pic32mx-irq.c index 08f630528..093d24d3d 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-irq.c +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-irq.c @@ -195,7 +195,7 @@ void up_disable_irq(int irq) /* Disable the interrupt by clearing the associated bit in the IEC register */ - DEBUGASSERT(irq >= PIC32MX_IRQSRC_FIRST && irq <= PIC32MX_IRQSRC_LAST) + DEBUGASSERT(irq >= PIC32MX_IRQSRC_FIRST && irq <= PIC32MX_IRQSRC_LAST); if (irq >= PIC32MX_IRQSRC_FIRST) { if (irq <= PIC32MX_IRQSRC0_LAST) @@ -249,7 +249,7 @@ void up_enable_irq(int irq) /* Enable the interrupt by setting the associated bit in the IEC register */ - DEBUGASSERT(irq >= PIC32MX_IRQSRC_FIRST && irq <= PIC32MX_IRQSRC_LAST) + DEBUGASSERT(irq >= PIC32MX_IRQSRC_FIRST && irq <= PIC32MX_IRQSRC_LAST); if (irq >= PIC32MX_IRQSRC_FIRST) { if (irq <= PIC32MX_IRQSRC0_LAST) @@ -303,13 +303,12 @@ bool up_pending_irq(int irq) uint32_t regval; int bitno; - /* Disable the interrupt by clearing the associated bit in the IEC and then - * acknowledge the interrupt by clearing the associated bit in the IFS - * register. It is necessary to do this BEFORE lowering the interrupt - * priority level otherwise recursive interrupts would occur. + /* Test if the interrupt is pending by reading both the IEC and IFS + * register. Return true if the bit associated with the irq is both pending + * the IFs and enabled in the IEC. */ - DEBUGASSERT(irq >= PIC32MX_IRQSRC_FIRST && irq <= PIC32MX_IRQSRC_LAST) + DEBUGASSERT(irq >= PIC32MX_IRQSRC_FIRST && irq <= PIC32MX_IRQSRC_LAST); if (irq >= PIC32MX_IRQSRC_FIRST) { if (irq <= PIC32MX_IRQSRC0_LAST) @@ -374,7 +373,7 @@ void up_clrpend_irq(int irq) * priority level otherwise recursive interrupts would occur. */ - DEBUGASSERT(irq >= PIC32MX_IRQSRC_FIRST && irq <= PIC32MX_IRQSRC_LAST) + DEBUGASSERT(irq >= PIC32MX_IRQSRC_FIRST && irq <= PIC32MX_IRQSRC_LAST); if (irq >= PIC32MX_IRQSRC_FIRST) { if (irq <= PIC32MX_IRQSRC0_LAST) @@ -407,7 +406,7 @@ void up_clrpend_irq(int irq) return; } - /* Disable then acknowledge interrupt */ + /* Acknowledge the interrupt */ putreg32((1 << bitno), regaddr); } |