aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGareth McMullin2015-03-11 20:13:38 -0700
committerGareth McMullin2015-03-11 20:13:38 -0700
commit4baa8aba4f03e9690caece538e0887ac09f1eafc (patch)
tree5b906a0b83bf63a5842bde26693a7cf5dc63c791
parent7c1c19881f5048abf353744f55c07e757c93c112 (diff)
cdcacm: Fix DCD for second ACM interface.
-rw-r--r--src/platforms/common/cdcacm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/platforms/common/cdcacm.c b/src/platforms/common/cdcacm.c
index d8c376e..ab8294e 100644
--- a/src/platforms/common/cdcacm.c
+++ b/src/platforms/common/cdcacm.c
@@ -426,12 +426,12 @@ static int cdcacm_control_request(usbd_device *dev,
switch(req->bRequest) {
case USB_CDC_REQ_SET_CONTROL_LINE_STATE:
+ cdcacm_set_modem_state(dev, req->wIndex, true, true);
/* Ignore if not for GDB interface */
if(req->wIndex != 0)
return 1;
cdcacm_gdb_dtr = req->wValue & 1;
- cdcacm_set_modem_state(dev, 0, true, true);
return 1;
case USB_CDC_REQ_SET_LINE_CODING:
@@ -490,9 +490,7 @@ static void cdcacm_set_modem_state(usbd_device *dev, int iface, bool dsr, bool d
notif->wLength = 2;
buf[8] = (dsr ? 2 : 0) | (dcd ? 1 : 0);
buf[9] = 0;
- usbd_ep_write_packet(dev, 0x82, buf, 10);
- notif->wIndex = 2;
- usbd_ep_write_packet(dev, 0x84, buf, 10);
+ usbd_ep_write_packet(dev, 0x82 + iface, buf, 10);
}
static void cdcacm_set_config(usbd_device *dev, uint16_t wValue)
@@ -533,6 +531,7 @@ static void cdcacm_set_config(usbd_device *dev, uint16_t wValue)
* Allows the use of /dev/tty* devices on *BSD/MacOS
*/
cdcacm_set_modem_state(dev, 0, true, true);
+ cdcacm_set_modem_state(dev, 2, true, true);
}
/* We need a special large control buffer for this device: */