mirror of https://github.com/ARMmbed/mbed-os.git
USBHOST : as DISCONNECTED_EVENT from root hub is sent in irq handler
and connection from hub are sent from usb task. A connection on an hub port can be sent , after irq disconnection from root hub.pull/4231/head
parent
41f12260b1
commit
bf2fc0a2cf
|
@ -82,6 +82,24 @@ void USBHost::usb_process()
|
||||||
|
|
||||||
do {
|
do {
|
||||||
Lock lock(this);
|
Lock lock(this);
|
||||||
|
bool hub_unplugged = true;
|
||||||
|
|
||||||
|
int idx = findDevice(usb_msg->hub, usb_msg->port, (USBHostHub *)(usb_msg->hub_parent));
|
||||||
|
/* check that hub is connected to root port */
|
||||||
|
if (usb_msg->hub_parent) {
|
||||||
|
/* a hub device must be present */
|
||||||
|
for (k = 0; k < MAX_HUB_NB; k++) {
|
||||||
|
if ((&hubs[k] == usb_msg->hub_parent) && (hub_in_use[k])) {
|
||||||
|
hub_unplugged=false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
hub_unplugged = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((idx!=-1) && deviceInUse[idx] ) || ((idx == -1) && hub_unplugged)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
for (i =0 ; i < MAX_DEVICE_CONNECTED; i++) {
|
for (i =0 ; i < MAX_DEVICE_CONNECTED; i++) {
|
||||||
if (!deviceInUse[i]) {
|
if (!deviceInUse[i]) {
|
||||||
|
|
Loading…
Reference in New Issue