summaryrefslogtreecommitdiff
path: root/supervisor/shared
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2021-01-21 11:33:13 -0800
committerScott Shawcroft <scott@tannewt.org>2021-01-21 11:33:13 -0800
commitb73b30ff9f890ffd4e38d4c7ce7bcef7c92c1afb (patch)
tree4f8035be07141b8e00cf759338a750e9b80e2ddd /supervisor/shared
parentaf8cc9345d8facd36d1e65cdbfc69f044a942a17 (diff)
Switch to upstream TinyUSB
Diffstat (limited to 'supervisor/shared')
-rw-r--r--supervisor/shared/usb/usb.c4
-rw-r--r--supervisor/shared/workflow.c4
2 files changed, 5 insertions, 3 deletions
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).