summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authormoebius.ever <[email protected]>2018-03-16 14:30:23 +0800
committermoebius.ever <[email protected]>2018-03-16 14:30:23 +0800
commitc1505a3d6025e01710759261573e75df347ee784 (patch)
tree1be1d09d679381c23a2d17f8c8aaec8236dcf08f /components
parent48ecbd3999bfdab6fbfbb3b07c5c5a44a9ec4d02 (diff)
parentbce9bc47af60f340e41f5d4e978972322b0fde83 (diff)
Merge branch 'master' of https://github.com/RT-Thread/rt-thread
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();