浏览代码

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;
}



正在加载...
取消
保存