summaryrefslogtreecommitdiff
path: root/supervisor/shared
diff options
context:
space:
mode:
authorDavePutz <dwputz@gmail.com>2021-01-21 16:07:24 -0600
committerGitHub <noreply@github.com>2021-01-21 16:07:24 -0600
commit6043fdf94085bf2ec00e9f95149a74fb7eb0c7c4 (patch)
tree49fb85346b3ce60a08ad7780b8aec7fd0f72366f /supervisor/shared
parente424c8424936ded83803b098229d0787903f9f92 (diff)
parent2249a33203339803c8a0b23e80eec15d77b7f23e (diff)
Merge pull request #39 from adafruit/main
Merge from adafruit main for RP2040
Diffstat (limited to 'supervisor/shared')
-rw-r--r--supervisor/shared/filesystem.c2
-rw-r--r--supervisor/shared/safe_mode.c2
-rw-r--r--supervisor/shared/usb/usb.c4
3 files changed, 8 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 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