summaryrefslogtreecommitdiff
path: root/src/device/usbd.h
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.h
parent1587d48e89cbaa8d0d1c870809bc40c3c8d1056f (diff)
change the tusb_rhport_init_t struct, exclude the rhport to make API more consistent
Diffstat (limited to 'src/device/usbd.h')
-rw-r--r--src/device/usbd.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h
index 05eb0173f..de6007fb3 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -38,19 +38,18 @@ extern "C" {
//--------------------------------------------------------------------+
// New API to replace tud_init() to init device stack on specific roothub port
-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);
// Init device stack on roothub port
#if TUSB_VERSION_NUMBER > 2000 // 0.20.0
-TU_ATTR_DEPRECATED("Please use tusb_init(tusb_rhport_init_t*) instead")
+TU_ATTR_DEPRECATED("Please use tusb_init(rhport, rh_init) instead")
#endif
TU_ATTR_ALWAYS_INLINE static inline bool tud_init (uint8_t rhport) {
const tusb_rhport_init_t rh_init = {
- .rhport = rhport,
.role = TUSB_ROLE_DEVICE,
.speed = TUD_OPT_HIGH_SPEED ? TUSB_SPEED_HIGH : TUSB_SPEED_FULL
};
- return tud_rhport_init(&rh_init);
+ return tud_rhport_init(rhport, &rh_init);
}
// Deinit device stack on roothub port