From 14b5080515ec483f0f7be843a089eea835e4519f Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 27 Nov 2025 15:00:12 +1100 Subject: shared/tinyusb: Add optional port-specific hook on USBD init. This allows a port to do hardware initialization just before the TinyUSB stack is brought up. That means the hardware is only turned on when it's needed. Signed-off-by: Damien George --- shared/tinyusb/mp_usbd_runtime.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'shared/tinyusb/mp_usbd_runtime.c') 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. -- cgit v1.2.3