瀏覽代碼

Disconnect downstream deviecs with hub disconnects

main
PaulStoffregen 7 年之前
父節點
當前提交
be1004e0f4
共有 1 個檔案被更改,包括 20 行新增1 行删除
  1. +20
    -1
      hub.cpp

+ 20
- 1
hub.cpp 查看文件

@@ -464,7 +464,26 @@ void USBHub::stop_debounce_timer(uint32_t port)

void USBHub::disconnect()
{
// TODO: free resources
// disconnect all downstream devices, which may be more hubs
for (uint32_t i=0; i < numports; i++) {
if (devicelist[i]) disconnect_Device(devicelist[i]);
}
numports = 0;
changepipe = NULL;
changebits = 0;
sending_control_transfer = 0;
port_doing_reset = 0;
memset(portstate, 0, sizeof(portstate));
memset(devicelist, 0, sizeof(devicelist));
send_pending_poweron = 0;
send_pending_getstatus = 0;
send_pending_clearstatus_connect = 0;
send_pending_clearstatus_enable = 0;
send_pending_clearstatus_suspend = 0;
send_pending_clearstatus_overcurrent = 0;
send_pending_clearstatus_reset = 0;
send_pending_setreset = 0;
debounce_in_use = 0;
}



Loading…
取消
儲存