diff options
| author | Ha Thach <[email protected]> | 2024-10-14 21:38:45 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-10-14 21:38:45 +0700 |
| commit | 933ac29d77f54c68cbb41f09b74e78f868a2b4a7 (patch) | |
| tree | f7c11374731a6aa9352464f065169d30d28d16c2 /examples/host | |
| parent | a4fb8354e41b2604f66e7da22afa292b1a44f0a2 (diff) | |
| parent | e83e08343afca86b2bacf26822ef9032571e6f56 (diff) | |
Merge pull request #2836 from hathach/more-tusb_init()
change tusb_init() to use init struct
Diffstat (limited to 'examples/host')
| -rw-r--r-- | examples/host/bare_api/src/main.c | 6 | ||||
| -rw-r--r-- | examples/host/cdc_msc_hid/src/main.c | 6 | ||||
| -rw-r--r-- | examples/host/cdc_msc_hid_freertos/src/main.c | 7 | ||||
| -rw-r--r-- | examples/host/device_info/src/main.c | 6 | ||||
| -rw-r--r-- | examples/host/hid_controller/src/main.c | 6 | ||||
| -rw-r--r-- | examples/host/msc_file_explorer/src/main.c | 6 |
6 files changed, 31 insertions, 6 deletions
diff --git a/examples/host/bare_api/src/main.c b/examples/host/bare_api/src/main.c index f248dd28d..f582f4f5a 100644 --- a/examples/host/bare_api/src/main.c +++ b/examples/host/bare_api/src/main.c @@ -62,7 +62,11 @@ int main(void) printf("TinyUSB Bare API Example\r\n"); // init host stack on configured roothub port - tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST); + tusb_rhport_init_t host_init = { + .role = TUSB_ROLE_HOST, + .speed = TUSB_SPEED_AUTO + }; + tusb_init(BOARD_TUH_RHPORT, &host_init); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/host/cdc_msc_hid/src/main.c b/examples/host/cdc_msc_hid/src/main.c index 65f7b5201..71257c0fe 100644 --- a/examples/host/cdc_msc_hid/src/main.c +++ b/examples/host/cdc_msc_hid/src/main.c @@ -50,7 +50,11 @@ int main(void) { printf("TinyUSB Host CDC MSC HID Example\r\n"); // init host stack on configured roothub port - tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST); + tusb_rhport_init_t host_init = { + .role = TUSB_ROLE_HOST, + .speed = TUSB_SPEED_AUTO + }; + tusb_init(BOARD_TUH_RHPORT, &host_init); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/host/cdc_msc_hid_freertos/src/main.c b/examples/host/cdc_msc_hid_freertos/src/main.c index 2116e6dcf..7fb84a40f 100644 --- a/examples/host/cdc_msc_hid_freertos/src/main.c +++ b/examples/host/cdc_msc_hid_freertos/src/main.c @@ -126,7 +126,12 @@ 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 = { + .role = TUSB_ROLE_HOST, + .speed = TUSB_SPEED_AUTO + }; + + if (!tusb_init(BOARD_TUH_RHPORT, &host_init)) { printf("Failed to init USB Host Stack\r\n"); vTaskSuspend(NULL); } diff --git a/examples/host/device_info/src/main.c b/examples/host/device_info/src/main.c index 55d685a5d..0ff4f32e9 100644 --- a/examples/host/device_info/src/main.c +++ b/examples/host/device_info/src/main.c @@ -66,7 +66,11 @@ int main(void) { printf("TinyUSB Device Info Example\r\n"); // init host stack on configured roothub port - tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST); + tusb_rhport_init_t host_init = { + .role = TUSB_ROLE_HOST, + .speed = TUSB_SPEED_AUTO + }; + tusb_init(BOARD_TUH_RHPORT, &host_init); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/host/hid_controller/src/main.c b/examples/host/hid_controller/src/main.c index 76b686683..ba12774bd 100644 --- a/examples/host/hid_controller/src/main.c +++ b/examples/host/hid_controller/src/main.c @@ -52,7 +52,11 @@ int main(void) printf("Note: Events only displayed for explicit supported controllers\r\n"); // init host stack on configured roothub port - tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST); + tusb_rhport_init_t host_init = { + .role = TUSB_ROLE_HOST, + .speed = TUSB_SPEED_AUTO + }; + tusb_init(BOARD_TUH_RHPORT, &host_init); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/host/msc_file_explorer/src/main.c b/examples/host/msc_file_explorer/src/main.c index 3af079b0e..9509035b4 100644 --- a/examples/host/msc_file_explorer/src/main.c +++ b/examples/host/msc_file_explorer/src/main.c @@ -78,7 +78,11 @@ int main(void) { printf("TinyUSB Host MassStorage Explorer Example\r\n"); // init host stack on configured roothub port - tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST); + tusb_rhport_init_t host_init = { + .role = TUSB_ROLE_HOST, + .speed = TUSB_SPEED_AUTO + }; + tusb_init(BOARD_TUH_RHPORT, &host_init); if (board_init_after_tusb) { board_init_after_tusb(); |
