Skip to content

Commit 2249a33

Browse files
authored
Merge pull request #4031 from tannewt/rp2040
Add initial RP2040 support
2 parents eff68b0 + 9b8246f commit 2249a33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+5712
-27
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ jobs:
177177
- "8086_commander"
178178
- "ADM_B_NRF52840_1"
179179
- "TG-Watch"
180+
- "adafruit_feather_rp2040"
180181
- "aloriumtech_evo_m51"
181182
- "aramcon_badge_2019"
182183
- "arduino_mkr1300"
@@ -294,6 +295,7 @@ jobs:
294295
- "pyruler"
295296
- "qtpy_m0"
296297
- "qtpy_m0_haxpress"
298+
- "raspberry_pi_pico"
297299
- "raytac_mdbt50q-db-40"
298300
- "robohatmm1_m4"
299301
- "sam32"
@@ -465,7 +467,7 @@ jobs:
465467
id: idf-cache
466468
with:
467469
path: ${{ github.workspace }}/.idf_tools
468-
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210114
470+
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210121
469471
- name: Clone IDF submodules
470472
run: |
471473
(cd $IDF_PATH && git submodule update --init)

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,6 @@
171171
[submodule "frozen/Adafruit_CircuitPython_LC709203F"]
172172
path = frozen/Adafruit_CircuitPython_LC709203F
173173
url = https://github.com/adafruit/Adafruit_CircuitPython_LC709203F
174+
[submodule "ports/raspberrypi/sdk"]
175+
path = ports/raspberrypi/sdk
176+
url = https://github.com/raspberrypi/pico-sdk.git

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ stubs:
255255
@$(PYTHON) tools/extract_pyi.py shared-bindings/ $(STUBDIR)
256256
@$(PYTHON) tools/extract_pyi.py extmod/ulab/code/ $(STUBDIR)/ulab
257257
@$(PYTHON) tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR)
258+
@$(PYTHON) tools/extract_pyi.py ports/raspberrypi/bindings $(STUBDIR)
258259
@$(PYTHON) setup.py -q sdist
259260

260261
.PHONY: check-stubs

conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
"ports/nrf/nrfx",
190190
"ports/nrf/peripherals",
191191
"ports/nrf/usb",
192+
"ports/raspberrypi/sdk",
192193
"ports/stm/st_driver",
193194
"ports/stm/packages",
194195
"ports/stm/peripherals",

docs/supported_ports.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ is limited.
1313

1414
../ports/atmel-samd/README
1515
../ports/cxd56/README
16+
../ports/esp32s2/README
1617
../ports/litex/README
1718
../ports/mimxrt10xx/README
1819
../ports/nrf/README
20+
../ports/raspberrypi/README
1921
../ports/stm/README
20-
../ports/esp32s2/README

extmod/vfs.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ mp_vfs_mount_t *mp_vfs_lookup_path(const char *path, const char **path_out) {
7171
STATIC mp_vfs_mount_t *lookup_path(mp_obj_t path_in, mp_obj_t *path_out) {
7272
const char *path = mp_obj_str_get_str(path_in);
7373
const char *p_out;
74+
*path_out = mp_const_none;
7475
mp_vfs_mount_t *vfs = mp_vfs_lookup_path(path, &p_out);
7576
if (vfs != MP_VFS_NONE && vfs != MP_VFS_ROOT) {
7677
*path_out = mp_obj_new_str_of_type(mp_obj_get_type(path_in),
@@ -329,7 +330,7 @@ mp_obj_t mp_vfs_ilistdir(size_t n_args, const mp_obj_t *args) {
329330
path_in = MP_OBJ_NEW_QSTR(MP_QSTR_);
330331
}
331332

332-
mp_obj_t path_out;
333+
mp_obj_t path_out = mp_const_none;
333334
mp_vfs_mount_t *vfs = lookup_path(path_in, &path_out);
334335

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

361362
mp_obj_t mp_vfs_mkdir(mp_obj_t path_in) {
362-
mp_obj_t path_out;
363+
mp_obj_t path_out = mp_const_none;
363364
mp_vfs_mount_t *vfs = lookup_path(path_in, &path_out);
364365
if (vfs == MP_VFS_ROOT || (vfs != MP_VFS_NONE && !strcmp(mp_obj_str_get_str(path_out), "/"))) {
365366
mp_raise_OSError(MP_EEXIST);

main.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
317317

318318
// Program has finished running.
319319

320-
bool serial_connected_before_animation = serial_connected();
320+
bool printed_press_any_key = false;
321321
#if CIRCUITPY_DISPLAYIO
322322
bool refreshed_epaper_display = false;
323323
#endif
@@ -364,19 +364,20 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
364364
}
365365
#endif
366366

367-
if (!serial_connected_before_animation && serial_connected()) {
367+
if (!printed_press_any_key && serial_connected()) {
368368
if (!serial_connected_at_start) {
369369
print_code_py_status_message(safe_mode);
370370
}
371371

372372
print_safe_mode_message(safe_mode);
373373
serial_write("\n");
374374
serial_write_compressed(translate("Press any key to enter the REPL. Use CTRL-D to reload.\n"));
375+
printed_press_any_key = true;
375376
}
376-
if (serial_connected_before_animation && !serial_connected()) {
377+
if (!serial_connected()) {
377378
serial_connected_at_start = false;
379+
printed_press_any_key = false;
378380
}
379-
serial_connected_before_animation = serial_connected();
380381

381382
// Refresh the ePaper display if we have one. That way it'll show an error message.
382383
#if CIRCUITPY_DISPLAYIO

ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ INTERNAL_FLASH_FILESYSTEM = 1
1010
LONGINT_IMPL = NONE
1111
CIRCUITPY_FULL_BUILD = 0
1212

13+
ifeq ($(TRANSLATION),de_DE)
14+
RELEASE_NEEDS_CLEAN_BUILD = 1
15+
CFLAGS_INLINE_LIMIT = 35
16+
SUPEROPT_VM = 0
17+
endif
18+
1319
SUPEROPT_GC = 0

ports/raspberrypi/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build-*/

0 commit comments

Comments
 (0)