Skip to content

If sketch is not connected to serial - dump serial output #123

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

Merged
merged 1 commit into from
May 21, 2025

Conversation

KurtE
Copy link

@KurtE KurtE commented May 17, 2025

Should resolve #35

Tested with Portenta, but should work on all of the others as well.

Current code would hang after a few Serial.print like statements happened when we are not connected to the Serial monitor.

So I put overrides in for the Serial.write(buf, cnt) and Serial.flush() That would first check to see if Serial returns true (DTR)...

This appears to match the behavior of the MBED Portenta H8 code.

Current code would hang after a few Serial.print like statements happened when we are not connected to
the Serial monitor.

So I put overrides in for the Serial.write(buf, cnt) and Serial.flush()
That would first check to see if Serial returns true (DTR)...

This appears to match the behavior of the MBED Portenta H8 code.
@KurtE KurtE force-pushed the no_usb_no_hang branch from 7e788c4 to aef4efc Compare May 21, 2025 13:22
@facchinm facchinm merged commit fe9e040 into arduino:arduino May 21, 2025
15 checks passed
@KurtE KurtE deleted the no_usb_no_hang branch May 21, 2025 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GIGA: Serial.flush() will hang if the Serial monitor is not connected.
2 participants