diff options
| author | Ha Thach <[email protected]> | 2024-10-10 17:00:40 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-10-10 17:00:40 +0700 |
| commit | a4fb8354e41b2604f66e7da22afa292b1a44f0a2 (patch) | |
| tree | 1e980f0c18f558e3041dbef3021afa346297a85d /src/host | |
| parent | ffdf81f53a84111a2536defa86e4a637c3c46854 (diff) | |
| parent | 57aac432b52df6d284c98daf591e661d1c55aa05 (diff) | |
Merge pull request #2834 from hathach/add-tusb_int_handler-update-tinyusb_init
add new tusb_int_handler(rhport, in_isr) and update tusb_init(rhport, role)
Diffstat (limited to 'src/host')
| -rw-r--r-- | src/host/usbh.c | 2 | ||||
| -rw-r--r-- | src/host/usbh.h | 5 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c index 8c488aaa2..ed253ffcc 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -459,7 +459,7 @@ bool tuh_task_event_ready(void) { int main(void) { application_init(); - tusb_init(); + tusb_init(0, TUSB_ROLE_HOST); while(1) // the mainloop { diff --git a/src/host/usbh.h b/src/host/usbh.h index d0a5732e5..217cb1a9c 100644 --- a/src/host/usbh.h +++ b/src/host/usbh.h @@ -149,12 +149,9 @@ extern void hcd_int_handler(uint8_t rhport, bool in_isr); #endif // Interrupt handler alias to HCD with in_isr as optional parameter -// - tuh_int_handler(rhport) --> hcd_int_handler(rhport, true) -// - tuh_int_handler(rhport, in_isr) --> hcd_int_handler(rhport, in_isr) -// Note: this is similar to TU_VERIFY(), _GET_3RD_ARG() is defined in tusb_verify.h #define _tuh_int_handler_1arg(_rhport) hcd_int_handler(_rhport, true) #define _tuh_int_hanlder_2arg(_rhport, _in_isr) hcd_int_handler(_rhport, _in_isr) -#define tuh_int_handler(...) _GET_3RD_ARG(__VA_ARGS__, _tuh_int_hanlder_2arg, _tuh_int_handler_1arg, _dummy)(__VA_ARGS__) +#define tuh_int_handler(...) TU_GET_3RD_ARG(__VA_ARGS__, _tuh_int_hanlder_2arg, _tuh_int_handler_1arg, _dummy)(__VA_ARGS__) // Check if roothub port is initialized and active as a host bool tuh_rhport_is_active(uint8_t rhport); |
