[En-Nut-Discussion] Problem using hardware interrupts
Tom Nyström
m99tomny at embassaden.liu.se
Mon Feb 10 17:55:41 CET 2003
Hello
I have been trying to register a hardware interrupt with the NutRegisterInterrupt function. I want to use the overflow interrupt of a timer to trigger a measurement function at the right time intervals. This results in a "multiple declaration" of __vector_16 that I don't really understand. I am using Nut/OS 3.0.1. Below is a short example and the compiler response:
#include <dev/irqreg.h>
static void loop_trigger(void *arg)
{
return ;
}
int main(void)
{
NutRegisterInterrupt(IRQ_TIMER0_OVF, loop_trigger, 0);
for(;;);
}
/* The compiler output:
C:\Ethernut\nut\app\simple>make all
avr-gcc -c -mmcu=atmega128 -Os -Wall -Wstrict-prototypes -Wa,-ahlms=simple.lst
-I../../mod/include -I../../include simple.c -o simple.o
avr-gcc simple.o -mmcu=atmega128 -Wl,-Map=simple.map,--cref -L../../lib/gcc/atme
ga128 ../../lib/gcc/atmega128/nutinit.o -lnutos -lnutdev -o simple.elf
../../lib/gcc/atmega128\libnutdev.a(ivect16.o): In function `__vector_16':
ivect16.o(.text+0x0): multiple definition of `__vector_16'
../../lib/gcc/atmega128\libnutdev.a(irqreg.o)(.text+0x474): first defined here
make: *** [simple.elf] Error 1
*/
Grateful for any help
Tom Nyström
More information about the En-Nut-Discussion
mailing list