summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2022-06-14 22:08:49 +0800
committersakumisu <[email protected]>2022-06-14 22:08:49 +0800
commitb57d3637bb134996f60c6d4a3c88986a8b416bc9 (patch)
treee78a029ba7caf13f4dcd8bbc801fb66645b9b039 /core
parenta31e56f13eba2a3761b994189a4fd7f892d2ba42 (diff)
add sw init for os and hw init for host controller
Diffstat (limited to 'core')
-rw-r--r--core/usbh_core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/usbh_core.c b/core/usbh_core.c
index 93cd1bf3..26a495b4 100644
--- a/core/usbh_core.c
+++ b/core/usbh_core.c
@@ -745,13 +745,15 @@ static void usbh_portchange_detect_thread(void *argument)
{
struct usbh_hubport *hport = NULL;
+ usb_hc_sw_init();
+
for (uint8_t port = USBH_HUB_PORT_START_INDEX; port <= CONFIG_USBHOST_RHPORTS; port++) {
usbh_core_cfg.rhport[port - 1].hport.port = port;
usbh_core_cfg.rhport[port - 1].devgen.next = 1;
usbh_hport_activate(&usbh_core_cfg.rhport[port - 1].hport);
}
- usb_hc_init();
+ usb_hc_hw_init();
while (1) {
usbh_portchange_wait(&hport);
@@ -844,9 +846,8 @@ int usbh_initialize(void)
usbh_class_info_table_end = (struct usbh_class_info *)(class_info_table[0] + (sizeof(class_info_table) / sizeof(class_info_table[0])));
#endif
-#ifdef CONFIG_USBHOST_HUB
usbh_workq_initialize();
-#endif
+
usbh_core_cfg.pscevent = usb_osal_event_create();
if (usbh_core_cfg.pscevent == NULL) {
return -1;