Add README.
[gps-watch.git] / src / common / usb_device_descriptor.c
index 8271e58a8ba781cb22fa7bfa9abe4170c4fe5181..ac95a13c68ade3f19d1d73c3a9827614211d8dd6 100644 (file)
@@ -62,9 +62,9 @@ uint8_t g_UsbDeviceDescriptor[USB_DESCRIPTOR_LENGTH_DEVICE] = {
     /* Maximum packet size for endpoint zero (only 8, 16, 32, or 64 are valid) */
     USB_CONTROL_MAX_PACKET_SIZE,
     /* Vendor ID (assigned by the USB-IF) */
-    0xC9U, 0x1FU,
+    0x00, 0x00,
     /* Product ID (assigned by the manufacturer) */
-    0x94, 0x00,
+    0x00, 0x00,
     /* Device release number in binary-coded decimal */
     USB_SHORT_GET_LOW(USB_DEVICE_DEMO_BCD_VERSION), USB_SHORT_GET_HIGH(USB_DEVICE_DEMO_BCD_VERSION),
     /* Index of string descriptor describing manufacturer */
@@ -480,3 +480,17 @@ usb_status_t USB_DeviceSetSpeed(usb_device_handle handle, uint8_t speed)
     }
     return kStatus_USB_Success;
 }
+
+void
+USB_DeviceSetVendorId (uint16_t vid)
+{
+       g_UsbDeviceDescriptor[8] = (vid >> 0) & 0xff;
+       g_UsbDeviceDescriptor[9] = (vid >> 8) & 0xff;
+}
+
+void
+USB_DeviceSetProductId (uint16_t pid)
+{
+       g_UsbDeviceDescriptor[10] = (pid >> 0) & 0xff;
+       g_UsbDeviceDescriptor[11] = (pid >> 8) & 0xff;
+}