Skip to content

Conversation

@peter-marcisovsky
Copy link
Collaborator

@peter-marcisovsky peter-marcisovsky commented Nov 24, 2025

Description

Renaming usb_host_lib_set_auto_pm to usb_host_lib_set_auto_suspend.
Also renaming it's related enums and typedefs, to align with the new name.

No functional change, just renaming.

Suspend timer type enum

Renamed from:

typedef enum {
    USB_HOST_LIB_PM_SUSPEND_ONE_SHOT,               /**< USB Host lib power management -> Auto suspend one-shot timer */
    USB_HOST_LIB_PM_SUSPEND_PERIODIC,               /**< USB Host lib power management -> Auto suspend periodic timer */
} usb_host_lib_pm_t;

to

typedef enum {
    USB_HOST_LIB_AUTO_SUSPEND_ONE_SHOT,             /**< Automatic suspend one-shot timer */
    USB_HOST_LIB_AUTO_SUSPEND_PERIODIC,             /**< Automatic suspend periodic timer */
} usb_host_lib_auto_suspend_tmr_t;

Suspend timer public API functions

Renamed from

esp_err_t usb_host_lib_set_auto_pm(usb_host_lib_pm_t timer_type, size_t timer_interval_ms);

to

esp_err_t usb_host_lib_set_auto_suspend(usb_host_lib_auto_suspend_tmr_t timer_type, size_t timer_interval_ms);

Related


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

Note

Renames usb_host_lib_set_auto_pm and related PM types/constants to usb_host_lib_set_auto_suspend with new auto-suspend enum names, and updates core implementation and tests accordingly.

  • API (usb_host.h):
    • Rename usb_host_lib_set_auto_pm(...)usb_host_lib_set_auto_suspend(...).
    • Replace usb_host_lib_pm_t with usb_host_lib_auto_suspend_tmr_t.
    • Replace USB_HOST_LIB_PM_SUSPEND_ONE_SHOT/PERIODIC with USB_HOST_LIB_AUTO_SUSPEND_ONE_SHOT/PERIODIC.
  • Core (usb_host.c):
    • Rename internal timer objects and helpers: auto_pm_timerauto_suspend_timer, reset_pm_timer/stop_pm_timerreset_auto_suspend_timer/stop_auto_suspend_timer, auto_pm_timer_cbauto_suspend_timer_cb.
    • Wire new API and naming through install/uninstall, event handling, and logging.
  • Tests:
    • Update CDC/MSC tests and USB host target tests to new API and constants.
    • Rename test macros, comments, and log tags from PM timer to suspend timer; adjust calls accordingly.

Written by Cursor Bugbot for commit 3670dbd. This will update automatically on new commits. Configure here.

@peter-marcisovsky peter-marcisovsky added this to the usb_host 1.1.0 milestone Nov 24, 2025
@peter-marcisovsky peter-marcisovsky self-assigned this Nov 24, 2025
@peter-marcisovsky peter-marcisovsky added the Component: usb_host Issue affects usb_host component label Nov 24, 2025
@peter-marcisovsky peter-marcisovsky changed the title fix(usb_host): Rename auto suspend timer public API Refactor(usb_host): Rename auto suspend timer public API Nov 24, 2025
@peter-marcisovsky peter-marcisovsky force-pushed the refactor/usb_host_auto_suspend_timer_api_rename branch 2 times, most recently from 793e666 to e11eed5 Compare November 24, 2025 16:49
@peter-marcisovsky peter-marcisovsky force-pushed the refactor/usb_host_auto_suspend_timer_api_rename branch from e11eed5 to 3670dbd Compare November 24, 2025 18:22
@peter-marcisovsky peter-marcisovsky added the Status: Reviewing Issue is being reviewed label Nov 25, 2025
Copy link
Contributor

@roma-jam roma-jam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One blocking note from my side regarding the public API update and potential breaking change during the non-breaking release.
Oh, we didn't release it yet. Than, no blocking notes.

Otherwise, LGTM.

@roma-jam roma-jam self-requested a review November 25, 2025 10:21
@peter-marcisovsky peter-marcisovsky merged commit 10c3138 into master Nov 25, 2025
65 checks passed
@peter-marcisovsky peter-marcisovsky deleted the refactor/usb_host_auto_suspend_timer_api_rename branch November 25, 2025 11:43
@peter-marcisovsky peter-marcisovsky added Status: Done Issue is done internally and removed Status: Reviewing Issue is being reviewed labels Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: usb_host Issue affects usb_host component Status: Done Issue is done internally

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants