Remove the CFG_TUSB_RHPORTx_MODE fallback and tusb_init(void); rename TUP_RHPORT_HIGHSPEED

Open
#4,501 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@anirudh12032008 is already working on this.

Since Nov 14, 2026.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
c
Domain
embedded-iot

Research direction

Start with the compatibility definitions in src/tusb_option.h and the deprecated initializer in src/tusb.h and src/tusb.c; review the cited changelog entries and the deferred issue #3779 for migration context. Then inspect the listed RT-Thread and unit-test configuration and call sites, the FT9xx comment, and unit-test build definitions. Done means removing or replacing the fallbacks and initializer, migrating in-tree users, renaming the high-speed defaults while preserving the SuperSpeed rule, and documenting the breaking change; first survey out-of-tree users.

Written by the indexing model from the issue text.

Description

follow-up Prio 📌

Deferred from #3779. CFG_TUSB_RHPORT0_MODE / CFG_TUSB_RHPORT1_MODE were superseded in 0.14.0 by CFG_TUD_ENABLED / CFG_TUH_ENABLED and CFG_TUD_MAX_SPEED / CFG_TUH_MAX_SPEED (docs/changelog/0.14.0.md:19), and tusb_init(void) was deprecated in 0.18.0 (docs/changelog/0.18.0.md:16). Both are still supported as fallbacks.

Scope

  • Remove the CFG_TUSB_RHPORTx_MODE fallback in src/tusb_option.h:489-506 (device) and :531-548 (host): TUD_RHPORT_MODE, TUH_RHPORT_MODE, and the CFG_TUD_ENABLED / CFG_TUD_MAX_SPEED / CFG_TUH_ENABLED / CFG_TUH_MAX_SPEED defaults derived from them.
  • tusb_init(void): its rhport comes only from TUD_OPT_RHPORT / TUH_OPT_RHPORT, which only CFG_TUSB_RHPORTx_MODE defines (src/tusb.h:143-146, src/tusb.c:66-86). Decide whether to remove it (calls fail at compile time with a pointer to tusb_init(rhport, &init)) or give it another rhport source.
  • Migrate the in-tree users:
    • lib/rt-thread/tusb_config.h:90-93, 156-157 sets CFG_TUSB_RHPORT0/1_MODE; lib/rt-thread/tusb_rt_thread_port.c:61 calls tusb_init().
    • test/unit-test/test/support/tusb_config.h.
    • Comment in src/portable/bridgetek/ft9xx/dcd_ft9xx.c:305.
  • Rename the high-speed port default the way #3779 renamed the SuperSpeed one (TUP_RHPORT_SUPERSPEED -> CFG_TUSB_SUPER_SPEED_DEFAULT, resolved to the overridable CFG_TUSB_SUPER_SPEED): TUP_RHPORT_HIGHSPEED -> CFG_TUSB_HIGH_SPEED_DEFAULT / CFG_TUSB_HIGH_SPEED, shared by TUD_OPT_HIGH_SPEED and TUH_OPT_HIGH_SPEED (src/tusb_option.h:515, 555), including the unit-test definitions (test/unit-test/project.yml:158, test/unit-test/CMakeLists.txt:160). Keep the SuperSpeed-implies-HighSpeed rule of TUD_OPT_HIGH_SPEED.
  • Changelog entry: breaking change for applications still using CFG_TUSB_RHPORTx_MODE or tusb_init(void).

Why deferred

It is a breaking change for every application on the old configuration and unrelated to the SuperSpeed ports in #3779. Out-of-tree users (Arduino, ESP-IDF components, vendor SDKs) are not surveyed yet.

Dominant language
C
Stars
7.3k
Forks
1.6k
Avg merge
1d 19h
Merged PRs (30d)
67

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hathach/tinyusb

All issues in hathach/tinyusb

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.