From 842d8ee580c986364de47df38189fd648c743b61 Mon Sep 17 00:00:00 2001 From: Roger Clark Date: Thu, 5 Nov 2015 20:28:09 +1100 Subject: [PATCH] Manually updated fix by @jcw for serial usb slow down --- STM32F1/cores/maple/usb_serial.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/STM32F1/cores/maple/usb_serial.cpp b/STM32F1/cores/maple/usb_serial.cpp index fcc39b1..6d0be3e 100644 --- a/STM32F1/cores/maple/usb_serial.cpp +++ b/STM32F1/cores/maple/usb_serial.cpp @@ -126,12 +126,17 @@ size_t n = 0; } - if (sent == USB_CDCACM_TX_EPSIZE) { - while (usb_cdcacm_is_transmitting() != 0) { - } - /* flush out to avoid having the pc wait for more data */ - usb_cdcacm_tx(NULL, 0); - } +#if 0 +// this code leads to a serious performance drop and appears to be +// unnecessary - everything seems to work fine without, -jcw, 2015-11-05 +// see http://stm32duino.com/posting.php?mode=quote&f=3&p=7746 + if (sent == USB_CDCACM_TX_EPSIZE) { + while (usb_cdcacm_is_transmitting() != 0) { + } + /* flush out to avoid having the pc wait for more data */ + usb_cdcacm_tx(NULL, 0); + } +#endif return n; }