Unverified Commit a582ca7b authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Avoid potential lockup w/Serial.read unconnected (#817)

Fixes #816

If a byte is available, return it even if the USB stack reports
disconnected.
parent 024ae9bb
...@@ -79,7 +79,7 @@ int SerialUSB::read() { ...@@ -79,7 +79,7 @@ int SerialUSB::read() {
return -1; return -1;
} }
if (tud_cdc_connected() && tud_cdc_available()) { if (tud_cdc_available()) {
return tud_cdc_read_char(); return tud_cdc_read_char();
} }
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment