summaryrefslogtreecommitdiff
path: root/supervisor
diff options
context:
space:
mode:
authorKevin Banks <kevin@firia.com>2021-02-03 16:48:28 -0600
committerKevin Banks <kevin@firia.com>2021-02-03 16:48:28 -0600
commit215a56c920b64d522e505d20e1480859fd0ea333 (patch)
tree1bee95771e6aeeb459eedb1837382f0431bd565b /supervisor
parent00926b687a619f18deb08c1f59f868a4e9b8514a (diff)
parentadaf43d6d84a49c382fd6fab3cb96da33aff02e4 (diff)
Merge branch 'main' into webusb (trying to get CI back online)
Diffstat (limited to 'supervisor')
-rw-r--r--supervisor/shared/filesystem.c2
-rw-r--r--supervisor/shared/safe_mode.c2
-rw-r--r--supervisor/shared/usb/usb.c4
-rw-r--r--supervisor/usb.h3
4 files changed, 11 insertions, 0 deletions
diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c
index 618dc796b..09b30b6ba 100644
--- a/supervisor/shared/filesystem.c
+++ b/supervisor/shared/filesystem.c
@@ -79,6 +79,8 @@ static void make_sample_code_file(FATFS *fatfs) {
f_open(fatfs, &fs, "/code.py", FA_WRITE | FA_CREATE_ALWAYS);
f_write(&fs, buffer, sizeof(buffer) - 1, &char_written);
f_close(&fs);
+ #else
+ make_empty_file(fatfs, "/code.py");
#endif
}
diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c
index 9032e4045..b37b38e08 100644
--- a/supervisor/shared/safe_mode.c
+++ b/supervisor/shared/safe_mode.c
@@ -28,7 +28,9 @@
#include "mphalport.h"
+#if defined(MICROPY_HW_LED_STATUS) || defined(CIRCUITPY_BOOT_BUTTON)
#include "shared-bindings/digitalio/DigitalInOut.h"
+#endif
#include "shared-bindings/microcontroller/Processor.h"
#include "shared-bindings/microcontroller/ResetReason.h"
diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c
index 5db90d2fa..06b9e0c4e 100644
--- a/supervisor/shared/usb/usb.c
+++ b/supervisor/shared/usb/usb.c
@@ -72,12 +72,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/usb.h b/supervisor/usb.h
index 0dead3e26..ccb35470c 100644
--- a/supervisor/usb.h
+++ b/supervisor/usb.h
@@ -42,6 +42,9 @@ void usb_irq_handler(void);
// TinyUSB.
void init_usb_hardware(void);
+// Temporary hook for code after init. Only used for RP2040.
+void post_usb_init(void);
+
// Shared implementation.
bool usb_enabled(void);
void usb_init(void);