2018.07.26
Dependencies: FATFileSystem3 mbed-rtos
Fork of USBHost by
Diff: USBHost/USBHost.cpp
- Revision:
- 32:e6717a485577
- Parent:
- 24:868cbfe611a7
--- a/USBHost/USBHost.cpp Mon Jun 01 11:01:25 2015 +0100 +++ b/USBHost/USBHost.cpp Tue Jun 02 05:57:44 2015 +0000 @@ -146,13 +146,15 @@ res = getDeviceDescriptor(&devices[i], buf, 8); if (res == USB_TYPE_OK) { + break; } Thread::wait(100); } - USB_INFO("New device connected: %p [hub: %d - port: %d]", &devices[i], usb_msg->hub, usb_msg->port); + USB_INFO("新しいデバイスが接続されました。"); + USB_INFO("%p [hub: %d - port: %d]", &devices[i], usb_msg->hub, usb_msg->port); #if MAX_HUB_NB if (buf[4] == HUB_CLASS) { @@ -162,11 +164,14 @@ if (hubs[k].connect(&devices[i])) { devices[i].hub = &hubs[k]; hub_in_use[k] = true; + USB_INFO("XX1"); break; } } - if (hub_in_use[k] == true) - break; + if (hub_in_use[k] == true){ + USB_INFO("XX2"); + break; + } } } @@ -175,15 +180,26 @@ too_many_hub = true; } } + else{ + USB_INFO("XX3"); + } - if (usb_msg->hub_parent) + if (usb_msg->hub_parent){ + USB_INFO("XX31"); ((USBHostHub *)(usb_msg->hub_parent))->deviceConnected(&devices[i]); + } + else{ + USB_INFO("XX4"); + } #endif if ((i < MAX_DEVICE_CONNECTED) && !too_many_hub) { deviceInUse[i] = true; + USB_INFO("XX5"); } - + else{ + deviceInUse[i] = true; + } } while(0); break;