diff options
| author | HiFiPhile <[email protected]> | 2023-10-10 15:02:25 +0200 |
|---|---|---|
| committer | HiFiPhile <[email protected]> | 2023-10-10 15:02:25 +0200 |
| commit | b5c839f739280a59dec8e2fe082005518dfc19c8 (patch) | |
| tree | 8140b74bfddb16a6ed5a0dcff13a22727da3a727 /src/host/usbh.h | |
| parent | 6be7f354c26e09a87d1b856b0e237ff82be5963f (diff) | |
| parent | 513ab37ec6f394d5332d159a62afa468a1a0a7cb (diff) | |
Merge branch 'master' of https://github.com/hathach/tinyusb into uac_interl
Diffstat (limited to 'src/host/usbh.h')
| -rw-r--r-- | src/host/usbh.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/host/usbh.h b/src/host/usbh.h index 684e8240e..770d70dfe 100644 --- a/src/host/usbh.h +++ b/src/host/usbh.h @@ -124,11 +124,16 @@ void tuh_task(void) { bool tuh_task_event_ready(void); #ifndef _TUSB_HCD_H_ -extern void hcd_int_handler(uint8_t rhport); +extern void hcd_int_handler(uint8_t rhport, bool in_isr); #endif -// Interrupt handler, name alias to HCD -#define tuh_int_handler hcd_int_handler +// 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__) // Check if roothub port is initialized and active as a host bool tuh_rhport_is_active(uint8_t rhport); |
