I’m trying to redo it. The problem is that gpio_isr_handler_add ((gpio_num_t) _sensorGPIO, isrGpioHandler, this);
does not accept a class method as an interrupt handler, only static. And without this, all this work loses all meaning, because all data and timings are stored in private class variables. How to make interrupts work with class ???
You’re going to have to implement something akin to what the people in the Arduino-ESP32 already do to enable abitrary lambdas and members functions as interrupts functions – use std::function.
For their implementation, see the FunctionalInterrupt.* files and examples.
The base ISR function must be a static void function with no arguments, not a member function of the class. However, you can store the to be called function expression in a std::function and call into that object later, just like their implementation does.