Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: Interrupt Handline

2004-11-08 by microbit

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 Ott

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.