Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement the Wire.flush() funtion#773

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
watershade wants to merge1 commit intoarduino:main
base:main
Choose a base branch
Loading
fromwatershade:wire_flush_implement

Conversation

watershade
Copy link

  1. implement flush of wire. (flush functions have never been implemented before. But it is useful.)

1. implement flush of wire.(flush functions have never been implemented before. But it is useful.)
@watershade
Copy link
Author

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.
Thanks!

@watershade
Copy link
Author

@facchinm Hi Martino, I don't know if you time to check this merge. Thanks.

@tokiedokie
Copy link
Contributor

Duplicate of#760

@pennampennam mentioned this pull requestFeb 1, 2024
@pennam
Copy link
Contributor

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/

@tokiedokie
Copy link
Contributor

Should the RX buffer cleanup API be calledclear()?

@pennam
Copy link
Contributor

Should the RX buffer cleanup API be calledclear()?

I don't think there is a standard Arduino API, but personally i think is a more appropriate name.

@watershade
Copy link
Author

watershade commentedFeb 3, 2024
edited
Loading

@pennam Thanks for your reply.

I remember flush really flush all data away in old Arduino version.

Prior to Arduino 1.0, this instead removed any buffered incoming serial data.

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@watershade@tokiedokie@pennam

[8]ページ先頭

©2009-2025 Movatter.jp