summaryrefslogtreecommitdiff
path: root/src/host/usbh.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-10-14 18:27:52 +0700
committerhathach <[email protected]>2024-10-14 18:27:52 +0700
commit1f18be93db39dbc57bbf34f982dbe07e209a2ae3 (patch)
tree4da021608772f07fba9105da956112e495d9eeb9 /src/host/usbh.c
parent1587d48e89cbaa8d0d1c870809bc40c3c8d1056f (diff)
change the tusb_rhport_init_t struct, exclude the rhport to make API more consistent
Diffstat (limited to 'src/host/usbh.c')
-rw-r--r--src/host/usbh.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c
index f9e6c4e97..b5df29f50 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -352,8 +352,8 @@ bool tuh_inited(void) {
return _usbh_controller != TUSB_INDEX_INVALID_8;
}
-bool tuh_rhport_init(const tusb_rhport_init_t* rh_init) {
- if (tuh_rhport_is_active(rh_init->rhport)) {
+bool tuh_rhport_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
+ if (tuh_rhport_is_active(rhport)) {
return true; // skip if already initialized
}
@@ -404,9 +404,9 @@ bool tuh_rhport_init(const tusb_rhport_init_t* rh_init) {
}
// Init host controller
- _usbh_controller = rh_init->rhport;
- TU_ASSERT(hcd_init(rh_init));
- hcd_int_enable(rh_init->rhport);
+ _usbh_controller = rhport;
+ TU_ASSERT(hcd_init(rhport, rh_init));
+ hcd_int_enable(rhport);
return true;
}