LPC2XXX interrupt_acknowledge

Sergei Gavrikov sg@belvok.com
Sat May 6 06:29:00 GMT 2006


Hi,

I'd found that LPC2XXX hal_interrupt_acknowledge() doesn't clear a
peripherial interrupt flag. In one ABC is written: at the end the ISR
should clear interrupt flag in EXTINT register and perform dummy write
to the correct register in the VIC to clear interrupt source.  What do
you thing about such a patch?  Without it I couldn't handle an exteranl
interrupt event with the cyg_drv_interrupt_* functions. The ISR for
any software interrupt event works well without the patch. Tested on an
Olimex LPC-H2294 (ARM) board.

Sergei Gavrikov
-------------- next part --------------
diff -urN ecos.orig/packages/hal/arm/lpc2xxx/var/current/src/lpc2xxx_misc.c ecos/packages/hal/arm/lpc2xxx/var/current/src/lpc2xxx_misc.c
--- ecos.orig/packages/hal/arm/lpc2xxx/var/current/src/lpc2xxx_misc.c	2006-05-05 19:42:04.000000000 +0300
+++ ecos/packages/hal/arm/lpc2xxx/var/current/src/lpc2xxx_misc.c	2006-05-06 00:48:38.000000000 +0300
@@ -249,6 +249,12 @@
 
 void hal_interrupt_acknowledge(int vector)
 {
+    if (vector <= CYGNUM_HAL_INTERRUPT_EINT3 &&
+        vector >= CYGNUM_HAL_INTERRUPT_EINT0) {
+        vector = 1 << (vector - CYGNUM_HAL_INTERRUPT_EINT0);
+        HAL_WRITE_UINT32 (CYGARC_HAL_LPC2XXX_REG_SCB_BASE +
+                         CYGARC_HAL_LPC2XXX_REG_EXTINT, vector);
+    }
     HAL_WRITE_UINT32(CYGARC_HAL_LPC2XXX_REG_VIC_BASE +
                      CYGARC_HAL_LPC2XXX_REG_VICVECTADDR, 0);
 }


More information about the Ecos-patches mailing list