summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorheyuanjie87 <[email protected]>2023-08-11 17:44:36 +0800
committersakumisu <[email protected]>2023-08-13 09:40:01 +0800
commit2789633b50d0b9d511a1adf3e7770500dbc31b71 (patch)
tree868de6c689c793fe6706ee3426401b698b3ce3f1
parent94505f9e417a954ec29c8a0cc1806d79e2e3274c (diff)
[hub 修正] 快速断开的情况下无法处理断开事件
-rw-r--r--class/hub/usbh_hub.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/class/hub/usbh_hub.c b/class/hub/usbh_hub.c
index 7c4ec7ba..2a124386 100644
--- a/class/hub/usbh_hub.c
+++ b/class/hub/usbh_hub.c
@@ -460,9 +460,10 @@ static void usbh_hub_events(struct usbh_hub *hub)
return;
}
- for (uint8_t port = 0; port < hub->hub_desc.bNbrPorts; port++) {
- portchange_index = hub->int_buffer[0];
+ portchange_index = hub->int_buffer[0];
+ hub->int_buffer[0] = 0;
+ for (uint8_t port = 0; port < hub->hub_desc.bNbrPorts; port++) {
USB_LOG_DBG("Port change:0x%02x\r\n", portchange_index);
if (!(portchange_index & (1 << (port + 1)))) {
@@ -625,7 +626,6 @@ static void usbh_hub_events(struct usbh_hub *hub)
}
}
- hub->int_buffer[0] = 0;
/* Start next hub int transfer */
if (!hub->is_roothub && hub->connected) {
usbh_submit_urb(&hub->intin_urb);