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:
parent
afcc77cebc
commit
7ae9e6ef69
@ -27,8 +27,12 @@
|
|||||||
#include "tusb.h"
|
#include "tusb.h"
|
||||||
#include "pico/unique_id.h"
|
#include "pico/unique_id.h"
|
||||||
|
|
||||||
#define USBD_VID (0x2E8A) // Raspberry Pi
|
#ifndef MICROPY_HW_USB_VID
|
||||||
#define USBD_PID (0x0005) // RP2 MicroPython
|
#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_DESC_LEN (TUD_CONFIG_DESC_LEN + TUD_CDC_DESC_LEN)
|
||||||
#define USBD_MAX_POWER_MA (250)
|
#define USBD_MAX_POWER_MA (250)
|
||||||
@ -58,8 +62,8 @@ static const tusb_desc_device_t usbd_desc_device = {
|
|||||||
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
|
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
|
||||||
.bDeviceProtocol = MISC_PROTOCOL_IAD,
|
.bDeviceProtocol = MISC_PROTOCOL_IAD,
|
||||||
.bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
|
.bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
|
||||||
.idVendor = USBD_VID,
|
.idVendor = MICROPY_HW_USB_VID,
|
||||||
.idProduct = USBD_PID,
|
.idProduct = MICROPY_HW_USB_PID,
|
||||||
.bcdDevice = 0x0100,
|
.bcdDevice = 0x0100,
|
||||||
.iManufacturer = USBD_STR_MANUF,
|
.iManufacturer = USBD_STR_MANUF,
|
||||||
.iProduct = USBD_STR_PRODUCT,
|
.iProduct = USBD_STR_PRODUCT,
|
||||||
|
Loading…
Reference in New Issue
Block a user