Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow retrieving the port a device is connected to #2357

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Add nullptr check
  • Loading branch information
Yveaux committed Nov 29, 2023
commit 7d6bfa9afd036427be5d9a64747b6f3e039ec80c
1 change: 1 addition & 0 deletions src/host/usbh.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ bool tuh_rhport_reset_bus(uint8_t rhport, bool active) {

uint8_t tuh_get_port(uint8_t dev_addr) {
usbh_device_t *dev = get_device(dev_addr);
TU_VERIFY(dev);
// rhport:hub_addr:hub_port
if (is_hub_addr(dev_addr)) {
return dev->hub_addr;
Expand Down