euchcat / arduino-tiny

Automatically exported from code.google.com/p/arduino-tiny
Other
1 stars 0 forks source link

TIMER1_OVF_vect error: multiple definition of __vector_4 #18

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When I try to compile a sketch for Attiny85 with an interrupt service routine 
hooked to TIMER1_OVF I get this error from Arduino IDE:
core.a(wiring.c.o): In function 'init':

/home/percorso/alla/cartella/Arduino/arduino-tiny-022/hardware/tiny/cores/tiny/w
iring.c:234: multiple definition of '__vector_4'
sketch_sep27b.cpp.o:sketch_sep27b.cpp:36: first defined here

If I use the TIMER0 I get no compilation errors.

To reproduce the error, just create a new sketch and copy the following code:

void setup() {
}

void loop() {
}

ISR(TIMER1_OVF_vect){
}

If you change TIMER1_OVF_vect with TIMER0_OVF_vect the compilation ends without 
errors.

(I simplified the sketch, I didn't copy all my code: the example above is 
enough to reproduce the error).
What steps will reproduce the problem?

I'm using Arduino 0022 IDE with Tiny cores 0022.

Original issue reported on code.google.com by leomi...@gmail.com on 28 Sep 2011 at 8:05

GoogleCodeExporter commented 8 years ago
Timer 1 is used by millis / micros.  Timer 0 is available for your use (or is 
used by Tone).  If you'd like to switch millis to timer 0, open the 
"core_build_options.h" file, locate the ATtiny85 section, and change 
TIMER_TO_USE_FOR_MILLIS to 0.

Original comment by arduino....@gmail.com on 28 Sep 2011 at 8:13

GoogleCodeExporter commented 8 years ago
Bear in mind that switching the two timers may cause problems...

http://code.google.com/p/arduino-tiny/issues/detail?id=2

Original comment by arduino....@gmail.com on 28 Sep 2011 at 8:14