summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/nuc1xx/nuc_irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/arm/src/nuc1xx/nuc_irq.c')
-rw-r--r--nuttx/arch/arm/src/nuc1xx/nuc_irq.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/nuttx/arch/arm/src/nuc1xx/nuc_irq.c b/nuttx/arch/arm/src/nuc1xx/nuc_irq.c
index 423e40031..fc3bd4d7e 100644
--- a/nuttx/arch/arm/src/nuc1xx/nuc_irq.c
+++ b/nuttx/arch/arm/src/nuc1xx/nuc_irq.c
@@ -52,6 +52,8 @@
#include "os_internal.h"
#include "up_internal.h"
+#include "nuc_irq.h"
+
/****************************************************************************
* Definitions
****************************************************************************/
@@ -179,6 +181,34 @@ static inline void nuc_prioritize_syscall(int priority)
}
/****************************************************************************
+ * Name: nuc_clrpend
+ *
+ * Description:
+ * Clear a pending interrupt at the NVIC.
+ *
+ ****************************************************************************/
+
+static inline void nuc_clrpend(int irq)
+{
+ /* This will be called on each interrupt exit whether the interrupt can be
+ * enambled or not. So this assertion is necessarily lame.
+ */
+
+ DEBUGASSERT((unsigned)irq < NR_IRQS);
+
+ /* Check for an external interrupt */
+
+ if (irq >= NUC_IRQ_INTERRUPT && irq < NUC_IRQ_INTERRUPT + 32)
+ {
+ /* Set the appropriate bit in the ISER register to enable the
+ * interrupt
+ */
+
+ putreg32((1 << (irq - NUC_IRQ_INTERRUPT)), ARMV6M_NVIC_ICPR);
+ }
+}
+
+/****************************************************************************
* Public Functions
****************************************************************************/
@@ -332,6 +362,7 @@ void up_enable_irq(int irq)
void up_maskack_irq(int irq)
{
up_disable_irq(irq);
+ nuc_clrpend(irq);
}
/****************************************************************************