From a3f060a79dff77d55fd43e060686ccf0141cf71d Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 28 Nov 2022 17:36:19 +0100 Subject: [PATCH] Setting own VID/PID (despite they are useless). Signed-off-by: Pol Henarejos --- src/usb/hid/usb_descriptors.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/usb/hid/usb_descriptors.c b/src/usb/hid/usb_descriptors.c index 345cc3f..843eb82 100644 --- a/src/usb/hid/usb_descriptors.c +++ b/src/usb/hid/usb_descriptors.c @@ -28,6 +28,13 @@ #include "pico/unique_id.h" #include "hsm_version.h" +#ifndef USB_VID +#define USB_VID 0xFEFF +#endif +#ifndef USB_PID +#define USB_PID 0xFCFD +#endif + /* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug. * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC. * @@ -49,8 +56,8 @@ tusb_desc_device_t const desc_device = .bDeviceProtocol = 0x00, .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE, - .idVendor = 0xCafe, - .idProduct = 0x4231, + .idVendor = (USB_VID), + .idProduct = (USB_PID), .bcdDevice = HSM_SDK_VERSION, .iManufacturer = 0x01,