add new tusb_int_handler(rhport, in_isr) as common irq handler
update tusb_init() to take rhport and role, defined as macro with optional argument for backward compatible
This commit is contained in:
@@ -62,7 +62,7 @@ int main(void)
|
||||
printf("TinyUSB Bare API Example\r\n");
|
||||
|
||||
// init host stack on configured roothub port
|
||||
tuh_init(BOARD_TUH_RHPORT);
|
||||
tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST);
|
||||
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
|
@@ -50,7 +50,7 @@ int main(void) {
|
||||
printf("TinyUSB Host CDC MSC HID Example\r\n");
|
||||
|
||||
// init host stack on configured roothub port
|
||||
tuh_init(BOARD_TUH_RHPORT);
|
||||
tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST);
|
||||
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
|
@@ -126,7 +126,7 @@ static void usb_host_task(void *param) {
|
||||
(void) param;
|
||||
|
||||
// init host stack on configured roothub port
|
||||
if (!tuh_init(BOARD_TUH_RHPORT)) {
|
||||
if (!tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST)) {
|
||||
printf("Failed to init USB Host Stack\r\n");
|
||||
vTaskSuspend(NULL);
|
||||
}
|
||||
|
@@ -19,13 +19,13 @@ add_executable(${PROJECT})
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
)
|
||||
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Configure compilation flags and libraries for the example without RTOS.
|
||||
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
|
||||
|
@@ -4,11 +4,11 @@ mcu:LPC177X_8X
|
||||
mcu:LPC18XX
|
||||
mcu:LPC40XX
|
||||
mcu:LPC43XX
|
||||
mcu:MAX3421
|
||||
mcu:MIMXRT1XXX
|
||||
mcu:MIMXRT10XX
|
||||
mcu:MIMXRT11XX
|
||||
mcu:RP2040
|
||||
mcu:MSP432E4
|
||||
mcu:RP2040
|
||||
mcu:RX65X
|
||||
mcu:RAXXX
|
||||
mcu:MAX3421
|
||||
|
@@ -66,7 +66,7 @@ int main(void) {
|
||||
printf("TinyUSB Device Info Example\r\n");
|
||||
|
||||
// init host stack on configured roothub port
|
||||
tuh_init(BOARD_TUH_RHPORT);
|
||||
tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST);
|
||||
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
|
@@ -52,7 +52,7 @@ 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_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST);
|
||||
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
|
@@ -78,7 +78,7 @@ int main(void) {
|
||||
printf("TinyUSB Host MassStorage Explorer Example\r\n");
|
||||
|
||||
// init host stack on configured roothub port
|
||||
tuh_init(BOARD_TUH_RHPORT);
|
||||
tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST);
|
||||
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
|
Reference in New Issue
Block a user