HardwareTimer : How to handle HardwareTimer instance caller in the timer callback
Posted: Wed May 20, 2020 1:52 pm
Hello,
As of the new 1.9.0 release, attachInterrupt callback's API of the HardwareTimer class is now std::function(void). HardwareTimer *htim is no longer passed as argument. As the callback must be a C function pointer, it must be a static function or a static member. So "this" operateur isn't usable.
So now, how to handle the HardwareTimer instance caller in the timer interrupt callback ?
As of the new 1.9.0 release, attachInterrupt callback's API of the HardwareTimer class is now std::function(void). HardwareTimer *htim is no longer passed as argument. As the callback must be a C function pointer, it must be a static function or a static member. So "this" operateur isn't usable.
So now, how to handle the HardwareTimer instance caller in the timer interrupt callback ?