Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
USBDevice: add documentation on USB suspend/resume to enter deep sleep #11635
It is now possible to temporarily suspend a USB Component and safely preserve its state. This functionality is needed to allow a device to enter deep sleep as a USBDevice instance prevents deep sleep.
Pull request type
It is possible to temporarily suspend USB and safely preserve its configuration. This is needed to allow a device to enter deep sleep as a USBDevice instance prevents deep sleep. USB operation can be suspended with `deinit` and restored with `connect`.
evedon left a comment
I am fine with this PR which adds documentation on how to achieve power saving.
On a side note, I find confusing the fact that connect() calls init() (although the init() documentation says that "This function must be called before calling any other functions of this class" and deinit() calls disconnect(). It would have been a cleaner API if each function only did one thing (at the expense of the users doing the right thing). But this is not someting I would like to change now.