aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/usb
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-08-03 23:15:43 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-08-03 23:15:43 -0400
commite5b44c156519598721979fd6cfa9f516198fc4f0 (patch)
treed668854ef17e7c79cd6ac2480880ae10648c4056 /libmaple/usb
parentf0b894fca7a56b8172bb0dff89283843dcd9d200 (diff)
downloadlibrambutan-e5b44c156519598721979fd6cfa9f516198fc4f0.tar.gz
librambutan-e5b44c156519598721979fd6cfa9f516198fc4f0.zip
usb_cdcacm: Improve write speed.
Actually fill the TX buffer in the packet memory area, so we can send more bytes per transaction. Using the test-session benchmark, we're now clocking in the high 700KB/sec range via PySerial. With screen, rate is now about 550 KB/sec. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'libmaple/usb')
-rw-r--r--libmaple/usb/stm32f1/usb_cdcacm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libmaple/usb/stm32f1/usb_cdcacm.c b/libmaple/usb/stm32f1/usb_cdcacm.c
index df9e6ea..e664797 100644
--- a/libmaple/usb/stm32f1/usb_cdcacm.c
+++ b/libmaple/usb/stm32f1/usb_cdcacm.c
@@ -434,10 +434,9 @@ uint32 usb_cdcacm_tx(const uint8* buf, uint32 len) {
return 0;
}
- // We can only put USB_CDCACM_TX_EPSIZE bytes in the buffer
- /* FIXME then why are we only copying half as many? */
- if (len > USB_CDCACM_TX_EPSIZE / 2) {
- len = USB_CDCACM_TX_EPSIZE / 2;
+ /* We can only put USB_CDCACM_TX_EPSIZE bytes in the buffer. */
+ if (len > USB_CDCACM_TX_EPSIZE) {
+ len = USB_CDCACM_TX_EPSIZE;
}
/* Queue bytes for sending */