feat(esp_tinyusb): Added device suspend/resume events#387
Merged
peter-marcisovsky merged 1 commit intomasterfrom Feb 2, 2026
Merged
feat(esp_tinyusb): Added device suspend/resume events#387peter-marcisovsky merged 1 commit intomasterfrom
peter-marcisovsky merged 1 commit intomasterfrom
Conversation
0ddf733 to
bde4855
Compare
ede084a to
1f55633
Compare
3df8428 to
adaf4eb
Compare
54cf7b0 to
7b92695
Compare
device/esp_tinyusb/test_apps/power_management/main/test_device_pm.c
Outdated
Show resolved
Hide resolved
dadba3e to
bc169d6
Compare
device/esp_tinyusb/test_apps/power_management/main/test_device_pm.c
Outdated
Show resolved
Hide resolved
bc169d6 to
5a79e76
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
device/esp_tinyusb/test_apps/power_management/main/test_device_pm.c
Outdated
Show resolved
Hide resolved
tore-espressif
approved these changes
Feb 2, 2026
Collaborator
tore-espressif
left a comment
There was a problem hiding this comment.
@peter-marcisovsky nice work, LGTM!
- Configurable Suspend/Resume device event callbacks
- User can register the tud_suspend_cb and tud_resume_cb callbacks to esp_tinyusb,
or to it's own custom suspend/resume callbacks implementations
- Configurable via Kconfig
d29982c to
28f055e
Compare
This was referenced Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds suspend/resume events to the device event callback handler
Reason for this change:
esp_tinyusb V.2lacks suspend/resume events needed for further HID Host tests, CDC-ACM Host tests and general usage of theesp_tinyusbThe device events are implemented using
tud_suspend_cb()andtud_suspend_cb()provided byTinyUSB. The callbacks registering in configurable via Kconfig. Users can:tud_suspend_cb()andtud_suspend_cb()in esp_tinyusb and benefit from internal event handlingRelated
Checklist
Before submitting a Pull Request, please ensure the following:
Note
Medium Risk
Medium risk because it introduces new TinyUSB callback hooks (
tud_suspend_cb/tud_resume_cb) behind Kconfig flags and adds a new public API (tinyusb_remote_wakeup) that changes runtime USB device behavior and is exercised in CI with new hardware-dependent tests.Overview
Adds optional USB device suspend/resume event reporting to
esp_tinyusb, gated by new Kconfig flags (CONFIG_TINYUSB_SUSPEND_CALLBACK,CONFIG_TINYUSB_RESUME_CALLBACK) that register strongtud_suspend_cb()/tud_resume_cb()implementations and emitTINYUSB_EVENT_SUSPENDED/TINYUSB_EVENT_RESUMED(including a remote-wakeup-enabled bit on suspend).Introduces a new public API
tinyusb_remote_wakeup()and internal tracking of host-enabled remote wakeup, plus documentation/CHANGELOG updates describing the opt-in behavior and linker constraints.Extends CI and test coverage with a new
power_managementdevice test app and pytest suite validating suspend/resume event delivery and remote wakeup behavior, and updates the USB runner workflow/container setup to mount/dev/bus/usband installlibusbforpyusb-based tests.Written by Cursor Bugbot for commit 28f055e. This will update automatically on new commits. Configure here.