From cfcef0558a5b8ab797408f998074fa0ba6703ece Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 19 Dec 2013 12:43:22 +0700 Subject: fix plug & unplug issue by reseting port immediately instead of waiting for usbh enumeration task to do so --- tinyusb/host/ohci/ohci.c | 1 + tinyusb/host/usbh.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'tinyusb/host') diff --git a/tinyusb/host/ohci/ohci.c b/tinyusb/host/ohci/ohci.c index b108dfe16..68954f83e 100644 --- a/tinyusb/host/ohci/ohci.c +++ b/tinyusb/host/ohci/ohci.c @@ -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 { diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c index e701d2605..7b358e2f2 100644 --- a/tinyusb/host/usbh.c +++ b/tinyusb/host/usbh.c @@ -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 -- cgit v1.3.1