Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial RP2040 support #4031

Merged
merged 12 commits into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ jobs:
- "8086_commander"
- "ADM_B_NRF52840_1"
- "TG-Watch"
- "adafruit_feather_rp2040"
- "aloriumtech_evo_m51"
- "aramcon_badge_2019"
- "arduino_mkr1300"
Expand Down Expand Up @@ -294,6 +295,7 @@ jobs:
- "pyruler"
- "qtpy_m0"
- "qtpy_m0_haxpress"
- "raspberry_pi_pico"
- "raytac_mdbt50q-db-40"
- "robohatmm1_m4"
- "sam32"
Expand Down Expand Up @@ -465,7 +467,7 @@ jobs:
id: idf-cache
with:
path: ${{ github.workspace }}/.idf_tools
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210114
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210121
- name: Clone IDF submodules
run: |
(cd $IDF_PATH && git submodule update --init)
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,6 @@
[submodule "frozen/Adafruit_CircuitPython_LC709203F"]
path = frozen/Adafruit_CircuitPython_LC709203F
url = https://github.com/adafruit/Adafruit_CircuitPython_LC709203F
[submodule "ports/raspberrypi/sdk"]
path = ports/raspberrypi/sdk
url = https://github.com/raspberrypi/pico-sdk.git
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ stubs:
@$(PYTHON) tools/extract_pyi.py shared-bindings/ $(STUBDIR)
@$(PYTHON) tools/extract_pyi.py extmod/ulab/code/ $(STUBDIR)/ulab
@$(PYTHON) tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR)
@$(PYTHON) tools/extract_pyi.py ports/raspberrypi/bindings $(STUBDIR)
@$(PYTHON) setup.py -q sdist

.PHONY: check-stubs
Expand Down
1 change: 1 addition & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
"ports/nrf/nrfx",
"ports/nrf/peripherals",
"ports/nrf/usb",
"ports/raspberrypi/sdk",
"ports/stm/st_driver",
"ports/stm/packages",
"ports/stm/peripherals",
Expand Down
3 changes: 2 additions & 1 deletion docs/supported_ports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ is limited.

../ports/atmel-samd/README
../ports/cxd56/README
../ports/esp32s2/README
../ports/litex/README
../ports/mimxrt10xx/README
../ports/nrf/README
../ports/raspberrypi/README
../ports/stm/README
../ports/esp32s2/README
5 changes: 3 additions & 2 deletions extmod/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ mp_vfs_mount_t *mp_vfs_lookup_path(const char *path, const char **path_out) {
STATIC mp_vfs_mount_t *lookup_path(mp_obj_t path_in, mp_obj_t *path_out) {
const char *path = mp_obj_str_get_str(path_in);
const char *p_out;
*path_out = mp_const_none;
mp_vfs_mount_t *vfs = mp_vfs_lookup_path(path, &p_out);
if (vfs != MP_VFS_NONE && vfs != MP_VFS_ROOT) {
*path_out = mp_obj_new_str_of_type(mp_obj_get_type(path_in),
Expand Down Expand Up @@ -329,7 +330,7 @@ mp_obj_t mp_vfs_ilistdir(size_t n_args, const mp_obj_t *args) {
path_in = MP_OBJ_NEW_QSTR(MP_QSTR_);
}

mp_obj_t path_out;
mp_obj_t path_out = mp_const_none;
mp_vfs_mount_t *vfs = lookup_path(path_in, &path_out);

if (vfs == MP_VFS_ROOT) {
Expand Down Expand Up @@ -359,7 +360,7 @@ mp_obj_t mp_vfs_listdir(size_t n_args, const mp_obj_t *args) {
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_vfs_listdir_obj, 0, 1, mp_vfs_listdir);

mp_obj_t mp_vfs_mkdir(mp_obj_t path_in) {
mp_obj_t path_out;
mp_obj_t path_out = mp_const_none;
mp_vfs_mount_t *vfs = lookup_path(path_in, &path_out);
if (vfs == MP_VFS_ROOT || (vfs != MP_VFS_NONE && !strcmp(mp_obj_str_get_str(path_out), "/"))) {
mp_raise_OSError(MP_EEXIST);
Expand Down
9 changes: 5 additions & 4 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {

// Program has finished running.

bool serial_connected_before_animation = serial_connected();
bool printed_press_any_key = false;
#if CIRCUITPY_DISPLAYIO
bool refreshed_epaper_display = false;
#endif
Expand Down Expand Up @@ -364,19 +364,20 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
}
#endif

if (!serial_connected_before_animation && serial_connected()) {
if (!printed_press_any_key && serial_connected()) {
if (!serial_connected_at_start) {
print_code_py_status_message(safe_mode);
}

print_safe_mode_message(safe_mode);
serial_write("\n");
serial_write_compressed(translate("Press any key to enter the REPL. Use CTRL-D to reload.\n"));
printed_press_any_key = true;
}
if (serial_connected_before_animation && !serial_connected()) {
if (!serial_connected()) {
serial_connected_at_start = false;
printed_press_any_key = false;
}
serial_connected_before_animation = serial_connected();

// Refresh the ePaper display if we have one. That way it'll show an error message.
#if CIRCUITPY_DISPLAYIO
Expand Down
6 changes: 6 additions & 0 deletions ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0

ifeq ($(TRANSLATION),de_DE)
RELEASE_NEEDS_CLEAN_BUILD = 1
CFLAGS_INLINE_LIMIT = 35
SUPEROPT_VM = 0
endif

SUPEROPT_GC = 0
1 change: 1 addition & 0 deletions ports/raspberrypi/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build-*/
Loading