IRMP-org / IRMP

Infrared Multi Protocol Decoder
GNU General Public License v3.0
274 stars 44 forks source link

Multiple definitions of Vector 3 when building with Servo_Attinycore - Tone-cpp.o? #32

Closed smashteevee closed 3 years ago

smashteevee commented 3 years ago

Bug Report

Arduino Platform

IDE

IR-Protocol

Example to reproduce the issue

Pin(s) used for IR-receive, if not default

Version

Current behavior

I am trying to utilize IRMP on an attiny85 using Attinycore (SpencerKonde core, no bootloader) and it's built-in Servo functionality.

When I add the following defines and headers to the top of the minimalReceiver sketch:

#define F_CPU 8000000
#define __AVR_ATtiny85__
#include <Servo_ATTinyCore.h>

my compile fails.

Expected behavior

Expected that this would build successfully.

I am still reading up and learning about Timers and Interrupts, but I suspect this is related to Attinycore's Servo code to be compatible with Tone() and similar compatibility code built into IRMP.

Error output

I get this compile eror:

Tone.cpp.o (symbol from plugin): In functiontone(unsigned char, unsigned long, unsigned long)': (.text+0x0): multiple definition of __vector_3' libraries/Servo_ATTinyCore/avr/Servo_ATTinyCore.cpp.o (symbol from plugin):(.text+0x0): first defined here collect2: error: ld returned 1 exit status exit status 1 Error compiling for board ATtiny25/45/85 (No bootloader).

Additional context

Is there a way to "disable" this redefinition of Tone() timer definition in IRMP? I'd love to use IRMP along with Attinycore's Servo lib. Thanks for this great library and its many options (eg, Pin change interrupt option especially and ability to minimize protocol config)

ArminJo commented 3 years ago

Thanks for pointig this out 🥇 . I commited the changes now, so use the current repo content or just remove the function irmp_tone() in irmpArduinoExt.cpp.h.