avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: [avr-gcc-list] tmr.h:15: error: `__vector_4' undeclared here (not i


From: Haase Bjoern (PT-BEU/MKP5) *
Subject: AW: [avr-gcc-list] tmr.h:15: error: `__vector_4' undeclared here (not in a function)
Date: Mon, 23 Aug 2004 15:45:55 +0200

Hello,

I think that the problem is related to the syntax GCC and your old compiler 
expect when dealing with IRQ routines.
You will have to change your source code in order to compile it with the gcc. 
Have a look at the avr-libc documentation.

You probably will have to change your source code line 

INTERRUPT [SIG_OUTPUT_COMPARE1A] void TmrTenMillisecondTick(void);

to look like

#include <avr/signal.h>

INTERRUPT(SIG_OUTPUT_COMPARE1A)
{
}

instead. Please check, however, whether the signal "SIG_OUTPUT_COMPARE1A" is 
really known in the libc. If I remember correctly, there is no check for 
misspelling the signal names and compiler error messages might be a bit 
misleading when using the INTERRUPT and SIGNAL macros.

Yours,

Björn Haase

-----Ursprüngliche Nachricht-----
Von: address@hidden
[mailto:address@hidden Auftrag von Günter Dannoritzer
Gesendet: Montag, 23. August 2004 15:30
An: address@hidden
Betreff: [avr-gcc-list] tmr.h:15: error: `__vector_4' undeclared here
(not in a function)


Hello,

I am a total newbie to AVR programming and try to change a project 
previously developed with a third party C compiler to be used with AVR-GCC.

Now, don't beat me ;-), but I installed the AVR-GCC provided by Atmel. 
Is that a big mistake or is this installation setup right to work? I 
thought having this DWARF debugging capability might be a nice feature, 
but maybe I overestimated it and should rather use the WINAVR installation?

Anyhow, I did some changes to the code of my project, mostly include 
paths. That took away most of the compile errors except for this one error:

tmr.h:15: error: `__vector_4' undeclared here (not in a function)

which has to do with the interrupt vector. I tried to find some more 
information about how the interrupt handling works, but had no luck 
getting rid of this error. I read through the AVR libc documentation 
concerning the INTERRUPT macro and it looks like it is used correct in 
my code.

My code line (line 15 of the tmr.h file) causing the error is this:

INTERRUPT [SIG_OUTPUT_COMPARE1A] void TmrTenMillisecondTick(void);

The INTERRUPT macro is defined in the sfr_defs.h file, which obviously 
is include, otherwise it would not replace the "INTERRUPT" macro with 
the "__vector_" define.

What I don't understand is, it looks like that the avr-gcc needs to know 
about this __vector_ which it seems like it does not. I searched through 
the archive but did not find any similar problems.

Can anybody give me some hints what I am doing wrong?

This is the compiler call and its output:


avr-gcc -Wall -gdwarf-2 -mmcu=at90s8515 -DAVR_GCC -ffreestanding 
-I../CommonSource/ -I/cygdrive/c/Programme/Atmel/AVR\ 
Tools/AvrGcc/avr/include/ -c -omain.o main.c
In file included from main.c:16:
tmr.h:15: error: `__vector_4' undeclared here (not in a function)
tmr.h:15: error: syntax error before "void"
main.c: In function `main':
main.c:24: warning: unused variable `quadData'
main.c:25: warning: unused variable `i'
main.c:25: warning: unused variable `j'
make: *** [main.o] Error 1

BTW, I added the path to the AVR-GCC tools to the PATH variable and I am 
using cygwin under Windows XP.

Thanks for the help.


Guenter



_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list



reply via email to

[Prev in Thread] Current Thread [Next in Thread]