From d20974b9d2b1d216cd01e0f70d440b1081b380c1 Mon Sep 17 00:00:00 2001 From: heyuanjie87 Date: Wed, 9 Jan 2013 12:18:00 +0800 Subject: [PATCH] allows the user custom PID and VID --- components/drivers/usb/usbdevice/class/cdc_vcom.c | 7 +++---- components/drivers/usb/usbdevice/class/mstorage.c | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/components/drivers/usb/usbdevice/class/cdc_vcom.c b/components/drivers/usb/usbdevice/class/cdc_vcom.c index addbb66c8..44c48a440 100644 --- a/components/drivers/usb/usbdevice/class/cdc_vcom.c +++ b/components/drivers/usb/usbdevice/class/cdc_vcom.c @@ -39,8 +39,8 @@ static struct udevice_descriptor dev_desc = 0x00, //bDeviceSubClass; 0x00, //bDeviceProtocol; 0x40, //bMaxPacketSize0; - USB_VENDOR_ID, //idVendor; - USB_CDC_PRODUCT_ID, //idProduct; + _VENDOR_ID, //idVendor; + _PRODUCT_ID, //idProduct; USB_BCD_DEVICE, //bcdDevice; USB_STRING_MANU_INDEX, //iManufacturer; USB_STRING_PRODUCT_INDEX, //iProduct; @@ -300,7 +300,7 @@ static rt_err_t _interface_handler(udevice_t device, uclass_t cls, ureq_t setup) _cdc_get_line_coding(device, setup); break; case CDC_SET_CONTROL_LINE_STATE: - rt_device_control((rt_device_t)device->dcd, CONTROL_SEND_STATUS, RT_NULL); + dcd_send_status(device->dcd); break; case CDC_SEND_BREAK: break; @@ -588,4 +588,3 @@ void rt_usb_vcom_init(void) } #endif - diff --git a/components/drivers/usb/usbdevice/class/mstorage.c b/components/drivers/usb/usbdevice/class/mstorage.c index 389c2ea47..ebd6342ec 100644 --- a/components/drivers/usb/usbdevice/class/mstorage.c +++ b/components/drivers/usb/usbdevice/class/mstorage.c @@ -43,8 +43,8 @@ static struct udevice_descriptor dev_desc = 0x00, //bDeviceSubClass; 0x00, //bDeviceProtocol; 0x40, //bMaxPacketSize0; - USB_VENDOR_ID, //idVendor; - USB_MASS_STORAGE_PRODUCT_ID,//idProduct; + _VENDOR_ID, //idVendor; + _PRODUCT_ID, //idProduct; USB_BCD_DEVICE, //bcdDevice; USB_STRING_MANU_INDEX, //iManufacturer; USB_STRING_PRODUCT_INDEX, //iProduct;