Andy 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")));
>
>
Both "IRQ" and "FIQ" should switch register contexts and save certain
registers (FIQ stacks nothing). "interrupt" is more a general "save
what you use here and restore when exiting".
Look at the ASM code, is the attribute doing what you need it to do?
You need to be carefull if you are doing nested interrupts to ensure
that you don't suffer a re-entry into the current context (IRQ) and
forget to save things.
TomW
--
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------Message
Re: [lpc2000] Interrupt function declaration
2006-05-10 by Tom Walsh
Attachments
- No local attachments were found for this message.