diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-02-27 20:34:57 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-02-27 20:34:57 +0000 |
commit | 5d5fc5f3d4f24c903e4638099ebb1abc0a1c55f4 (patch) | |
tree | 713777811f408512b10824e7becacd598d9c2885 /nuttx/arch/arm/src/nuc1xx/nuc_irq.c | |
parent | 087496c688535e1717cd05d3f58635fb911abb4e (diff) | |
download | px4-nuttx-5d5fc5f3d4f24c903e4638099ebb1abc0a1c55f4.tar.gz px4-nuttx-5d5fc5f3d4f24c903e4638099ebb1abc0a1c55f4.tar.bz2 px4-nuttx-5d5fc5f3d4f24c903e4638099ebb1abc0a1c55f4.zip |
The NuTiny-SDK-NUC120 basic port is complete and functional
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5682 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/nuc1xx/nuc_irq.c')
-rw-r--r-- | nuttx/arch/arm/src/nuc1xx/nuc_irq.c | 31 |
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); } /**************************************************************************** |