summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorChunfengMu <[email protected]>2018-01-19 01:23:28 +0800
committerChunfengMu <[email protected]>2018-01-19 01:24:33 +0800
commit31dcce45c81e7a204f773704ce202c591f90660f (patch)
tree275fefb0effd908dc9b09db94b559ae48c108e3a /components
parent973a5fb885cb7edc55d5aed6ce2445cb457d7f6c (diff)
1:修复cdc_vcom命令处理错误,SetLineCoding命令用于设置一些vcom参数,在此处判定vcom连接状态不合适,因通过SetControlLineState命令wValue字段最低位进行判断。
Diffstat (limited to 'components')
-rw-r--r--components/drivers/usb/usbdevice/class/cdc_vcom.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/drivers/usb/usbdevice/class/cdc_vcom.c b/components/drivers/usb/usbdevice/class/cdc_vcom.c
index 62f3bdcb28..a2eb5e66a0 100644
--- a/components/drivers/usb/usbdevice/class/cdc_vcom.c
+++ b/components/drivers/usb/usbdevice/class/cdc_vcom.c
@@ -400,12 +400,13 @@ static rt_err_t _interface_handler(ufunction_t func, ureq_t setup)
break;
case CDC_SET_LINE_CODING:
_cdc_set_line_coding(func->device, setup);
- data->connected = RT_TRUE;
break;
case CDC_GET_LINE_CODING:
_cdc_get_line_coding(func->device, setup);
break;
case CDC_SET_CONTROL_LINE_STATE:
+ data->connected = (setup->wValue & 0x01) > 0?RT_TRUE:RT_FALSE;
+ RT_DEBUG_LOG(RT_DEBUG_USB, ("vcom state:%d \n", data->connected));
dcd_ep0_send_status(func->device->dcd);
break;
case CDC_SEND_BREAK: