summaryrefslogtreecommitdiff
path: root/supervisor
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2021-01-20 16:47:18 -0800
committerScott Shawcroft <scott@tannewt.org>2021-01-20 19:16:56 -0800
commit733094aead6e84b42da54655b2b0a5d0dbd1a503 (patch)
tree2ff6a1aabf8b5ea8a042fdd012deb7682eca6864 /supervisor
parenteff68b0d9fb101176a808cb68f0158e1615ed8bf (diff)
Add initial RP2040 support
The RP2040 is new microcontroller from Raspberry Pi that features two Cortex M0s and eight PIO state machines that are good for crunching lots of data. It has 264k RAM and a built in UF2 bootloader too. Datasheet: https://pico.raspberrypi.org/files/rp2040_datasheet.pdf
Diffstat (limited to 'supervisor')
-rw-r--r--supervisor/shared/filesystem.c2
-rw-r--r--supervisor/shared/safe_mode.c2
-rw-r--r--supervisor/shared/workflow.c4
3 files changed, 7 insertions, 1 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..f8e871f97 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)
#include "shared-bindings/digitalio/DigitalInOut.h"
+#endif
#include "shared-bindings/microcontroller/Processor.h"
#include "shared-bindings/microcontroller/ResetReason.h"
diff --git a/supervisor/shared/workflow.c b/supervisor/shared/workflow.c
index 4986c0957..9aac7c4d0 100644
--- a/supervisor/shared/workflow.c
+++ b/supervisor/shared/workflow.c
@@ -36,7 +36,9 @@ 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 tud_connected() && !tud_suspended();
+ return true;
+ // TODO: Use the below once we've updated TinyUSB for the RP2040.
+ // return tud_connected() && !tud_suspended();
}
// Return true if host has completed connection to us (such as USB enumeration).