(the static variables are defined in the class also)
but I get this error:
sketchbook/libraries/WavetableSynthesizer/WavetableSynthesizer.cpp: In member function ‘void WavetableSynthesizer::InterruptHandler()’:
.../sketchbook/libraries/WavetableSynthesizer/WavetableSynthesizer.cpp:43: error: expected unqualified-id before string constant
.../sketchbook/libraries/WavetableSynthesizer/WavetableSynthesizer.cpp:44: error: a function-definition is not allowed here before ‘{’ token
.../sketchbook/libraries/WavetableSynthesizer/WavetableSynthesizer.cpp:136: error: expected `}' at end of input
What am I doing wrong here? Or should I put this method elsewhere (not as private member)?
You are trying to define the function inside another function. That is not allowed. Defining the function and calling it are two separate activities.
The ISR will be called when some timer based action occurs. In the ISR, you might be able to call a static method of your class. But, the class method is not what gets called when the interrupt happens, so it can't call the ISR.
you mean in the WavetableSynthesizer.cpp as a static function?
static, in classes, really only (to me, at least) means something with regards to methods. The ISR is NOT going to be a class method. So, no, not a static function. Just a regular function implementation.