Hi Randy,
Thanks, I must have overlooked something, because I was in the belief that
the VICVectAddr was "lost" once in the "irq_handler", thought could only
handle
it in ASM - must have gotten confused somewhere.
B rgds
Kris
> Here's the way I do it:
>
> // IRQ exception handler. Calls the interrupt handlers.
> __irq __arm void irq_handler(void)
> {
> void (*interrupt_function)();
> unsigned int vector;
>
> vector = VICVectAddr; // Get interrupt vector.
> interrupt_function = (void(*)())vector;
> (*interrupt_function)(); // Call vectored interrupt function.
> VICVectAddr = 0; // Clear interrupt in VIC.
> }
>
> That way you can write the individual ISRs in thumb mode. The IRQ
> handler must be written in ARM mode because the processor is in that
> mode when an exception occurs. During linking the weak link to
> irq_handler (or whatever it is called) gets replaced with the C
> function.
>
> Randy OttMessage
Re: [lpc2000] Re: Interrupt Handline
2004-11-08 by microbit
Attachments
- No local attachments were found for this message.