summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2018-04-08 15:59:19 -0400
committerDan Halbert <halbert@halwitz.org>2018-04-08 15:59:19 -0400
commit1e87a785b925657c5ab8fe14e76509debca663a3 (patch)
tree5c3580b913c4aa81aca0101d984dc58d3f1987ca
parente7305ce15f861ad565ef7ee46b5d9b6bec7d0033 (diff)
Move CDC Comm back to Interface 0 for compat with Win7 drivers.
-rw-r--r--ports/atmel-samd/tools/gen_usb_descriptor.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/ports/atmel-samd/tools/gen_usb_descriptor.py b/ports/atmel-samd/tools/gen_usb_descriptor.py
index d37699662..4669110fb 100644
--- a/ports/atmel-samd/tools/gen_usb_descriptor.py
+++ b/ports/atmel-samd/tools/gen_usb_descriptor.py
@@ -169,7 +169,7 @@ hid_interfaces = [
# This will renumber the endpoints to make them unique across descriptors,
# and renumber the interfaces in order. But we still need to fix up certain
# interface cross-references.
-interfaces = util.join_interfaces(hid_interfaces, msc_interfaces, cdc_interfaces)
+interfaces = util.join_interfaces(cdc_interfaces, msc_interfaces, hid_interfaces)
# Now adjust the CDC interface cross-references.
@@ -196,14 +196,16 @@ configuration = standard.ConfigurationDescriptor(
descriptor_list = []
descriptor_list.append(device)
descriptor_list.append(configuration)
-descriptor_list.extend(hid_interfaces)
+descriptor_list.append(cdc_iad)
+descriptor_list.extend(cdc_interfaces)
descriptor_list.extend(msc_interfaces)
# Put the CDC IAD just before the CDC interfaces.
# There appears to be a bug in the Windows composite USB driver that requests the
# HID report descriptor with the wrong interface number if the HID interface is not given
-# first. However, it still fetches the descriptor anyway.
-descriptor_list.append(cdc_iad)
-descriptor_list.extend(cdc_interfaces)
+# first. However, it still fetches the descriptor anyway. We could reorder the interfaces but
+# the Windows 7 Adafruit_usbser.inf file thinks CDC is at Interface 0, so we'll leave it
+# there for backwards compatibility.
+descriptor_list.extend(hid_interfaces)
string_descriptors = [standard.StringDescriptor(string) for string in StringIndex.strings_in_order()]
serial_number_descriptor = string_descriptors[SERIAL_NUMBER_INDEX]