Browse Source

allows the user custom PID and VID

heyuanjie87 12 years ago
parent
commit
928cabff50
1 changed files with 6 additions and 3 deletions
  1. 6 3
      components/drivers/usb/usbdevice/core/usbdevice.c

+ 6 - 3
components/drivers/usb/usbdevice/core/usbdevice.c

@@ -9,13 +9,15 @@
  *
  *
  * Change Logs:
  * Change Logs:
  * Date           Author       Notes
  * Date           Author       Notes
- * 2012-10-02     Yi Qiu      first version
+ * 2012-10-02     Yi Qiu       first version
  */
  */
 
 
 #include <rtthread.h>
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <rtdevice.h>
 #include <rtservice.h>
 #include <rtservice.h>
 
 
+#ifdef RT_USING_USB_DEVICE
+
 const static char* ustring[] = 
 const static char* ustring[] = 
 {
 {
     "Language",
     "Language",
@@ -36,8 +38,8 @@ static struct udevice_descriptor compsit_desc =
     0x02,                       //bDeviceSubClass;
     0x02,                       //bDeviceSubClass;
     0x01,                       //bDeviceProtocol;
     0x01,                       //bDeviceProtocol;
     0x40,                       //bMaxPacketSize0;
     0x40,                       //bMaxPacketSize0;
-    USB_VENDOR_ID,              //idVendor;
-    0xbacf,                     //idProduct;
+    _VENDOR_ID,                 //idVendor;
+    _PRODUCT_ID,                //idProduct;
     USB_BCD_DEVICE,             //bcdDevice;
     USB_BCD_DEVICE,             //bcdDevice;
     USB_STRING_MANU_INDEX,      //iManufacturer;
     USB_STRING_MANU_INDEX,      //iManufacturer;
     USB_STRING_PRODUCT_INDEX,   //iProduct;
     USB_STRING_PRODUCT_INDEX,   //iProduct;
@@ -115,3 +117,4 @@ rt_err_t rt_usb_device_init(const char* udc_name)
     return RT_EOK;
     return RT_EOK;
 }
 }
 
 
+#endif