rust-embedded-community / usb-device

Experimental device-side USB framework for microcontrollers in Rust.
MIT License
437 stars 75 forks source link

Adding basic remote wakeup hooks #67

Closed haata closed 2 years ago

haata commented 3 years ago
haata commented 2 years ago

Any thoughts on this PR?

ryan-summers commented 2 years ago

Actually, why do we need this to be on the usb-device itself? Why can't user software just directly call remote_wakeup() on the peripheral? Do you need to implement this at some higher-level USB class that doesn't have knowledge of the underlying bus?

haata commented 2 years ago

Sorry for the delay, I went ahead and implemented your suggestion (it's working! and passes the USB compliance tool too!).

The main annoyance (and I'm not really sure how to get around this), is using remote_wakeup_enabled flag inside the USB driver. Just a few more lines of setup code, so not really a big deal.