I'm trying to use a class function (interrupt service routine),

void (ClassName::*fp)(void)=ClassName::FunctionName;

and attaching it to an Arduino interrupt pin using the function with the following type inputs but that doesn't work.

void attachInterrupt(int, void (*)(void),int);

How can I make this happen? The interrupt service routine (ISR) needs to access privat object data, so I can't make a function outside of the class.

My compiler error:

ClassName.cpp : : In constructor 'ClassName::ClassName()':
ClassName.cpp : *)()'
ClassName.cpp : *)()' to 'void (*)()' for argument '2' to 'void attachInterrupt(uint8_t, void (*)(), int)'

Note: I am looking for a solution inside the class and will accept the answer that shows me a solution or shows me it's not possible.

Edit
Report