I am trying to run the following code on an Attiny85 running @8Mhz internal clk:
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
uint32_t state = 37;
void setup() {
pinMode(0, OUTPUT);
TCCR0A = _BV(COM0A1) | _BV(WGM00);
TCCR0B = _BV(CS02); //sets prescaler to 256
TIMSK = _BV(TOIE0);
}
void loop() { }
SIGNAL(TIM0_OVF_vect)
{
state = (state >> 1) ^ (-(state & 1) & 0xd0000001);
OCR0A = state & 0xff;
}
I get the error:
1.0.5.app/Contents/Resources/Java/hardware/arduino/cores/arduino/wiring.c:52: multiple definition of `__vector_5'
Any clues on how to fix this?
I tried editing these lines in the Arduino wiring.c file:
#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
ISR(TIM0_OVF_vect)
#else
ISR(TIMER0_OVF_vect)
#endif
to this:
#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny85__)
ISR(TIM0_OVF_vect)
#else
ISR(TIMER0_OVF_vect)
#endif
but it made no difference.