From 817ca39f59a539fff9e0bc29259b114e34cdf609 Mon Sep 17 00:00:00 2001 From: Kevin Banks Date: Mon, 1 Feb 2021 18:35:58 -0600 Subject: [PATCH] ITF_NUM_VENDOR is now automatically computed at run-time --- tools/gen_usb_descriptor.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index 36c6f45a6e..bd77be5832 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -757,11 +757,7 @@ const tusb_desc_webusb_url_t desc_webusb_url = // These next two hardcoded descriptor were pulled from the usb_descriptor.c file // of the tinyusb webusb_serial demo. TODO - this is probably something else to -// integrate into the adafruit_usb_descriptors project, especially with this next -// #define.. - -// SWAG for now. Will have to be manually corrected until generated by gen_usb_descriptor.py -#define ITF_NUM_VENDOR 3 +// integrate into the adafruit_usb_descriptors project... //--------------------------------------------------------------------+ // BOS Descriptor @@ -804,6 +800,8 @@ uint8_t const * tud_descriptor_bos_cb(void) }} +#define ITF_NUM_VENOR {webusb_interface} // used in this next descriptor + uint8_t const desc_ms_os_20[] = {{ // Set header: length, type, windows version, total length @@ -836,4 +834,4 @@ TU_VERIFY_STATIC(sizeof(desc_ms_os_20) == MS_OS_20_DESC_LEN, "Incorrect size"); // End of section about desc_ms_os_20 -""".format(webusb_url=args.webusb_url)) +""".format(webusb_url=args.webusb_url, webusb_interface=vendor_interface.bInterfaceNumber))