diff options
| author | iabdalkader <i.abdalkader@gmail.com> | 2021-07-27 18:32:38 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-08-01 10:51:24 +1000 |
| commit | 7ae9e6ef6900ad2d386bf5453b47a89b026b51f1 (patch) | |
| tree | 36aa1cc4912f91ddd338f32aa72af6b2d2c86408 | |
| parent | afcc77cebc38020d838e0af5ef4c9b7d3028a6c3 (diff) | |
rp2/tusb_port: Allow boards to configure USB VID and PID.
By defining MICROPY_HW_USB_VID and MICROPY_HW_USB_PID.
| -rw-r--r-- | ports/rp2/tusb_port.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ports/rp2/tusb_port.c b/ports/rp2/tusb_port.c index 874d837b9..8896be907 100644 --- a/ports/rp2/tusb_port.c +++ b/ports/rp2/tusb_port.c @@ -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, |
