diff options
| -rw-r--r-- | shared/tinyusb/mp_usbd.h | 5 | ||||
| -rw-r--r-- | shared/tinyusb/mp_usbd_runtime.c | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/shared/tinyusb/mp_usbd.h b/shared/tinyusb/mp_usbd.h index 311575b3a..d73cb5ade 100644 --- a/shared/tinyusb/mp_usbd.h +++ b/shared/tinyusb/mp_usbd.h @@ -45,6 +45,10 @@ #define MICROPY_WRAP_TUD_EVENT_HOOK_CB(name) name #endif +#ifndef MICROPY_HW_TINYUSB_LL_INIT +#define MICROPY_HW_TINYUSB_LL_INIT() +#endif + #if MICROPY_HW_ENABLE_USBDEV #include "py/obj.h" @@ -102,6 +106,7 @@ void mp_usbd_task_callback(mp_sched_node_t *node); static inline void mp_usbd_init(void) { // Without runtime USB support, this can be a thin wrapper wrapper around tusb_init() // which is called in the below helper function. + MICROPY_HW_TINYUSB_LL_INIT(); mp_usbd_init_tud(); } diff --git a/shared/tinyusb/mp_usbd_runtime.c b/shared/tinyusb/mp_usbd_runtime.c index 72e011732..39344729d 100644 --- a/shared/tinyusb/mp_usbd_runtime.c +++ b/shared/tinyusb/mp_usbd_runtime.c @@ -430,6 +430,8 @@ void mp_usbd_init(void) { } if (need_usb) { + // Call any port-specific initialization code. + MICROPY_HW_TINYUSB_LL_INIT(); // The following will call tusb_init(), which is safe to call redundantly. mp_usbd_init_tud(); // Reconnect if mp_usbd_deinit() has disconnected. |
