change tusb_init(), tusb_rhport_init() to use init struct for expandability

This commit is contained in:
hathach
2024-10-11 12:58:18 +07:00
parent a4fb8354e4
commit 92602b9de3
46 changed files with 348 additions and 80 deletions

View File

@@ -126,7 +126,13 @@ static void usb_host_task(void *param) {
(void) param;
// init host stack on configured roothub port
if (!tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST)) {
tusb_rhport_init_t host_init = {
.rhport = BOARD_TUH_RHPORT,
.role = TUSB_ROLE_HOST,
.speed = TUSB_SPEED_AUTO
};
if (!tusb_init(&host_init)) {
printf("Failed to init USB Host Stack\r\n");
vTaskSuspend(NULL);
}