summaryrefslogtreecommitdiff
path: root/src/device/usbd.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/device/usbd.c
parent1587d48e89cbaa8d0d1c870809bc40c3c8d1056f (diff)
change the tusb_rhport_init_t struct, exclude the rhport to make API more consistent
Diffstat (limited to 'src/device/usbd.c')
-rw-r--r--src/device/usbd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index 12f95ab40..4b6600eb2 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -448,7 +448,7 @@ bool tud_inited(void) {
return _usbd_rhport != RHPORT_INVALID;
}
-bool tud_rhport_init(const tusb_rhport_init_t* rh_init) {
+bool tud_rhport_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
if (tud_inited()) {
return true; // skip if already initialized
}
@@ -487,11 +487,11 @@ bool tud_rhport_init(const tusb_rhport_init_t* rh_init) {
driver->init();
}
- _usbd_rhport = rh_init->rhport;
+ _usbd_rhport = rhport;
// Init device controller driver
- dcd_init(rh_init);
- dcd_int_enable(rh_init->rhport);
+ dcd_init(rhport, rh_init);
+ dcd_int_enable(rhport);
return true;
}