summaryrefslogtreecommitdiff
path: root/examples/device/video_capture/src
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2024-10-14 21:38:45 +0700
committerGitHub <[email protected]>2024-10-14 21:38:45 +0700
commit933ac29d77f54c68cbb41f09b74e78f868a2b4a7 (patch)
treef7c11374731a6aa9352464f065169d30d28d16c2 /examples/device/video_capture/src
parenta4fb8354e41b2604f66e7da22afa292b1a44f0a2 (diff)
parente83e08343afca86b2bacf26822ef9032571e6f56 (diff)
Merge pull request #2836 from hathach/more-tusb_init()
change tusb_init() to use init struct
Diffstat (limited to 'examples/device/video_capture/src')
-rw-r--r--examples/device/video_capture/src/main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/examples/device/video_capture/src/main.c b/examples/device/video_capture/src/main.c
index 4b8877a2f..aeeeb8930 100644
--- a/examples/device/video_capture/src/main.c
+++ b/examples/device/video_capture/src/main.c
@@ -68,7 +68,11 @@ int main(void) {
freertos_init_task();
#else
// init device stack on configured roothub port
- tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE);
+ tusb_rhport_init_t dev_init = {
+ .role = TUSB_ROLE_DEVICE,
+ .speed = TUSB_SPEED_AUTO
+ };
+ tusb_init(BOARD_TUD_RHPORT, &dev_init);
if (board_init_after_tusb) {
board_init_after_tusb();
@@ -319,7 +323,11 @@ void usb_device_task(void *param) {
// init device stack on configured roothub port
// This should be called after scheduler/kernel is started.
// Otherwise, it could cause kernel issue since USB IRQ handler does use RTOS queue API.
- tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE);
+ tusb_rhport_init_t dev_init = {
+ .role = TUSB_ROLE_DEVICE,
+ .speed = TUSB_SPEED_AUTO
+ };
+ tusb_init(BOARD_TUD_RHPORT, &dev_init);
if (board_init_after_tusb) {
board_init_after_tusb();