mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
fix plug & unplug issue by reseting port immediately instead of waiting for usbh enumeration task to do so
This commit is contained in:
parent
fce6252456
commit
cfcef0558a
@ -60,14 +60,14 @@
|
||||
//--------------------------------------------------------------------+
|
||||
// HOST CONFIGURATION
|
||||
//--------------------------------------------------------------------+
|
||||
#define TUSB_CFG_HOST_DEVICE_MAX 3
|
||||
#define TUSB_CFG_HOST_DEVICE_MAX 1
|
||||
#define TUSB_CFG_CONFIGURATION_MAX 1
|
||||
|
||||
//------------- USBD -------------//
|
||||
#define TUSB_CFG_HOST_ENUM_BUFFER_SIZE 255
|
||||
|
||||
//------------- CLASS -------------//
|
||||
#define TUSB_CFG_HOST_HUB 1
|
||||
#define TUSB_CFG_HOST_HUB 0
|
||||
#define TUSB_CFG_HOST_HID_KEYBOARD 0
|
||||
#define TUSB_CFG_HOST_HID_MOUSE 1
|
||||
#define TUSB_CFG_HOST_HID_GENERIC 0
|
||||
|
@ -666,6 +666,7 @@ void hcd_isr(uint8_t hostid)
|
||||
{
|
||||
if ( OHCI_REG->rhport_status_bit[0].current_connect_status )
|
||||
{
|
||||
OHCI_REG->rhport_status[0] = OHCI_RHPORT_PORT_RESET_STATUS_MASK;
|
||||
usbh_hcd_rhport_plugged_isr(0);
|
||||
}else
|
||||
{
|
||||
|
@ -374,9 +374,9 @@ tusb_error_t enumeration_body_subtask(void)
|
||||
{ // connected/disconnected directly with roothub
|
||||
if( hcd_port_connect_status(usbh_devices[0].core_id) )
|
||||
{ // connection event
|
||||
osal_task_delay(200); // wait for device is stable
|
||||
hcd_port_reset( usbh_devices[0].core_id ); // port must be reset to have correct speed operation
|
||||
osal_task_delay(50); // TODO reset is recommended to last 50 ms (NXP EHCI passes this)
|
||||
osal_task_delay(200); // wait for port reset is complete & device is stable
|
||||
// hcd_port_reset( usbh_devices[0].core_id ); // port must be reset to have correct speed operation
|
||||
// osal_task_delay(50); // TODO reset is recommended to last 50 ms (NXP EHCI passes this)
|
||||
usbh_devices[0].speed = hcd_port_speed_get( usbh_devices[0].core_id );
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user