How to add a low priority interrupt
Posted: Mon May 26, 2008 8:35 pm
Hello,
I have ATmega8 running with AVR-USB and I need to enable a compare match interrupt on Timer1 for a small project.
Knowing the interrupt should start with "sei", I searched and found this paragraph in the AVR Libc 1.6.1 documentation:
I declared the interrupt that way in the main.c file, but I got the following error message:
What could be the cause for the compile error? (The USB driver works great without the interrupt addition, but I need the timer interrupt.)
Thanks for your help!
I have ATmega8 running with AVR-USB and I need to enable a compare match interrupt on Timer1 for a small project.
Knowing the interrupt should start with "sei", I searched and found this paragraph in the AVR Libc 1.6.1 documentation:
The compiler can be instructed to insert an SEI instruction right at the beginning of an interrupt handler by declaring the handler the following way:
ISR(XXX_vect, ISR_NOBLOCK)
{
...
}
where XXX_vect is the name of a valid interrupt vector for the MCU type in question, as explained below.
I declared the interrupt that way in the main.c file, but I got the following error message:
static declaration of __vector_3 follows non-static declaration
What could be the cause for the compile error? (The USB driver works great without the interrupt addition, but I need the timer interrupt.)
Thanks for your help!