-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
Implement the Wire.flush() funtion #773
base: main
Are you sure you want to change the base?
Conversation
watershade
commented
Nov 24, 2023
- implement flush of wire. (flush functions have never been implemented before. But it is useful.)
Wire.flush() is useful, if I haven't read obsolete data from it. I will get a wrong number via Wire.available() because the size have include the obsolete data. And If I use Wire.read(), the data I read out is include the obsolete data also. Yes, I can read the obsolete data out via Wire.read(), but it is not necessary. If Wire.flush() is I implemented, It will become perfect. |
@facchinm Hi Martino, I don't know if you time to check this merge. Thanks. |
Duplicate of #760 |
Flush should be intended as a way to send all data out of the TX buffer not to cleanup the RX. See Serial.flush() https://www.arduino.cc/reference/it/language/functions/communication/serial/flush/ |
Should the RX buffer cleanup API be called |
I don't think there is a standard Arduino API, but personally i think is a more appropriate name. |
@pennam Thanks for your reply. I remember flush really flush all data away in old Arduino version.
I will check the new version and try to find a better name. Maybe clear and it is just like @tokiedokie have said . Thanks again. |