rename hcd_device_remove to hcd_device_close
This commit is contained in:
		@@ -181,7 +181,7 @@ static void list_remove_qhd_by_addr(ehci_link_t* list_head, uint8_t dev_addr)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Close all opened endpoint belong to this device
 | 
			
		||||
void hcd_device_remove(uint8_t rhport, uint8_t dev_addr)
 | 
			
		||||
void hcd_device_close(uint8_t rhport, uint8_t dev_addr)
 | 
			
		||||
{
 | 
			
		||||
  // skip dev0
 | 
			
		||||
  if (dev_addr == 0) return;
 | 
			
		||||
 
 | 
			
		||||
@@ -108,8 +108,8 @@ bool hcd_port_connect_status(uint8_t hostid);
 | 
			
		||||
void hcd_port_reset(uint8_t hostid);
 | 
			
		||||
tusb_speed_t hcd_port_speed_get(uint8_t hostid);
 | 
			
		||||
 | 
			
		||||
// HCD closs all opened endpoints belong to this device
 | 
			
		||||
void hcd_device_remove(uint8_t rhport, uint8_t dev_addr);
 | 
			
		||||
// HCD closes all opened endpoints belong to this device
 | 
			
		||||
void hcd_device_close(uint8_t rhport, uint8_t dev_addr);
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------+
 | 
			
		||||
// Event function
 | 
			
		||||
 
 | 
			
		||||
@@ -216,7 +216,7 @@ tusb_speed_t hcd_port_speed_get(uint8_t hostid)
 | 
			
		||||
 | 
			
		||||
// endpoints are tied to an address, which only reclaim after a long delay when enumerating
 | 
			
		||||
// thus there is no need to make sure ED is not in HC's cahed as it will not for sure
 | 
			
		||||
void hcd_device_remove(uint8_t rhport, uint8_t dev_addr)
 | 
			
		||||
void hcd_device_close(uint8_t rhport, uint8_t dev_addr)
 | 
			
		||||
{
 | 
			
		||||
  // TODO OHCI
 | 
			
		||||
  (void) rhport;
 | 
			
		||||
 
 | 
			
		||||
@@ -334,7 +334,7 @@ static void usbh_device_unplugged(uint8_t rhport, uint8_t hub_addr, uint8_t hub_
 | 
			
		||||
      memset(dev->itf2drv, 0xff, sizeof(dev->itf2drv)); // invalid mapping
 | 
			
		||||
      memset(dev->ep2drv , 0xff, sizeof(dev->ep2drv )); // invalid mapping
 | 
			
		||||
 | 
			
		||||
      hcd_device_remove(rhport, dev_addr);
 | 
			
		||||
      hcd_device_close(rhport, dev_addr);
 | 
			
		||||
 | 
			
		||||
      dev->state = TUSB_DEVICE_STATE_UNPLUG;
 | 
			
		||||
    }
 | 
			
		||||
@@ -495,7 +495,7 @@ bool enum_task(hcd_event_t* event)
 | 
			
		||||
  new_dev->speed    = dev0->speed;
 | 
			
		||||
  new_dev->state    = TUSB_DEVICE_STATE_ADDRESSED;
 | 
			
		||||
 | 
			
		||||
  hcd_device_remove(dev0->rhport, 0); // close device 0
 | 
			
		||||
  hcd_device_close(dev0->rhport, 0); // close device 0
 | 
			
		||||
  dev0->state = TUSB_DEVICE_STATE_UNPLUG;
 | 
			
		||||
 | 
			
		||||
  // open control pipe for new address
 | 
			
		||||
 
 | 
			
		||||
@@ -42,10 +42,6 @@
 | 
			
		||||
 | 
			
		||||
#include "chip.h"
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------+
 | 
			
		||||
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
 | 
			
		||||
//--------------------------------------------------------------------+
 | 
			
		||||
 | 
			
		||||
void hcd_int_enable(uint8_t rhport)
 | 
			
		||||
{
 | 
			
		||||
  NVIC_EnableIRQ(rhport ? USB1_IRQn : USB0_IRQn);
 | 
			
		||||
@@ -55,4 +51,5 @@ void hcd_int_disable(uint8_t rhport)
 | 
			
		||||
{
 | 
			
		||||
  NVIC_DisableIRQ(rhport ? USB1_IRQn : USB0_IRQn);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user