summaryrefslogtreecommitdiff
path: root/tinyusb/host/ehci
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-04-25 17:48:55 +0700
committerhathach <[email protected]>2013-04-25 17:48:55 +0700
commitc0104b996e9ea0c5c25861ccf24e0255431a8f9c (patch)
treee6bc02cedad783d2c4d771ac4a9633be23b982d5 /tinyusb/host/ehci
parent3763e22c9a91e9bb21f9fa3dc5dafc9eea6254b7 (diff)
implement hcd_port_speed_get
move port reset & speed detection from isr context to usbh enumeration task - decrease time in isr significantly from 50 ms to 580us fix bug with osal_task_delay for freeRTOS buil
Diffstat (limited to 'tinyusb/host/ehci')
-rw-r--r--tinyusb/host/ehci/ehci.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c
index a91f62ef8..cef713133 100644
--- a/tinyusb/host/ehci/ehci.c
+++ b/tinyusb/host/ehci/ehci.c
@@ -137,7 +137,7 @@ void hcd_port_reset(uint8_t hostid)
#ifndef _TEST_
// NXP specific, port reset will automatically be 0 when reset sequence complete
// there is chance device is unplugged while reset sequence is not complete
- while( regs->portsc_bit.port_reset) {}
+ while( regs->portsc_bit.port_reset) {} // TODO use task delay to remove blocking
#endif
}
@@ -146,6 +146,11 @@ bool hcd_port_connect_status(uint8_t hostid)
return get_operational_register(hostid)->portsc_bit.current_connect_status;
}
+tusb_speed_t hcd_port_speed_get(uint8_t hostid)
+{
+ return get_operational_register(hostid)->portsc_bit.nxp_port_speed; // NXP specific port speed
+}
+
//--------------------------------------------------------------------+
// Controller API
//--------------------------------------------------------------------+
@@ -479,8 +484,7 @@ void port_connect_status_change_isr(uint8_t hostid)
if (regs->portsc_bit.current_connect_status) // device plugged
{
- hcd_port_reset(hostid);
- usbh_device_plugged_isr(hostid, regs->portsc_bit.nxp_port_speed); // NXP specific port speed
+ usbh_device_plugged_isr(hostid);
}else // device unplugged
{
usbh_device_unplugged_isr(hostid);