From 7f71c9b8285372640d66ba07822436a094764381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Wed, 20 Jan 2016 22:28:22 +0100 Subject: [PATCH] make USB TX buffer less lock prone --- lib/usb_cdcacm.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/usb_cdcacm.c b/lib/usb_cdcacm.c index b3751ee..65fa9e9 100644 --- a/lib/usb_cdcacm.c +++ b/lib/usb_cdcacm.c @@ -168,7 +168,7 @@ static const struct usb_config_descriptor config = { .bNumInterfaces = 2, // the number of interfaces in this configuration .bConfigurationValue = 1, // the index of this configuration .iConfiguration = 0, // a string index describing this configuration (zero means not provided) - .bmAttributes = 0x80, // self powered (0<<6), supports remote wakeup (5<<0) + .bmAttributes = 0x80, // self powered (0<<6), supports remote wakeup (0<<5) .bMaxPower = 0x32, // the maximum amount of current that this device will draw in 2mA units // end of header .interface = interfaces, // pointer to an array of interfaces @@ -264,12 +264,16 @@ static void cdcacm_data_tx_cb(usbd_device *usbd_dev, uint8_t ep) /* transmit data */ if (tx_used) { // copy received data - for (usb_length=0; usb_length