Skip to content

Commit

Permalink
device.hardware.py: Set skip_on_error flag to improve Windows experie…
Browse files Browse the repository at this point in the history
…nce with USB discovery
  • Loading branch information
colinoflynn committed Mar 28, 2024
1 parent 1f5691a commit 2db7048
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions software/glasgow/device/hardware.py
Expand Up @@ -96,7 +96,7 @@ def hotplug_callback(usb_context, device, event):
usb_context.hotplugRegisterCallback(hotplug_callback,
flags=usb1.HOTPLUG_ENUMERATE)
else:
devices.extend(list(usb_context.getDeviceIterator()))
devices.extend(list(usb_context.getDeviceIterator(skip_on_error=True)))

while any(devices):
device = devices.pop()
Expand Down Expand Up @@ -185,7 +185,7 @@ def hotplug_callback(usb_context, device, event):
logger.debug("waiting for re-enumeration")
time.sleep(5.0)

devices.extend(list(usb_context.getDeviceIterator()))
devices.extend(list(usb_context.getDeviceIterator(skip_on_error=True)))

return devices_by_serial

Expand Down

0 comments on commit 2db7048

Please sign in to comment.