Skip to content

Commit

Permalink
cores/usb/generic_device: fix descriptor to support multiples interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
povauboin committed Sep 30, 2024
1 parent ce66607 commit eb35139
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lambdalib/cores/usb/generic_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def __init__(self, pins,
ep_sizes=None,
max_packet_size=None,
with_cdc=True,
with_microsoft_os_1_0=False,
with_microsoft_os_1_0=False, # Set to True for interface 0,
# or pass a list() of interfaces
force_contiguous_blockram=False,
**kwargs):

Expand Down Expand Up @@ -137,9 +138,9 @@ def add_microsoft_os_1_0(self, descriptors):
if isinstance(self.with_microsoft_os_1_0, bool):
self.with_microsoft_os_1_0 = [0]

for intf in self.with_microsoft_os_1_0:
with msft_descriptors.ExtendedCompatIDDescriptor() as c:
# Declare all interfaces from the list as Windows compatible
with msft_descriptors.ExtendedCompatIDDescriptor() as c:
for intf in self.with_microsoft_os_1_0:
with c.Function() as f:
f.bFirstInterfaceNumber = intf
f.compatibleID = "WINUSB"
Expand Down

0 comments on commit eb35139

Please sign in to comment.