summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorcharlown <[email protected]>2018-03-15 10:05:17 +0800
committercharlown <[email protected]>2018-03-15 10:07:23 +0800
commit4f1f0ad918379292ad2e1e3cd13289e30a11086f (patch)
treefa6b68ca431a454e1e4931c02706f7c482dd07fd /components
parent93f5e3e466af0e89a3cbce55443cad491844e9fc (diff)
fix cdc_vcom.c notify receive data.
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 60ed85d9f3..b8728beac5 100644
--- a/components/drivers/usb/usbdevice/class/cdc_vcom.c
+++ b/components/drivers/usb/usbdevice/class/cdc_vcom.c
@@ -304,7 +304,8 @@ static rt_err_t _ep_out_handler(ufunction_t func, rt_size_t size)
data = (struct vcom*)func->user_data;
/* ensure serial is active */
- if(data->serial.parent.open_flag & RT_DEVICE_FLAG_ACTIVATED)
+ if((data->serial.parent.flag & RT_DEVICE_FLAG_ACTIVATED)
+ && (data->serial.parent.open_flag & RT_DEVICE_OFLAG_OPEN))
{
/* receive data from USB VCOM */
level = rt_hw_interrupt_disable();