Guest
#1172344
I'm trying to program an interrupt for the LPC-2294 (using a Olimex
LPC-H2294 development print).
It seems there's not that much information about interrupts using the
GCC-compiler...
This is what I already have/tried/found on other sites (only interrupt
code):
//Prototype:
void _attribute_ ((interrupt("IRQ"))) EINT0_routine(void);
//Initialisation
void Init()
{
...
PinFunctionSelect( P0_16, 1); //external interrupt0
...
}
void InterruptInit()
{
IOWRITE(VICVectCntl0, 0x002E); //External int0 (14)
IOWRITE(VICVectAddr0, (unsigned long)EINT0_routine);
IOWRITE(VICIntEnable,0x004000); //Interrupt Enable
}
//Interrupt
void _attribute_ ((interrupt("IRQ"))) EINT0_routine(void)
{
GpioSetState(P1_16,1); //Turn led on
IOWRITE(SCB_EXTINT, 1); //Clear EINT0 interrupt flag
IOWRITE(VICVectAddr, 0); //Dummy write to signal end of interrupt
}
It compiles without any errors/warnings, but it doesn't work. The µC
never jumps to the interrupt-routine.
I removed -mthumb-interwork from the Makefile (i've read somewhere that
there's a bug). Can't find more information about this :-(. Anyone knows
what I'm doing wrong?