[hub 修正] 快速断开的情况下无法处理断开事件
This commit is contained in:
@@ -460,9 +460,10 @@ static void usbh_hub_events(struct usbh_hub *hub)
|
|||||||
return;
|
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);
|
USB_LOG_DBG("Port change:0x%02x\r\n", portchange_index);
|
||||||
|
|
||||||
if (!(portchange_index & (1 << (port + 1)))) {
|
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 */
|
/* Start next hub int transfer */
|
||||||
if (!hub->is_roothub && hub->connected) {
|
if (!hub->is_roothub && hub->connected) {
|
||||||
usbh_submit_urb(&hub->intin_urb);
|
usbh_submit_urb(&hub->intin_urb);
|
||||||
|
|||||||
Reference in New Issue
Block a user