From b73b30ff9f890ffd4e38d4c7ce7bcef7c92c1afb Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 21 Jan 2021 11:33:13 -0800 Subject: Switch to upstream TinyUSB --- supervisor/shared/usb/usb.c | 4 ++++ supervisor/shared/workflow.c | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'supervisor/shared') diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index ff08ade18..07c6aee6c 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -59,12 +59,16 @@ bool usb_enabled(void) { return tusb_inited(); } +MP_WEAK void post_usb_init(void) {} + void usb_init(void) { init_usb_hardware(); load_serial_number(); tusb_init(); + post_usb_init(); + #if MICROPY_KBD_EXCEPTION // Set Ctrl+C as wanted char, tud_cdc_rx_wanted_cb() usb_callback will be invoked when Ctrl+C is received // This usb_callback always got invoked regardless of mp_interrupt_char value since we only set it once here diff --git a/supervisor/shared/workflow.c b/supervisor/shared/workflow.c index 9aac7c4d0..4986c0957 100644 --- a/supervisor/shared/workflow.c +++ b/supervisor/shared/workflow.c @@ -36,9 +36,7 @@ void supervisor_workflow_reset(void) { // Not that some chips don't notice when USB is unplugged after first being plugged in, // so this is not perfect, but tud_suspended() check helps. bool supervisor_workflow_connecting(void) { - return true; - // TODO: Use the below once we've updated TinyUSB for the RP2040. - // return tud_connected() && !tud_suspended(); + return tud_connected() && !tud_suspended(); } // Return true if host has completed connection to us (such as USB enumeration). -- cgit v1.2.3