File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -140,8 +140,16 @@ bool tusb_rhport_init(uint8_t rhport, const tusb_rhport_init_t* rh_init);
140140// Note: when using with RTOS, this should be called after scheduler/kernel is started.
141141// Otherwise, it could cause kernel issue since USB IRQ handler does use RTOS queue API.
142142// Note2: defined as macro for backward compatible with tusb_init(void), can be changed to function in the future.
143- #if defined(TUD_OPT_RHPORT ) || defined(TUH_OPT_RHPORT )
144- #define _tusb_init_arg0 () tusb_rhport_init(0, NULL)
143+ #if defined(TUD_OPT_RHPORT )
144+ #define TUx_OPT_RHPORT TUD_OPT_RHPORT
145+ #endif //
146+ #if defined(TUH_OPT_RHPORT )
147+ #define TUx_OPT_RHPORT TUH_OPT_RHPORT
148+ #endif //
149+
150+ #if defined(TUx_OPT_RHPORT )
151+ // _tusb_init_arg0() get the port number from TUD_OPT_RHPORT or TUH_OPT_RHPORT option
152+ #define _tusb_init_arg0 () tusb_rhport_init(TUx_OPT_RHPORT, NULL)
145153#else
146154 #define _tusb_init_arg0 () TU_VERIFY_STATIC(false, "CFG_TUSB_RHPORT0_MODE/CFG_TUSB_RHPORT1_MODE must be defined")
147155#endif
You can’t perform that action at this time.
0 commit comments