@@ -140,7 +140,7 @@ bool tusb_rhport_init(uint8_t rhport, const tusb_rhport_init_t* rh_init);
140140
141141// Initialize roothub port with device/host role
142142// Note: when using with RTOS, this should be called after scheduler/kernel is started.
143- // Otherwise, it could cause kernel issue since USB IRQ handler does use RTOS queue API.
143+ // Since USB IRQ handler does use RTOS queue API.
144144// Note2: defined as macro for backward compatible with tusb_init(void), can be changed to function in the future.
145145#if defined(TUD_OPT_RHPORT ) || defined(TUH_OPT_RHPORT )
146146 #define _tusb_init_arg0 () tusb_rhport_init(0, NULL)
@@ -158,24 +158,15 @@ bool tusb_inited(void);
158158// Called to handle usb interrupt/event. tusb_init(rhport, role) must be called before
159159void tusb_int_handler (uint8_t rhport , bool in_isr );
160160
161- // Internal helper for backward compatibility with tusb_init(void)
162- bool tusb_rhport_teardown (uint8_t rhport );
163-
164- #if defined(TUD_OPT_RHPORT ) || defined(TUH_OPT_RHPORT )
165- #define _tusb_teardown_arg0 () tusb_rhport_teardown(0)
166- #else
167- #define _tusb_teardown_arg0 () TU_VERIFY_STATIC(false, "CFG_TUSB_RHPORT0_MODE/CFG_TUSB_RHPORT1_MODE must be defined")
168- #endif
169-
170- #define _tusb_teardown_arg1 (_rhport ) tusb_rhport_teardown(_rhport)
171- #define tusb_teardown (...) TU_FUNC_OPTIONAL_ARG(_tusb_teardown, __VA_ARGS__)
161+ // Deinit usb stack on roothub port
162+ bool tusb_deinit (uint8_t rhport );
172163
173164#else
174165
175166#define tusb_init (...) (false)
176167#define tusb_int_handler (...) do {}while(0)
177168#define tusb_inited () (false)
178- #define tusb_teardown (...) (false)
169+ #define tusb_deinit (...) (false)
179170
180171#endif
181172
0 commit comments