From 4f1f0ad918379292ad2e1e3cd13289e30a11086f Mon Sep 17 00:00:00 2001 From: charlown Date: Thu, 15 Mar 2018 10:05:17 +0800 Subject: [PATCH] fix cdc_vcom.c notify receive data. --- components/drivers/usb/usbdevice/class/cdc_vcom.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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();