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:
hathach
2024-10-10 16:22:12 +07:00
parent ffdf81f53a
commit 57aac432b5
59 changed files with 192 additions and 286 deletions

View File

@@ -79,8 +79,8 @@ int main(void) {
printf("TinyUSB Host HID <-> Device CDC Example\r\n");
// init device and host stack on configured roothub port
tud_init(BOARD_TUD_RHPORT);
tuh_init(BOARD_TUH_RHPORT);
tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE);
tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST);
if (board_init_after_tusb) {
board_init_after_tusb();

View File

@@ -82,8 +82,8 @@ int main(void) {
printf("TinyUSB Host Information -> Device CDC Example\r\n");
// init device and host stack on configured roothub port
tud_init(BOARD_TUD_RHPORT);
tuh_init(BOARD_TUH_RHPORT);
tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE);
tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST);
if (board_init_after_tusb) {
board_init_after_tusb();