Skip to content

Conversation

algernon
Copy link

@algernon algernon commented Nov 25, 2017

This is based on #4241, with only USBDevice.isSuspended() picked out, and rebased on top of master. In my tests, the callbacks (especially the wakeup callback) weren't reliably usable, but I could make things work with using isSuspended() in my loop().

Having this - or something like it - in Arduino core would be awesome. I have a few devices where I need to be able to run custom code on suspend & wakeup, and this allows me to do just that.

Based on code originally by Rob van der Veer <[email protected]>, this adds
USBDevice.isSuspended(), so user sketches can run custom code in their `loop`
methods after checking if the device is suspended or not.

Signed-off-by: Gergely Nagy <[email protected]>
@algernon algernon changed the title Added callback support for USB host suspend/wake Add USBDevice.isSuspended() Nov 25, 2017
@facchinm facchinm added Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) Component: USB Device Opposed to USB Host. Related to the USB subsystem (SerialUSB, HID, ...) labels Nov 27, 2017
@algernon
Copy link
Author

As the AVR core has been moved to its own repository, this PR is obsolete, and has been superceded by arduino/ArduinoCore-avr#54.

@algernon algernon closed this Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) Component: USB Device Opposed to USB Host. Related to the USB subsystem (SerialUSB, HID, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants