use clock;
extern {
- fn USB_VcomInit();
+ fn USB_VcomInit(vid: u16, pid: u16);
}
pub unsafe fn init(vid: u16, pid: u16) {
- USB_VcomInit();
+ USB_VcomInit(vid, pid);
}
#[no_mangle]
}
/* 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;
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;
*
* @return pointer to USB device handle.
*/
-usb_device_handle USB_VcomInit(void);
+usb_device_handle USB_VcomInit (uint16_t vid, uint16_t pid);
/*!
* @brief Application initialization function.