adafruit / Adafruit_CircuitPython_HID

USB Human Interface Device drivers.
MIT License
365 stars 106 forks source link

QT Py M0 Haxpress hangs when using HID Library #57

Closed jfurcean closed 3 years ago

jfurcean commented 3 years ago

Program hangs when using the adafruit_hid library on the QT Py M0 Haxpress. I could not replicate the issue on either the plain QT Py M0 or the Feather M4 Express. See the below example code. The mouse moves for a few seconds and then hangs. This issue occurs when the reset button is press or the board is unplugged and plugged back in. It does not occur when code.py is saved to the board.

import time
import usb_hid
from adafruit_hid.mouse import Mouse

m = Mouse(usb_hid.devices)

while True:
    m.move(10, 0, 0)
    time.sleep(.05)
    m.move(-10,0,0)
    time.sleep(.05)

The issue was originally raised in adafruit_nunchuk library: https://github.com/adafruit/Adafruit_CircuitPython_Nunchuk/issues/22

Edit: this occurs on MacOS and couldn't be duplicated on Linux or Windows.

dhalbert commented 3 years ago

This was a CircuitPython problem (Gamepad HID device in wrong order for MacOS) and should have been fixed by https://github.com/adafruit/circuitpython/pull/4558. If it still happens, please open an issue in https://github.com/adafruit/circuitpython.