summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-02-26 18:02:09 +0700
committerhathach <[email protected]>2026-02-26 18:02:09 +0700
commitfd933642df6a687d4452275d277e9479870f806c (patch)
treecc07b93d154f8ab92c925849a44492bf3aeac701 /src
parentabdf3452ac5657d880d944201ef21ff18263311a (diff)
fix fallthrough
Diffstat (limited to 'src')
-rw-r--r--src/host/usbh.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c
index ef2e22a16..76269eb2f 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -1516,7 +1516,16 @@ static void enum_async_delay(uintptr_t state) {
tuh_bus_info_t *dev0_bus = &_usbh_data.dev0_bus;
switch (state) {
case ENUM_AFTER_DEBOUNCING_DELAY:
- if (dev0_bus->hub_addr == 0) {
+ #if CFG_TUH_HUB
+ if (dev0_bus->hub_addr != 0) {
+ // connected via hub
+ TU_VERIFY(dev0_bus->hub_port != 0, );
+ TU_ASSERT(hub_port_get_status(dev0_bus->hub_addr, dev0_bus->hub_port, NULL, process_enumeration,
+ ENUM_HUB_RERSET), );
+ break;
+ } else
+ #endif
+ {
// connected directly to roothub
_usbh_data.attach_debouncing_bm &= (uint8_t)~TU_BIT(dev0_bus->rhport); // clear roothub debouncing delay
if (!hcd_port_connect_status(dev0_bus->rhport)) {
@@ -1527,15 +1536,6 @@ static void enum_async_delay(uintptr_t state) {
hcd_port_reset(dev0_bus->rhport); // reset port
ENUM_ASYNC_DELAY_OR_FALLTHROUGH(ENUM_RESET_ROOT_DELAY_MS, ENUM_AFTER_RESET_ROOT_DELAY);
}
- #if CFG_TUH_HUB
- else {
- // connected via hub
- TU_VERIFY(dev0_bus->hub_port != 0, );
- TU_ASSERT(hub_port_get_status(dev0_bus->hub_addr, dev0_bus->hub_port, NULL, process_enumeration,
- ENUM_HUB_RERSET), );
- break;
- }
- #endif // hub
case ENUM_AFTER_RESET_ROOT_DELAY:
hcd_port_reset_end(dev0_bus->rhport);