Interrupt in other file than main .ino?

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.)

if i'm correct i've solved this problem... i just don't remeber how. I have code at home, this message is just a "placeholder".

Geez I'm really dumb. I did some modifications in included libraries section when modifying the code to be C++ compatible and I deleted <avr/interrupt.h>.
Although there are some posts on the net from people having the exact message and their problem was corrupt arduino installation or incorrect libraries/paths...
Is there any way to delete this thread, cause It's really useless?

just leave it here :smiley: