Skip to content

Commit eda671c

Browse files
authored
Merge pull request #3167 from adafruit/memory_mouse
resolve mouse errors
2 parents ec3260c + b0cf84c commit eda671c

File tree

1 file changed

+9
-12
lines changed
  • Metro/Metro_RP2350_Memory/memory_game

1 file changed

+9
-12
lines changed

Metro/Metro_RP2350_Memory/memory_game/code.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -299,20 +299,18 @@ def update_score_text():
299299
print(f"{device.idVendor:04x}:{device.idProduct:04x}")
300300
print(device.manufacturer, device.product)
301301
print(device.serial_number)
302-
303-
config_descriptor = adafruit_usb_host_descriptors.get_configuration_descriptor(
304-
device, 0
305-
)
306-
307-
_possible_interface_index, _possible_endpoint_address = (
302+
mouse_interface_index, mouse_endpoint_address = (
308303
adafruit_usb_host_descriptors.find_boot_mouse_endpoint(device))
309304

310-
if _possible_interface_index is not None and _possible_endpoint_address is not None:
305+
if mouse_interface_index is not None and mouse_endpoint_address is not None:
311306
mouse = device
312-
mouse_interface_index = _possible_interface_index
313-
mouse_endpoint_address = _possible_endpoint_address
314-
print(f"mouse interface: {mouse_interface_index}", end="")
315-
print(f"endpoint_address: {hex(mouse_endpoint_address)}")
307+
print(
308+
f"mouse interface: {mouse_interface_index} "
309+
+ f"endpoint_address: {hex(mouse_endpoint_address)}"
310+
)
311+
312+
break
313+
316314

317315
mouse_was_attached = None
318316
if mouse is not None:
@@ -326,7 +324,6 @@ def update_score_text():
326324
# set configuration on the mouse so we can use it
327325
mouse.set_configuration()
328326

329-
330327
def atexit_callback():
331328
"""
332329
re-attach USB devices to kernel if needed.

0 commit comments

Comments
 (0)