summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZYH <[email protected]>2018-03-15 21:43:17 +0800
committerGitHub <[email protected]>2018-03-15 21:43:17 +0800
commit9ad0cb214dfec89c45a95264968fde40b69b190f (patch)
tree7a5a7e604547a6af1190161bdca47d90f86b9198
parent9ae79c0c1500ed3548381935f88b2ad8a71d5d53 (diff)
parent4f1f0ad918379292ad2e1e3cd13289e30a11086f (diff)
Merge pull request #1280 from charlown/master
fix cdc_vcom.c notify receive data.
-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();