Explorar el Código

implement port hcd_port_connect_status
clean up

hathach hace 13 años
padre
commit
60c2caf84a
Se han modificado 2 ficheros con 3 adiciones y 9 borrados
  1. 1 6
      tinyusb/host/ehci/ehci.c
  2. 2 3
      tinyusb/host/hcd.h

+ 1 - 6
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;
 }
 
 //--------------------------------------------------------------------+

+ 2 - 3
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
  }