8000 Fix CDC write() when DTR is not set by NicoHood · Pull Request #3839 · arduino/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Fix CDC write() when DTR is not set #3839

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Avoid long CDC write timeout if host isnt listening
  • Loading branch information
NicoHood committed Sep 22, 2015
commit b4fd19c57997dd3147c91209ab026a151a8e3499
2 changes: 1 addition & 1 deletion hardware/arduino/avr/cores/arduino/CDC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ size_t Serial_::write(const uint8_t *buffer, size_t size)
// TODO - ZE - check behavior on different OSes and test what happens if an
// open connection isn't broken cleanly (cable is yanked out, host dies
// or locks up, or host virtual serial port hangs)
if (USBDevice.configured()) {
if (USBDevice.configured() && availableForWrite()) {
int r = USB_Send(CDC_TX,buffer,size);
if (r > 0) {
return r;
Expand Down
0