Skip to content

Commit a7cd740

Browse files
felixdoerredpgeorge
authored andcommitted
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>
1 parent 7f5ac83 commit a7cd740

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
metadata(version="0.1.1")
1+
metadata(version="0.2.0")
22
package("usb")

micropython/usb/usb-device/usb/device/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def config( # noqa: PLR0913
110110
device_protocol=0,
111111
config_str=None,
112112
max_power_ma=None,
113+
remote_wakeup=False,
113114
):
114115
# Configure the USB device with a set of interfaces, and optionally reconfiguring the
115116
# device and configuration descriptor fields
@@ -199,7 +200,7 @@ def maybe_set(value, idx):
199200
bmAttributes = (
200201
(1 << 7) # Reserved
201202
| (0 if max_power_ma else (1 << 6)) # Self-Powered
202-
# Remote Wakeup not currently supported
203+
| ((1 << 5) if remote_wakeup else 0)
203204
)
204205

205206
# Configuration string is optional but supported

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy