add callback for hcd when it cleaned up all cache data for a device (previously mark as removing).

This commit is contained in:
hathach
2013-03-22 18:55:45 +07:00
parent 6b276d09bf
commit f6acca6664
4 changed files with 12 additions and 7 deletions

View File

@@ -225,11 +225,15 @@ void usbh_device_unplugged_isr(uint8_t hostid)
usbh_pipe_control_close(dev_addr);
// set to REMOVING to prevent allocate to other new device
// need to set to UNPLUGGED by HCD after freeing all resources
// set to REMOVING to end wait for HCD to clean up its cached data for this device
usbh_device_info_pool[dev_addr].status = TUSB_DEVICE_STATUS_REMOVING;
}
// HCD cleaned up cached data for this device
void usbh_device_hcd_data_cleaned_up_cb(uint8_t dev_addr)
{
usbh_device_info_pool[dev_addr].status = TUSB_DEVICE_STATUS_UNPLUG;
}
//--------------------------------------------------------------------+
// ENUMERATION TASK