diff options
| author | sakumisu <[email protected]> | 2022-12-03 19:29:18 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2022-12-03 19:29:18 +0800 |
| commit | 77f0afb94fe6c1660753eb08652888a8435140ba (patch) | |
| tree | 9400c3d84c250be902db08ba56c9f4c8a865b6d6 | |
| parent | 7e749a8a7bc649cc25aa150455c7129797ef9fec (diff) | |
remove roothub parent hport to reduce codesize
| -rw-r--r-- | class/hub/usbh_hub.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/class/hub/usbh_hub.c b/class/hub/usbh_hub.c index d4dc216c..e7af8299 100644 --- a/class/hub/usbh_hub.c +++ b/class/hub/usbh_hub.c @@ -24,7 +24,6 @@ usb_osal_sem_t hub_event_wait; usb_osal_thread_t hub_thread; USB_NOCACHE_RAM_SECTION struct usbh_hub roothub; -struct usbh_hubport roothub_parent_port; USB_NOCACHE_RAM_SECTION struct usbh_hub exthub[CONFIG_USBHOST_MAX_EXTHUBS]; @@ -346,14 +345,12 @@ static int usbh_hub_disconnect(struct usbh_hubport *hport, uint8_t intf) static void usbh_roothub_register(void) { memset(&roothub, 0, sizeof(struct usbh_hub)); - memset(&roothub_parent_port, 0, sizeof(struct usbh_hubport)); - roothub_parent_port.port = 1; - roothub_parent_port.dev_addr = 1; + roothub.connected = true; roothub.index = 1; roothub.is_roothub = true; - roothub.parent = &roothub_parent_port; - roothub.hub_addr = roothub_parent_port.dev_addr; + roothub.parent = NULL; + roothub.hub_addr = 1; roothub.hub_desc.bNbrPorts = CONFIG_USBHOST_MAX_RHPORTS; usbh_hub_register(&roothub); } |
