Skip to content

Commit 02afb3a

Browse files
committed
Fix CDC write() when DTR is not set
Fix arduino#1182
1 parent a4576a5 commit 02afb3a

File tree

1 file changed

+1
-1
lines changed
  • hardware/arduino/avr/cores/arduino

1 file changed

+1
-1
lines changed

Diff for: hardware/arduino/avr/cores/arduino/CDC.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ size_t Serial_::write(const uint8_t *buffer, size_t size)
206206
// TODO - ZE - check behavior on different OSes and test what happens if an
207207
// open connection isn't broken cleanly (cable is yanked out, host dies
208208
// or locks up, or host virtual serial port hangs)
209-
if (_usbLineInfo.lineState > 0) {
209+
if (USBDevice.configured()) {
210210
int r = USB_Send(CDC_TX,buffer,size);
211211
if (r > 0) {
212212
return r;

0 commit comments

Comments
 (0)