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

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

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


From: E. Weddington
Subject: Re: [avr-gcc-list] tmr.h:15: error: `__vector_4' undeclared here (not in a function)
Date: Mon, 23 Aug 2004 09:27:58 -0600
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

Günter Dannoritzer wrote:

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?

The latest WinAVR release is built for generating DWARF debug information. So you can drop Atmel's release and use WinAVR.

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);

As Björn Haase points out you should change that. However, you should probably change that to:

#include <avr/signal.h>

SIGNAL(SIG_OUTPUT_COMPARE1A)
{
      // Interrupt Service Routine
}

Note the use of SIGNAL() instead of INTERRUPT(). See the avr-libc documentation for details, but INTERRUPT() creates an ISR that *CAN BE INTERRUPTED*. SIGNAL() creates and ISR that *CANNOT BE INTERRUPTED*. In most cases you will really want to use SIGNAL() for an ISR.

Eric



reply via email to

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