common: Make USB_VcomInit() take VID/PID and pass them on.
[gps-watch.git] / src / common / virtual_com.c
index 804c91a95de332de0963865746ef18f236d79f19..370767898a4c275b16c8ad9f57fd701a37e3f39f 100644 (file)
@@ -624,7 +624,8 @@ flush_tx_buffer (void *user_data, void *vbuf, size_t bufsiz, size_t count)
 }
 
 /* See virtual_com.h for documentation of this function. */
-usb_device_handle USB_VcomInit(void)
+usb_device_handle
+USB_VcomInit (uint16_t vid, uint16_t pid)
 {
     usb_device_handle deviceHandle = NULL;
 
@@ -638,6 +639,9 @@ usb_device_handle USB_VcomInit(void)
     s_cdcVcom.attach = 0;
     s_cdcVcom.deviceHandle = NULL;
 
+       USB_DeviceSetVendorId(vid);
+       USB_DeviceSetProductId(pid);
+
     if (kStatus_USB_Success != USB_DeviceInit(CONTROLLER_ID, USB_DeviceCallback, &s_cdcVcom.deviceHandle))
     {
         deviceHandle = NULL;