Skip to content
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

Serial[x].flush() does not wait until transmission is finished #158

Closed
TNobuhara opened this issue Oct 5, 2023 · 2 comments · May be fixed by #304
Closed

Serial[x].flush() does not wait until transmission is finished #158

TNobuhara opened this issue Oct 5, 2023 · 2 comments · May be fixed by #304
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@TNobuhara
Copy link

Using Serial1.flush()
In flush() of ArduinoUnoR3 waited until the transmission was completely finished.
When I tried R4, it seemed to exit as soon as the Tx buffer was empty.

Please tell me what to do. Or is it possible to fix it?

@delta-G
Copy link
Contributor

delta-G commented May 6, 2024

Serial on the R4 doesn't currently use the txBuffer at all. Serial.write is blocking by itself which makes 'flush' redundant. I've submitted PR #304 to modify the UART class to use the buffer and not to block. This by itself restores the function of flush. It will still block until the buffer is empty, but the buffer won't be empty until the transmission end interrupt at the end of the transmission.

@per1234 per1234 changed the title Regarding Serial[x].flush() Serial[x].flush() does not wait until transmission is finished May 9, 2024
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels May 9, 2024
@per1234 per1234 linked a pull request May 9, 2024 that will close this issue
@per1234
Copy link
Collaborator

per1234 commented Nov 30, 2024

Closing as fixed by #405

@per1234 per1234 closed this as completed Nov 30, 2024
@per1234 per1234 added the conclusion: resolved Issue was resolved label Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
3 participants