summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Banks <kevin@firia.com>2021-02-01 18:35:58 -0600
committerKevin Banks <kevin@firia.com>2021-02-01 18:35:58 -0600
commit817ca39f59a539fff9e0bc29259b114e34cdf609 (patch)
tree23c5de79d3737305420a5b9746bd921632723264
parente1618c21b20e82f2259118cd1baf67f6954b92ef (diff)
ITF_NUM_VENDOR is now automatically computed at run-time
-rw-r--r--tools/gen_usb_descriptor.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py
index 36c6f45a6..bd77be583 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))