aboutsummaryrefslogtreecommitdiff
path: root/src/stm32
diff options
context:
space:
mode:
authorGareth McMullin2012-01-07 18:46:17 +1300
committerGareth McMullin2012-01-07 18:46:17 +1300
commit9663274572ee5e2742c3de5df56ec8d8741a9978 (patch)
tree48d0b8d93a15a0dc99f076b4ceefb409e8209fb1 /src/stm32
parentedaae3957a90903b5bd92fa3575aafc79a4c0d12 (diff)
Advertise that we accept SET_LINE_CODING and ignore it on GDB interface.
This fixes SetCommState failure on Windows.
Diffstat (limited to 'src/stm32')
-rw-r--r--src/stm32/cdcacm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/stm32/cdcacm.c b/src/stm32/cdcacm.c
index 0be7cbf..5c61eb7 100644
--- a/src/stm32/cdcacm.c
+++ b/src/stm32/cdcacm.c
@@ -118,7 +118,7 @@ static const struct {
.bFunctionLength = sizeof(struct usb_cdc_acm_descriptor),
.bDescriptorType = CS_INTERFACE,
.bDescriptorSubtype = USB_CDC_TYPE_ACM,
- .bmCapabilities = 0,
+ .bmCapabilities = 2, /* SET_LINE_CODING supported */
},
.cdc_union = {
.bFunctionLength = sizeof(struct usb_cdc_union_descriptor),
@@ -222,7 +222,7 @@ static const struct {
.bFunctionLength = sizeof(struct usb_cdc_acm_descriptor),
.bDescriptorType = CS_INTERFACE,
.bDescriptorSubtype = USB_CDC_TYPE_ACM,
- .bmCapabilities = 0,
+ .bmCapabilities = 2, /* SET_LINE_CODING supported*/
},
.cdc_union = {
.bFunctionLength = sizeof(struct usb_cdc_union_descriptor),
@@ -399,6 +399,9 @@ static int cdcacm_control_request(struct usb_setup_data *req, uint8_t **buf,
if(*len < sizeof(struct usb_cdc_line_coding))
return 0;
+ if(req->wIndex == 0)
+ return 1; /* Ignore on GDB Port */
+
if(req->wIndex != 2)
return 0;