Class A {
public:
A();
void onTouch();
}
A::A() {
touchAttachInterrupt(1, std::bind(&A::onTouch, this), 40)
}
This does not works for me with ESP32. The definition of the touchAttachInterrupt is:
void touchAttachInterrupt(uint8_t pin, void (*userFunc)(void), uint16_t threshold);
My code results in a compilation error,
error: cannot convert 'std::_Bind_helper<false, void (TouchPin::*)(), TouchPin*&>::type' {aka 'std::_Bind<void (TouchPin::*(TouchPin*))()>'} to 'void (*)()