Hi, I am using a pin change interrupt in my sketch using PCINT1_vect. If I #include <SoftwareSerial.h> I get a compile error "multiple definition of `__vector_3'" By commenting out the definition for PCINT1_vect in SoftwareSerial.cpp the conflict is resolved.
#if defined(PCINT0_vect)
ISR(PCINT0_vect)
{
SoftwareSerial::handle_interrupt();
}
#endif
// comment out so we can use PCINT1 on our ATtiny84A project
/*
#if defined(PCINT1_vect)
ISR(PCINT1_vect, ISR_ALIASOF(PCINT0_vect));
#endif
#if defined(PCINT2_vect)
ISR(PCINT2_vect, ISR_ALIASOF(PCINT0_vect));
#endif
#if defined(PCINT3_vect)
ISR(PCINT3_vect, ISR_ALIASOF(PCINT0_vect));
#endif
*/
Rather than commenting out the offending code however, I want to put in a conditional statement so that the library remains unchanged for other applications. I pinched "if defined (AVR_ATtiny84A)" from io.h and tried to use it like below but it didn't work. Can anyone fix my code? Thanks.
// comment out so we can use PCINT1 on our ATtiny84A project
#if !defined (__AVR_ATtiny84A__)
#if defined(PCINT1_vect)
ISR(PCINT1_vect, ISR_ALIASOF(PCINT0_vect));
#endif
#if defined(PCINT2_vect)
ISR(PCINT2_vect, ISR_ALIASOF(PCINT0_vect));
#endif
#if defined(PCINT3_vect)
ISR(PCINT3_vect, ISR_ALIASOF(PCINT0_vect));
#endif
#endif
A better approach would be to make the library considerate of any PCINT-vectors already used/defined in the sketch..... any suggestions how this could be done?