adafruit / Adafruit_CircuitPython_USB_Host_MIDI

CircuitPython USB host driver for MIDI devices
MIT License
5 stars 1 forks source link

Add timeout parameter, add Feather RP2040 with USB Type A Host example #2

Closed todbot closed 6 months ago

todbot commented 6 months ago

Adds a timeout property on the constructor that is used when doing usb.core.Device.read()s, so devices can be read in a non-blocking fashion. Also adds an example for use on the Feather RP2040 with USB Type A Host.

tannewt commented 6 months ago

Looks like I hadn't done lint over the library. Would you mind doing it? pre-commit can help: https://learn.adafruit.com/improve-your-code-with-pylint

todbot commented 6 months ago

One of the remaining problems is Sphinx is failing with

autodoc: failed to import module 'adafruit_usb_host_midi'; the following exception was raised:
No module named 'usb'

I had to add import usb.core to get usb.core.USBTimeoutError. And Adafruit-Blinka doesn't have a fakey usb module I guess?

todbot commented 6 months ago

Hmm, okay well I added two dependencies to requirements.txt:

adafruit-circuitpython-usb-host-descriptors
pyusb

I assume requirements.txt is only used in CPython and not circup?

tannewt commented 6 months ago

I assume requirements.txt is only used in CPython and not circup?

I'm not sure exactly how it'll interact with circup. I think this is right for CPython.

Thanks for fixing everything up!