refractor hub api

fix all test build errors
This commit is contained in:
hathach
2013-10-16 11:05:33 +07:00
parent 3d13516106
commit de7e21dc66
21 changed files with 124 additions and 32 deletions

View File

@@ -273,19 +273,29 @@ void usbh_xfer_isr(pipe_handle_t pipe_hdl, uint8_t class_code, tusb_event_t even
}
}
void usbh_hcd_rhport_plugged_isr(uint8_t hostid, uint8_t hub_addr, uint8_t hub_port)
void usbh_hub_port_plugged_isr(uint8_t hub_addr, uint8_t hub_port)
{
osal_queue_send(enum_queue_hdl,
&(usbh_enumerate_t){
.core_id = hostid,
.core_id = usbh_devices[hub_addr].core_id,
.hub_addr = hub_addr,
.hub_port = hub_port}
);
}
void usbh_hcd_rhport_plugged_isr(uint8_t hostid)
{
osal_queue_send(enum_queue_hdl,
&(usbh_enumerate_t){
.core_id = hostid,
.hub_addr = 0,
.hub_port = 0}
);
}
// a device unplugged on hostid, hub_addr, hub_port
// return true if found and unmounted device, false if cannot find
void usbh_device_unplugged(uint8_t hostid, uint8_t hub_addr, uint8_t hub_port)
static void usbh_device_unplugged(uint8_t hostid, uint8_t hub_addr, uint8_t hub_port)
{
bool is_found = false;
//------------- find the all devices (star-network) under port that is unplugged -------------//
@@ -316,7 +326,7 @@ void usbh_device_unplugged(uint8_t hostid, uint8_t hub_addr, uint8_t hub_port)
}
}
if (is_found) hcd_hub_advance_asyn(usbh_devices[0].core_id); // TODO hack
if (is_found) hcd_port_unplug(usbh_devices[0].core_id); // TODO hack
}