Skip to content

Commit 842d8ee

Browse files
Manually updated fix by @jcw for serial usb slow down
1 parent d94452f commit 842d8ee

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

STM32F1/cores/maple/usb_serial.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,17 @@ size_t n = 0;
126126
}
127127

128128

129-
if (sent == USB_CDCACM_TX_EPSIZE) {
130-
while (usb_cdcacm_is_transmitting() != 0) {
131-
}
132-
/* flush out to avoid having the pc wait for more data */
133-
usb_cdcacm_tx(NULL, 0);
134-
}
129+
#if 0
130+
// this code leads to a serious performance drop and appears to be
131+
// unnecessary - everything seems to work fine without, -jcw, 2015-11-05
132+
// see http://stm32duino.com/posting.php?mode=quote&f=3&p=7746
133+
if (sent == USB_CDCACM_TX_EPSIZE) {
134+
while (usb_cdcacm_is_transmitting() != 0) {
135+
}
136+
/* flush out to avoid having the pc wait for more data */
137+
usb_cdcacm_tx(NULL, 0);
138+
}
139+
#endif
135140
return n;
136141
}
137142

0 commit comments

Comments
 (0)