From e3514b80543ac2514a80d886255bd8e33b325750 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 12 Dec 2018 11:32:46 +0700 Subject: [PATCH] rename hcd_device_remove to hcd_device_close --- src/host/ehci/ehci.c | 2 +- src/host/hcd.h | 4 ++-- src/host/ohci/ohci.c | 2 +- src/host/usbh.c | 4 ++-- src/portable/nxp/lpc18_43/hcd_lpc18_43.c | 5 +---- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/host/ehci/ehci.c b/src/host/ehci/ehci.c index 146ab061..ef5510a6 100644 --- a/src/host/ehci/ehci.c +++ b/src/host/ehci/ehci.c @@ -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; diff --git a/src/host/hcd.h b/src/host/hcd.h index 1496d462..f93cbd2c 100644 --- a/src/host/hcd.h +++ b/src/host/hcd.h @@ -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 diff --git a/src/host/ohci/ohci.c b/src/host/ohci/ohci.c index 669aa2a1..c35eaa77 100644 --- a/src/host/ohci/ohci.c +++ b/src/host/ohci/ohci.c @@ -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; diff --git a/src/host/usbh.c b/src/host/usbh.c index 31024f1f..962dc04d 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -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 diff --git a/src/portable/nxp/lpc18_43/hcd_lpc18_43.c b/src/portable/nxp/lpc18_43/hcd_lpc18_43.c index 141a7765..efdf8fea 100644 --- a/src/portable/nxp/lpc18_43/hcd_lpc18_43.c +++ b/src/portable/nxp/lpc18_43/hcd_lpc18_43.c @@ -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