From e5b44c156519598721979fd6cfa9f516198fc4f0 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Fri, 3 Aug 2012 23:15:43 -0400 Subject: 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 --- libmaple/usb/stm32f1/usb_cdcacm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libmaple') 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 */ -- cgit v1.2.3