diff options
Diffstat (limited to 'examples/host/hid_controller/src/main.c')
| -rw-r--r-- | examples/host/hid_controller/src/main.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/examples/host/hid_controller/src/main.c b/examples/host/hid_controller/src/main.c index 299a3ff10..ba12774bd 100644 --- a/examples/host/hid_controller/src/main.c +++ b/examples/host/hid_controller/src/main.c @@ -1,4 +1,4 @@ -/* +/* * The MIT License (MIT) * * Copyright (c) 2019 Ha Thach (tinyusb.org) @@ -32,7 +32,7 @@ #include <stdio.h> #include <string.h> -#include "bsp/board.h" +#include "bsp/board_api.h" #include "tusb.h" //--------------------------------------------------------------------+ @@ -52,7 +52,15 @@ int main(void) printf("Note: Events only displayed for explicit supported controllers\r\n"); // init host stack on configured roothub port - tuh_init(BOARD_TUH_RHPORT); + 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(); + } while (1) { @@ -68,8 +76,6 @@ int main(void) hid_app_task(); #endif } - - return 0; } //--------------------------------------------------------------------+ |
