-
-
Notifications
You must be signed in to change notification settings - Fork 33
Add support for function objects in ioDeviceAttachInterrupt #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We'll need to take a look at this in terms of safety, if as it looks it's already supported on ESP, then it could certainly be conditional for ESP32 and ESP8266 boards. |
Wow, how time flies, it's been a really busy year, but I've taken a look at this now and it looks like it would work for at least ESP32 and STM32Duino. |
…ing std::function on ESP32 and STM32 boards
will be added in the next release of taskmanager |
Unfortunately, ESP32 does not support this directly, STM32 does, but I'm not sure how safe it even is on STM32 as I don't know how safe std::function objects are in an interrupt context. Memory visibility and safety in interrupts is my major concern, if anything goes wrong, it would be extremely difficult to debug. At any rate, we no longer really recommend the original interrupt marshalling, instead we suggest that people use events to handle the raw interrupt and just trigger the event. I thought this would be an easy one supported by ESP32, but unfortunately it is not. I'd recommend you just use that class in your own code with a task manager BaseEvent. |
Would it be possible to support non-static class methods as callbacks in ioDeviceAttachInterrupt?
I ran across this post where they came up with this to work around the limitation.
The text was updated successfully, but these errors were encountered: