summaryrefslogtreecommitdiff
path: root/tinyusb
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-03-12 16:46:47 +0700
committerhathach <[email protected]>2013-03-12 16:46:47 +0700
commit60c2caf84a4ee9e9095925186de0cd275005b2fc (patch)
tree7f3d5dc55285e7c47ca72e87f31ed3bc8281e634 /tinyusb
parent80facf6f2ec06b3c0c6cb1061ea27d75c26557d2 (diff)
implement port hcd_port_connect_status
clean up
Diffstat (limited to 'tinyusb')
-rw-r--r--tinyusb/host/ehci/ehci.c7
-rw-r--r--tinyusb/host/hcd.h5
2 files changed, 3 insertions, 9 deletions
diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c
index 6caf1e71c..078cf6261 100644
--- a/tinyusb/host/ehci/ehci.c
+++ b/tinyusb/host/ehci/ehci.c
@@ -152,12 +152,7 @@ void hcd_port_reset(uint8_t hostid)
bool hcd_port_connect_status(uint8_t hostid)
{
- return false;
-}
-
-tusb_speed_t hcd_port_speed(uint8_t hostid)
-{
- return TUSB_SPEED_HIGH;
+ return get_operational_register(hostid)->portsc_bit.current_connect_status;
}
//--------------------------------------------------------------------+
diff --git a/tinyusb/host/hcd.h b/tinyusb/host/hcd.h
index 95eea8718..98b5e5c5c 100644
--- a/tinyusb/host/hcd.h
+++ b/tinyusb/host/hcd.h
@@ -91,9 +91,8 @@ tusb_error_t hcd_pipe_cancel()ATTR_WARN_UNUSED_RESULT;
// PORT API
//--------------------------------------------------------------------+
/// return the current connect status of roothub port
-bool hcd_port_connect_status(uint8_t core_id) ATTR_WARN_UNUSED_RESULT;
-tusb_speed_t hcd_port_speed(uint8_t core_id) ATTR_WARN_UNUSED_RESULT;
-//tusb_error_t hcd_port_reset(uint8_t core_id) ATTR_WARN_UNUSED_RESULT;
+bool hcd_port_connect_status(uint8_t core_id) ATTR_CONST ATTR_WARN_UNUSED_RESULT;
+void hcd_port_reset(uint8_t core_id);
#ifdef __cplusplus
}