Hello,
I have some working code I wrote a while ago in C for decoding Philips RC5 algorithm for smaler devices like Atmega8/168/328 etc. Since it has to measure some pulses it uses an external interrupt.
I'd like to import the code into a project that uses Arduino Mega 2560.
At first, I tried to use extern "C" {...} in the header but when I was pressing a button on the remote and an interrupt was triggering, the chip was resetting since it didn't know where to jump, altough the vector was correct (INT5_vect is what I use). I changed the name of the file to .cpp and some things the compiler didn't like, since it was written in C (and deleted extern "C" {...} obviously) and now I get an error from the compiler referring to the line where isr is defined.
error: expected constructor, destructor, or type conversion before ‘(’ token
If I comment the code of the ISR in that .cpp file and write some dummy ISR in main .ino file, it executes it correctly.
Somebody happens to know anything about this?
(Oh, and I don't want to use Arduino's attachInterrupt or how it is called since the non .ino files have to be as independent as possible.)