Yahoo Groups archive

Lpc2000

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

Message

Re: Interrupt function declaration

2006-05-10 by brendanmurphy37

My advice would be to avoid using extensions at all and code an 
assembler prolog and epilog. 

See http://groups.yahoo.com/group/lpc2000/message/14623 for an 
example. 

I haven't verified this particular one myself, but it looks OK.

This approach has the advantage:

- doesn't rely on compiler extensions, which have a habit of being 
bug-prone (see messages posted around the same time)

- you know exactly what's going on, and aren't relying on possibly 
poorly documented compiler features.

- you can control whether you allow nested interrupts or not

Brendan


--- In lpc2000@...m, "Andy" <me@...> wrote:
>
> Hi all,
> 
> Just wondering if anyone can clear something up for me.
> I'm using the Vectored Interrupt Controller as decribed below, 
just wondering what function delaration extention I should use and 
what the difference is?
> 
> Thanks,
> Andy
> 
> // Vectored Interrupt - Using Timer 0
> VICVectAddr0 = (tDWord)Interrupt_Function;
> VICVectCntl0 = 0x20 | 4;
> VICIntEnable |= 1<<4;
> 
> void Interrupt_Function (void) __attribute__((interrupt));
> void Interrupt_Function (void) __attribute__((interrupt ("IRQ")));
> void Interrupt_Function (void) __attribute__((interrupt ("FIQ")));
> void Interrupt_Function (void) __irq; 
> 
> 
> [Non-text portions of this message have been removed]
>

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.