rp2/tusb_port: Allow boards to configure USB VID and PID.

By defining MICROPY_HW_USB_VID and MICROPY_HW_USB_PID.
This commit is contained in:
iabdalkader 2021-07-27 18:32:38 +02:00 committed by Damien George
parent afcc77cebc
commit 7ae9e6ef69

View File

@ -27,8 +27,12 @@
#include "tusb.h"
#include "pico/unique_id.h"
#define USBD_VID (0x2E8A) // Raspberry Pi
#define USBD_PID (0x0005) // RP2 MicroPython
#ifndef MICROPY_HW_USB_VID
#define MICROPY_HW_USB_VID (0x2E8A) // Raspberry Pi
#endif
#ifndef MICROPY_HW_USB_PID
#define MICROPY_HW_USB_PID (0x0005) // RP2 MicroPython
#endif
#define USBD_DESC_LEN (TUD_CONFIG_DESC_LEN + TUD_CDC_DESC_LEN)
#define USBD_MAX_POWER_MA (250)
@ -58,8 +62,8 @@ static const tusb_desc_device_t usbd_desc_device = {
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
.bDeviceProtocol = MISC_PROTOCOL_IAD,
.bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
.idVendor = USBD_VID,
.idProduct = USBD_PID,
.idVendor = MICROPY_HW_USB_VID,
.idProduct = MICROPY_HW_USB_PID,
.bcdDevice = 0x0100,
.iManufacturer = USBD_STR_MANUF,
.iProduct = USBD_STR_PRODUCT,