Wykres commitów

5 Commity (942c80cbd053c863720887437b36684be4dc0b4f)

Autor SHA1 Wiadomość Data
HLammers 942c80cbd0 Update core.py
⦁	Removed `import time` (not used)
⦁	Removed unused/duplicate `_Device.config` argument `config_str`
⦁	Fixed the loop reserving other string indexes used by built-in drivers `while len(strs) < builtin_driver.str_max:` to `while len(strs) < builtin\_driver.str\_max - 1:` (row 169)because str_max equals to one more than the highest string descriptor index value used by any built-in descriptor according to the [docs](https://docs.micropython.org/en/latest/library/machine.USBDevice.html) and added a comment that this loop is probably unnecessary or even wrong
⦁	Added `bAlternateSetting` as argument to `Descriptor.interface`, because it is used for USB MIDI 2.0
⦁	Some code optimisations
2025-07-05 11:49:36 +02:00
Felix Dörre a7cd740b64 usb-device: Allow signaling capability of remote_wakeup.
To use this feature you need to create a usb device signaling remote wakeup
and then enable remote wakeup on the host (on linux write enabled to
/sys/bus/usb/devices/<device>/power/wakeup). Then you can wake up the host
when is on standby using USBDevice.remote_wakeup.

Signed-off-by: Felix Dörre <felix@dogcraft.de>
2024-10-18 12:54:48 +11:00
Angus Gratton c61ca51c67 usb: Tidy up the description of TinyUSB callbacks.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-17 11:20:00 +10:00
Angus Gratton 1d3c722b7d usb: Fix race if transfers are submitted by a thread.
The USB pending transfer flag was cleared before calling the completion
callback, to allow the callback code to call submit_xfer() again.

Unfortunately this isn't safe in a multi-threaded environment, as another
thread may see the endpoint is available before the callback is done
executing and submit a new transfer.

Rather than adding extra locking, specifically treat the transfer as still
pending if checked from another thread while the callback is executing.

Closes #874

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-11 17:13:53 +10:00
Angus Gratton 583bc0da70 usb: Add USB device support packages.
These packages build on top of machine.USBDevice() to provide high level
and flexible support for implementing USB devices in Python code.

Additional credits, as per included copyright notices:

- CDC support based on initial implementation by @hoihu with fixes by
  @linted.

- MIDI support based on initial implementation by @paulhamsh.

- HID keypad example based on work by @turmoni.

- Everyone who tested and provided feedback on early versions of these
  packages.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-04-30 15:57:50 +10:00