-
Notifications
You must be signed in to change notification settings - Fork 1k
I2C slave: allow function wrapped callbacks #1835
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
I2C slave: allow function wrapped callbacks #1835
Conversation
c528a21
to
774cbac
Compare
Maybe related to #1617 |
@fpistm I was thinking the same, I've used the Today I'll do more tests. |
Yes it is probably the case but requires to be be tested 😉 |
I've tested with a STM32G030C8T and a NUCLEO F401 and both works. |
So you have tested with the c declaration removed ? if it works could you update the PR. |
Not yet, I'm gonna do it tomorrow. |
Hi @hitech95 |
Hi |
No worry. I understand perfectly 😉 |
774cbac
to
4aea869
Compare
Signed-off-by: hitech95 <nicveronese@gmail.com>
4aea869
to
8e1da5c
Compare
I've tested with the So I'm pushing a simplified patch for that. Tested on Nucleo STM32 F401RE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Tested on several series.
Thank you @hitech95
Summary
This PR fixes/implements the following bugs/features
This allow to have TwoWire callbacks methods inside classes. You can use std::bind to wrap the callback functions.
This is an example of a Class that completely handle the I2C comunication without having the user to manually implement the callbacks:
Validation
Code formatting
Closing issues
Closes #1833