diff --git a/components/drivers/usb/usbdevice/class/cdc_vcom.c b/components/drivers/usb/usbdevice/class/cdc_vcom.c index 60ed85d9f33b98b6352b392ab1b7ed7610b237ae..b8728beac53520e1f29ca74f505d6c9468676e23 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();