From 547ca5a452f64fec654005ec669bb5c5184bd8a2 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 4 Feb 2023 12:02:06 -0600 Subject: [PATCH 01/90] bitmap constructor positive validation --- shared-bindings/displayio/Bitmap.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 65551f4e0d..f507a64880 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -62,14 +62,11 @@ //| ... STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { mp_arg_check_num(n_args, n_kw, 3, 3, false); - uint32_t width = mp_obj_get_int(all_args[0]); - uint32_t height = mp_obj_get_int(all_args[1]); - uint32_t value_count = mp_obj_get_int(all_args[2]); + uint32_t width = mp_arg_validate_int_min(mp_obj_get_int(all_args[0]), 1, MP_QSTR_width); + uint32_t height = mp_arg_validate_int_min(mp_obj_get_int(all_args[1]), 1, MP_QSTR_height); + uint32_t value_count = mp_arg_validate_int_min(mp_obj_get_int(all_args[2]), 1, MP_QSTR_value_count); uint32_t bits = 1; - if (value_count == 0) { - mp_raise_ValueError(translate("value_count must be > 0")); - } while ((value_count - 1) >> bits) { if (bits < 8) { bits <<= 1; From beb4a797ff136d695d611c8b1665b433cd438331 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 4 Feb 2023 12:37:43 -0600 Subject: [PATCH 02/90] bitmap fill, __get_item__, and __set_item__ positive validation --- shared-bindings/displayio/Bitmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index f507a64880..a6bccc6298 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -141,15 +141,15 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val uint16_t x = 0; uint16_t y = 0; if (mp_obj_is_small_int(index_obj)) { - mp_int_t i = MP_OBJ_SMALL_INT_VALUE(index_obj); + mp_int_t i = mp_arg_validate_int_min(MP_OBJ_SMALL_INT_VALUE(index_obj), 0, MP_QSTR_index); uint16_t width = common_hal_displayio_bitmap_get_width(self); x = i % width; y = i / width; } else { mp_obj_t *items; mp_obj_get_array_fixed_n(index_obj, 2, &items); - x = mp_obj_get_int(items[0]); - y = mp_obj_get_int(items[1]); + x = mp_arg_validate_int_min(mp_obj_get_int(items[0]), 0, MP_QSTR_x); + y = mp_arg_validate_int_min(mp_obj_get_int(items[1]), 0, MP_QSTR_y); if (x >= common_hal_displayio_bitmap_get_width(self) || y >= common_hal_displayio_bitmap_get_height(self)) { mp_raise_IndexError(translate("pixel coordinates out of bounds")); } @@ -286,7 +286,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_blit_obj, 1, displayio_bitmap_obj_bl STATIC mp_obj_t displayio_bitmap_obj_fill(mp_obj_t self_in, mp_obj_t value_obj) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); - mp_uint_t value = (mp_uint_t)mp_obj_get_int(value_obj); + mp_uint_t value = (mp_uint_t)mp_arg_validate_int_min(mp_obj_get_int(value_obj), 0, MP_QSTR_value); if ((value >> common_hal_displayio_bitmap_get_bits_per_value(self)) != 0) { mp_raise_ValueError(translate("pixel value requires too many bits")); } From efe48e61ed8c3cef958dc9b5ad367cd454c9da19 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 6 Feb 2023 17:03:49 -0600 Subject: [PATCH 03/90] argument bounds validation for bitmap.blit() --- shared-bindings/displayio/Bitmap.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index a6bccc6298..458a73c3b1 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -212,8 +212,9 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg displayio_bitmap_t *self = MP_OBJ_TO_PTR(pos_args[0]); - int16_t x = args[ARG_x].u_int; - int16_t y = args[ARG_y].u_int; + // Check x,y are within self (target) bitmap boundary + int16_t x = mp_arg_validate_int_range(args[ARG_x].u_int, 0, self->width - 1, MP_QSTR_x); + int16_t y = mp_arg_validate_int_range(args[ARG_y].u_int, 0, self->height - 1, MP_QSTR_y); displayio_bitmap_t *source = mp_arg_validate_type(args[ARG_source].u_obj, &displayio_bitmap_type, MP_QSTR_source_bitmap); @@ -223,32 +224,21 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg mp_raise_ValueError(translate("source palette too large")); } - int16_t x1 = args[ARG_x1].u_int; - int16_t y1 = args[ARG_y1].u_int; + // Check x1,y1,x2,y2 are within source bitmap boundary + int16_t x1 = mp_arg_validate_int_range(args[ARG_x1].u_int, 0, source->width - 1, MP_QSTR_x1); + int16_t y1 = mp_arg_validate_int_range(args[ARG_y1].u_int, 0, source->height - 1, MP_QSTR_y1); int16_t x2, y2; // if x2 or y2 is None, then set as the maximum size of the source bitmap if (args[ARG_x2].u_obj == mp_const_none) { x2 = source->width; } else { - x2 = mp_obj_get_int(args[ARG_x2].u_obj); + x2 = mp_arg_validate_int_range(mp_obj_get_int(args[ARG_x2].u_obj), 0, source->width, MP_QSTR_x2); } // int16_t y2; if (args[ARG_y2].u_obj == mp_const_none) { y2 = source->height; } else { - y2 = mp_obj_get_int(args[ARG_y2].u_obj); - } - - // Check x,y are within self (target) bitmap boundary - if ((x < 0) || (y < 0) || (x > self->width) || (y > self->height)) { - mp_raise_ValueError(translate("out of range of target")); - } - // Check x1,y1,x2,y2 are within source bitmap boundary - if ((x1 < 0) || (x1 > source->width) || - (y1 < 0) || (y1 > source->height) || - (x2 < 0) || (x2 > source->width) || - (y2 < 0) || (y2 > source->height)) { - mp_raise_ValueError(translate("out of range of source")); + y2 = mp_arg_validate_int_range(mp_obj_get_int(args[ARG_y2].u_obj), 0, source->height, MP_QSTR_y2); } // Ensure x1 < x2 and y1 < y2 From bb4cccc1cda1573889097ee0c596e27686a794bf Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 10 Feb 2023 17:26:01 -0600 Subject: [PATCH 04/90] use range instead of min where applicable to consolodate bounds checks --- shared-bindings/displayio/Bitmap.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 458a73c3b1..0efa801a7d 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -148,21 +148,15 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val } else { mp_obj_t *items; mp_obj_get_array_fixed_n(index_obj, 2, &items); - x = mp_arg_validate_int_min(mp_obj_get_int(items[0]), 0, MP_QSTR_x); - y = mp_arg_validate_int_min(mp_obj_get_int(items[1]), 0, MP_QSTR_y); - if (x >= common_hal_displayio_bitmap_get_width(self) || y >= common_hal_displayio_bitmap_get_height(self)) { - mp_raise_IndexError(translate("pixel coordinates out of bounds")); - } + x = mp_arg_validate_int_range(mp_obj_get_int(items[0]), 0, self->width - 1, MP_QSTR_x); + y = mp_arg_validate_int_range(mp_obj_get_int(items[1]), 0, self->height - 1, MP_QSTR_y); } if (value_obj == MP_OBJ_SENTINEL) { // load return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_bitmap_get_pixel(self, x, y)); } else { - mp_uint_t value = (mp_uint_t)mp_obj_get_int(value_obj); - if ((value >> common_hal_displayio_bitmap_get_bits_per_value(self)) != 0) { - mp_raise_ValueError(translate("pixel value requires too many bits")); - } + mp_uint_t value = (mp_uint_t)mp_arg_validate_int_range(mp_obj_get_int(value_obj), 0,(1u << common_hal_displayio_bitmap_get_bits_per_value(self)) - 1, MP_QSTR_value); common_hal_displayio_bitmap_set_pixel(self, x, y, value); } return mp_const_none; @@ -276,10 +270,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_blit_obj, 1, displayio_bitmap_obj_bl STATIC mp_obj_t displayio_bitmap_obj_fill(mp_obj_t self_in, mp_obj_t value_obj) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); - mp_uint_t value = (mp_uint_t)mp_arg_validate_int_min(mp_obj_get_int(value_obj), 0, MP_QSTR_value); - if ((value >> common_hal_displayio_bitmap_get_bits_per_value(self)) != 0) { - mp_raise_ValueError(translate("pixel value requires too many bits")); - } + mp_uint_t value = (mp_uint_t)mp_arg_validate_int_range(mp_obj_get_int(value_obj), 0,(1u << common_hal_displayio_bitmap_get_bits_per_value(self)) - 1,MP_QSTR_value); common_hal_displayio_bitmap_fill(self, value); return mp_const_none; From 67fd815e27581a1a758de68943cd64717e856021 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 10 Feb 2023 17:39:38 -0600 Subject: [PATCH 05/90] maximum value validation for bitmap constructor --- shared-bindings/displayio/Bitmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 0efa801a7d..566bee954c 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -62,9 +62,9 @@ //| ... STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { mp_arg_check_num(n_args, n_kw, 3, 3, false); - uint32_t width = mp_arg_validate_int_min(mp_obj_get_int(all_args[0]), 1, MP_QSTR_width); - uint32_t height = mp_arg_validate_int_min(mp_obj_get_int(all_args[1]), 1, MP_QSTR_height); - uint32_t value_count = mp_arg_validate_int_min(mp_obj_get_int(all_args[2]), 1, MP_QSTR_value_count); + uint32_t width = mp_arg_validate_int_range(mp_obj_get_int(all_args[0]), 1, 32767, MP_QSTR_width); + uint32_t height = mp_arg_validate_int_range(mp_obj_get_int(all_args[1]), 1, 32767, MP_QSTR_height); + uint32_t value_count = mp_arg_validate_int_range(mp_obj_get_int(all_args[2]), 1, 32767, MP_QSTR_value_count); uint32_t bits = 1; while ((value_count - 1) >> bits) { From 5f3f87e371c7cc0d83817308375ab58e3d329210 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 10 Feb 2023 18:05:07 -0600 Subject: [PATCH 06/90] validate palette color count and group scale --- shared-bindings/displayio/Group.c | 2 +- shared-bindings/displayio/Palette.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 3e4569b271..24064a74c1 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -56,7 +56,7 @@ STATIC mp_obj_t displayio_group_make_new(const mp_obj_type_t *type, size_t n_arg mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_int_t scale = mp_arg_validate_int_min(args[ARG_scale].u_int, 1, MP_QSTR_scale); + mp_int_t scale = mp_arg_validate_int_range(args[ARG_scale].u_int, 1, 32767,MP_QSTR_scale); displayio_group_t *self = m_new_obj(displayio_group_t); self->base.type = &displayio_group_type; diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index aa24dc262f..804b9ff034 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -58,7 +58,7 @@ STATIC mp_obj_t displayio_palette_make_new(const mp_obj_type_t *type, size_t n_a displayio_palette_t *self = m_new_obj(displayio_palette_t); self->base.type = &displayio_palette_type; - common_hal_displayio_palette_construct(self, args[ARG_color_count].u_int); + common_hal_displayio_palette_construct(self, mp_arg_validate_int_range(args[ARG_color_count].u_int, 1, 32767, MP_QSTR_color_count)); return MP_OBJ_FROM_PTR(self); } From 694537acb323314a25a802e53c4c34be5c6ced73 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 18 Feb 2023 10:35:39 -0600 Subject: [PATCH 07/90] change validation maximum computation --- shared-bindings/displayio/Bitmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 566bee954c..e14ac638e2 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -156,7 +156,9 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val // load return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_bitmap_get_pixel(self, x, y)); } else { - mp_uint_t value = (mp_uint_t)mp_arg_validate_int_range(mp_obj_get_int(value_obj), 0,(1u << common_hal_displayio_bitmap_get_bits_per_value(self)) - 1, MP_QSTR_value); + mp_uint_t value = (mp_uint_t)mp_arg_validate_int_range( + mp_obj_get_int(value_obj), 0, + (UINT32_MAX >> (32 - common_hal_displayio_bitmap_get_bits_per_value(self))), MP_QSTR_value); common_hal_displayio_bitmap_set_pixel(self, x, y, value); } return mp_const_none; From 3601bb3062735e12e9666e0bd1c0f730ab831f33 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 20 Feb 2023 20:37:42 -0600 Subject: [PATCH 08/90] change value_count max --- shared-bindings/displayio/Bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index e14ac638e2..c2431699b2 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -64,7 +64,7 @@ STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_ar mp_arg_check_num(n_args, n_kw, 3, 3, false); uint32_t width = mp_arg_validate_int_range(mp_obj_get_int(all_args[0]), 1, 32767, MP_QSTR_width); uint32_t height = mp_arg_validate_int_range(mp_obj_get_int(all_args[1]), 1, 32767, MP_QSTR_height); - uint32_t value_count = mp_arg_validate_int_range(mp_obj_get_int(all_args[2]), 1, 32767, MP_QSTR_value_count); + uint32_t value_count = mp_arg_validate_int_range(mp_obj_get_int(all_args[2]), 1, 65535, MP_QSTR_value_count); uint32_t bits = 1; while ((value_count - 1) >> bits) { From d9fee4c354fdebc5470f378cae799adb7a97efac Mon Sep 17 00:00:00 2001 From: hathach Date: Sat, 18 Mar 2023 21:28:45 +0700 Subject: [PATCH 09/90] add codespell --- .codespell/exclude-file.txt | 0 .codespell/ignore-words.txt | 4 ++++ .codespellrc | 10 ++++++++++ .pre-commit-config.yaml | 6 ++++++ 4 files changed, 20 insertions(+) create mode 100644 .codespell/exclude-file.txt create mode 100644 .codespell/ignore-words.txt create mode 100644 .codespellrc diff --git a/.codespell/exclude-file.txt b/.codespell/exclude-file.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.codespell/ignore-words.txt b/.codespell/ignore-words.txt new file mode 100644 index 0000000000..84171bfd52 --- /dev/null +++ b/.codespell/ignore-words.txt @@ -0,0 +1,4 @@ +ans +ure +clen +ser diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000000..dd495c65bd --- /dev/null +++ b/.codespellrc @@ -0,0 +1,10 @@ +# See: https://github.com/codespell-project/codespell#using-a-config-file +[codespell] +# In the event of a false positive, add the problematic word, in all lowercase, to 'ignore-words.txt' (one word per line). +# Or copy & paste the whole problematic line to 'exclude-file.txt' +ignore-words = .codespell/ignore-words.txt +exclude-file = .codespell/exclude-file.txt +check-filenames = +check-hidden = +count = +skip = .cproject,.git,./lib,./locale diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1905b233cf..c1a3a61387 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,6 +11,12 @@ repos: exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/espressif/esp-idf-config/.*|ports/espressif/boards/.*/sdkconfig)' - id: trailing-whitespace exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/.*)' +- repo: https://github.com/codespell-project/codespell + rev: v2.2.4 + hooks: + - id: codespell + #args: [-w] + exclude: ^locale/ - repo: local hooks: - id: translations From fecc1bdedbfff71448474c654ff543c1dbc52560 Mon Sep 17 00:00:00 2001 From: hathach Date: Sat, 18 Mar 2023 22:17:02 +0700 Subject: [PATCH 10/90] fix typos (partial) detected by codepell --- .codespell/ignore-words.txt | 13 +++++ .codespellrc | 2 +- .pre-commit-config.yaml | 2 +- devices/ble_hci/common-hal/_bleio/Adapter.c | 2 +- devices/ble_hci/common-hal/_bleio/Adapter.h | 2 +- .../ble_hci/common-hal/_bleio/Connection.c | 2 +- devices/ble_hci/common-hal/_bleio/att.c | 4 +- .../_bleio/hci_include/att_internal.h | 4 +- docs/library/collections.rst | 4 +- examples/natmod/features1/features1.c | 2 +- lib/cmsis/inc/core_armv81mml.h | 4 +- lib/cmsis/inc/core_sc300.h | 2 +- lib/cmsis/inc/mpu_armv8.h | 2 +- lib/libm_dbl/__rem_pio2_large.c | 6 +-- lib/libm_dbl/fmod.c | 2 +- lib/libm_dbl/sqrt.c | 2 +- lib/littlefs/lfs1.h | 12 ++--- lib/littlefs/lfs2.c | 6 +-- lib/littlefs/lfs2.h | 14 +++--- lib/oofatfs/diskio.h | 4 +- lib/oofatfs/ff.c | 48 +++++++++---------- lib/oofatfs/ff.h | 2 +- lib/oofatfs/ffconf.h | 6 +-- lib/oofatfs/ffunicode.c | 2 +- lib/sdmmc/sdmmc_io.c | 2 +- lib/uzlib/tinflate.c | 2 +- locale/circuitpython.pot | 31 ++++++------ .../asf4_conf/samd21/hpl_tc_config.h | 2 +- .../asf4_conf/samd51/hpl_tc_config.h | 2 +- .../asf4_conf/same51/hpl_tc_config.h | 2 +- .../asf4_conf/same54/hpl_tc_config.h | 2 +- .../boards/hallowing_m0_express/board.c | 2 +- ports/atmel-samd/boards/pybadge/board.c | 2 +- ports/atmel-samd/boards/pygamer/board.c | 2 +- ports/atmel-samd/boards/ugame10/board.c | 2 +- .../common-hal/alarm/time/TimeAlarm.c | 2 +- .../common-hal/frequencyio/FrequencyIn.c | 2 +- ports/atmel-samd/mpconfigport.h | 2 +- ports/atmel-samd/sd_mmc/sd_mmc.c | 10 ++-- ports/atmel-samd/sd_mmc/sd_mmc.h | 4 +- ports/atmel-samd/sd_mmc/sd_mmc_protocol.h | 16 +++---- ports/atmel-samd/supervisor/port.c | 4 +- ports/espressif/README.rst | 6 +-- ports/espressif/bindings/espcamera/Camera.c | 4 +- ports/espressif/bindings/espnow/Peer.c | 2 +- ports/espressif/boards/lolin_s2_mini/pins.c | 4 +- .../espressif/boards/m5stack_stick_c/board.c | 2 +- .../waveshare_esp32_s2_pico_lcd/board.c | 2 +- ports/espressif/common-hal/_bleio/Adapter.c | 2 +- .../espressif/common-hal/_bleio/Connection.c | 2 +- .../common-hal/alarm/touch/TouchAlarm.c | 4 +- ports/espressif/common-hal/pulseio/PulseIn.c | 2 +- ports/espressif/common-hal/pwmio/PWMOut.c | 2 +- .../common-hal/rotaryio/IncrementalEncoder.c | 2 +- ports/espressif/i2s_lcd_driver.h | 2 +- ports/litex/boards/fomu/fomu-spi.ld | 2 +- .../common-hal/neopixel_write/__init__.c | 2 +- ports/litex/crt0-vexriscv.S | 2 +- .../common-hal/neopixel_write/__init__.c | 2 +- ports/nrf/Makefile | 2 +- .../s140_nrf52_6.1.0_API/include/ble_l2cap.h | 2 +- .../s140_nrf52_7.0.1_API/include/ble_l2cap.h | 2 +- .../s140_nrf52_7.0.1_API/include/nrf_sdm.h | 4 +- .../boards/feather_nrf52840_express/README.md | 2 +- ports/nrf/boards/hiibot_bluefi/pins.c | 2 +- .../sparkfun_nrf52840_micromod/README.md | 4 +- ports/nrf/common-hal/_bleio/Adapter.c | 4 +- ports/nrf/common-hal/_bleio/Characteristic.c | 2 +- ports/nrf/common-hal/_bleio/Connection.c | 2 +- ports/nrf/common-hal/_bleio/__init__.c | 2 +- .../nrf/common-hal/microcontroller/__init__.c | 2 +- ports/nrf/common-hal/pwmio/PWMOut.c | 2 +- ports/nrf/mpconfigport.h | 2 +- ports/nrf/supervisor/qspi_flash.c | 2 +- ports/raspberrypi/bindings/cyw43/__init__.c | 2 +- ports/raspberrypi/common-hal/ssl/SSLSocket.c | 4 +- ports/raspberrypi/common-hal/wifi/Radio.c | 2 +- ports/raspberrypi/common-hal/wifi/__init__.c | 2 +- ports/stm/boards/common_default.ld | 2 +- ports/stm/boards/common_nvm.ld | 2 +- ports/stm/boards/common_tcm.ld | 2 +- .../stm/boards/espruino_pico/mpconfigboard.mk | 2 +- ports/stm/boards/meowbit_v121/board.c | 2 +- ports/stm/boards/swan_r5/tests/enable_3v3.py | 2 +- ports/stm/common-hal/audiobusio/MEMS_Audio.h | 2 +- .../stm/common-hal/neopixel_write/__init__.c | 2 +- ports/unix/coverage.c | 2 +- ports/unix/modos.c | 2 +- ports/unix/modtermios.c | 2 +- py/asmthumb.c | 2 +- py/circuitpy_mpconfig.h | 2 +- py/circuitpy_mpconfig.mk | 2 +- py/compile.c | 2 +- py/formatfloat.c | 4 +- py/makecompresseddata.py | 2 +- py/mkrules.mk | 4 +- py/objexcept.c | 2 +- py/objtype.c | 2 +- py/runtime.c | 2 +- py/sequence.c | 2 +- shared-bindings/alarm/__init__.c | 2 +- shared-bindings/alarm/__init__.h | 2 +- shared-bindings/audiomp3/__init__.c | 2 +- shared-bindings/bitmaptools/__init__.c | 10 ++-- shared-bindings/board/__init__.c | 2 +- shared-bindings/busio/UART.c | 2 +- shared-bindings/countio/__init__.c | 2 +- shared-bindings/displayio/__init__.c | 2 +- shared-bindings/keypad/Event.c | 2 +- shared-bindings/keypad/KeyMatrix.c | 2 +- shared-bindings/microcontroller/ResetReason.c | 14 +++--- shared-bindings/paralleldisplay/ParallelBus.c | 2 +- shared-bindings/rotaryio/IncrementalEncoder.c | 2 +- shared-module/bitmaptools/__init__.c | 2 +- shared/netutils/dhcpserver.c | 4 +- shared/runtime/pyexec.c | 2 +- .../shared/external_flash/external_flash.c | 2 +- supervisor/shared/safe_mode.c | 2 +- .../shared/translate/compressed_string.h | 2 +- tests/basics/annotate_var.py | 2 +- tests/basics/deque2.py | 4 +- tests/basics/struct1.py | 2 +- tests/cpydiff/core_fstring_repr.py | 2 +- tests/cpydiff/core_import_path.py | 2 +- tests/cpydiff/core_import_split_ns_pkgs.py | 2 +- tests/extmod/framebuf_palette.py | 2 +- tests/extmod/uctypes_sizeof_layout.py | 2 +- tests/extmod/utimeq1.py | 2 +- tests/thread/thread_lock1.py | 2 +- tools/analyze_heap_dump.py | 2 +- tools/cpboard.py | 2 +- tools/gendoc.py | 2 +- tools/makemanifest.py | 2 +- tools/preprocess_frozen_modules.py | 10 ++-- tools/pydfu.py | 2 +- tools/uncrustify.cfg | 14 +++--- tools/verifygitlog.py | 2 +- 137 files changed, 253 insertions(+), 243 deletions(-) diff --git a/.codespell/ignore-words.txt b/.codespell/ignore-words.txt index 84171bfd52..76849278a0 100644 --- a/.codespell/ignore-words.txt +++ b/.codespell/ignore-words.txt @@ -2,3 +2,16 @@ ans ure clen ser +endianess +pris +synopsys +reenable +dout +wel +iput +hsi +astroid +busses +cyphertext +dum +extint diff --git a/.codespellrc b/.codespellrc index dd495c65bd..d4ef112d7a 100644 --- a/.codespellrc +++ b/.codespellrc @@ -7,4 +7,4 @@ exclude-file = .codespell/exclude-file.txt check-filenames = check-hidden = count = -skip = .cproject,.git,./lib,./locale +skip = .cproject,.git,./lib,./locale,ACKNOWLEDGEMENTS diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c1a3a61387..1695a883b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: hooks: - id: codespell #args: [-w] - exclude: ^locale/ + exclude: ^(locale/|lib/) - repo: local hooks: - id: translations diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index f558d66d40..843c143424 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -483,7 +483,7 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t if (self->scan_results != NULL) { if (!shared_module_bleio_scanresults_get_done(self->scan_results)) { - mp_raise_bleio_BluetoothError(translate("Scan already in progess. Stop with stop_scan.")); + mp_raise_bleio_BluetoothError(translate("Scan already in progress. Stop with stop_scan.")); } self->scan_results = NULL; } diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index 48d4f2e6a2..45a37ad67c 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -65,7 +65,7 @@ typedef struct _bleio_adapter_obj_t { uint16_t manufacturer; uint16_t lmp_subversion; - // Used to monitor advertising timeout for legacy avertising. + // Used to monitor advertising timeout for legacy advertising. uint64_t advertising_start_ticks; uint64_t advertising_timeout_msecs; // If zero, do not check. diff --git a/devices/ble_hci/common-hal/_bleio/Connection.c b/devices/ble_hci/common-hal/_bleio/Connection.c index 9531231506..e9e1254b43 100644 --- a/devices/ble_hci/common-hal/_bleio/Connection.c +++ b/devices/ble_hci/common-hal/_bleio/Connection.c @@ -515,7 +515,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // (gattc_char->char_props.write ? CHAR_PROP_WRITE : 0) | // (gattc_char->char_props.write_wo_resp ? CHAR_PROP_WRITE_NO_RESPONSE : 0); -// // Call common_hal_bleio_characteristic_construct() to initalize some fields and set up evt handler. +// // Call common_hal_bleio_characteristic_construct() to initialize some fields and set up evt handler. // common_hal_bleio_characteristic_construct( // characteristic, m_char_discovery_service, gattc_char->handle_value, uuid, // props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN, diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index f649967ca9..9dfe9eb26c 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -96,7 +96,7 @@ STATIC uint8_t bleio_properties_to_ble_spec_properties(uint8_t bleio_properties) return ble_spec_properties; } -// FIX not currently used; reenable when used. +// FIX not currently used; re-enable when used. #if 0 STATIC uint8_t ble_spec_properties_to_bleio_properties(uint8_t ble_spec_properties) { uint8_t bleio_properties = 0; @@ -964,7 +964,7 @@ static void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t d // Keep track of the first one to make sure. size_t sizeof_first_service_uuid = 0; - // Size of a single bt_att_group_data chunk. Start with the intial size, and + // Size of a single bt_att_group_data chunk. Start with the initial size, and // add the uuid size in the loop below. size_t data_length = sizeof(struct bt_att_group_data); diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h b/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h index af8695da98..0f03894caa 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h +++ b/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h @@ -150,7 +150,7 @@ struct bt_att_read_mult_req { uint16_t handles[]; } __packed; -/* Read Multiple Respose */ +/* Read Multiple Response */ #define BT_ATT_OP_READ_MULT_RSP 0x0f struct bt_att_read_mult_rsp { uint8_t _dummy[0]; @@ -243,7 +243,7 @@ struct bt_att_read_mult_vl_req { uint16_t handles[]; } __packed; -/* Read Multiple Respose */ +/* Read Multiple Response */ #define BT_ATT_OP_READ_MULT_VL_RSP 0x21 struct bt_att_read_mult_vl_rsp { uint16_t len; diff --git a/docs/library/collections.rst b/docs/library/collections.rst index 2cc1a215d1..01882ba244 100644 --- a/docs/library/collections.rst +++ b/docs/library/collections.rst @@ -16,8 +16,8 @@ Classes .. function:: deque(iterable, maxlen[, flags]) - Deques (double-ended queues) are a list-like container that support O(1) - appends and pops from either side of the deque. New deques are created + Dequeues (double-ended queues) are a list-like container that support O(1) + appends and pops from either side of the deque. New dequeues are created using the following arguments: - *iterable* must be the empty tuple, and the new deque is created empty. diff --git a/examples/natmod/features1/features1.c b/examples/natmod/features1/features1.c index f865f1887c..a5e82252a1 100644 --- a/examples/natmod/features1/features1.c +++ b/examples/natmod/features1/features1.c @@ -88,7 +88,7 @@ mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *a // This must be first, it sets up the globals dict and other things MP_DYNRUNTIME_INIT_ENTRY - // Messages can be printed as usualy + // Messages can be printed as usually mp_printf(&mp_plat_print, "initialising module self=%p\n", self); // Make the functions available in the module's namespace diff --git a/lib/cmsis/inc/core_armv81mml.h b/lib/cmsis/inc/core_armv81mml.h index 9425dbc321..48428fd650 100644 --- a/lib/cmsis/inc/core_armv81mml.h +++ b/lib/cmsis/inc/core_armv81mml.h @@ -2162,7 +2162,7 @@ __STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ reg_value = (reg_value | ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */ + (PriorityGroupTmp << 8U) ); /* Insert write key and priority group */ SCB->AIRCR = reg_value; } @@ -2536,7 +2536,7 @@ __STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup) reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ reg_value = (reg_value | ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */ + (PriorityGroupTmp << 8U) ); /* Insert write key and priority group */ SCB_NS->AIRCR = reg_value; } diff --git a/lib/cmsis/inc/core_sc300.h b/lib/cmsis/inc/core_sc300.h index 5478ea74a5..cbbac7e82c 100644 --- a/lib/cmsis/inc/core_sc300.h +++ b/lib/cmsis/inc/core_sc300.h @@ -1467,7 +1467,7 @@ __STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ reg_value = (reg_value | ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */ + (PriorityGroupTmp << 8U) ); /* Insert write key and priority group */ SCB->AIRCR = reg_value; } diff --git a/lib/cmsis/inc/mpu_armv8.h b/lib/cmsis/inc/mpu_armv8.h index 8002738606..84fdd323ae 100644 --- a/lib/cmsis/inc/mpu_armv8.h +++ b/lib/cmsis/inc/mpu_armv8.h @@ -84,7 +84,7 @@ * \param SH Defines the Shareability domain for this memory region. * \param RO Read-Only: Set to 1 for a read-only memory region. * \param NP Non-Privileged: Set to 1 for a non-privileged memory region. -* \oaram XN eXecute Never: Set to 1 for a non-executable memory region. +* \param XN eXecute Never: Set to 1 for a non-executable memory region. */ #define ARM_MPU_RBAR(BASE, SH, RO, NP, XN) \ ((BASE & MPU_RBAR_BASE_Msk) | \ diff --git a/lib/libm_dbl/__rem_pio2_large.c b/lib/libm_dbl/__rem_pio2_large.c index 958f28c255..2d1904efc3 100644 --- a/lib/libm_dbl/__rem_pio2_large.c +++ b/lib/libm_dbl/__rem_pio2_large.c @@ -40,14 +40,14 @@ * z = (z-x[i])*2**24 * * - * y[] ouput result in an array of double precision numbers. + * y[] output result in an array of double precision numbers. * The dimension of y[] is: * 24-bit precision 1 * 53-bit precision 2 * 64-bit precision 2 * 113-bit precision 3 * The actual value is the sum of them. Thus for 113-bit - * precison, one may have to do something like: + * precision, one may have to do something like: * * long double t,w,r_head, r_tail; * t = (long double)y[2] + (long double)y[1]; @@ -78,7 +78,7 @@ * jk+1 must be 2 larger than you might expect so that our * recomputation test works. (Up to 24 bits in the integer * part (the 24 bits of it that we compute) and 23 bits in - * the fraction part may be lost to cancelation before we + * the fraction part may be lost to cancellation before we * recompute.) * * jz local integer variable indicating the number of diff --git a/lib/libm_dbl/fmod.c b/lib/libm_dbl/fmod.c index 6849722bac..cf03aacdb2 100644 --- a/lib/libm_dbl/fmod.c +++ b/lib/libm_dbl/fmod.c @@ -9,7 +9,7 @@ double fmod(double x, double y) int sx = ux.i>>63; uint64_t i; - /* in the followings uxi should be ux.i, but then gcc wrongly adds */ + /* in the following uxi should be ux.i, but then gcc wrongly adds */ /* float load/store to inner loops ruining performance and code size */ uint64_t uxi = ux.i; diff --git a/lib/libm_dbl/sqrt.c b/lib/libm_dbl/sqrt.c index b277567385..194b09fb52 100644 --- a/lib/libm_dbl/sqrt.c +++ b/lib/libm_dbl/sqrt.c @@ -37,7 +37,7 @@ * If (2) is false, then q = q ; otherwise q = q + 2 . * i+1 i i+1 i * - * With some algebric manipulation, it is not difficult to see + * With some algebraic manipulation, it is not difficult to see * that (2) is equivalent to * -(i+1) * s + 2 <= y (3) diff --git a/lib/littlefs/lfs1.h b/lib/littlefs/lfs1.h index 355c145d08..08f0b193c8 100644 --- a/lib/littlefs/lfs1.h +++ b/lib/littlefs/lfs1.h @@ -94,7 +94,7 @@ enum lfs1_open_flags { LFS1_F_DIRTY = 0x10000, // File does not match storage LFS1_F_WRITING = 0x20000, // File has been written since last flush LFS1_F_READING = 0x40000, // File has been read since last flush - LFS1_F_ERRED = 0x80000, // An error occured during write + LFS1_F_ERRED = 0x80000, // An error occurred during write }; // File seek flags @@ -111,25 +111,25 @@ struct lfs1_config { // information to the block device operations void *context; - // Read a region in a block. Negative error codes are propogated + // Read a region in a block. Negative error codes are propagated // to the user. int (*read)(const struct lfs1_config *c, lfs1_block_t block, lfs1_off_t off, void *buffer, lfs1_size_t size); // Program a region in a block. The block must have previously - // been erased. Negative error codes are propogated to the user. + // been erased. Negative error codes are propagated to the user. // May return LFS1_ERR_CORRUPT if the block should be considered bad. int (*prog)(const struct lfs1_config *c, lfs1_block_t block, lfs1_off_t off, const void *buffer, lfs1_size_t size); // Erase a block. A block must be erased before being programmed. // The state of an erased block is undefined. Negative error codes - // are propogated to the user. + // are propagated to the user. // May return LFS1_ERR_CORRUPT if the block should be considered bad. int (*erase)(const struct lfs1_config *c, lfs1_block_t block); // Sync the state of the underlying block device. Negative error codes - // are propogated to the user. + // are propagated to the user. int (*sync)(const struct lfs1_config *c); // Minimum size of a block read. This determines the size of read buffers. @@ -484,7 +484,7 @@ int lfs1_dir_rewind(lfs1_t *lfs1, lfs1_dir_t *dir); // Returns a negative error code on failure. int lfs1_traverse(lfs1_t *lfs1, int (*cb)(void*, lfs1_block_t), void *data); -// Prunes any recoverable errors that may have occured in the filesystem +// Prunes any recoverable errors that may have occurred in the filesystem // // Not needed to be called by user unless an operation is interrupted // but the filesystem is still mounted. This is already called on first diff --git a/lib/littlefs/lfs2.c b/lib/littlefs/lfs2.c index 39bd2f0d1c..7f3519acd2 100644 --- a/lib/littlefs/lfs2.c +++ b/lib/littlefs/lfs2.c @@ -1449,7 +1449,7 @@ static int lfs2_dir_alloc(lfs2_t *lfs2, lfs2_mdir_t *dir) { } } - // zero for reproducability in case initial block is unreadable + // zero for reproducibility in case initial block is unreadable dir->rev = 0; // rather than clobbering one of the blocks we just pretend @@ -1643,7 +1643,7 @@ static int lfs2_dir_compact(lfs2_t *lfs2, return err; } - // welp, we tried, if we ran out of space there's not much + // whelp, we tried, if we ran out of space there's not much // we can do, we'll error later if we've become frozen if (!err) { end = begin; @@ -4037,7 +4037,7 @@ static int lfs2_fs_relocate(lfs2_t *lfs2, lfs2_fs_prepmove(lfs2, 0x3ff, NULL); } - // replace bad pair, either we clean up desync, or no desync occured + // replace bad pair, either we clean up desync, or no desync occurred lfs2_pair_tole32(newpair); err = lfs2_dir_commit(lfs2, &parent, LFS2_MKATTRS( {LFS2_MKTAG_IF(moveid != 0x3ff, diff --git a/lib/littlefs/lfs2.h b/lib/littlefs/lfs2.h index f3b66d76ff..b819aaa3b5 100644 --- a/lib/littlefs/lfs2.h +++ b/lib/littlefs/lfs2.h @@ -159,34 +159,34 @@ struct lfs2_config { // information to the block device operations void *context; - // Read a region in a block. Negative error codes are propogated + // Read a region in a block. Negative error codes are propagated // to the user. int (*read)(const struct lfs2_config *c, lfs2_block_t block, lfs2_off_t off, void *buffer, lfs2_size_t size); // Program a region in a block. The block must have previously - // been erased. Negative error codes are propogated to the user. + // been erased. Negative error codes are propagated to the user. // May return LFS2_ERR_CORRUPT if the block should be considered bad. int (*prog)(const struct lfs2_config *c, lfs2_block_t block, lfs2_off_t off, const void *buffer, lfs2_size_t size); // Erase a block. A block must be erased before being programmed. // The state of an erased block is undefined. Negative error codes - // are propogated to the user. + // are propagated to the user. // May return LFS2_ERR_CORRUPT if the block should be considered bad. int (*erase)(const struct lfs2_config *c, lfs2_block_t block); // Sync the state of the underlying block device. Negative error codes - // are propogated to the user. + // are propagated to the user. int (*sync)(const struct lfs2_config *c); #ifdef LFS2_THREADSAFE // Lock the underlying block device. Negative error codes - // are propogated to the user. + // are propagated to the user. int (*lock)(const struct lfs2_config *c); // Unlock the underlying block device. Negative error codes - // are propogated to the user. + // are propagated to the user. int (*unlock)(const struct lfs2_config *c); #endif @@ -479,7 +479,7 @@ int lfs2_stat(lfs2_t *lfs2, const char *path, struct lfs2_info *info); // Returns the size of the attribute, or a negative error code on failure. // Note, the returned size is the size of the attribute on disk, irrespective // of the size of the buffer. This can be used to dynamically allocate a buffer -// or check for existance. +// or check for existence. lfs2_ssize_t lfs2_getattr(lfs2_t *lfs2, const char *path, uint8_t type, void *buffer, lfs2_size_t size); diff --git a/lib/oofatfs/diskio.h b/lib/oofatfs/diskio.h index d886bdd9cc..00768cac72 100644 --- a/lib/oofatfs/diskio.h +++ b/lib/oofatfs/diskio.h @@ -3,7 +3,7 @@ */ /*-----------------------------------------------------------------------/ -/ Low level disk interface modlue include file (C)ChaN, 2014 / +/ Low level disk interface module include file (C)ChaN, 2014 / /-----------------------------------------------------------------------*/ #ifndef _DISKIO_DEFINED @@ -42,7 +42,7 @@ DRESULT disk_ioctl (void *drv, BYTE cmd, void* buff); #define STA_PROTECT 0x04 /* Write protected */ -/* Command code for disk_ioctrl fucntion */ +/* Command code for disk_ioctrl function */ /* Generic command (Used by FatFs) */ #define CTRL_SYNC 0 /* Complete pending write process (needed at FF_FS_READONLY == 0) */ diff --git a/lib/oofatfs/ff.c b/lib/oofatfs/ff.c index dbcfa3efc3..a4c17f0560 100644 --- a/lib/oofatfs/ff.c +++ b/lib/oofatfs/ff.c @@ -996,7 +996,7 @@ static FRESULT dec_lock ( /* Decrement object open counter */ if (n == 0) Files[i].fs = 0; /* Delete the entry if open count gets zero */ res = FR_OK; } else { - res = FR_INT_ERR; /* Invalid index nunber */ + res = FR_INT_ERR; /* Invalid index number */ } return res; } @@ -1990,7 +1990,7 @@ static void gen_numname ( seq = (UINT)sr; } - /* itoa (hexdecimal) */ + /* itoa (hexadecimal) */ i = 7; do { c = (BYTE)((seq % 16) + '0'); @@ -2098,7 +2098,7 @@ static DWORD xsum32 ( /* Returns 32-bit checksum */ /*------------------------------------------------------*/ static void get_xfileinfo ( - BYTE* dirb, /* Pointer to the direcotry entry block 85+C0+C1s */ + BYTE* dirb, /* Pointer to the directory entry block 85+C0+C1s */ FILINFO* fno /* Buffer to store the extracted file information */ ) { @@ -2135,16 +2135,16 @@ static void get_xfileinfo ( /*-----------------------------------*/ -/* exFAT: Get a directry entry block */ +/* exFAT: Get a directory entry block */ /*-----------------------------------*/ static FRESULT load_xdir ( /* FR_INT_ERR: invalid entry block */ - DIR* dp /* Reading direcotry object pointing top of the entry block to load */ + DIR* dp /* Reading directory object pointing top of the entry block to load */ ) { FRESULT res; UINT i, sz_ent; - BYTE* dirb = dp->obj.fs->dirbuf; /* Pointer to the on-memory direcotry entry block 85+C0+C1s */ + BYTE* dirb = dp->obj.fs->dirbuf; /* Pointer to the on-memory directory entry block 85+C0+C1s */ /* Load file-directory entry */ @@ -2208,7 +2208,7 @@ static void init_alloc_info ( /*------------------------------------------------*/ static FRESULT load_obj_xdir ( - DIR* dp, /* Blank directory object to be used to access containing direcotry */ + DIR* dp, /* Blank directory object to be used to access containing directory */ const FFOBJID* obj /* Object with its containing directory information */ ) { @@ -2237,18 +2237,18 @@ static FRESULT load_obj_xdir ( /*----------------------------------------*/ static FRESULT store_xdir ( - DIR* dp /* Pointer to the direcotry object */ + DIR* dp /* Pointer to the directory object */ ) { FRESULT res; UINT nent; - BYTE* dirb = dp->obj.fs->dirbuf; /* Pointer to the direcotry entry block 85+C0+C1s */ + BYTE* dirb = dp->obj.fs->dirbuf; /* Pointer to the directory entry block 85+C0+C1s */ /* Create set sum */ st_word(dirb + XDIR_SetSum, xdir_sum(dirb)); nent = dirb[XDIR_NumSec] + 1; - /* Store the direcotry entry block to the directory */ + /* Store the directory entry block to the directory */ res = dir_sdi(dp, dp->blk_ofs); while (res == FR_OK) { res = move_window(dp->obj.fs, dp->sect); @@ -2265,11 +2265,11 @@ static FRESULT store_xdir ( /*-------------------------------------------*/ -/* exFAT: Create a new directory enrty block */ +/* exFAT: Create a new directory entry block */ /*-------------------------------------------*/ static void create_xdir ( - BYTE* dirb, /* Pointer to the direcotry entry block buffer */ + BYTE* dirb, /* Pointer to the directory entry block buffer */ const WCHAR* lfn /* Pointer to the object name */ ) { @@ -2690,7 +2690,7 @@ static void get_fileinfo ( fno->altname[di] = 0; /* Terminate the SFN (null string means SFN is invalid) */ if (fno->fname[0] == 0) { /* If LFN is invalid, altname[] needs to be copied to fname[] */ - if (di == 0) { /* If LFN and SFN both are invalid, this object is inaccesible */ + if (di == 0) { /* If LFN and SFN both are invalid, this object is inaccessible */ fno->fname[di++] = '?'; } else { for (si = di = 0, lcf = NS_BODY; fno->altname[si]; si++, di++) { /* Copy altname[] to fname[] with case information */ @@ -2764,7 +2764,7 @@ static DWORD get_achar ( /* Get a character and advances ptr */ static int pattern_matching ( /* 0:not matched, 1:matched */ const TCHAR* pat, /* Matching pattern */ - const TCHAR* nam, /* String to be tested */ + const TCHAR* name, /* String to be tested */ int skip, /* Number of pre-skip chars (number of ?s) */ int inf /* Infinite search (* specified) */ ) @@ -2775,12 +2775,12 @@ static int pattern_matching ( /* 0:not matched, 1:matched */ while (skip--) { /* Pre-skip name chars */ - if (!get_achar(&nam)) return 0; /* Branch mismatched if less name chars */ + if (!get_achar(&name)) return 0; /* Branch mismatched if less name chars */ } if (*pat == 0 && inf) return 1; /* (short circuit) */ do { - pp = pat; np = nam; /* Top of pattern and name to match */ + pp = pat; np = name; /* Top of pattern and name to match */ for (;;) { if (*pp == '?' || *pp == '*') { /* Wildcard? */ nm = nx = 0; @@ -2795,7 +2795,7 @@ static int pattern_matching ( /* 0:not matched, 1:matched */ if (pc != nc) break; /* Branch mismatched? */ if (pc == 0) return 1; /* Branch matched? (matched at end of both strings) */ } - get_achar(&nam); /* nam++ */ + get_achar(&name); /* name++ */ } while (inf && nc); /* Retry until end of name if infinite search is specified */ return 0; @@ -3183,7 +3183,7 @@ static FRESULT find_volume ( /* FR_OK(0): successful, !=0: an error occurred fmt = bsect ? check_fs(fs, bsect) : 3; /* Check the partition */ } while (LD2PT(fs) == 0 && fmt >= 2 && ++i < 4); } - if (fmt == 4) return FR_DISK_ERR; /* An error occured in the disk I/O layer */ + if (fmt == 4) return FR_DISK_ERR; /* An error occurred in the disk I/O layer */ if (fmt >= 2) return FR_NO_FILESYSTEM; /* No FAT volume is found */ /* An FAT volume is found (bsect). Following code initializes the filesystem object */ @@ -3221,7 +3221,7 @@ static FRESULT find_volume ( /* FR_OK(0): successful, !=0: an error occurred fs->volbase = bsect; fs->database = bsect + ld_dword(fs->win + BPB_DataOfsEx); fs->fatbase = bsect + ld_dword(fs->win + BPB_FatOfsEx); - if (maxlba < (QWORD)fs->database + nclst * fs->csize) return FR_NO_FILESYSTEM; /* (Volume size must not be smaller than the size requiered) */ + if (maxlba < (QWORD)fs->database + nclst * fs->csize) return FR_NO_FILESYSTEM; /* (Volume size must not be smaller than the size required) */ fs->dirbase = ld_dword(fs->win + BPB_RootClusEx); /* Get bitmap location and check if it is contiguous (implementation assumption) */ @@ -3365,7 +3365,7 @@ static FRESULT validate ( /* Returns FR_OK or FR_INVALID_OBJECT */ if (obj && obj->fs && obj->fs->fs_type && obj->id == obj->fs->id) { /* Test if the object is valid */ #if FF_FS_REENTRANT if (lock_fs(obj->fs)) { /* Obtain the filesystem object */ - if (disk_ioctl(obj->fs->drv, IOCTL_STATUS, &stat) == RES_OK && !(stat & STA_NOINIT)) { /* Test if the phsical drive is kept initialized */ + if (disk_ioctl(obj->fs->drv, IOCTL_STATUS, &stat) == RES_OK && !(stat & STA_NOINIT)) { /* Test if the physical drive is kept initialized */ res = FR_OK; } else { unlock_fs(obj->fs, FR_OK); @@ -3374,7 +3374,7 @@ static FRESULT validate ( /* Returns FR_OK or FR_INVALID_OBJECT */ res = FR_TIMEOUT; } #else - if (disk_ioctl(obj->fs->drv, IOCTL_STATUS, &stat) == RES_OK && !(stat & STA_NOINIT)) { /* Test if the phsical drive is kept initialized */ + if (disk_ioctl(obj->fs->drv, IOCTL_STATUS, &stat) == RES_OK && !(stat & STA_NOINIT)) { /* Test if the physical drive is kept initialized */ res = FR_OK; } #endif @@ -3528,7 +3528,7 @@ FRESULT f_open ( } } else { /* Open an existing file */ - if (res == FR_OK) { /* Is the object exsiting? */ + if (res == FR_OK) { /* Is the object existing? */ if (dj.obj.attr & AM_DIR) { /* File open against a directory */ res = FR_NO_FILE; } else { @@ -4339,7 +4339,7 @@ FRESULT f_opendir ( FREE_NAMBUF(); if (res == FR_NO_FILE) res = FR_NO_PATH; } - if (res != FR_OK) dp->obj.fs = 0; /* Invalidate the directory object if function faild */ + if (res != FR_OK) dp->obj.fs = 0; /* Invalidate the directory object if function failed */ LEAVE_FF(fs, res); } @@ -4779,7 +4779,7 @@ FRESULT f_mkdir ( st_clust(fs, fs->win + SZDIRE, pcl); fs->wflag = 1; } - res = dir_register(&dj); /* Register the object to the parent directoy */ + res = dir_register(&dj); /* Register the object to the parent directory */ } } if (res == FR_OK) { diff --git a/lib/oofatfs/ff.h b/lib/oofatfs/ff.h index b133d770db..fe731eb694 100644 --- a/lib/oofatfs/ff.h +++ b/lib/oofatfs/ff.h @@ -240,7 +240,7 @@ typedef struct { WORD ftime; /* Modified time */ BYTE fattrib; /* File attribute */ #if FF_USE_LFN - TCHAR altname[FF_SFN_BUF + 1];/* Altenative file name */ + TCHAR altname[FF_SFN_BUF + 1];/* Alternative file name */ TCHAR fname[FF_LFN_BUF + 1]; /* Primary file name */ #else TCHAR fname[12 + 1]; /* File name */ diff --git a/lib/oofatfs/ffconf.h b/lib/oofatfs/ffconf.h index 52ff6d0a7a..bcd7ee5baf 100644 --- a/lib/oofatfs/ffconf.h +++ b/lib/oofatfs/ffconf.h @@ -188,7 +188,7 @@ #define FF_LFN_BUF 255 #define FF_SFN_BUF 12 /* This set of options defines size of file name members in the FILINFO structure -/ which is used to read out directory items. These values should be suffcient for +/ which is used to read out directory items. These values should be sufficient for / the file names to read. The maximum possible length of the read file name depends / on character encoding. When LFN is not enabled, these options have no effect. */ @@ -251,7 +251,7 @@ / number and only an FAT volume found on the physical drive will be mounted. / When this function is enabled (1), each logical drive number can be bound to / arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk() -/ funciton will be available. */ +/ function will be available. */ #define FF_MIN_SS 512 @@ -316,7 +316,7 @@ #define FF_NORTC_MON 1 #define FF_NORTC_MDAY 1 #define FF_NORTC_YEAR 2018 -/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have +/* The option FF_FS_NORTC switches timestamp function. If the system does not have / any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable / the timestamp function. Every object modified by FatFs will have a fixed timestamp / defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time. diff --git a/lib/oofatfs/ffunicode.c b/lib/oofatfs/ffunicode.c index a04577616a..ce60b42193 100644 --- a/lib/oofatfs/ffunicode.c +++ b/lib/oofatfs/ffunicode.c @@ -3,7 +3,7 @@ /*------------------------------------------------------------------------*/ /* This module will occupy a huge memory in the .const section when the / / FatFs is configured for LFN with DBCS. If the system has any Unicode / -/ utilitiy for the code conversion, this module should be modified to use / +/ utility for the code conversion, this module should be modified to use / / that function to avoid silly memory consumption. / /-------------------------------------------------------------------------*/ /* diff --git a/lib/sdmmc/sdmmc_io.c b/lib/sdmmc/sdmmc_io.c index 17ab291515..68c804982b 100644 --- a/lib/sdmmc/sdmmc_io.c +++ b/lib/sdmmc/sdmmc_io.c @@ -282,7 +282,7 @@ sdmmc_err_t sdmmc_io_rw_extended(sdmmc_card_t* card, int func, return SDMMC_ERR_INVALID_SIZE; } if (datalen == max_byte_transfer_size) { - count = 0; // See 5.3.1 SDIO simplifed spec + count = 0; // See 5.3.1 SDIO simplified spec } else { count = datalen; } diff --git a/lib/uzlib/tinflate.c b/lib/uzlib/tinflate.c index 045952c755..fbee7ce721 100644 --- a/lib/uzlib/tinflate.c +++ b/lib/uzlib/tinflate.c @@ -597,7 +597,7 @@ next_blk: if (res == TINF_DONE && !d->bfinal) { /* the block has ended (without producing more data), but we - can't return without data, so start procesing next block */ + can't return without data, so start processing next block */ goto next_blk; } diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 560dffe6a4..f3e6ffc341 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -188,10 +188,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -200,6 +196,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1229,7 +1229,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1523,10 +1524,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1939,7 +1936,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2252,6 +2249,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2287,11 +2289,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -3044,8 +3041,8 @@ msgid "extra positional arguments given" msgstr "" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" diff --git a/ports/atmel-samd/asf4_conf/samd21/hpl_tc_config.h b/ports/atmel-samd/asf4_conf/samd21/hpl_tc_config.h index d651ca33a8..706c7f4b67 100644 --- a/ports/atmel-samd/asf4_conf/samd21/hpl_tc_config.h +++ b/ports/atmel-samd/asf4_conf/samd21/hpl_tc_config.h @@ -49,7 +49,7 @@ #define CONF_TC3_WAVE_DUTY_VAL 0x1f4 #endif -/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ +/* Calculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ #if CONF_TC3_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val #define CONF_TC3_CC0 \ ((uint32_t)(((double)CONF_TC3_WAVE_PER_VAL * CONF_GCLK_TC3_FREQUENCY) / 1000000 / (1 << CONF_TC3_PRESCALER) - 1)) diff --git a/ports/atmel-samd/asf4_conf/samd51/hpl_tc_config.h b/ports/atmel-samd/asf4_conf/samd51/hpl_tc_config.h index 3bc688295b..dc08b6eb23 100644 --- a/ports/atmel-samd/asf4_conf/samd51/hpl_tc_config.h +++ b/ports/atmel-samd/asf4_conf/samd51/hpl_tc_config.h @@ -42,7 +42,7 @@ #define CONF_TC0_WAVE_DUTY_VAL 0x1f4 #endif -/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ +/* Calculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ #if CONF_TC0_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val #define CONF_TC0_CC0 \ ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1000000 / (1 << CONF_TC0_PRESCALER) - 1)) diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_tc_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_tc_config.h index 3bc688295b..dc08b6eb23 100644 --- a/ports/atmel-samd/asf4_conf/same51/hpl_tc_config.h +++ b/ports/atmel-samd/asf4_conf/same51/hpl_tc_config.h @@ -42,7 +42,7 @@ #define CONF_TC0_WAVE_DUTY_VAL 0x1f4 #endif -/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ +/* Calculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ #if CONF_TC0_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val #define CONF_TC0_CC0 \ ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1000000 / (1 << CONF_TC0_PRESCALER) - 1)) diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h index 3bc688295b..dc08b6eb23 100644 --- a/ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h +++ b/ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h @@ -42,7 +42,7 @@ #define CONF_TC0_WAVE_DUTY_VAL 0x1f4 #endif -/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ +/* Calculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ #if CONF_TC0_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val #define CONF_TC0_CC0 \ ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1000000 / (1 << CONF_TC0_PRESCALER) - 1)) diff --git a/ports/atmel-samd/boards/hallowing_m0_express/board.c b/ports/atmel-samd/boards/hallowing_m0_express/board.c index 701dc4a8ec..aeea62d2a2 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m0_express/board.c @@ -51,7 +51,7 @@ uint8_t display_init_sequence[] = { 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x2a, 0, // _INVOFF 0x36, 1, 0x18, // _MADCTL bottom to top refresh - // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, + // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie, // fix on VTL 0x3a, 1, 0x05, // COLMOD - 16bit color 0xe0, 16, 0x02, 0x1c, 0x07, 0x12, // _GMCTRP1 Gamma diff --git a/ports/atmel-samd/boards/pybadge/board.c b/ports/atmel-samd/boards/pybadge/board.c index a1cb3a0714..11db1ba0a8 100644 --- a/ports/atmel-samd/boards/pybadge/board.c +++ b/ports/atmel-samd/boards/pybadge/board.c @@ -50,7 +50,7 @@ uint8_t display_init_sequence[] = { 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x2a, 0, // _INVOFF 0x36, 1, 0b10100000, // _MADCTL for rotation 0 - // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, + // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie, // fix on VTL 0x3a, 1, 0x05, // COLMOD - 16bit color 0xe0, 16, 0x02, 0x1c, 0x07, 0x12, // _GMCTRP1 Gamma diff --git a/ports/atmel-samd/boards/pygamer/board.c b/ports/atmel-samd/boards/pygamer/board.c index 8ff34f24c5..141365a4a1 100644 --- a/ports/atmel-samd/boards/pygamer/board.c +++ b/ports/atmel-samd/boards/pygamer/board.c @@ -52,7 +52,7 @@ uint8_t display_init_sequence[] = { 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x2a, 0, // _INVOFF 0x36, 1, 0b10100000, // _MADCTL for rotation 0 - // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, + // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie, // fix on VTL 0x3a, 1, 0x05, // COLMOD - 16bit color 0xe0, 16, 0x02, 0x1c, 0x07, 0x12, // _GMCTRP1 Gamma diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index 90cf9dff20..9953f27d02 100644 --- a/ports/atmel-samd/boards/ugame10/board.c +++ b/ports/atmel-samd/boards/ugame10/board.c @@ -52,7 +52,7 @@ uint8_t display_init_sequence[] = { 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x2a, 0, // _INVOFF 0x36, 1, 0xa8, // _MADCTL bottom to top refresh - // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, + // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie, // fix on VTL 0x3a, 1, 0x05, // COLMOD - 16bit color 0xe0, 16, 0x02, 0x1c, 0x07, 0x12, // _GMCTRP1 Gamma diff --git a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c index 2ead87428b..4c1d05feb2 100644 --- a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c +++ b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c @@ -36,7 +36,7 @@ STATIC volatile bool woke_up = false; STATIC mp_float_t wakeup_time; void common_hal_alarm_time_timealarm_construct(alarm_time_timealarm_obj_t *self, mp_float_t monotonic_time) { - // TODO: when issueing light/seep sleep, throw a ValueError if the + // TODO: when issuing light/seep sleep, throw a ValueError if the // time exceeds the maximum value. For light sleep, max = // 2**32 / 16384 = 3 days. For deep sleep, max = 2**32 / 32 // = 1550 days. diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c index 22200c5d1c..6d1a3f7c0e 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -482,7 +482,7 @@ uint32_t common_hal_frequencyio_frequencyin_get_item(frequencyio_frequencyin_obj float time_each_event = self->factor / self->frequency; // get the time for each event during actual period float capture_diff = self->factor - self->capture_period; // get the difference of actual and base periods // we only need to adjust if the capture_diff can contain 1 or more events - // if so, we add how many events could have occured during the diff time + // if so, we add how many events could have occurred during the diff time if (time_each_event > capture_diff) { frequency_adjustment = capture_diff / time_each_event; } diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 887748c7a0..73686e1445 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -189,7 +189,7 @@ // - firmware // - internal CIRCUITPY flash filesystem (optional) // - internal config, used to store crystalless clock calibration info (optional) -// - microntroller.nvm (optional) +// - microcontroller.nvm (optional) // Define these regions starting up from the bottom of flash: diff --git a/ports/atmel-samd/sd_mmc/sd_mmc.c b/ports/atmel-samd/sd_mmc/sd_mmc.c index de5a3cfe17..b558922d1f 100644 --- a/ports/atmel-samd/sd_mmc/sd_mmc.c +++ b/ports/atmel-samd/sd_mmc/sd_mmc.c @@ -1073,7 +1073,7 @@ static void sd_mmc_deselect_slot(void) { * \note * This function runs the initialization procedure and the identification * process, then it sets the SD/MMC card in transfer state. - * At last, it will automaticly enable maximum bus width and transfer speed. + * At last, it will automatically enable maximum bus width and transfer speed. * * \return true if success, otherwise false */ @@ -1205,7 +1205,7 @@ static bool sd_mmc_mci_card_init(void) { * \note * This function runs the initialization procedure and the identification * process, then it sets the SD/MMC card in transfer state. - * At last, it will automaticly enable maximum bus width and transfer speed. + * At last, it will automatically enable maximum bus width and transfer speed. * * \return true if success, otherwise false */ @@ -1270,7 +1270,7 @@ static bool sd_mmc_mci_install_mmc(void) { uint8_t retry = 10; while (retry--) { /* Retry is a WORKAROUND for no compliance card (Atmel Internal ref. MMC19): - * These cards seem not ready immediatly + * These cards seem not ready immediately * after the end of busy of mmc_cmd6_set_high_speed()*/ /* Set default block size */ @@ -1427,7 +1427,7 @@ sd_mmc_err_t sd_mmc_wait_end_of_read_blocks(bool abort) { return SD_MMC_OK; } - /* All blocks are transfered then stop read operation */ + /* All blocks are transferred then stop read operation */ if (sd_mmc_nb_block_to_tranfer == 1) { /* Single block transfer, then nothing to do */ sd_mmc_deselect_slot(); @@ -1506,7 +1506,7 @@ sd_mmc_err_t sd_mmc_wait_end_of_write_blocks(bool abort) { return SD_MMC_OK; } - /* All blocks are transfered then stop write operation */ + /* All blocks are transferred then stop write operation */ if (sd_mmc_nb_block_to_tranfer == 1) { /* Single block transfer, then nothing to do */ sd_mmc_deselect_slot(); diff --git a/ports/atmel-samd/sd_mmc/sd_mmc.h b/ports/atmel-samd/sd_mmc/sd_mmc.h index e51bf17e80..667520317c 100644 --- a/ports/atmel-samd/sd_mmc/sd_mmc.h +++ b/ports/atmel-samd/sd_mmc/sd_mmc.h @@ -67,7 +67,7 @@ typedef uint8_t sd_mmc_err_t; /**< Type of return error code */ #define SD_MMC_INIT_ONGOING 1 /**< Card not initialized */ #define SD_MMC_ERR_NO_CARD 2 /**< No SD/MMC card inserted */ #define SD_MMC_ERR_UNUSABLE 3 /**< Unusable card */ -#define SD_MMC_ERR_SLOT 4 /**< Slot unknow */ +#define SD_MMC_ERR_SLOT 4 /**< Slot unknown */ #define SD_MMC_ERR_COMM 5 /**< General communication error */ #define SD_MMC_ERR_PARAM 6 /**< Illeage input parameter */ #define SD_MMC_ERR_WP 7 /**< Card write protected */ @@ -166,7 +166,7 @@ uint32_t sd_mmc_get_capacity(uint8_t slot); * * \param[in] slot Card slot * - * \return true, if write portected + * \return true, if write protected */ bool sd_mmc_is_write_protected(uint8_t slot); diff --git a/ports/atmel-samd/sd_mmc/sd_mmc_protocol.h b/ports/atmel-samd/sd_mmc/sd_mmc_protocol.h index 9b4d8e8e74..c205415559 100644 --- a/ports/atmel-samd/sd_mmc/sd_mmc_protocol.h +++ b/ports/atmel-samd/sd_mmc/sd_mmc_protocol.h @@ -73,8 +73,8 @@ extern "C" { * Responses types: * * R1, R3, R4 & R5 use a 48 bits response protected by a 7bit CRC checksum - * - R1 receiv data not specified - * - R3 receiv OCR + * - R1 receive data not specified + * - R3 receive OCR * - R4, R5 RCA management (MMC only) * - R6, R7 RCA management (SD only) * @@ -115,14 +115,14 @@ typedef uint32_t sdmmc_cmd_def_t; #define SDMMC_RESP_CRC (1lu << 12) // ! Card may send busy #define SDMMC_RESP_BUSY (1lu << 13) -// Open drain for a braodcast command (bc) +// Open drain for a broadcast command (bc) // or to enter in inactive state (MCI only) #define SDMMC_CMD_OPENDRAIN (1lu << 14) // ! To signal a data write operation #define SDMMC_CMD_WRITE (1lu << 15) -// ! To signal a SDIO tranfer in multi byte mode +// ! To signal a SDIO transfer in multi byte mode #define SDMMC_CMD_SDIO_BYTE (1lu << 16) -// ! To signal a SDIO tranfer in block mode +// ! To signal a SDIO transfer in block mode #define SDMMC_CMD_SDIO_BLOCK (1lu << 17) // ! To signal a data transfer in stream mode #define SDMMC_CMD_STREAM (1lu << 18) @@ -132,7 +132,7 @@ typedef uint32_t sdmmc_cmd_def_t; #define SDMMC_CMD_MULTI_BLOCK (1lu << 20) // ! @} -// ! \name Set of flags to define a reponse type +// ! \name Set of flags to define a response type // ! @{ #define SDMMC_CMD_NO_RESP (0) #define SDMMC_CMD_R1 (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC) @@ -324,7 +324,7 @@ typedef uint32_t sdmmc_cmd_def_t; #define SD_MCI_ACMD41_SD_SEND_OP_COND (41 | SDMMC_CMD_R3 | SDMMC_CMD_OPENDRAIN) /** * ACMD41(R1): Send host capacity support information (HCS) and activates the - * card's initilization process + * card's initialization process */ #define SD_SPI_ACMD41_SD_SEND_OP_COND (41 | SDMMC_CMD_R1) /** @@ -440,7 +440,7 @@ typedef uint32_t sdmmc_cmd_def_t; #define SDIO_R5_ERROR (1lu << 11) /**< General error */ #define SDIO_R5_FUNC_NUM (1lu << 9) /**< Invalid function number */ #define SDIO_R5_OUT_OF_RANGE (1lu << 8) /**< Argument out of range */ -#define SDIO_R5_STATUS_ERR (SDIO_R5_ERROR | SDIO_R5_FUNC_NUM | SDIO_R5_OUT_OF_RANGE) // !< Errro status bits mask +#define SDIO_R5_STATUS_ERR (SDIO_R5_ERROR | SDIO_R5_FUNC_NUM | SDIO_R5_OUT_OF_RANGE) // !< Error status bits mask // ! @} // ! \name SDIO state (in R6) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 45b999f1a1..8cba5c61e0 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -307,7 +307,7 @@ safe_mode_t port_init(void) { // because it was hard enough to figure out, and maybe there's // a mistake that could make it work in the future. #if 0 - // Designate QSPI memory mapped region as not cachable. + // Designate QSPI memory mapped region as not cacheable. // Turn off MPU in case it is on. MPU->CTRL = 0; @@ -320,7 +320,7 @@ safe_mode_t port_init(void) { 0b011 << MPU_RASR_AP_Pos | // full read/write access for privileged and user mode 0b000 << MPU_RASR_TEX_Pos | // caching not allowed, strongly ordered 1 << MPU_RASR_S_Pos | // sharable - 0 << MPU_RASR_C_Pos | // not cachable + 0 << MPU_RASR_C_Pos | // not cacheable 0 << MPU_RASR_B_Pos | // not bufferable 0b10111 << MPU_RASR_SIZE_Pos | // 16MB region size 1 << MPU_RASR_ENABLE_Pos // enable this region diff --git a/ports/espressif/README.rst b/ports/espressif/README.rst index 949f3533ae..49f372359b 100644 --- a/ports/espressif/README.rst +++ b/ports/espressif/README.rst @@ -55,7 +55,7 @@ Connect these pins using a `USB adapter ` **UART Connection:** -A `USB to UART convertor `_ can be used for connecting to ESP32-C3 to get access to the serial console and REPL and for flashing CircuitPython. +A `USB to UART converter `_ can be used for connecting to ESP32-C3 to get access to the serial console and REPL and for flashing CircuitPython. The following connections need to be made in this case: @@ -92,7 +92,7 @@ Connect these pins using a `USB adapter ` **UART Connection:** -A `USB to UART convertor `_ can be used for connecting to ESP32-S2 to get access to the serial console and REPL and for flashing CircuitPython. +A `USB to UART converter `_ can be used for connecting to ESP32-S2 to get access to the serial console and REPL and for flashing CircuitPython. The following connections need to be made in this case: @@ -129,7 +129,7 @@ Connect these pins using a `USB adapter ` **UART Connection:** -A `USB to UART convertor `_ can be used for connecting to ESP32-S3 to get access to the serial console and REPL and for flashing CircuitPython. +A `USB to UART converter `_ can be used for connecting to ESP32-S3 to get access to the serial console and REPL and for flashing CircuitPython. The following connections need to be made in this case: diff --git a/ports/espressif/bindings/espcamera/Camera.c b/ports/espressif/bindings/espcamera/Camera.c index 824bc7d3dc..5fb9576e58 100644 --- a/ports/espressif/bindings/espcamera/Camera.c +++ b/ports/espressif/bindings/espcamera/Camera.c @@ -63,7 +63,7 @@ //| """ //| Configure and initialize a camera with the given properties //| -//| This driver requires that the ``CIRCUITPY_RESERVED_PSRAM`` in ``settings.toml`` be large enough to hold the camera frambuffer(s). Generally, boards with built-in cameras will have a default setting that is large enough. If the constructor raises a MemoryError or an IDFError, this probably indicates the setting is too small and should be increased. +//| This driver requires that the ``CIRCUITPY_RESERVED_PSRAM`` in ``settings.toml`` be large enough to hold the camera framebuffer(s). Generally, boards with built-in cameras will have a default setting that is large enough. If the constructor raises a MemoryError or an IDFError, this probably indicates the setting is too small and should be increased. //| //| //| .. important:: @@ -89,7 +89,7 @@ //| :param reset_pin: The reset input to the camera module //| :param pixel_format: The pixel format of the captured image //| :param frame_size: The size of captured image -//| :param jpeg_quality: For `PixelFormat.JPEG`, the quality. Higher numbers increase quality. If the quality is too high, the JPEG data will be larger than the availalble buffer size and the image will be unusable or truncated. The exact range of appropriate values depends on the sensor and must be determined empirically. +//| :param jpeg_quality: For `PixelFormat.JPEG`, the quality. Higher numbers increase quality. If the quality is too high, the JPEG data will be larger than the available buffer size and the image will be unusable or truncated. The exact range of appropriate values depends on the sensor and must be determined empirically. //| :param framebuffer_count: The number of framebuffers (1 for single-buffered and 2 for double-buffered) //| :param grab_mode: When to grab a new frame //| """ diff --git a/ports/espressif/bindings/espnow/Peer.c b/ports/espressif/bindings/espnow/Peer.c index 7b6cc5f668..ca756409a6 100644 --- a/ports/espressif/bindings/espnow/Peer.c +++ b/ports/espressif/bindings/espnow/Peer.c @@ -32,7 +32,7 @@ #include "common-hal/espnow/__init__.h" // TODO: check peer already exist -// TODO: check peer dosen't exist +// TODO: check peer doesn't exist //| class Peer: //| """A data class to store parameters specific to a peer.""" diff --git a/ports/espressif/boards/lolin_s2_mini/pins.c b/ports/espressif/boards/lolin_s2_mini/pins.c index a4b18c4e9b..ee81e00d9e 100644 --- a/ports/espressif/boards/lolin_s2_mini/pins.c +++ b/ports/espressif/boards/lolin_s2_mini/pins.c @@ -4,7 +4,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS // S2 Mini Board bottom, right, top-bottom - // GPIO0-GPIO14: broken out as a bloc on ESP32-S2FN4R2 SoC + // GPIO0-GPIO14: broken out as a block on ESP32-S2FN4R2 SoC // mpconfigboard.h: GPIO0: CIRCUITPY_BOOT_BUTTON { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, // RTC_GPIO0,GPIO0 @@ -57,7 +57,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { // skip GPIO22-GPIO25: not broken out on ESP32-S2FN4R2 SoC // skip GPIO26-GPIO32: SPI Flash & RAM, not broken out on S2 Mini (internal to ESP32-S2FN4R2 SoC?) - // GPIO33-GPIO40: broken out as a bloc on ESP32-S2FN4R2 SoC, last 2 half of JTAG + // GPIO33-GPIO40: broken out as a block on ESP32-S2FN4R2 SoC, last 2 half of JTAG { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) },// SPIIO4,GPIO33,FSPIHD { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) },// def from Wemos MP { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO33) },// D1 mini pin D2 GPIO4 diff --git a/ports/espressif/boards/m5stack_stick_c/board.c b/ports/espressif/boards/m5stack_stick_c/board.c index bbc0447056..88d0287419 100644 --- a/ports/espressif/boards/m5stack_stick_c/board.c +++ b/ports/espressif/boards/m5stack_stick_c/board.c @@ -193,7 +193,7 @@ static bool pmic_init(void) { } // Reg: 12h - // Enable EXTEN, DCDC1, LDO2 and LDO3 + // Enable EXTENT, DCDC1, LDO2 and LDO3 write_buf[0] = AXP192_DCDC13_LDO23_CTRL; write_buf[1] = AXP192_DCDC13_LDO23_CTRL_EXTEN | AXP192_DCDC13_LDO23_CTRL_LDO3 | diff --git a/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/board.c b/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/board.c index 070e3418da..359263df81 100644 --- a/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/board.c +++ b/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/board.c @@ -51,7 +51,7 @@ uint8_t display_init_sequence[] = { 0xC5, 0x01, 0x0E, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x20, 0x00, // _INVOFF 0x36, 0x01, 0x18, // _MADCTL bottom to top refresh - // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, + // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie, // fix on VTL 0x3A, 0x01, 0x05, // COLMOD - 16bit color 0xE0, 0x10, 0x02, 0x1C, 0x07, 0x12, 0x37, 0x32, 0x29, 0x2D, 0x29, 0x25, 0x2B, 0x39, 0x00, 0x01, 0x03, 0x10, // _GMCTRP1 Gamma diff --git a/ports/espressif/common-hal/_bleio/Adapter.c b/ports/espressif/common-hal/_bleio/Adapter.c index 3239c501cc..01adae3adb 100644 --- a/ports/espressif/common-hal/_bleio/Adapter.c +++ b/ports/espressif/common-hal/_bleio/Adapter.c @@ -221,7 +221,7 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t mp_float_t interval, mp_float_t window, mp_int_t minimum_rssi, bool active) { if (self->scan_results != NULL) { if (!shared_module_bleio_scanresults_get_done(self->scan_results)) { - mp_raise_bleio_BluetoothError(translate("Scan already in progess. Stop with stop_scan.")); + mp_raise_bleio_BluetoothError(translate("Scan already in progress. Stop with stop_scan.")); } self->scan_results = NULL; } diff --git a/ports/espressif/common-hal/_bleio/Connection.c b/ports/espressif/common-hal/_bleio/Connection.c index 75def8ad76..5e3e02d8e5 100644 --- a/ports/espressif/common-hal/_bleio/Connection.c +++ b/ports/espressif/common-hal/_bleio/Connection.c @@ -248,7 +248,7 @@ STATIC int _discovered_characteristic_cb(uint16_t conn_handle, ((chr->properties & BLE_GATT_CHR_PROP_WRITE) != 0 ? CHAR_PROP_WRITE : 0) | ((chr->properties & BLE_GATT_CHR_PROP_WRITE_NO_RSP) != 0 ? CHAR_PROP_WRITE_NO_RESPONSE : 0); - // Call common_hal_bleio_characteristic_construct() to initalize some fields and set up evt handler. + // Call common_hal_bleio_characteristic_construct() to initialize some fields and set up evt handler. common_hal_bleio_characteristic_construct( characteristic, service, chr->val_handle, uuid, props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN, diff --git a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c index 232614ce32..b58234c9a8 100644 --- a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c +++ b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c @@ -119,7 +119,7 @@ void alarm_touch_touchalarm_set_alarm(const bool deep_sleep, const size_t n_alar for (uint8_t i = 1; i <= 14; i++) { if ((touch_channel_mask & 1 << i) != 0) { touch_pad_t touch_channel = (touch_pad_t)i; - // intialize touchpad + // initialize touchpad peripherals_touch_init(touch_channel); // wait for touch data to reset @@ -166,7 +166,7 @@ void alarm_touch_touchalarm_prepare_for_deep_sleep(void) { peripherals_touch_never_reset(false); peripherals_touch_reset(); - // intialize touchpad + // initialize touchpad peripherals_touch_init(touch_channel); #if !defined(CONFIG_IDF_TARGET_ESP32) diff --git a/ports/espressif/common-hal/pulseio/PulseIn.c b/ports/espressif/common-hal/pulseio/PulseIn.c index bb6ef7f975..42db2f18bd 100644 --- a/ports/espressif/common-hal/pulseio/PulseIn.c +++ b/ports/espressif/common-hal/pulseio/PulseIn.c @@ -123,7 +123,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu rmt_config_t config = RMT_DEFAULT_CONFIG_RX(pin->number, channel); config.rx_config.filter_en = true; config.rx_config.idle_threshold = 30000; // 30*3=90ms idle required to register a sequence - config.clk_div = 240; // All measurements are divided by 3 to accomodate 65ms pulses + config.clk_div = 240; // All measurements are divided by 3 to accommodate 65ms pulses rmt_config(&config); rmt_driver_install(channel, 1000, 0); // TODO: pick a more specific buffer size? diff --git a/ports/espressif/common-hal/pwmio/PWMOut.c b/ports/espressif/common-hal/pwmio/PWMOut.c index 2cb1e6254b..519885a032 100644 --- a/ports/espressif/common-hal/pwmio/PWMOut.c +++ b/ports/espressif/common-hal/pwmio/PWMOut.c @@ -197,7 +197,7 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t *self) { if (!taken || self->variable_frequency) { ledc_timer_rst(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num); reserved_timer_freq[self->tim_handle.timer_num] = 0; - // if timer isn't varfreq this will be off aleady + // if timer isn't varfreq this will be off already varfreq_timers[self->tim_handle.timer_num] = false; never_reset_tim[self->tim_handle.timer_num] = false; } diff --git a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c index 07b97cf9a3..088f4a15dc 100644 --- a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c @@ -69,7 +69,7 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode .unit = unit, }; - // Reinitalize same unit, CHANNEL_1 with different parameters. + // Reinitialize same unit, CHANNEL_1 with different parameters. peripherals_pcnt_reinit(&pcnt_config_channel_1); self->pin_a = pin_a->number; diff --git a/ports/espressif/i2s_lcd_driver.h b/ports/espressif/i2s_lcd_driver.h index 0002d6b564..27c4e66b06 100644 --- a/ports/espressif/i2s_lcd_driver.h +++ b/ports/espressif/i2s_lcd_driver.h @@ -44,7 +44,7 @@ typedef struct { } i2s_lcd_config_t; /** - * @brief Initilize i2s lcd driver. + * @brief Initialize i2s lcd driver. * * @param config configuration of i2s * diff --git a/ports/litex/boards/fomu/fomu-spi.ld b/ports/litex/boards/fomu/fomu-spi.ld index e7db25b0c5..33ba3db686 100644 --- a/ports/litex/boards/fomu/fomu-spi.ld +++ b/ports/litex/boards/fomu/fomu-spi.ld @@ -93,7 +93,7 @@ SECTIONS . = ALIGN(4); _etext = .; /* define a global symbol at end of code */ - _sidata = _etext; /* This is used by the startup in order to initialize the .data secion */ + _sidata = _etext; /* This is used by the startup in order to initialize the .data section */ } >FLASH_FIRMWARE /* Uninitialized data section */ diff --git a/ports/litex/common-hal/neopixel_write/__init__.c b/ports/litex/common-hal/neopixel_write/__init__.c index e7e5600fb1..b26bbac695 100644 --- a/ports/litex/common-hal/neopixel_write/__init__.c +++ b/ports/litex/common-hal/neopixel_write/__init__.c @@ -72,7 +72,7 @@ static void ledda_init(void) { // Set clock register to 12 MHz / 64 kHz - 1 ledda_write((12000000 / 64000) - 1, LEDDBR); - // Ensure LED "breathe" effect is diabled + // Ensure LED "breathe" effect is disabled ledda_write(0, LEDDBCRR); ledda_write(0, LEDDBCFR); diff --git a/ports/litex/crt0-vexriscv.S b/ports/litex/crt0-vexriscv.S index 0419acf851..0517711865 100644 --- a/ports/litex/crt0-vexriscv.S +++ b/ports/litex/crt0-vexriscv.S @@ -6,7 +6,7 @@ _start: j crt_init - # This sentinal ensures that this program is loaded + # This sentinel ensures that this program is loaded # to RAM when loaded using dfu-util. #.word 0x17ab0f23 #.word 0x10001000 diff --git a/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c b/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c index 88d0453065..c757a28e6e 100644 --- a/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c +++ b/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c @@ -64,7 +64,7 @@ void PLACE_IN_ITCM(common_hal_neopixel_write)(const digitalio_digitalinout_obj_t const uint32_t pin = digitalinout->pin->number; __disable_irq(); - // Enable DWT in debug core. Useable when interrupts disabled, as opposed to Systick->VAL + // Enable DWT in debug core. Usable when interrupts disabled, as opposed to Systick->VAL CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; DWT->CYCCNT = 0; diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 2267a582a4..412ff86cde 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -241,7 +241,7 @@ FLASHER ?= ifeq ($(FLASHER),) -# Also update to bootloader settting to validate application and skip checksum ( app valid = 0x0001, crc = 0x0000 ) +# Also update to bootloader setting to validate application and skip checksum ( app valid = 0x0001, crc = 0x0000 ) flash: $(BUILD)/firmware.hex nrfjprog --program $< --sectorerase -f $(MCU_VARIANT) nrfjprog --erasepage $(BOOT_SETTING_ADDR) -f $(MCU_VARIANT) diff --git a/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/include/ble_l2cap.h b/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/include/ble_l2cap.h index d04bec3fbf..e0f005d9b0 100644 --- a/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/include/ble_l2cap.h +++ b/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/include/ble_l2cap.h @@ -286,7 +286,7 @@ typedef struct /**@brief L2CAP event structure. */ typedef struct { - uint16_t conn_handle; /**< Connection Handle on which the event occured. */ + uint16_t conn_handle; /**< Connection Handle on which the event occurred. */ uint16_t local_cid; /**< Local Channel ID of the L2CAP channel, or @ref BLE_L2CAP_CID_INVALID if not present. */ union diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h index 933f398b57..a624338ceb 100644 --- a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h @@ -287,7 +287,7 @@ typedef struct /**@brief L2CAP event structure. */ typedef struct { - uint16_t conn_handle; /**< Connection Handle on which the event occured. */ + uint16_t conn_handle; /**< Connection Handle on which the event occurred. */ uint16_t local_cid; /**< Local Channel ID of the L2CAP channel, or @ref BLE_L2CAP_CID_INVALID if not present. */ union diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h index 24001fb12a..3def7d6783 100644 --- a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h @@ -275,8 +275,8 @@ typedef struct * If the application returns from the fault handler the SoftDevice will call NVIC_SystemReset(). * * @note It is recommended to either perform a reset in the fault handler or to let the SoftDevice reset the device. - * Otherwise SoC peripherals may behave in an undefined way. For example, the RADIO peripherial may - * continously transmit packets. + * Otherwise SoC peripherals may behave in an undefined way. For example, the RADIO peripheral may + * continuously transmit packets. * * @note This callback is executed in HardFault context, thus SVC functions cannot be called from the fault callback. * diff --git a/ports/nrf/boards/feather_nrf52840_express/README.md b/ports/nrf/boards/feather_nrf52840_express/README.md index 8d515010f9..88a78a20fd 100644 --- a/ports/nrf/boards/feather_nrf52840_express/README.md +++ b/ports/nrf/boards/feather_nrf52840_express/README.md @@ -104,7 +104,7 @@ Parsing hex file. Erasing user available code and UICR flash areas. Applying system reset. Checking that the area to write is not protected. -Programing device. +Programming device. Applying system reset. Run. ``` diff --git a/ports/nrf/boards/hiibot_bluefi/pins.c b/ports/nrf/boards/hiibot_bluefi/pins.c index ba1910dc9d..7e0e0a94f4 100644 --- a/ports/nrf/boards/hiibot_bluefi/pins.c +++ b/ports/nrf/boards/hiibot_bluefi/pins.c @@ -117,7 +117,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { // { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_P1_13) }, { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_P1_13) }, - // P28~P33/D28~D33 connecte into QSPI FlashROM (W25Q16JV_IQ) + // P28~P33/D28~D33 connected into QSPI FlashROM (W25Q16JV_IQ) { MP_ROM_QSTR(MP_QSTR_P34), MP_ROM_PTR(&pin_P0_22) }, { MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_P0_22) }, diff --git a/ports/nrf/boards/sparkfun_nrf52840_micromod/README.md b/ports/nrf/boards/sparkfun_nrf52840_micromod/README.md index 5c41fdb7cf..7040507ba6 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_micromod/README.md +++ b/ports/nrf/boards/sparkfun_nrf52840_micromod/README.md @@ -8,11 +8,11 @@ We've also routed two I2C buses, 2 SPI buses, eleven GPIO, dedicated ## CircuitPython Pin Defs -CircuitPython pin definitions, while simialr to other boards represent a slight departure from just the typical `A` and `D` pin definitions. The majority of general pins are labled as `G` (or alternatively, `BUS`,) as the MicroMod system they build on uses those names to specify pins that may not be specficially analog or digital. +CircuitPython pin definitions, while similar to other boards represent a slight departure from just the typical `A` and `D` pin definitions. The majority of general pins are labeled as `G` (or alternatively, `BUS`,) as the MicroMod system they build on uses those names to specify pins that may not be specficially analog or digital. This can be somewhat confusing, especially around the analog pins. Here's a quick pin-map: -MicroMod Pin # | ATP Pin Label | Pin Definition | Additional Definitons | Pin/Port Reference | Notes +MicroMod Pin # | ATP Pin Label | Pin Definition | Additional Definitions | Pin/Port Reference | Notes :--------------|:--------------|:--------------|:-----------------------|:-------------------|:------ 8 | G11 | | | (Not Connected) | 10 | D0 | D0 | | P0_27 | diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 1c3c829c5b..828ff8806d 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -190,7 +190,7 @@ STATIC uint32_t ble_stack_enable(void) { return err_code; } - // Increase the GATT Server attribute size to accomodate both the CircuitPython built-in service + // Increase the GATT Server attribute size to accommodate both the CircuitPython built-in service // and anything the user does. memset(&ble_conf, 0, sizeof(ble_conf)); // Each increment to the BLE_GATTS_ATTR_TAB_SIZE_DEFAULT multiplier costs 1408 bytes. @@ -529,7 +529,7 @@ STATIC bool scan_on_ble_evt(ble_evt_t *ble_evt, void *scan_results_in) { mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t *prefixes, size_t prefix_length, bool extended, mp_int_t buffer_size, mp_float_t timeout, mp_float_t interval, mp_float_t window, mp_int_t minimum_rssi, bool active) { if (self->scan_results != NULL) { if (!shared_module_bleio_scanresults_get_done(self->scan_results)) { - mp_raise_bleio_BluetoothError(translate("Scan already in progess. Stop with stop_scan.")); + mp_raise_bleio_BluetoothError(translate("Scan already in progress. Stop with stop_scan.")); } self->scan_results = NULL; } diff --git a/ports/nrf/common-hal/_bleio/Characteristic.c b/ports/nrf/common-hal/_bleio/Characteristic.c index df86654c70..e911e5a1e3 100644 --- a/ports/nrf/common-hal/_bleio/Characteristic.c +++ b/ports/nrf/common-hal/_bleio/Characteristic.c @@ -283,7 +283,7 @@ void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, } // Write with response will return NRF_ERROR_BUSY if the response has not been received. - // Write without reponse will return NRF_ERROR_RESOURCES if too many writes are pending. + // Write without response will return NRF_ERROR_RESOURCES if too many writes are pending. if (err_code == NRF_ERROR_BUSY || err_code == NRF_ERROR_RESOURCES) { // We could wait for an event indicating the write is complete, but just retrying is easier. RUN_BACKGROUND_TASKS; diff --git a/ports/nrf/common-hal/_bleio/Connection.c b/ports/nrf/common-hal/_bleio/Connection.c index 0d8d8c32f0..69e6945d21 100644 --- a/ports/nrf/common-hal/_bleio/Connection.c +++ b/ports/nrf/common-hal/_bleio/Connection.c @@ -528,7 +528,7 @@ STATIC void on_char_discovery_rsp(ble_gattc_evt_char_disc_rsp_t *response, bleio (gattc_char->char_props.write ? CHAR_PROP_WRITE : 0) | (gattc_char->char_props.write_wo_resp ? CHAR_PROP_WRITE_NO_RESPONSE : 0); - // Call common_hal_bleio_characteristic_construct() to initalize some fields and set up evt handler. + // Call common_hal_bleio_characteristic_construct() to initialize some fields and set up evt handler. common_hal_bleio_characteristic_construct( characteristic, m_char_discovery_service, gattc_char->handle_value, uuid, props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN, diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index 718b28c7fe..75bfb60342 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -249,7 +249,7 @@ void common_hal_bleio_gattc_write(uint16_t handle, uint16_t conn_handle, mp_buff } // Write with response will return NRF_ERROR_BUSY if the response has not been received. - // Write without reponse will return NRF_ERROR_RESOURCES if too many writes are pending. + // Write without response will return NRF_ERROR_RESOURCES if too many writes are pending. if (err_code == NRF_ERROR_BUSY || err_code == NRF_ERROR_RESOURCES) { // We could wait for an event indicating the write is complete, but just retrying is easier. MICROPY_VM_HOOK_LOOP; diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index cd4114dcfb..7824175605 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -55,7 +55,7 @@ void common_hal_mcu_disable_interrupts() { // Unlike __disable_irq(), this should only be called the first time // "is_nested_critical_region" is sd's equivalent of our nesting count // so a nested call would store 0 in the global and make the later - // exit call not actually reenable interrupts + // exit call not actually re-enable interrupts // // This only disables interrupts of priority 2 through 7; levels 0, 1, // and 4, are exclusive to softdevice and should never be used, so diff --git a/ports/nrf/common-hal/pwmio/PWMOut.c b/ports/nrf/common-hal/pwmio/PWMOut.c index f73e3d3952..6171f5eb76 100644 --- a/ports/nrf/common-hal/pwmio/PWMOut.c +++ b/ports/nrf/common-hal/pwmio/PWMOut.c @@ -94,7 +94,7 @@ STATIC void reset_single_pwmout(uint8_t i) { for (int ch = 0; ch < CHANNELS_PER_PWM; ch++) { pwm_seq[i][ch] = (1 << 15); // polarity = 0 - pwm->PSEL.OUT[ch] = 0xFFFFFFFF; // disconnnect from I/O + pwm->PSEL.OUT[ch] = 0xFFFFFFFF; // disconnect from I/O } } diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 99effcea2f..4726d51c55 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -65,7 +65,7 @@ // This also includes mpconfigboard.h. #include "py/circuitpy_mpconfig.h" -// Definitions that might be overriden by mpconfigboard.h +// Definitions that might be overridden by mpconfigboard.h #ifndef CIRCUITPY_INTERNAL_NVM_SIZE #define CIRCUITPY_INTERNAL_NVM_SIZE (8 * 1024) diff --git a/ports/nrf/supervisor/qspi_flash.c b/ports/nrf/supervisor/qspi_flash.c index df80671e64..2ae166d3ad 100644 --- a/ports/nrf/supervisor/qspi_flash.c +++ b/ports/nrf/supervisor/qspi_flash.c @@ -59,7 +59,7 @@ static int sck_delay_saved = 0; void qspi_disable(void) { // If VBUS is detected, no need to disable QSPI if (NRF_QSPI->ENABLE && !(NRF_POWER->USBREGSTATUS & POWER_USBREGSTATUS_VBUSDETECT_Msk)) { - // Keep CS high when QSPI is diabled + // Keep CS high when QSPI is disabled nrf_gpio_cfg_output(MICROPY_QSPI_CS); nrf_gpio_pin_write(MICROPY_QSPI_CS, 1); diff --git a/ports/raspberrypi/bindings/cyw43/__init__.c b/ports/raspberrypi/bindings/cyw43/__init__.c index 778da1ab62..520d10263c 100644 --- a/ports/raspberrypi/bindings/cyw43/__init__.c +++ b/ports/raspberrypi/bindings/cyw43/__init__.c @@ -84,7 +84,7 @@ const mp_obj_type_t cyw43_pin_type = { //| The low 4 bits, ``m``, are the power management mode: //| * 0: disabled //| * 1: aggressive power saving which reduces wifi throughput -//| * 2: Power saving with high througput +//| * 2: Power saving with high throughput //| //| The next 8 bits, ``r``, specify "the maximum time to wait before going back to sleep" for power management mode 2. The units of ``r`` are 10ms. //| diff --git a/ports/raspberrypi/common-hal/ssl/SSLSocket.c b/ports/raspberrypi/common-hal/ssl/SSLSocket.c index 67508f16c8..06fe350cb6 100644 --- a/ports/raspberrypi/common-hal/ssl/SSLSocket.c +++ b/ports/raspberrypi/common-hal/ssl/SSLSocket.c @@ -257,7 +257,7 @@ mp_uint_t common_hal_ssl_sslsocket_recv_into(ssl_sslsocket_obj_t *self, uint8_t } else if (ret == MBEDTLS_ERR_SSL_WANT_WRITE) { // If handshake is not finished, read attempt may end up in protocol // wanting to write next handshake message. The same may happen with - // renegotation. + // renegotiation. ret = MP_EWOULDBLOCK; } DEBUG("raising errno [error case] %d\n", ret); @@ -276,7 +276,7 @@ mp_uint_t common_hal_ssl_sslsocket_send(ssl_sslsocket_obj_t *self, const uint8_t } else if (ret == MBEDTLS_ERR_SSL_WANT_READ) { // If handshake is not finished, write attempt may end up in protocol // wanting to read next handshake message. The same may happen with - // renegotation. + // renegotiation. ret = MP_EWOULDBLOCK; } DEBUG("raising errno [error case] %d\n", ret); diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index ae14d29ade..2ed19a96e7 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -176,7 +176,7 @@ void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_ common_hal_wifi_radio_stop_ap(self); - // Channel can only be changed after inital powerup and config of ap. + // Channel can only be changed after initial powerup and config of ap. // Defaults to 1 if not set or invalid (i.e. 13) cyw43_wifi_ap_set_channel(&cyw43_state, (const uint32_t)channel); diff --git a/ports/raspberrypi/common-hal/wifi/__init__.c b/ports/raspberrypi/common-hal/wifi/__init__.c index e5a646f88f..91a45e8d92 100644 --- a/ports/raspberrypi/common-hal/wifi/__init__.c +++ b/ports/raspberrypi/common-hal/wifi/__init__.c @@ -107,7 +107,7 @@ void raise_cyw_error(int err) { mp_errno = MP_ETIMEDOUT; break; default: - mp_raise_OSError_msg_varg(translate("Unkown error code %d"), err); + mp_raise_OSError_msg_varg(translate("Unknown error code %d"), err); } mp_raise_OSError(mp_errno); } diff --git a/ports/stm/boards/common_default.ld b/ports/stm/boards/common_default.ld index 0c7efd01d4..7c96a42bc5 100644 --- a/ports/stm/boards/common_default.ld +++ b/ports/stm/boards/common_default.ld @@ -24,7 +24,7 @@ SECTIONS . = ALIGN(4); KEEP(*(.isr_vector)) /* Startup code */ - /* This first flash block is 16K annd the isr vectors only take up + /* This first flash block is 16K and the isr vectors only take up about 400 bytes. Micropython pads this with files, but this didn't work with the size of Circuitpython's ff object. */ diff --git a/ports/stm/boards/common_nvm.ld b/ports/stm/boards/common_nvm.ld index 91e453bfd9..1d10db8a31 100644 --- a/ports/stm/boards/common_nvm.ld +++ b/ports/stm/boards/common_nvm.ld @@ -26,7 +26,7 @@ SECTIONS . = ALIGN(4); KEEP(*(.isr_vector)) /* Startup code */ - /* This first flash block is 16K annd the isr vectors only take up + /* This first flash block is 16K and the isr vectors only take up about 400 bytes. Micropython pads this with files, but this didn't work with the size of Circuitpython's ff object. */ diff --git a/ports/stm/boards/common_tcm.ld b/ports/stm/boards/common_tcm.ld index 9e677862d3..d7be64d667 100644 --- a/ports/stm/boards/common_tcm.ld +++ b/ports/stm/boards/common_tcm.ld @@ -26,7 +26,7 @@ SECTIONS . = ALIGN(4); KEEP(*(.isr_vector)) /* Startup code */ - /* This first flash block is 16K annd the isr vectors only take up + /* This first flash block is 16K and the isr vectors only take up about 400 bytes. Micropython pads this with files, but this didn't work with the size of Circuitpython's ff object. */ diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk index 6e4da86dd7..0ed5b161a1 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.mk +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -14,7 +14,7 @@ LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F401xd_fs.ld # Disable ulab as we're nearly out of space on this board due to -# INTERNAL_FLASH_FILESYSTEM. It can probably be reenabled if we enable +# INTERNAL_FLASH_FILESYSTEM. It can probably be re-enabled if we enable # lto for this port, and if other stuff hasn't been added in the # meantime CIRCUITPY_AESIO = 0 diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index e4d362bbfa..0edf3d40e4 100644 --- a/ports/stm/boards/meowbit_v121/board.c +++ b/ports/stm/boards/meowbit_v121/board.c @@ -54,7 +54,7 @@ uint8_t display_init_sequence[] = { 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x20, 0, // _INVOFF //MISMATCh 0x2a vs 0x20 0x36, 1, 0x60, // _MADCTL bottom to top refresh - // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, + // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie, // fix on VTL 0x3a, 1, 0x05, // COLMOD - 16bit color 0xe0, 0x10, 0x02, 0x1c, 0x07, 0x12, diff --git a/ports/stm/boards/swan_r5/tests/enable_3v3.py b/ports/stm/boards/swan_r5/tests/enable_3v3.py index ba955c4f58..c32bbc58b8 100644 --- a/ports/stm/boards/swan_r5/tests/enable_3v3.py +++ b/ports/stm/boards/swan_r5/tests/enable_3v3.py @@ -5,7 +5,7 @@ import digitalio import supervisor import time -# Scenario: Enable 3V3 pin defintiion +# Scenario: Enable 3V3 pin definition # Then the symbol "board.ENABLE_3V3" is defined assert board.ENABLE_3V3 is not None diff --git a/ports/stm/common-hal/audiobusio/MEMS_Audio.h b/ports/stm/common-hal/audiobusio/MEMS_Audio.h index 2f670c8505..77f11dc82f 100644 --- a/ports/stm/common-hal/audiobusio/MEMS_Audio.h +++ b/ports/stm/common-hal/audiobusio/MEMS_Audio.h @@ -35,7 +35,7 @@ extern "C" { /** * @brief How many milliseconds of audio can fit in the audio buffer(s). - * Interrupts for recieved data fire at half this duration / twice the frequency. + * Interrupts for received data fire at half this duration / twice the frequency. */ #ifndef MEMS_AUDIO_MS_BUFFER #define MEMS_AUDIO_MS_BUFFER (1) diff --git a/ports/stm/common-hal/neopixel_write/__init__.c b/ports/stm/common-hal/neopixel_write/__init__.c index 99529793fa..9eb30a4509 100644 --- a/ports/stm/common-hal/neopixel_write/__init__.c +++ b/ports/stm/common-hal/neopixel_write/__init__.c @@ -67,7 +67,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout, uint32_t p_mask = pin_mask(digitalinout->pin->number); __disable_irq(); - // Enable DWT in debug core. Useable when interrupts disabled, as opposed to Systick->VAL + // Enable DWT in debug core. Usable when interrupts disabled, as opposed to Systick->VAL CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; DWT->CYCCNT = 0; diff --git a/ports/unix/coverage.c b/ports/unix/coverage.c index 0e4c6dbd48..b04bc2158c 100644 --- a/ports/unix/coverage.c +++ b/ports/unix/coverage.c @@ -456,7 +456,7 @@ STATIC mp_obj_t extra_coverage(void) { { mp_printf(&mp_plat_print, "# VM\n"); - // call mp_execute_bytecode with invalide bytecode (should raise NotImplementedError) + // call mp_execute_bytecode with invalid bytecode (should raise NotImplementedError) mp_obj_fun_bc_t fun_bc; fun_bc.bytecode = (const byte *)"\x01"; // just needed for n_state mp_code_state_t *code_state = m_new_obj_var(mp_code_state_t, mp_obj_t, 1); diff --git a/ports/unix/modos.c b/ports/unix/modos.c index a6365aa6a3..8373c07a5c 100644 --- a/ports/unix/modos.c +++ b/ports/unix/modos.c @@ -147,7 +147,7 @@ STATIC mp_obj_t mod_os_remove(mp_obj_t path_in) { const char *path = mp_obj_str_get_str(path_in); // Note that POSIX requires remove() to be able to delete a directory - // too (act as rmdir()). This is POSIX extenstion to ANSI C semantics + // too (act as rmdir()). This is POSIX extension to ANSI C semantics // of that function. But Python remove() follows ANSI C, and explicitly // required to raise exception on attempt to remove a directory. Thus, // call POSIX unlink() here. diff --git a/ports/unix/modtermios.c b/ports/unix/modtermios.c index 7a578becb9..4adef8a380 100644 --- a/ports/unix/modtermios.c +++ b/ports/unix/modtermios.c @@ -73,7 +73,7 @@ STATIC mp_obj_t mod_termios_tcsetattr(mp_obj_t fd_in, mp_obj_t when_in, mp_obj_t // We don't export TCSANOW and friends to save on code space. Then // common lazy sense says that passing 0 should be godo enough, and // it is e.g. for glibc. But for other libc's it's not, so set just - // treat 0 as defauling to TCSANOW. + // treat 0 as defaulting to TCSANOW. when = TCSANOW; } diff --git a/py/asmthumb.c b/py/asmthumb.c index 547e5bedc1..1b1923370b 100644 --- a/py/asmthumb.c +++ b/py/asmthumb.c @@ -281,7 +281,7 @@ bool asm_thumb_b_n_label(asm_thumb_t *as, uint label) { #define OP_BCC_N(cond, byte_offset) (0xd000 | ((cond) << 8) | (((byte_offset) >> 1) & 0x00ff)) -// all these bit arithmetics need coverage testing! +// all these bit arithmetic need coverage testing! #define OP_BCC_W_HI(cond, byte_offset) (0xf000 | ((cond) << 6) | (((byte_offset) >> 10) & 0x0400) | (((byte_offset) >> 14) & 0x003f)) #define OP_BCC_W_LO(byte_offset) (0x8000 | ((byte_offset) & 0x2000) | (((byte_offset) >> 1) & 0x0fff)) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 641da7814f..b4cbe83b95 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -393,7 +393,7 @@ extern const struct _mp_obj_module_t nvm_module; // Native modules that are weak links can be accessed directly // by prepending their name with an underscore. This list should correspond to // MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS, assuming you want the native modules -// to be accessible when overriden. +// to be accessible when overridden. #define MICROPY_PORT_BUILTIN_MODULE_ALT_NAMES diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index c849a12851..046957751a 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -526,7 +526,7 @@ CFLAGS += -DUSB_NUM_ENDPOINT_PAIRS=$(USB_NUM_ENDPOINT_PAIRS) CIRCUITPY_USTACK ?= 0 CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK) -# for decompressing utlities +# for decompressing utilities CIRCUITPY_ZLIB ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ZLIB=$(CIRCUITPY_ZLIB) diff --git a/py/compile.c b/py/compile.c index 432aeca561..3668bee320 100644 --- a/py/compile.c +++ b/py/compile.c @@ -3477,7 +3477,7 @@ mp_raw_code_t *mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr source_f } } - // update maximim number of labels needed + // update maximum number of labels needed if (comp->next_label > max_num_labels) { max_num_labels = comp->next_label; } diff --git a/py/formatfloat.c b/py/formatfloat.c index d75cfc6658..4671f3348b 100644 --- a/py/formatfloat.c +++ b/py/formatfloat.c @@ -39,7 +39,7 @@ Routine for converting a arbitrary floating point number into a string. - The code in this funcion was inspired from Fred Bayer's pdouble.c. + The code in this function was inspired from Fred Bayer's pdouble.c. Since pdouble.c was released as Public Domain, I'm releasing this code as public domain as well. @@ -390,7 +390,7 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch --dec; --num_digits_left; if (digit_index <= 0) { - // Once we get below 1.0, we scale up f instead of calculting + // Once we get below 1.0, we scale up f instead of calculating // negative powers of 10 in u_base. This provides better // renditions of exact decimals like 1/16 etc. f *= FPCONST(10.0); diff --git a/py/makecompresseddata.py b/py/makecompresseddata.py index 9603de8713..1bce3e8e83 100644 --- a/py/makecompresseddata.py +++ b/py/makecompresseddata.py @@ -24,7 +24,7 @@ def check_non_ascii(msg): # Replace with . -# Trival scheme to demo/test. +# Trivial scheme to demo/test. def space_compression(error_strings): for line in error_strings: check_non_ascii(line) diff --git a/py/mkrules.mk b/py/mkrules.mk index ef0f66117d..09ed82ac5b 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -13,7 +13,7 @@ OBJ_EXTRA_ORDER_DEPS = # tree. # # So for example, py/map.c would have an object file name py/map.o -# The object files will go into the build directory and mantain the same +# The object files will go into the build directory and maintain the same # directory structure as the source tree. So the final dependency will look # like this: # @@ -142,7 +142,7 @@ endif ifneq ($(PROG),) # Build a standalone executable (unix does this) -# The executable should have an .exe extension for builds targetting 'pure' +# The executable should have an .exe extension for builds targeting 'pure' # Windows, i.e. msvc or mingw builds, but not when using msys or cygwin's gcc. COMPILER_TARGET := $(shell $(CC) -dumpmachine) ifneq (,$(findstring mingw,$(COMPILER_TARGET))) diff --git a/py/objexcept.c b/py/objexcept.c index 24fb564e23..e05c3ca8d7 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -176,7 +176,7 @@ mp_obj_t mp_obj_exception_make_new(const mp_obj_type_t *type, size_t n_args, siz mp_obj_tuple_t *o_tuple; if (n_args == 0) { - // No args, can use the empty tuple straightaway + // No args, can use the empty tuple straight away o_tuple = (mp_obj_tuple_t *)&mp_const_empty_tuple_obj; } else { // Try to allocate memory for the tuple containing the args diff --git a/py/objtype.c b/py/objtype.c index 76b9551be8..5b04c361e1 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -649,7 +649,7 @@ STATIC void mp_obj_instance_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *des mp_obj_t member = dest[0]; if (member != MP_OBJ_NULL) { if (!(self->base.type->flags & MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS)) { - // Class doesn't have any special accessors to check so return straightaway + // Class doesn't have any special accessors to check so return straight away return; } diff --git a/py/runtime.c b/py/runtime.c index 9227594d83..5d8be5672f 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -414,7 +414,7 @@ mp_obj_t MICROPY_WRAP_MP_BINARY_OP(mp_binary_op)(mp_binary_op_t op, mp_obj_t lhs } else { // standard precision is enough for right-shift if (rhs_val >= (mp_int_t)(sizeof(lhs_val) * MP_BITS_PER_BYTE)) { - // Shifting to big amounts is underfined behavior + // Shifting to big amounts is undefined behavior // in C and is CPU-dependent; propagate sign bit. rhs_val = sizeof(lhs_val) * MP_BITS_PER_BYTE - 1; } diff --git a/py/sequence.c b/py/sequence.c index 7befc85763..42a9a4a0ae 100644 --- a/py/sequence.c +++ b/py/sequence.c @@ -171,7 +171,7 @@ bool mp_seq_cmp_objs(mp_uint_t op, const mp_obj_t *items1, size_t len1, const mp continue; } - // Othewise, if they are not equal, we can have final decision based on them + // Otherwise, if they are not equal, we can have final decision based on them if (op == MP_BINARY_OP_EQUAL) { // In particular, if we are checking for equality, here're the answer return false; diff --git a/shared-bindings/alarm/__init__.c b/shared-bindings/alarm/__init__.c index 29c9b49d3f..94879e14d4 100644 --- a/shared-bindings/alarm/__init__.c +++ b/shared-bindings/alarm/__init__.c @@ -71,7 +71,7 @@ //| wake_alarm: Optional[circuitpython_typing.Alarm] //| """The most recently triggered alarm. If CircuitPython was sleeping, the alarm that woke it from sleep. -//| If no alarm occured since the last hard reset or soft restart, value is ``None``. +//| If no alarm occurred since the last hard reset or soft restart, value is ``None``. //| """ //| diff --git a/shared-bindings/alarm/__init__.h b/shared-bindings/alarm/__init__.h index 82bfae4286..c47f482e74 100644 --- a/shared-bindings/alarm/__init__.h +++ b/shared-bindings/alarm/__init__.h @@ -33,7 +33,7 @@ #include "common-hal/digitalio/DigitalInOut.h" // Light sleep fully self-contained and does not exit user code. It will return -// the same alarm object that was orignally passed in, unlike deep sleep, which +// the same alarm object that was originally passed in, unlike deep sleep, which // must create an identical copy due to the VM reset extern mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj_t *alarms); diff --git a/shared-bindings/audiomp3/__init__.c b/shared-bindings/audiomp3/__init__.c index 948910c45e..9fe525dfe2 100644 --- a/shared-bindings/audiomp3/__init__.c +++ b/shared-bindings/audiomp3/__init__.c @@ -33,7 +33,7 @@ //| """Support for MP3-compressed audio files //| -//| For more infomration about working with MP3 files in CircuitPython, +//| For more information about working with MP3 files in CircuitPython, //| see `this CircuitPython Essentials Learn guide page //| `_. //| """ diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c index 1195e1811d..f965e504f2 100644 --- a/shared-bindings/bitmaptools/__init__.c +++ b/shared-bindings/bitmaptools/__init__.c @@ -530,14 +530,14 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_draw_line_obj, 0, bitmaptools_obj_draw_li //| value: int, //| close: Optional[bool] = True, //| ) -> None: -//| """Draw a polygon conecting points on provided bitmap with provided value +//| """Draw a polygon connecting points on provided bitmap with provided value //| //| :param bitmap dest_bitmap: Destination bitmap that will be written into //| :param ReadableBuffer xs: x-pixel position of the polygon's vertices //| :param ReadableBuffer ys: y-pixel position of the polygon's vertices //| :param int value: Bitmap palette index that will be written into the //| line in the destination bitmap -//| :param bool close: (Optional) Wether to connect first and last point. (True) +//| :param bool close: (Optional) Whether to connect first and last point. (True) //| //| .. code-block:: Python //| @@ -630,7 +630,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_draw_polygon_obj, 0, bitmaptools_obj_draw //| """Inserts pixels from ``data`` into the rectangle of width×height pixels with the upper left corner at ``(x,y)`` //| //| The values from ``data`` are taken modulo the number of color values -//| avalable in the destination bitmap. +//| available in the destination bitmap. //| //| If x1 or y1 are not specified, they are taken as 0. If x2 or y2 //| are not specified, or are given as -1, they are taken as the width @@ -722,7 +722,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_arrayblit_obj, 0, bitmaptools_arrayblit); //| :param typing.BinaryIO file: A file opened in binary mode //| :param int bits_per_pixel: Number of bits per pixel. Values 1, 2, 4, 8, 16, 24, and 32 are supported; //| :param int element_size: Number of bytes per element. Values of 1, 2, and 4 are supported, except that 24 ``bits_per_pixel`` requires 1 byte per element. -//| :param bool reverse_pixels_in_element: If set, the first pixel in a word is taken from the Most Signficant Bits; otherwise, it is taken from the Least Significant Bits. +//| :param bool reverse_pixels_in_element: If set, the first pixel in a word is taken from the Most Significant Bits; otherwise, it is taken from the Least Significant Bits. //| :param bool swap_bytes_in_element: If the ``element_size`` is not 1, then reverse the byte order of each element read. //| :param bool reverse_rows: Reverse the direction of the row loading (required for some bitmap images). //| """ @@ -782,7 +782,7 @@ STATIC mp_obj_t bitmaptools_readinto(size_t n_args, const mp_obj_t *pos_args, mp MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_readinto_obj, 0, bitmaptools_readinto); //| class DitherAlgorithm: -//| """Identifies the algorith for dither to use""" +//| """Identifies the algorithm for dither to use""" //| //| Atkinson: "DitherAlgorithm" //| """The classic Atkinson dither, often associated with the Hypercard esthetic""" diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 971ed2f676..99b99b37ea 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -43,7 +43,7 @@ //| Common container for board base pin names. These will vary from board to //| board so don't expect portability when using this module. //| -//| Another common use of this module is to use serial communciation buses with +//| Another common use of this module is to use serial communication buses with //| the default pins and settings. For more information about serial communcication //| in CircuitPython, see the :mod:`busio`. //| diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 77d7036c2e..a10dc8efad 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -157,7 +157,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, si // Always initially allocate the UART object within the long-lived heap. // This is needed to avoid crashes with certain UART implementations which - // cannot accomodate being moved after creation. (See + // cannot accommodate being moved after creation. (See // https://github.com/adafruit/circuitpython/issues/1056) busio_uart_obj_t *self = m_new_ll_obj_with_finaliser(busio_uart_obj_t); self->base.type = &busio_uart_type; diff --git a/shared-bindings/countio/__init__.c b/shared-bindings/countio/__init__.c index 25e9c7d630..0d412cc17f 100644 --- a/shared-bindings/countio/__init__.c +++ b/shared-bindings/countio/__init__.c @@ -11,7 +11,7 @@ //| """Support for edge counting //| -//| The `countio` module contains logic to read and count edge transistions +//| The `countio` module contains logic to read and count edge transitions //| //| For more information on the applications of counting edges, see //| `this Learn Guide on sequential circuits diff --git a/shared-bindings/displayio/__init__.c b/shared-bindings/displayio/__init__.c index 3fcd1d082b..77dc8aecee 100644 --- a/shared-bindings/displayio/__init__.c +++ b/shared-bindings/displayio/__init__.c @@ -61,7 +61,7 @@ //| //| def release_displays() -> None: -//| """Releases any actively used displays so their busses and pins can be used again. This will also +//| """Releases any actively used displays so their buses and pins can be used again. This will also //| release the builtin display on boards that have one. You will need to reinitialize it yourself //| afterwards. This may take seconds to complete if an active EPaperDisplay is refreshing. //| diff --git a/shared-bindings/keypad/Event.c b/shared-bindings/keypad/Event.c index c8d24294f8..8264ebe612 100644 --- a/shared-bindings/keypad/Event.c +++ b/shared-bindings/keypad/Event.c @@ -64,7 +64,7 @@ STATIC mp_obj_t keypad_event_make_new(const mp_obj_type_t *type, size_t n_args, timestamp = supervisor_ticks_ms(); } - (void)mp_obj_get_int_truncated(timestamp); // ensure that timesamp is an integer + (void)mp_obj_get_int_truncated(timestamp); // ensure that timestamp is an integer common_hal_keypad_event_construct(self, key_number, args[ARG_pressed].u_bool, timestamp); return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/keypad/KeyMatrix.c b/shared-bindings/keypad/KeyMatrix.c index 49723dbb9e..1c623f4bed 100644 --- a/shared-bindings/keypad/KeyMatrix.c +++ b/shared-bindings/keypad/KeyMatrix.c @@ -56,7 +56,7 @@ //| An `EventQueue` is created when this object is created and is available in the `events` attribute. //| //| :param Sequence[microcontroller.Pin] row_pins: The pins attached to the rows. -//| :param Sequence[microcontroller.Pin] column_pins: The pins attached to the colums. +//| :param Sequence[microcontroller.Pin] column_pins: The pins attached to the columns. //| :param bool columns_to_anodes: Default ``True``. //| If the matrix uses diodes, the diode anodes are typically connected to the column pins, //| and the cathodes should be connected to the row pins. If your diodes are reversed, diff --git a/shared-bindings/microcontroller/ResetReason.c b/shared-bindings/microcontroller/ResetReason.c index 13a8f25e6d..6f8ac8f42b 100644 --- a/shared-bindings/microcontroller/ResetReason.c +++ b/shared-bindings/microcontroller/ResetReason.c @@ -39,31 +39,31 @@ MAKE_ENUM_VALUE(mcu_reset_reason_type, reset_reason, UNKNOWN, RESET_REASON_UNKNO MAKE_ENUM_VALUE(mcu_reset_reason_type, reset_reason, RESCUE_DEBUG, RESET_REASON_RESCUE_DEBUG); //| class ResetReason: -//| """The reason the microntroller was last reset""" +//| """The reason the microcontroller was last reset""" //| //| POWER_ON: object //| """The microcontroller was started from power off.""" //| //| BROWNOUT: object -//| """The microntroller was reset due to too low a voltage.""" +//| """The microcontroller was reset due to too low a voltage.""" //| //| SOFTWARE: object -//| """The microntroller was reset from software.""" +//| """The microcontroller was reset from software.""" //| //| DEEP_SLEEP_ALARM: object -//| """The microntroller was reset for deep sleep and restarted by an alarm.""" +//| """The microcontroller was reset for deep sleep and restarted by an alarm.""" //| //| RESET_PIN: object -//| """The microntroller was reset by a signal on its reset pin. The pin might be connected to a reset button.""" +//| """The microcontroller was reset by a signal on its reset pin. The pin might be connected to a reset button.""" //| //| WATCHDOG: object //| """The microcontroller was reset by its watchdog timer.""" //| //| UNKNOWN: object -//| """The microntroller restarted for an unknown reason.""" +//| """The microcontroller restarted for an unknown reason.""" //| //| RESCUE_DEBUG: object -//| """The microntroller was reset by the rescue debug port.""" +//| """The microcontroller was reset by the rescue debug port.""" //| MAKE_ENUM_MAP(mcu_reset_reason) { MAKE_ENUM_MAP_ENTRY(reset_reason, POWER_ON), diff --git a/shared-bindings/paralleldisplay/ParallelBus.c b/shared-bindings/paralleldisplay/ParallelBus.c index 42b4c788c7..ad9a1efdce 100644 --- a/shared-bindings/paralleldisplay/ParallelBus.c +++ b/shared-bindings/paralleldisplay/ParallelBus.c @@ -39,7 +39,7 @@ //| class ParallelBus: //| """Manage updating a display over 8-bit parallel bus in the background while Python code runs. This -//| protocol may be refered to as 8080-I Series Parallel Interface in datasheets. It doesn't handle +//| protocol may be referred to as 8080-I Series Parallel Interface in datasheets. It doesn't handle //| display initialization.""" //| //| def __init__( diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index fae55db317..09a48f01aa 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -42,7 +42,7 @@ //| ) -> None: //| """Create an IncrementalEncoder object associated with the given pins. It tracks the positional //| state of an incremental rotary encoder (also known as a quadrature encoder.) Position is -//| relative to the position when the object is contructed. +//| relative to the position when the object is constructed. //| //| :param ~microcontroller.Pin pin_a: First pin to read pulses from. //| :param ~microcontroller.Pin pin_b: Second pin to read pulses from. diff --git a/shared-module/bitmaptools/__init__.c b/shared-module/bitmaptools/__init__.c index 6818316768..08b4138202 100644 --- a/shared-module/bitmaptools/__init__.c +++ b/shared-module/bitmaptools/__init__.c @@ -776,7 +776,7 @@ void common_hal_bitmaptools_dither(displayio_bitmap_t *dest_bitmap, displayio_bi bitmaptools_dither_algorithm_info_t *info = algorithms[algorithm]; // rowdata holds 3 rows of data. Each one is larger than the input - // bitmap's width, beacuse `mx` extra pixels are allocated at the start and + // bitmap's width, because `mx` extra pixels are allocated at the start and // end of the row so that no conditionals are needed when storing the error data. int16_t rowdata[(width + 2 * info->mx) * 3]; int16_t *rows[3] = { diff --git a/shared/netutils/dhcpserver.c b/shared/netutils/dhcpserver.c index d396a2ba56..3f90a06e46 100644 --- a/shared/netutils/dhcpserver.c +++ b/shared/netutils/dhcpserver.c @@ -277,8 +277,8 @@ static void dhcp_server_process(void *arg, struct udp_pcb *upcb, struct pbuf *p, opt_write_n(&opt, DHCP_OPT_SERVER_ID, 4, &d->ip.addr); opt_write_n(&opt, DHCP_OPT_SUBNET_MASK, 4, &d->nm.addr); - opt_write_n(&opt, DHCP_OPT_ROUTER, 4, &d->ip.addr); // aka gateway; can have mulitple addresses - opt_write_u32(&opt, DHCP_OPT_DNS, DEFAULT_DNS); // can have mulitple addresses + opt_write_n(&opt, DHCP_OPT_ROUTER, 4, &d->ip.addr); // aka gateway; can have multiple addresses + opt_write_u32(&opt, DHCP_OPT_DNS, DEFAULT_DNS); // can have multiple addresses opt_write_u32(&opt, DHCP_OPT_IP_LEASE_TIME, DEFAULT_LEASE_TIME_S); *opt++ = DHCP_OPT_END; dhcp_socket_sendto(&d->udp, &dhcp_msg, opt - (uint8_t *)&dhcp_msg, 0xffffffff, PORT_DHCP_CLIENT); diff --git a/shared/runtime/pyexec.c b/shared/runtime/pyexec.c index 87219d18f5..aeb92f59d3 100644 --- a/shared/runtime/pyexec.c +++ b/shared/runtime/pyexec.c @@ -643,7 +643,7 @@ friendly_repl_reset: // If the user gets to here and interrupts are disabled then // they'll never see the prompt, traceback etc. The USB REPL needs // interrupts to be enabled or no transfers occur. So we try to - // do the user a favor and reenable interrupts. + // do the user a favor and re-enable interrupts. if (query_irq() == IRQ_STATE_DISABLED) { enable_irq(IRQ_STATE_ENABLED); mp_hal_stdout_tx_str("MPY: enabling IRQs\r\n"); diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 141ad7e5f8..f72518ac50 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -97,7 +97,7 @@ static bool write_flash(uint32_t address, const uint8_t *data, uint32_t data_len if (flash_device == NULL) { return false; } - // Don't bother writing if the data is all 1s. Thats equivalent to the flash + // Don't bother writing if the data is all 1s. That's equivalent to the flash // state after an erase. if (!flash_device->no_erase_cmd) { // Only do this if the device has an erase command diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 5112b17ebf..8709d3c356 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -116,7 +116,7 @@ safe_mode_t wait_for_safe_mode_reset(void) { if (boot_in_safe_mode) { return SAFE_MODE_USER; } - // Restore the original state of the saved word if no reset occured during our wait period. + // Restore the original state of the saved word if no reset occurred during our wait period. port_set_saved_word(reset_state); return SAFE_MODE_NONE; } diff --git a/supervisor/shared/translate/compressed_string.h b/supervisor/shared/translate/compressed_string.h index e331a5866f..f524010db5 100644 --- a/supervisor/shared/translate/compressed_string.h +++ b/supervisor/shared/translate/compressed_string.h @@ -62,7 +62,7 @@ // // The "data" / "tail" construct is so that the struct's last member is a // "flexible array". However, the _only_ member is not permitted to be -// a flexible member, so we have to declare the first byte as a separte +// a flexible member, so we have to declare the first byte as a separate // member of the structure. // // For translations where length needs 8 bits, this saves about 1.5 diff --git a/tests/basics/annotate_var.py b/tests/basics/annotate_var.py index 3f767e4a73..a359b229b1 100644 --- a/tests/basics/annotate_var.py +++ b/tests/basics/annotate_var.py @@ -1,4 +1,4 @@ -# test PEP 526, varible annotations +# test PEP 526, variable annotations x: int print("x" in globals()) diff --git a/tests/basics/deque2.py b/tests/basics/deque2.py index 22d370e943..1b6f072da5 100644 --- a/tests/basics/deque2.py +++ b/tests/basics/deque2.py @@ -1,4 +1,4 @@ -# Tests for deques with "check overflow" flag and other extensions +# Tests for dequeues with "check overflow" flag and other extensions # wrt to CPython. try: try: @@ -22,7 +22,7 @@ try: except ValueError: print("ValueError") -# Only fixed-size deques are supported, so length arg is mandatory +# Only fixed-size dequeues are supported, so length arg is mandatory try: deque(()) except TypeError: diff --git a/tests/basics/struct1.py b/tests/basics/struct1.py index ec29ea9080..2ac900bbc7 100644 --- a/tests/basics/struct1.py +++ b/tests/basics/struct1.py @@ -79,7 +79,7 @@ try: except: print("Unknown type") -# Initially repitition counters were supported only for strings, +# Initially repetition counters were supported only for strings, # but later were implemented for all. print(struct.unpack("<3B2h", b"foo\x12\x34\xff\xff")) print(struct.pack("<3B", 1, 2, 3)) diff --git a/tests/cpydiff/core_fstring_repr.py b/tests/cpydiff/core_fstring_repr.py index fcadcbf1b9..df80abf795 100644 --- a/tests/cpydiff/core_fstring_repr.py +++ b/tests/cpydiff/core_fstring_repr.py @@ -2,7 +2,7 @@ categories: Core description: f-strings don't support the !r, !s, and !a conversions cause: MicroPython is optimised for code space. -workaround: Use repr(), str(), and ascii() explictly. +workaround: Use repr(), str(), and ascii() explicitly. """ diff --git a/tests/cpydiff/core_import_path.py b/tests/cpydiff/core_import_path.py index 04fc4bd5bb..959fd571f5 100644 --- a/tests/cpydiff/core_import_path.py +++ b/tests/cpydiff/core_import_path.py @@ -1,7 +1,7 @@ """ categories: Core,import description: __path__ attribute of a package has a different type (single string instead of list of strings) in MicroPython -cause: MicroPython does't support namespace packages split across filesystem. Beyond that, MicroPython's import system is highly optimized for minimal memory usage. +cause: MicroPython doesn't support namespace packages split across filesystem. Beyond that, MicroPython's import system is highly optimized for minimal memory usage. workaround: Details of import handling is inherently implementation dependent. Don't rely on such details in portable applications. """ import modules diff --git a/tests/cpydiff/core_import_split_ns_pkgs.py b/tests/cpydiff/core_import_split_ns_pkgs.py index 62bf337a22..5c92b63124 100644 --- a/tests/cpydiff/core_import_split_ns_pkgs.py +++ b/tests/cpydiff/core_import_split_ns_pkgs.py @@ -1,6 +1,6 @@ """ categories: Core,import -description: MicroPython does't support namespace packages split across filesystem. +description: MicroPython doesn't support namespace packages split across filesystem. cause: MicroPython's import system is highly optimized for simplicity, minimal memory usage, and minimal filesystem search overhead. workaround: Don't install modules belonging to the same namespace package in different directories. For MicroPython, it's recommended to have at most 3-component module search paths: for your current application, per-user (writable), system-wide (non-writable). """ diff --git a/tests/extmod/framebuf_palette.py b/tests/extmod/framebuf_palette.py index 84db834c15..f5b15fda73 100644 --- a/tests/extmod/framebuf_palette.py +++ b/tests/extmod/framebuf_palette.py @@ -30,6 +30,6 @@ fbd.blit(fbc, 0, 0, -1, palette) print(fbd.pixel(0, 0) == fg) print(fbd.pixel(7, 7) == fg) -print(fbd.pixel(8, 8) == 0) # Ouside blit +print(fbd.pixel(8, 8) == 0) # Outside blit print(fbd.pixel(0, 1) == bg) print(fbd.pixel(1, 0) == bg) diff --git a/tests/extmod/uctypes_sizeof_layout.py b/tests/extmod/uctypes_sizeof_layout.py index 2108e81502..c710ecde95 100644 --- a/tests/extmod/uctypes_sizeof_layout.py +++ b/tests/extmod/uctypes_sizeof_layout.py @@ -13,7 +13,7 @@ desc = { # uctypes.NATIVE is default print(uctypes.sizeof(desc) == uctypes.sizeof(desc, uctypes.NATIVE)) -# Here we assume that that we run on a platform with convential ABI +# Here we assume that that we run on a platform with conventional ABI # (which rounds up structure size based on max alignment). For platforms # where that doesn't hold, this tests should be just disabled in the runner. print(uctypes.sizeof(desc, uctypes.NATIVE) > uctypes.sizeof(desc, uctypes.LITTLE_ENDIAN)) diff --git a/tests/extmod/utimeq1.py b/tests/extmod/utimeq1.py index ddbc969afb..688e5b834f 100644 --- a/tests/extmod/utimeq1.py +++ b/tests/extmod/utimeq1.py @@ -125,7 +125,7 @@ assert edge_case(MODULO_HALF - 1, -100) == diff # We expect diff to be always positive, per the definition of heappop() which should return # the smallest value. -# This is the edge case where this invariant breaks, due to assymetry of two's-complement +# This is the edge case where this invariant breaks, due to asymmetry of two's-complement # range - there's one more negative integer than positive, so heappushing values like below # will then make ticks_diff() return the minimum negative value. We could make heappop # return them in a different order, but ticks_diff() result would be the same. Conclusion: diff --git a/tests/thread/thread_lock1.py b/tests/thread/thread_lock1.py index e7066402ca..f49f57ce83 100644 --- a/tests/thread/thread_lock1.py +++ b/tests/thread/thread_lock1.py @@ -32,7 +32,7 @@ print(lock.locked()) with lock: print(lock.locked()) -# test that lock is unlocked if an error is rasied +# test that lock is unlocked if an error is raised try: with lock: print(lock.locked()) diff --git a/tools/analyze_heap_dump.py b/tools/analyze_heap_dump.py index d9b3dda599..ede990929d 100755 --- a/tools/analyze_heap_dump.py +++ b/tools/analyze_heap_dump.py @@ -446,7 +446,7 @@ def do_all_the_things( current_allocation = 1 elif block_state == AT_TAIL and current_allocation > 0: # In gc_free the logging happens before the tail is freed. So checking - # current_allocation > 0 ensures we only extend an allocation thats started. + # current_allocation > 0 ensures we only extend an allocation that's started. current_allocation += 1 longest_free = max(longest_free, current_free) # if current_free > 0: diff --git a/tools/cpboard.py b/tools/cpboard.py index 1f399d1dfc..46ae659d34 100644 --- a/tools/cpboard.py +++ b/tools/cpboard.py @@ -357,7 +357,7 @@ class CPboard: else: serials = [serial for serial in os.listdir("/dev/serial/by-path") if portstr in serial] if len(serials) != 1: - raise RuntimeError("Can't find excatly one matching usb serial device") + raise RuntimeError("Can't find exactly one matching usb serial device") self.device = os.path.realpath("/dev/serial/by-path/" + serials[0]) self.usb_dev = device diff --git a/tools/gendoc.py b/tools/gendoc.py index f3df853e49..e7eb011b7c 100644 --- a/tools/gendoc.py +++ b/tools/gendoc.py @@ -523,7 +523,7 @@ def main(): description="Generate documentation for pyboard API from C files." ) cmd_parser.add_argument( - "--outdir", metavar="", default="gendoc-out", help="ouput directory" + "--outdir", metavar="", default="gendoc-out", help="output directory" ) cmd_parser.add_argument("--format", default="html", help="output format: html or rst") cmd_parser.add_argument("files", nargs="+", help="input files") diff --git a/tools/makemanifest.py b/tools/makemanifest.py index 8cdc3eb774..b2856889b9 100644 --- a/tools/makemanifest.py +++ b/tools/makemanifest.py @@ -164,7 +164,7 @@ def system(cmd): def convert_path(path): - # Perform variable substituion. + # Perform variable substitution. for name, value in VARS.items(): path = path.replace("$({})".format(name), value) # Convert to absolute path (so that future operations don't rely on diff --git a/tools/preprocess_frozen_modules.py b/tools/preprocess_frozen_modules.py index 6c41c4cd43..80ab547f3b 100755 --- a/tools/preprocess_frozen_modules.py +++ b/tools/preprocess_frozen_modules.py @@ -21,10 +21,10 @@ def version_string(path=None, *, valid_semver=False): version = tag.strip().decode("utf-8", "strict") except subprocess.CalledProcessError: describe = subprocess.check_output("git describe --tags", shell=True, cwd=path) - tag, additional_commits, commitish = ( + tag, additional_commits, committish = ( describe.strip().decode("utf-8", "strict").rsplit("-", maxsplit=2) ) - commitish = commitish[1:] + committish = committish[1:] if valid_semver: version_info = semver.parse_version_info(tag) if not version_info.prerelease: @@ -33,12 +33,12 @@ def version_string(path=None, *, valid_semver=False): + "-alpha.0.plus." + additional_commits + "+" - + commitish + + committish ) else: - version = tag + ".plus." + additional_commits + "+" + commitish + version = tag + ".plus." + additional_commits + "+" + committish else: - version = commitish + version = committish return version diff --git a/tools/pydfu.py b/tools/pydfu.py index ce34b08a58..57a8708e5d 100755 --- a/tools/pydfu.py +++ b/tools/pydfu.py @@ -483,7 +483,7 @@ def get_memory_layout(device): def list_dfu_devices(*args, **kwargs): - """Prints a lits of devices detected in DFU mode.""" + """Prints a list of devices detected in DFU mode.""" devices = get_dfu_devices(*args, **kwargs) if not devices: raise SystemExit("No DFU capable devices found") diff --git a/tools/uncrustify.cfg b/tools/uncrustify.cfg index 88127112e8..a92530fd93 100644 --- a/tools/uncrustify.cfg +++ b/tools/uncrustify.cfg @@ -1323,7 +1323,7 @@ indent_using_block = true # true/false # 2: When the `:` is a continuation, indent it under `?` indent_ternary_operator = 0 # unsigned number -# Whether to indent the statments inside ternary operator. +# Whether to indent the statements inside ternary operator. indent_inside_ternary_operator = false # true/false # If true, the indentation of the chunks after a `return` sequence will be set at return indentation column. @@ -1779,7 +1779,7 @@ nl_func_call_args_multi_line = false # true/false # different lines. nl_func_call_end_multi_line = false # true/false -# Whether to respect nl_func_call_XXX option incase of closure args. +# Whether to respect nl_func_call_XXX option in case of closure args. nl_func_call_args_multi_line_ignore_closures = false # true/false # Whether to add a newline after '<' of a template parameter list. @@ -2570,7 +2570,7 @@ align_oc_decl_colon = false # true/false # (OC) Whether to not align parameters in an Objectve-C message call if first # colon is not on next line of the message call (the same way Xcode does -# aligment) +# alignment) align_oc_msg_colon_xcode_like = false # true/false # @@ -2916,28 +2916,28 @@ pp_define_at_level = false # true/false pp_ignore_define_body = false # true/false # Whether to indent case statements between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the case statements +# Only applies to the indent of the preprocessor that the case statements # directly inside of. # # Default: true pp_indent_case = true # true/false # Whether to indent whole function definitions between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the function definition +# Only applies to the indent of the preprocessor that the function definition # is directly inside of. # # Default: true pp_indent_func_def = true # true/false # Whether to indent extern C blocks between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the extern block is +# Only applies to the indent of the preprocessor that the extern block is # directly inside of. # # Default: true pp_indent_extern = true # true/false # Whether to indent braces directly inside #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the braces are directly +# Only applies to the indent of the preprocessor that the braces are directly # inside of. # # Default: true diff --git a/tools/verifygitlog.py b/tools/verifygitlog.py index cc4b80f4a9..24171f9c68 100755 --- a/tools/verifygitlog.py +++ b/tools/verifygitlog.py @@ -101,7 +101,7 @@ def run(args): def show_help(): print("usage: verifygitlog.py [-v -n -h] ...") - print("-v : increase verbosity, can be speficied multiple times") + print("-v : increase verbosity, can be specified multiple times") print("-n : do not print multi-line suggestions") print("-h : print this help message and exit") print("... : arguments passed to git log to retrieve commits to verify") From c2d506b1fa931744a6ff4ca0a54c60aaac68f095 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 18 Mar 2023 19:38:40 -0400 Subject: [PATCH 11/90] add 'deque` to known words. --- .codespell/ignore-words.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/.codespell/ignore-words.txt b/.codespell/ignore-words.txt index 76849278a0..39eb42e0df 100644 --- a/.codespell/ignore-words.txt +++ b/.codespell/ignore-words.txt @@ -14,4 +14,5 @@ astroid busses cyphertext dum +deque extint From ce2c3d7dc5d5824ff2f6df302ffde229214915f2 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 20 Mar 2023 12:12:30 +0700 Subject: [PATCH 12/90] revert deque(s) --- .codespell/ignore-words.txt | 1 + docs/library/collections.rst | 4 ++-- tests/basics/deque2.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.codespell/ignore-words.txt b/.codespell/ignore-words.txt index 39eb42e0df..5a54e22f0d 100644 --- a/.codespell/ignore-words.txt +++ b/.codespell/ignore-words.txt @@ -15,4 +15,5 @@ busses cyphertext dum deque +deques extint diff --git a/docs/library/collections.rst b/docs/library/collections.rst index 01882ba244..2cc1a215d1 100644 --- a/docs/library/collections.rst +++ b/docs/library/collections.rst @@ -16,8 +16,8 @@ Classes .. function:: deque(iterable, maxlen[, flags]) - Dequeues (double-ended queues) are a list-like container that support O(1) - appends and pops from either side of the deque. New dequeues are created + Deques (double-ended queues) are a list-like container that support O(1) + appends and pops from either side of the deque. New deques are created using the following arguments: - *iterable* must be the empty tuple, and the new deque is created empty. diff --git a/tests/basics/deque2.py b/tests/basics/deque2.py index 1b6f072da5..22d370e943 100644 --- a/tests/basics/deque2.py +++ b/tests/basics/deque2.py @@ -1,4 +1,4 @@ -# Tests for dequeues with "check overflow" flag and other extensions +# Tests for deques with "check overflow" flag and other extensions # wrt to CPython. try: try: @@ -22,7 +22,7 @@ try: except ValueError: print("ValueError") -# Only fixed-size dequeues are supported, so length arg is mandatory +# Only fixed-size deques are supported, so length arg is mandatory try: deque(()) except TypeError: From 36e4dc2588f705f6d0010aff33b8f618b2310355 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Fri, 17 Mar 2023 19:11:51 +0100 Subject: [PATCH 13/90] Adding 01space OLED 0.42 C3 --- .../boards/01space_lcd042_esp32c3/board.c | 102 ++++++++++++++++++ .../01space_lcd042_esp32c3/mpconfigboard.h | 40 +++++++ .../01space_lcd042_esp32c3/mpconfigboard.mk | 8 ++ .../boards/01space_lcd042_esp32c3/pins.c | 68 ++++++++++++ .../boards/01space_lcd042_esp32c3/sdkconfig | 6 ++ 5 files changed, 224 insertions(+) create mode 100644 ports/espressif/boards/01space_lcd042_esp32c3/board.c create mode 100644 ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.h create mode 100644 ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.mk create mode 100644 ports/espressif/boards/01space_lcd042_esp32c3/pins.c create mode 100644 ports/espressif/boards/01space_lcd042_esp32c3/sdkconfig diff --git a/ports/espressif/boards/01space_lcd042_esp32c3/board.c b/ports/espressif/boards/01space_lcd042_esp32c3/board.c new file mode 100644 index 0000000000..56df21ab57 --- /dev/null +++ b/ports/espressif/boards/01space_lcd042_esp32c3/board.c @@ -0,0 +1,102 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * Copyright (c) 2021 skieast/Bruce Segal + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/board/__init__.h" +#include "shared-bindings/displayio/I2CDisplay.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" +#include "shared-bindings/busio/I2C.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/board.h" +#include "supervisor/shared/board.h" +#include "shared-bindings/board/__init__.h" + +uint8_t display_init_sequence[] = { // SSD1306 + 0xAE, 0, // DISPLAY_OFF + 0x20, 1, 0x00, // Set memory addressing to horizontal mode. + 0x81, 1, 0xcf, // set contrast control + 0xA1, 0, // Column 127 is segment 0 + 0xA6, 0, // Normal display + 0xc8, 0, // Normal display + 0xA8, 1, 0x3f, // Mux ratio is 1/64 + 0xd5, 1, 0x80, // Set divide ratio + 0xd9, 1, 0xf1, // Set pre-charge period + 0xda, 1, 0x12, // Set com configuration + 0xdb, 1, 0x40, // Set vcom configuration + 0x8d, 1, 0x14, // Enable charge pump + 0xAF, 0, // DISPLAY_ON +}; + +void board_init(void) { + busio_i2c_obj_t *i2c = common_hal_board_create_i2c(0); + + // What we would do if it wasn't the shared board I2C: (for reference) + // busio_i2c_obj_t *i2c = &displays[0].i2cdisplay_bus.inline_bus; + // common_hal_busio_i2c_construct(i2c, &pin_GPIO23, &pin_GPIO22, 100000, 0); + // common_hal_busio_i2c_never_reset(i2c); + + displayio_i2cdisplay_obj_t *bus = &displays[0].i2cdisplay_bus; + bus->base.type = &displayio_i2cdisplay_type; + common_hal_displayio_i2cdisplay_construct(bus, + i2c, + 0x3c, + NULL + ); + + displayio_display_obj_t *display = &displays[0].display; + display->base.type = &displayio_display_type; + common_hal_displayio_display_construct(display, + bus, + 72, // Width + 40, // Height + 28, // column start + 28, // row start + 0, // rotation + 1, // Color depth + true, // grayscale + false, // pixels in byte share row. Only used with depth < 8 + 1, // bytes per cell. Only valid for depths < 8 + false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word + 0x21, // Set column command + 0x22, // Set row command + 44, // Write ram command + display_init_sequence, + sizeof(display_init_sequence), + NULL, // no backlight pin + 0x81, // brightness command + 1.0f, // brightness + true, // single_byte_bounds + true, // data as commands + true, // auto_refresh + 60, // native_frames_per_second + true, // backlight_on_high + false, // SH1107_addressing + 0); // backlight pwm frequency +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.h b/ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.h new file mode 100644 index 0000000000..cae80fa78c --- /dev/null +++ b/ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.h @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2023 Neradoc + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Board setup +#define MICROPY_HW_BOARD_NAME "01Space 0.42 OLED ESP32C3" +#define MICROPY_HW_MCU_NAME "ESP32-C3FH4" + +// Status LED +#define MICROPY_HW_NEOPIXEL (&pin_GPIO2) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO6, .sda = &pin_GPIO5}} + +// For entering safe mode +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9) + +#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1) diff --git a/ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.mk b/ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.mk new file mode 100644 index 0000000000..e4467a3bbf --- /dev/null +++ b/ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.mk @@ -0,0 +1,8 @@ +CIRCUITPY_CREATOR_ID = 0x01011ACE +CIRCUITPY_CREATION_ID = 0x00C30042 + +IDF_TARGET = esp32c3 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/01space_lcd042_esp32c3/pins.c b/ports/espressif/boards/01space_lcd042_esp32c3/pins.c new file mode 100644 index 0000000000..a28ffca6d2 --- /dev/null +++ b/ports/espressif/boards/01space_lcd042_esp32c3/pins.c @@ -0,0 +1,68 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2023 Neradoc + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + + { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/01space_lcd042_esp32c3/sdkconfig b/ports/espressif/boards/01space_lcd042_esp32c3/sdkconfig new file mode 100644 index 0000000000..b75eaee69f --- /dev/null +++ b/ports/espressif/boards/01space_lcd042_esp32c3/sdkconfig @@ -0,0 +1,6 @@ +# chip is ESP32-C3 FH4 +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="Adafruit-QTPy-ESP32C3" +# end of LWIP From b45d1287263a94d1f4f415d07b8a6dd1d5188dc7 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Tue, 21 Mar 2023 16:45:38 +0100 Subject: [PATCH 14/90] fix lwip name in 01space_lcd042_esp32c3 --- ports/espressif/boards/01space_lcd042_esp32c3/sdkconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/01space_lcd042_esp32c3/sdkconfig b/ports/espressif/boards/01space_lcd042_esp32c3/sdkconfig index b75eaee69f..24f7d625ea 100644 --- a/ports/espressif/boards/01space_lcd042_esp32c3/sdkconfig +++ b/ports/espressif/boards/01space_lcd042_esp32c3/sdkconfig @@ -2,5 +2,5 @@ # # LWIP # -CONFIG_LWIP_LOCAL_HOSTNAME="Adafruit-QTPy-ESP32C3" +CONFIG_LWIP_LOCAL_HOSTNAME="01Space-LCD042-ESP32C3" # end of LWIP From 08358ecd5004fe14169d0851dcae8635a13befe3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 20 Mar 2023 10:28:46 -0500 Subject: [PATCH 15/90] constify spi, i2c, uart bank data --- ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c | 6 +++--- ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h | 6 +++--- ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c | 6 +++--- ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h | 6 +++--- ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c | 6 +++--- ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h | 6 +++--- ports/mimxrt10xx/peripherals/mimxrt10xx/periph.h | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c index bdf3299217..0c2b5893bc 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c @@ -29,7 +29,7 @@ #include "py/mphal.h" #include "mimxrt10xx/periph.h" -LPI2C_Type *mcu_i2c_banks[2] = { LPI2C1, LPI2C2 }; +LPI2C_Type *const mcu_i2c_banks[2] = { LPI2C1, LPI2C2 }; const mcu_periph_obj_t mcu_i2c_sda_list[8] = { PERIPH_PIN(1, 0, kIOMUXC_LPI2C1_SDA_SELECT_INPUT, 0, &pin_GPIO_AD_13), @@ -55,7 +55,7 @@ const mcu_periph_obj_t mcu_i2c_scl_list[8] = { PERIPH_PIN(2, 3, kIOMUXC_LPI2C2_SCL_SELECT_INPUT, 3, &pin_GPIO_10), }; -LPSPI_Type *mcu_spi_banks[2] = { LPSPI1, LPSPI2 }; +LPSPI_Type *const mcu_spi_banks[2] = { LPSPI1, LPSPI2 }; const mcu_periph_obj_t mcu_spi_sck_list[4] = { PERIPH_PIN(1, 0, kIOMUXC_LPSPI1_SCK_SELECT_INPUT, 0, &pin_GPIO_AD_06), @@ -81,7 +81,7 @@ const mcu_periph_obj_t mcu_spi_miso_list[4] = { PERIPH_PIN(2, 1, kIOMUXC_LPSPI2_SDI_SELECT_INPUT, 1, &pin_GPIO_SD_09), }; -LPUART_Type *mcu_uart_banks[4] = { LPUART1, LPUART2, LPUART3, LPUART4 }; +LPUART_Type *const mcu_uart_banks[4] = { LPUART1, LPUART2, LPUART3, LPUART4 }; const mcu_periph_obj_t mcu_uart_rx_list[9] = { PERIPH_PIN(1, 2, kIOMUXC_LPUART1_RXD_SELECT_INPUT, 0, &pin_GPIO_SD_11), diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h index c50d73294b..b3bddcb76b 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h @@ -27,18 +27,18 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1011_PERIPHERALS_MIMXRT1011_PERIPH_H #define MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1011_PERIPHERALS_MIMXRT1011_PERIPH_H -extern LPI2C_Type *mcu_i2c_banks[2]; +extern LPI2C_Type *const mcu_i2c_banks[2]; extern const mcu_periph_obj_t mcu_i2c_sda_list[8]; extern const mcu_periph_obj_t mcu_i2c_scl_list[8]; -extern LPSPI_Type *mcu_spi_banks[2]; +extern LPSPI_Type *const mcu_spi_banks[2]; extern const mcu_periph_obj_t mcu_spi_sck_list[4]; extern const mcu_periph_obj_t mcu_spi_mosi_list[4]; extern const mcu_periph_obj_t mcu_spi_miso_list[4]; -extern LPUART_Type *mcu_uart_banks[4]; +extern LPUART_Type *const mcu_uart_banks[4]; extern const mcu_periph_obj_t mcu_uart_rx_list[9]; extern const mcu_periph_obj_t mcu_uart_tx_list[9]; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c index 5b21c12c2a..ffcadbb696 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c @@ -30,7 +30,7 @@ #include "py/mphal.h" #include "mimxrt10xx/periph.h" -LPI2C_Type *mcu_i2c_banks[4] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; +LPI2C_Type *const mcu_i2c_banks[4] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; const mcu_periph_obj_t mcu_i2c_sda_list[8] = { PERIPH_PIN(1, 6, kIOMUXC_LPI2C1_SDA_SELECT_INPUT, 0, &pin_GPIO_EMC_03), @@ -60,7 +60,7 @@ const mcu_periph_obj_t mcu_i2c_scl_list[8] = { PERIPH_PIN(4, 3, kIOMUXC_LPI2C4_SCL_SELECT_INPUT, 1, &pin_GPIO_SD_B1_02), }; -LPSPI_Type *mcu_spi_banks[4] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; +LPSPI_Type *const mcu_spi_banks[4] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; const mcu_periph_obj_t mcu_spi_sck_list[8] = { PERIPH_PIN(1, 4, kIOMUXC_LPSPI1_SCK_SELECT_INPUT, 0, &pin_GPIO_SD_B0_02), @@ -104,7 +104,7 @@ const mcu_periph_obj_t mcu_spi_miso_list[8] = { PERIPH_PIN(4, 4, kIOMUXC_LPSPI2_SDI_SELECT_INPUT, 1, &pin_GPIO_EMC_35), }; -LPUART_Type *mcu_uart_banks[8] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; +LPUART_Type *const mcu_uart_banks[8] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; const mcu_periph_obj_t mcu_uart_rx_list[16] = { PERIPH_PIN(1, 2, 0, 0, &pin_GPIO_AD_B0_07), diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h index 6c778ad525..9074987cd8 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h @@ -28,18 +28,18 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H #define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H -extern LPI2C_Type *mcu_i2c_banks[4]; +extern LPI2C_Type *const mcu_i2c_banks[4]; extern const mcu_periph_obj_t mcu_i2c_sda_list[8]; extern const mcu_periph_obj_t mcu_i2c_scl_list[8]; -extern LPSPI_Type *mcu_spi_banks[4]; +extern LPSPI_Type *const mcu_spi_banks[4]; extern const mcu_periph_obj_t mcu_spi_sck_list[8]; extern const mcu_periph_obj_t mcu_spi_mosi_list[8]; extern const mcu_periph_obj_t mcu_spi_miso_list[8]; -extern LPUART_Type *mcu_uart_banks[8]; +extern LPUART_Type *const mcu_uart_banks[8]; extern const mcu_periph_obj_t mcu_uart_rx_list[16]; extern const mcu_periph_obj_t mcu_uart_tx_list[16]; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c index 19ce48f288..b6efe5e6a9 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c @@ -29,7 +29,7 @@ #include "py/mphal.h" #include "mimxrt10xx/periph.h" -LPI2C_Type *mcu_i2c_banks[4] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; +LPI2C_Type *const mcu_i2c_banks[4] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; const mcu_periph_obj_t mcu_i2c_sda_list[9] = { PERIPH_PIN(1, 2, kIOMUXC_LPI2C1_SDA_SELECT_INPUT, 0, &pin_GPIO_SD_B1_05), @@ -61,7 +61,7 @@ const mcu_periph_obj_t mcu_i2c_scl_list[9] = { PERIPH_PIN(4, 0, kIOMUXC_LPI2C4_SCL_SELECT_INPUT, 1, &pin_GPIO_AD_B0_12), }; -LPSPI_Type *mcu_spi_banks[4] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; +LPSPI_Type *const mcu_spi_banks[4] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; const mcu_periph_obj_t mcu_spi_sck_list[8] = { PERIPH_PIN(1, 3, kIOMUXC_LPSPI1_SCK_SELECT_INPUT, 0, &pin_GPIO_EMC_27), @@ -105,7 +105,7 @@ const mcu_periph_obj_t mcu_spi_miso_list[8] = { PERIPH_PIN(4, 1, kIOMUXC_LPSPI4_SDI_SELECT_INPUT, 1, &pin_GPIO_B1_05), }; -LPUART_Type *mcu_uart_banks[8] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; +LPUART_Type *const mcu_uart_banks[8] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; const mcu_periph_obj_t mcu_uart_rx_list[18] = { PERIPH_PIN(1, 2, 0, 0, &pin_GPIO_AD_B0_13), diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h index 067c05d0d0..9a06a491f9 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h @@ -27,18 +27,18 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1062_PERIPHERALS_MIMXRT1011_PERIPH_H #define MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1062_PERIPHERALS_MIMXRT1011_PERIPH_H -extern LPI2C_Type *mcu_i2c_banks[4]; +extern LPI2C_Type *const mcu_i2c_banks[4]; extern const mcu_periph_obj_t mcu_i2c_sda_list[9]; extern const mcu_periph_obj_t mcu_i2c_scl_list[9]; -extern LPSPI_Type *mcu_spi_banks[4]; +extern LPSPI_Type *const mcu_spi_banks[4]; extern const mcu_periph_obj_t mcu_spi_sck_list[8]; extern const mcu_periph_obj_t mcu_spi_mosi_list[8]; extern const mcu_periph_obj_t mcu_spi_miso_list[8]; -extern LPUART_Type *mcu_uart_banks[8]; +extern LPUART_Type *const mcu_uart_banks[8]; extern const mcu_periph_obj_t mcu_uart_rx_list[18]; extern const mcu_periph_obj_t mcu_uart_tx_list[18]; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/periph.h index c77497a775..818b203da4 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/periph.h @@ -72,9 +72,9 @@ typedef struct { .pin = p_pin, \ } -extern LPI2C_Type *mcu_i2c_banks[]; -extern LPSPI_Type *mcu_spi_banks[]; -extern LPUART_Type *mcu_uart_banks[]; +extern LPI2C_Type *const mcu_i2c_banks[]; +extern LPSPI_Type *const mcu_spi_banks[]; +extern LPUART_Type *const mcu_uart_banks[]; #ifdef MIMXRT1011_SERIES #include "MIMXRT1011/periph.h" From 1e1172bc246d325d342d48a35663116bafdfc631 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 21 Mar 2023 12:07:03 -0500 Subject: [PATCH 16/90] fix sorting of block --- ports/mimxrt10xx/mpconfigport.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 236d5b9966..7eaac85b34 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -11,8 +11,8 @@ CIRCUITPY_TUSB_MEM_ALIGN = 32 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_AUDIOIO = 0 CIRCUITPY_BUSDEVICE = 1 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 From 36dbaf4ccc51c61c11b90954ddbbed90927fb7ef Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 22 Mar 2023 10:14:34 -0700 Subject: [PATCH 17/90] Add more checks for read-only Bitmaps Fixes #7768 --- shared-module/displayio/Bitmap.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index dc82d04e05..8cb80a661d 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -128,6 +128,9 @@ void displayio_bitmap_set_dirty_area(displayio_bitmap_t *self, const displayio_a } void displayio_bitmap_write_pixel(displayio_bitmap_t *self, int16_t x, int16_t y, uint32_t value) { + if (self->read_only) { + mp_raise_RuntimeError(translate("Read-only")); + } // Writes the color index value into a pixel position // Must update the dirty area separately @@ -160,6 +163,9 @@ void displayio_bitmap_write_pixel(displayio_bitmap_t *self, int16_t x, int16_t y void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16_t y, displayio_bitmap_t *source, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint32_t skip_index, bool skip_index_none) { + if (self->read_only) { + mp_raise_RuntimeError(translate("Read-only")); + } // Copy region of "source" bitmap into "self" bitmap at location x,y in the "self" // If skip_value is encountered in the source bitmap, it will not be copied. // If skip_value is `None`, then all pixels are copied. @@ -213,6 +219,9 @@ void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16 } void common_hal_displayio_bitmap_set_pixel(displayio_bitmap_t *self, int16_t x, int16_t y, uint32_t value) { + if (self->read_only) { + mp_raise_RuntimeError(translate("Read-only")); + } // update the dirty region displayio_area_t a = {x, y, x + 1, y + 1, NULL}; displayio_bitmap_set_dirty_area(self, &a); @@ -223,7 +232,7 @@ void common_hal_displayio_bitmap_set_pixel(displayio_bitmap_t *self, int16_t x, } displayio_area_t *displayio_bitmap_get_refresh_areas(displayio_bitmap_t *self, displayio_area_t *tail) { - if (self->dirty_area.x1 == self->dirty_area.x2) { + if (self->dirty_area.x1 == self->dirty_area.x2 || self->read_only) { return tail; } self->dirty_area.next = tail; @@ -231,11 +240,17 @@ displayio_area_t *displayio_bitmap_get_refresh_areas(displayio_bitmap_t *self, d } void displayio_bitmap_finish_refresh(displayio_bitmap_t *self) { + if (self->read_only) { + return; + } self->dirty_area.x1 = 0; self->dirty_area.x2 = 0; } void common_hal_displayio_bitmap_fill(displayio_bitmap_t *self, uint32_t value) { + if (self->read_only) { + mp_raise_RuntimeError(translate("Read-only")); + } displayio_area_t a = {0, 0, self->width, self->height, NULL}; displayio_bitmap_set_dirty_area(self, &a); From c6bc9c48c9958947c5e65e712bda953a024bfef0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 22 Mar 2023 12:14:00 -0500 Subject: [PATCH 18/90] mimxrt10xx: implement i2sout tested on metro m7 (green prototype version) with max98357a i2s amplifier and the following test code: ```py import board import time import digitalio from audiobusio import I2SOut from audiocore import RawSample from microcontroller import pin from ulab import numpy as np n = np.array(np.sin(np.linspace(0, np.pi*2, 218, endpoint=False)) * 200, dtype=np.int16) print(n) r = RawSample(n, sample_rate=8000, channel_count=2) def main(): with digitalio.DigitalInOut(board.LED) as l: l.switch_to_output(True) value = False while True: with I2SOut(pin.GPIO_06, pin.GPIO_07, pin.GPIO_04) as i: time.sleep(.01) l.value = value = not value i.play(r, loop=True) print(i.playing) time.sleep(.5) i.stop() print("STOPPED") print(i.playing) time.sleep(.5) i.play(r, loop=True) print(i.playing) print("PLAY AGAIN") time.sleep(.5) time.sleep(1) ``` Only stereo, 16-bit, raw samples were tested; the sample rate is actually fixed at 48kHz in the core right now. There is more to do, but the basics work. # Conflicts: # ports/mimxrt10xx/Makefile # ports/mimxrt10xx/mpconfigport.mk --- ports/mimxrt10xx/Makefile | 6 +- ports/mimxrt10xx/background.c | 3 - ports/mimxrt10xx/boards/metro_m7_1011/pins.c | 4 + .../mimxrt10xx/common-hal/audiobusio/I2SOut.c | 154 +++++++ .../mimxrt10xx/common-hal/audiobusio/I2SOut.h | 47 ++ .../mimxrt10xx/common-hal/audiobusio/PDMIn.c | 0 .../mimxrt10xx/common-hal/audiobusio/PDMIn.h | 0 .../common-hal/audiobusio/__init__.c | 422 ++++++++++++++++++ .../common-hal/audiobusio/__init__.h | 59 +++ .../common-hal/microcontroller/Pin.c | 19 +- .../common-hal/microcontroller/Pin.h | 12 +- ports/mimxrt10xx/mpconfigport.mk | 4 +- .../mimxrt10xx/MIMXRT1011/periph.c | 25 ++ .../mimxrt10xx/MIMXRT1011/periph.h | 7 + .../mimxrt10xx/MIMXRT1021/periph.c | 55 +++ .../mimxrt10xx/MIMXRT1021/periph.h | 10 +- .../mimxrt10xx/MIMXRT1062/periph.c | 56 +++ .../mimxrt10xx/MIMXRT1062/periph.h | 7 + .../peripherals/mimxrt10xx/periph.h | 2 +- ports/mimxrt10xx/supervisor/port.c | 7 +- 20 files changed, 878 insertions(+), 21 deletions(-) create mode 100644 ports/mimxrt10xx/common-hal/audiobusio/I2SOut.c create mode 100644 ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h create mode 100644 ports/mimxrt10xx/common-hal/audiobusio/PDMIn.c create mode 100644 ports/mimxrt10xx/common-hal/audiobusio/PDMIn.h create mode 100644 ports/mimxrt10xx/common-hal/audiobusio/__init__.c create mode 100644 ports/mimxrt10xx/common-hal/audiobusio/__init__.h diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index d8d12b74da..27f3b0e304 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -119,6 +119,7 @@ SRC_SDK := \ drivers/lpuart/fsl_lpuart.c \ drivers/ocotp/fsl_ocotp.c \ drivers/pwm/fsl_pwm.c \ + drivers/sai/fsl_sai.c \ drivers/snvs_hp/fsl_snvs_hp.c \ drivers/snvs_lp/fsl_snvs_lp.c \ drivers/tempmon/fsl_tempmon.c \ @@ -146,11 +147,6 @@ SRC_C += \ endif -# TODO -#ifeq ($(CIRCUITPY_AUDIOBUSIO),1) -#SRC_C += peripherals/samd/i2s.c peripherals/samd/$(CHIP_FAMILY)/i2s.c -#endif -# SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \ $(addprefix common-hal/, $(SRC_COMMON_HAL)) diff --git a/ports/mimxrt10xx/background.c b/ports/mimxrt10xx/background.c index 529f791a39..faa2bda3f8 100644 --- a/ports/mimxrt10xx/background.c +++ b/ports/mimxrt10xx/background.c @@ -35,9 +35,6 @@ void PLACE_IN_ITCM(port_background_task)(void) { } void port_background_tick(void) { - #if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO - audio_dma_background(); - #endif } void port_start_background_task(void) { diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/pins.c b/ports/mimxrt10xx/boards/metro_m7_1011/pins.c index 886909e1dd..f48066dae1 100644 --- a/ports/mimxrt10xx/boards/metro_m7_1011/pins.c +++ b/ports/mimxrt10xx/boards/metro_m7_1011/pins.c @@ -56,5 +56,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + + { MP_ROM_QSTR(MP_QSTR_I2S_WSEL), MP_ROM_PTR(&pin_GPIO_06) }, // D10 + { MP_ROM_QSTR(MP_QSTR_I2S_BCLK), MP_ROM_PTR(&pin_GPIO_07) }, // D9 + { MP_ROM_QSTR(MP_QSTR_I2S_DOUT), MP_ROM_PTR(&pin_GPIO_04) }, // D12 }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.c b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.c new file mode 100644 index 0000000000..06765afe02 --- /dev/null +++ b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.c @@ -0,0 +1,154 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include + +#include "mpconfigport.h" + +// Some boards don't implement I2SOut, so suppress any routines from here. +#if CIRCUITPY_AUDIOBUSIO_I2SOUT + +#include "py/gc.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "common-hal/audiobusio/I2SOut.h" +#include "shared-bindings/audiobusio/I2SOut.h" +#include "shared-bindings/audiocore/RawSample.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/translate/translate.h" +#include "supervisor/shared/tick.h" + +// Where required we use identifier names that are required by NXP's +// API, even though they do not conform to the naming standards that Adafruit +// strives to adhere to. https://www.adafruit.com/blacklivesmatter +#include "sdk/drivers/sai/fsl_sai.h" + +STATIC void config_periph_pin(const mcu_periph_obj_t *periph) { + if (!periph) { + return; + } + if (periph->pin->mux_reg) { + IOMUXC_SetPinMux( + periph->pin->mux_reg, periph->mux_mode, + periph->input_reg, periph->input_idx, + 0, + 1); + } + + IOMUXC_SetPinConfig(0, 0, 0, 0, + periph->pin->cfg_reg, + IOMUXC_SW_PAD_CTL_PAD_HYS(0) + | IOMUXC_SW_PAD_CTL_PAD_PUS(0) + | IOMUXC_SW_PAD_CTL_PAD_PUE(0) + | IOMUXC_SW_PAD_CTL_PAD_PKE(1) + | IOMUXC_SW_PAD_CTL_PAD_ODE(0) + | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) + | IOMUXC_SW_PAD_CTL_PAD_DSE(4) + | IOMUXC_SW_PAD_CTL_PAD_SRE(0)); +} + +// Caller validates that pins are free. +void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t *self, + const mcu_pin_obj_t *bit_clock, const mcu_pin_obj_t *word_select, + const mcu_pin_obj_t *data, bool left_justified) { + + int instance = -1; + const mcu_periph_obj_t *bclk_periph = find_pin_function(mcu_sai_tx_bclk_list, bit_clock, &instance, MP_QSTR_bit_clock); + const mcu_periph_obj_t *sync_periph = find_pin_function(mcu_sai_tx_sync_list, word_select, &instance, MP_QSTR_word_select); + const mcu_periph_obj_t *data_periph = find_pin_function(mcu_sai_tx_data0_list, data, &instance, MP_QSTR_data); + + sai_transceiver_t config; + SAI_GetClassicI2SConfig(&config, 16, kSAI_Stereo, 1); + config.syncMode = kSAI_ModeAsync; + config.fifo.fifoPacking = kSAI_FifoPackingDisabled; + // These identifier names are required by NXP's API, even though they do + // not conform to the naming standards that Adafruit strives to adhere to. + // https://www.adafruit.com/blacklivesmatter + config.masterSlave = kSAI_Master; + port_i2s_initialize(&self->i2s, instance, &config); + + self->bit_clock = bit_clock; + self->word_select = word_select; + self->data = data; + claim_pin(bit_clock); + claim_pin(word_select); + claim_pin(data); + config_periph_pin(data_periph); + config_periph_pin(sync_periph); + config_periph_pin(bclk_periph); +} + +bool common_hal_audiobusio_i2sout_deinited(audiobusio_i2sout_obj_t *self) { + return port_i2s_deinited(&self->i2s); +} + +void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t *self) { + if (common_hal_audiobusio_i2sout_deinited(self)) { + return; + } + + port_i2s_deinit(&self->i2s); + + common_hal_reset_pin(self->bit_clock); + self->bit_clock = NULL; + + common_hal_reset_pin(self->word_select); + self->word_select = NULL; + + common_hal_reset_pin(self->data); + self->data = NULL; +} + +void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t *self, + mp_obj_t sample, bool loop) { + if (common_hal_audiobusio_i2sout_get_playing(self)) { + common_hal_audiobusio_i2sout_stop(self); + } + port_i2s_play(&self->i2s, sample, loop); +} + +void common_hal_audiobusio_i2sout_pause(audiobusio_i2sout_obj_t *self) { + port_i2s_pause(&self->i2s); +} + +void common_hal_audiobusio_i2sout_resume(audiobusio_i2sout_obj_t *self) { + port_i2s_resume(&self->i2s); +} + +bool common_hal_audiobusio_i2sout_get_paused(audiobusio_i2sout_obj_t *self) { + return port_i2s_get_paused(&self->i2s); +} + +void common_hal_audiobusio_i2sout_stop(audiobusio_i2sout_obj_t *self) { + port_i2s_stop(&self->i2s); +} + +bool common_hal_audiobusio_i2sout_get_playing(audiobusio_i2sout_obj_t *self) { + return port_i2s_get_playing(&self->i2s); +} + +#endif // CIRCUITPY_AUDIOBUSIO_I2SOUT diff --git a/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h new file mode 100644 index 0000000000..c4194402be --- /dev/null +++ b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include "supervisor/background_callback.h" +#include "common-hal/microcontroller/Pin.h" + +#include "common-hal/audiobusio/__init__.h" + +// Some boards don't implement I2SOut, so suppress any routines from here. +#if CIRCUITPY_AUDIOBUSIO_I2SOUT + +#include "sdk/drivers/sai/fsl_sai.h" + +typedef struct { + mp_obj_base_t base; + i2s_t i2s; + const mcu_pin_obj_t *bit_clock; + const mcu_pin_obj_t *word_select; + const mcu_pin_obj_t *data; +} audiobusio_i2sout_obj_t; + +#endif diff --git a/ports/mimxrt10xx/common-hal/audiobusio/PDMIn.c b/ports/mimxrt10xx/common-hal/audiobusio/PDMIn.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/mimxrt10xx/common-hal/audiobusio/PDMIn.h b/ports/mimxrt10xx/common-hal/audiobusio/PDMIn.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c new file mode 100644 index 0000000000..2be6c6bcbb --- /dev/null +++ b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c @@ -0,0 +1,422 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/runtime.h" + +#include "common-hal/audiobusio/__init__.h" +#include "shared-module/audiocore/__init__.h" + +#define SAI_CLOCK_SOURCE_SELECT (2U) +#define SAI_CLOCK_SOURCE_DIVIDER (63U) +#define SAI_CLOCK_SOURCE_PRE_DIVIDER (0U) + +#define SAI_CLOCK_FREQ (CLOCK_GetFreq(kCLOCK_AudioPllClk) / (SAI_CLOCK_SOURCE_DIVIDER + 1U) / \ + (SAI_CLOCK_SOURCE_PRE_DIVIDER + 1U)) + +// must match what's in clocks.c (but that's a C file so there's no way to include it) +// This is 480MMHz * (18/17) / 8 (around 63.5MHz) and there's no partiuclar +// logic to this value that I was able to determine. +#define BOARD_BOOTCLOCKRUN_SAI1_CLK_ROOT 63529411UL + +#define AUDIO_BUFFER_FRAME_COUNT (128) // in uint32_t; there are 4, giving 2048 bytes. In all they hold 10ms @ stereo 16-bit 48kHz before all buffers drain + +/* + * AUDIO PLL setting: Frequency = Fref * (DIV_SELECT + NUM / DENOM) + * = 24 * (32 + 77/100) + * = 786.48 MHz + */ +const clock_audio_pll_config_t audioPllConfig = { + .loopDivider = 32, /* PLL loop divider. Valid range for DIV_SELECT divider value: 27~54. */ + .postDivider = 1, /* Divider after the PLL, should only be 1, 2, 4, 8, 16. */ + .numerator = 77, /* 30 bit numerator of fractional loop divider. */ + .denominator = 100, /* 30 bit denominator of fractional loop divider */ +}; + +static I2S_Type *const i2s_instances[] = I2S_BASE_PTRS; +static uint8_t i2s_in_use; + +static I2S_Type *SAI_GetPeripheral(int idx) { + if (idx < 0 || idx >= (int)MP_ARRAY_SIZE(i2s_instances)) { + return NULL; + } + return i2s_instances[idx]; +} + +static int SAI_GetInstance(I2S_Type *peripheral) { + for (size_t i = 0; i < MP_ARRAY_SIZE(i2s_instances); i++) { if (peripheral == i2s_instances[i]) { + return i; + } + } + return -1; +} + +static bool i2s_clock_off(I2S_Type *peripheral) { + int index = SAI_GetInstance(peripheral); + switch (index) { + #if defined(SAI0) + case 0: + CLOCK_DisableClock(kCLOCK_Sai0); + return true; + #endif + #if defined(SAI1) + case 1: + CLOCK_DisableClock(kCLOCK_Sai1); + return true; + #endif + #if defined(SAI2) + case 2: + CLOCK_DisableClock(kCLOCK_Sai2); + return true; + #endif + #if defined(SAI3) + case 3: + CLOCK_DisableClock(kCLOCK_Sai3); + return true; + #endif + #if defined(SAI4) + case 4: + CLOCK_DisableClock(kCLOCK_Sai4); + return true; + #endif + #if defined(SAI5) + case 5: + CLOCK_DisableClock(kCLOCK_Sai5); + return true; + #endif + #if defined(SAI6) + case 6: + CLOCK_DisableClock(kCLOCK_Sai6); + return true; + #endif + #if defined(SAI7) + case 7: + CLOCK_DisableClock(kCLOCK_Sai7); + return true; + #endif + } + return false; +} + +static bool i2s_clocking(I2S_Type *peripheral) { + int index = SAI_GetInstance(peripheral); + switch (index) { + #if defined(SAI0) + case 0: + CLOCK_SetDiv(kCLOCK_Sai0PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai0Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai0Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai0); + return true; + #endif + #if defined(SAI1) + case 1: + CLOCK_SetDiv(kCLOCK_Sai1PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai1Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai1Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai1); + return true; + #endif + #if defined(SAI2) + case 2: + CLOCK_SetDiv(kCLOCK_Sai2PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai2Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai2Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai2); + return true; + #endif + #if defined(SAI3) + case 3: + CLOCK_SetDiv(kCLOCK_Sai3PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai3Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai3Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai3); + return true; + #endif + #if defined(SAI4) + case 4: + CLOCK_SetDiv(kCLOCK_Sai4PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai4Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai4Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai4); + return true; + #endif + #if defined(SAI5) + case 5: + CLOCK_SetDiv(kCLOCK_Sai5PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai5Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai5Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai5); + return true; + #endif + #if defined(SAI6) + case 6: + CLOCK_SetDiv(kCLOCK_Sai6PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai6Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai6Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai6); + return true; + #endif + #if defined(SAI7) + case 7: + CLOCK_SetDiv(kCLOCK_Sai7PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai7Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai7Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai7); + return true; + #endif + } + return false; +} + + +static bool i2s_queue_available(i2s_t *self) { + return !self->handle.saiQueue[self->handle.queueUser].data; +} + +static void i2s_fill_buffer(i2s_t *self) { + if (!self->peripheral) { + return; + } + while (i2s_queue_available(self)) { + uint32_t *buffer = self->buffers[self->buffer_idx]; + uint32_t *ptr = buffer, *end = buffer + AUDIO_BUFFER_FRAME_COUNT; + self->buffer_idx = (self->buffer_idx + 1) % SAI_XFER_QUEUE_SIZE; + + while (self->playing && !self->paused && ptr < end) { + if (self->sample_data == self->sample_end) { + if (self->stopping) { + // non-looping sample, previously returned GET_BUFFER_DONE + self->playing = false; + break; + } + uint32_t sample_buffer_length; + audioio_get_buffer_result_t get_buffer_result = + audiosample_get_buffer(self->sample, false, 0, + &self->sample_data, &sample_buffer_length); + self->sample_end = self->sample_data + sample_buffer_length; + if (get_buffer_result == GET_BUFFER_DONE) { + if (self->loop) { + audiosample_reset_buffer(self->sample, false, 0); + } else { + self->stopping = true; + } + } + if (get_buffer_result == GET_BUFFER_ERROR || sample_buffer_length == 0) { + self->stopping = true; + } + } + size_t input_bytecount = self->sample_end - self->sample_data; + size_t bytes_per_input_frame = self->channel_count * self->bytes_per_sample; + size_t framecount = MIN((size_t)(end - ptr), input_bytecount / bytes_per_input_frame); + +#define SAMPLE_TYPE(is_signed, channel_count, bytes_per_sample) ((is_signed) | ((channel_count) << 1) | ((bytes_per_sample) << 3)) + + switch (SAMPLE_TYPE(self->samples_signed, self->channel_count, self->bytes_per_sample)) { + + case SAMPLE_TYPE(true, 2, 2): + memcpy(ptr, self->sample_data, 4 * framecount); + break; + + case SAMPLE_TYPE(false, 2, 2): + audiosample_convert_u16s_s16s((int16_t *)ptr, (uint16_t *)(void *)self->sample_data, framecount); + break; + + case SAMPLE_TYPE(true, 1, 2): + audiosample_convert_s16m_s16s((int16_t *)ptr, (int16_t *)(void *)self->sample_data, framecount); + break; + + case SAMPLE_TYPE(false, 1, 2): + audiosample_convert_u16m_s16s((int16_t *)ptr, (uint16_t *)(void *)self->sample_data, framecount); + break; + + case SAMPLE_TYPE(true, 2, 1): + audiosample_convert_s8s_s16s((int16_t *)ptr, (int8_t *)(void *)self->sample_data, framecount); + memcpy(ptr, self->sample_data, 4 * framecount); + break; + + case SAMPLE_TYPE(false, 2, 1): + audiosample_convert_u8s_s16s((int16_t *)ptr, (uint8_t *)(void *)self->sample_data, framecount); + break; + + case SAMPLE_TYPE(true, 1, 1): + audiosample_convert_s8m_s16s((int16_t *)ptr, (int8_t *)(void *)self->sample_data, framecount); + break; + + case SAMPLE_TYPE(false, 1, 1): + audiosample_convert_u8m_s16s((int16_t *)ptr, (uint8_t *)(void *)self->sample_data, framecount); + break; + } + self->sample_data += bytes_per_input_frame * framecount; // in bytes + ptr += framecount; // in frames + } + // Fill any remaining portion of the buffer with 'no sound' + memset(ptr, 0, (end - ptr) * sizeof(uint32_t)); + sai_transfer_t xfer = { + .data = (uint8_t *)buffer, + .dataSize = AUDIO_BUFFER_FRAME_COUNT * sizeof(uint32_t), + }; + int r = SAI_TransferSendNonBlocking(self->peripheral, &self->handle, &xfer); + if (r != kStatus_Success) { + mp_printf(&mp_plat_print, "transfer returned %d\n", (int)r); + } + } +} + +static void i2s_callback_fun(void *self_in) { + i2s_t *self = self_in; + i2s_fill_buffer(self); +} + +static void i2s_transfer_callback(I2S_Type *base, sai_handle_t *handle, status_t status, void *self_in) { + i2s_t *self = self_in; + if (status == kStatus_SAI_TxIdle) { + // a block has been finished + background_callback_add(&self->callback, i2s_callback_fun, self_in); + } +} + + +void port_i2s_initialize(i2s_t *self, int instance, sai_transceiver_t *config) { + if (!i2s_in_use) { + // need to set audio pll up! + + /* DeInit Audio PLL. */ + CLOCK_DeinitAudioPll(); + /* Bypass Audio PLL. */ + CLOCK_SetPllBypass(CCM_ANALOG, kCLOCK_PllAudio, 1); + /* Set divider for Audio PLL. */ + CCM_ANALOG->MISC2 &= ~CCM_ANALOG_MISC2_AUDIO_DIV_LSB_MASK; + CCM_ANALOG->MISC2 &= ~CCM_ANALOG_MISC2_AUDIO_DIV_MSB_MASK; + /* Enable Audio PLL output. */ + CCM_ANALOG->PLL_AUDIO |= CCM_ANALOG_PLL_AUDIO_ENABLE_MASK; + + CLOCK_InitAudioPll(&audioPllConfig); + } + + I2S_Type *peripheral = SAI_GetPeripheral(instance); + if (!peripheral) { + mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_I2SOut); + } + if (i2s_in_use & (1 << instance)) { + mp_raise_ValueError_varg(translate("%q in use"), MP_QSTR_I2SOut); + } + if (!i2s_clocking(peripheral)) { + mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_I2SOut); + } + for (size_t i = 0; i < MP_ARRAY_SIZE(self->buffers); i++) { + self->buffers[i] = m_malloc(AUDIO_BUFFER_FRAME_COUNT * sizeof(uint32_t), false); + } + self->peripheral = peripheral; + SAI_Init(self->peripheral); + SAI_TransferTxCreateHandle(peripheral, &self->handle, i2s_transfer_callback, (void *)self); + SAI_TransferTxSetConfig(peripheral, &self->handle, config); + self->sample_rate = 0; + i2s_in_use |= (1 << instance); +} + +bool port_i2s_deinited(i2s_t *self) { + return !self->peripheral; +} + +void port_i2s_deinit(i2s_t *self) { + if (port_i2s_deinited(self)) { + return; + } + SAI_TransferAbortSend(self->peripheral, &self->handle); + i2s_clock_off(self->peripheral); + i2s_in_use &= ~(1 << SAI_GetInstance(self->peripheral)); + if (!i2s_in_use) { + CCM_ANALOG->PLL_AUDIO = CCM_ANALOG_PLL_AUDIO_BYPASS_MASK | CCM_ANALOG_PLL_AUDIO_POWERDOWN_MASK | CCM_ANALOG_PLL_AUDIO_BYPASS_CLK_SRC(kCLOCK_PllClkSrc24M); + } + self->peripheral = NULL; + for (size_t i = 0; i < MP_ARRAY_SIZE(self->buffers); i++) { + self->buffers[i] = NULL; + } +} + +void port_i2s_play(i2s_t *self, mp_obj_t sample, bool loop) { + self->sample = sample; + self->loop = loop; + self->bytes_per_sample = audiosample_bits_per_sample(sample) / 8; + self->channel_count = audiosample_channel_count(sample); + uint32_t sample_rate = audiosample_sample_rate(sample); + if (sample_rate != self->sample_rate) { + SAI_TxSetBitClockRate(self->peripheral, SAI_CLOCK_FREQ, sample_rate, 16, 2); + self->sample_rate = sample_rate; + } + bool single_buffer; + bool samples_signed; + uint32_t max_buffer_length; + uint8_t spacing; + audiosample_get_buffer_structure(sample, false, &single_buffer, &samples_signed, + &max_buffer_length, &spacing); + self->samples_signed = samples_signed; + self->playing = true; + self->paused = false; + self->stopping = false; + self->sample_data = self->sample_end = NULL; + + audiosample_reset_buffer(self->sample, false, 0); + +// TODO + #if 0 + uint32_t sample_rate = audiosample_sample_rate(sample); + if (sample_rate != self->i2s_config.sample_rate) { + CHECK_ESP_RESULT(i2s_set_sample_rates(self->instance, audiosample_sample_rate(sample))); + self->i2s_config.sample_rate = sample_rate; + } + #endif + background_callback_add(&self->callback, i2s_callback_fun, self); +} + +bool port_i2s_get_playing(i2s_t *self) { + return self->playing; +} + +bool port_i2s_get_paused(i2s_t *self) { + return self->paused; +} + +void port_i2s_stop(i2s_t *self) { + self->sample = NULL; + self->paused = false; + self->playing = false; + self->stopping = false; +} + +void port_i2s_pause(i2s_t *self) { + self->paused = true; +} + +void port_i2s_resume(i2s_t *self) { + self->paused = false; +} + +void i2s_reset() { +// this port relies on object finalizers for reset +} diff --git a/ports/mimxrt10xx/common-hal/audiobusio/__init__.h b/ports/mimxrt10xx/common-hal/audiobusio/__init__.h new file mode 100644 index 0000000000..f0663e2897 --- /dev/null +++ b/ports/mimxrt10xx/common-hal/audiobusio/__init__.h @@ -0,0 +1,59 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include "sdk/drivers/sai/fsl_sai.h" +#include "py/obj.h" + +#include "supervisor/background_callback.h" + + +typedef struct { + I2S_Type *peripheral; + sai_handle_t handle; + mp_obj_t sample; + uint32_t *buffers[SAI_XFER_QUEUE_SIZE]; + uint8_t *sample_data, *sample_end; + background_callback_t callback; + bool playing, paused, loop, stopping; + bool samples_signed; + uint8_t channel_count, bytes_per_sample; + uint8_t buffer_idx; + uint32_t sample_rate; +} i2s_t; + + +void i2s_reset(void); +void port_i2s_initialize(i2s_t *self, int instance, sai_transceiver_t *config); +void port_i2s_deinit(i2s_t *self); +bool port_i2s_deinited(i2s_t *self); +void port_i2s_play(i2s_t *self, mp_obj_t sample, bool loop); +void port_i2s_stop(i2s_t *self); +bool port_i2s_get_playing(i2s_t *self); +bool port_i2s_get_paused(i2s_t *self); +void port_i2s_pause(i2s_t *self); +void port_i2s_resume(i2s_t *self); diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index 3c8c7f2b27..a43ef2b7ab 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -25,8 +25,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "shared-bindings/microcontroller/__init__.h" +#include "py/runtime.h" #include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/__init__.h" STATIC bool claimed_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; STATIC bool never_reset_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; @@ -116,3 +117,19 @@ void claim_pin(const mcu_pin_obj_t *pin) { void common_hal_mcu_pin_reset_number(uint8_t pin_no) { common_hal_reset_pin((mcu_pin_obj_t *)(mcu_pin_globals.map.table[pin_no].value)); } + +const mcu_periph_obj_t *find_pin_function_sz(const mcu_periph_obj_t *list, size_t sz, const mcu_pin_obj_t *pin, int *instance, uint16_t name) { + if (!pin) { + return NULL; + } + for (size_t i = 0; i < sz; i++) { + if (*instance != -1 && *instance != list[i].bank_idx) { + continue; + } + if (pin == list[i].pin) { + *instance = list[i].bank_idx; + return &list[i]; + } + } + mp_raise_ValueError_varg(translate("Invalid %q pin"), name); +} diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h index 1bfbe41a18..4c66dd4ea5 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h @@ -25,11 +25,9 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PIN_H -#define MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PIN_H - -#include +#pragma once +#include "periph.h" #include "pins.h" void reset_all_pins(void); @@ -45,4 +43,8 @@ extern const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[]; // the port-default reset behavior. extern bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin); -#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PIN_H +// Find the entry in the peripheral list for this pin. If instance is (-1), any instance (bank_idx) may be used. Otherwise, the bank_idx must match the instance. +// If instance was -1, and the function succeeds, then instance is updated with the new bank_idx. +// If the pin is NULL then NULL is always returned. But if it was not NULL, and no match was found, then a ValueError is raised. +const mcu_periph_obj_t *find_pin_function_sz(const mcu_periph_obj_t *list, size_t sz, const mcu_pin_obj_t *pin, int *instance, uint16_t name); +#define find_pin_function(list, pin, instance, name) (find_pin_function_sz((list), MP_ARRAY_SIZE((list)), (pin), (instance), (name))) diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 7eaac85b34..787c3c7929 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -11,7 +11,9 @@ CIRCUITPY_TUSB_MEM_ALIGN = 32 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_AUDIOBUSIO = 1 +CIRCUITPY_AUDIOBUSIO_PDMIN = 0 +CIRCUITPY_AUDIOCORE = 1 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_BUSDEVICE = 1 CIRCUITPY_COUNTIO = 0 diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c index 0c2b5893bc..fbbf65c8a5 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c @@ -166,3 +166,28 @@ const mcu_pwm_obj_t mcu_pwm_list[20] = { PWM_PIN(PWM1, kPWM_Module_3, kPWM_PwmX, IOMUXC_GPIO_AD_09_FLEXPWM1_PWM3_X, &pin_GPIO_AD_09), }; + +const mcu_periph_obj_t mcu_sai_rx_bclk_list[] = { + PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_08), + PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_00), +}; +const mcu_periph_obj_t mcu_sai_rx_data0_list[] = { + PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_03), + PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_03), +}; +const mcu_periph_obj_t mcu_sai_rx_sync_list[] = { + PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_02), + PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_04), +}; +const mcu_periph_obj_t mcu_sai_tx_bclk_list[] = { + PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_06), + PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_01), +}; +const mcu_periph_obj_t mcu_sai_tx_data0_list[] = { + PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_04), + PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_02), +}; +const mcu_periph_obj_t mcu_sai_tx_sync_list[] = { + PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_07), + PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_00), +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h index b3bddcb76b..109717528f 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h @@ -47,4 +47,11 @@ extern const mcu_periph_obj_t mcu_uart_cts_list[4]; extern const mcu_pwm_obj_t mcu_pwm_list[20]; +extern const mcu_periph_obj_t mcu_sai_rx_bclk_list[2]; +extern const mcu_periph_obj_t mcu_sai_rx_data0_list[2]; +extern const mcu_periph_obj_t mcu_sai_rx_sync_list[2]; +extern const mcu_periph_obj_t mcu_sai_tx_bclk_list[2]; +extern const mcu_periph_obj_t mcu_sai_tx_data0_list[2]; +extern const mcu_periph_obj_t mcu_sai_tx_sync_list[2]; + #endif // MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1011_PERIPHERALS_MIMXRT1011_PERIPH_H diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c index ffcadbb696..b80fcf5065 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c @@ -256,3 +256,58 @@ const mcu_pwm_obj_t mcu_pwm_list[39] = { PWM_PIN(PWM2, kPWM_Module_2, kPWM_PwmX, IOMUXC_GPIO_EMC_12_FLEXPWM2_PWMX02, &pin_GPIO_EMC_12), PWM_PIN(PWM2, kPWM_Module_3, kPWM_PwmX, IOMUXC_GPIO_EMC_13_FLEXPWM2_PWMX03, &pin_GPIO_EMC_13), }; + +const mcu_periph_obj_t mcu_sai_rx_bclk_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_14), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_19), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_06), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_09), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_SD_B0_02), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_29), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_SD_B1_09), +}; +const mcu_periph_obj_t mcu_sai_rx_data0_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_13), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_21), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_05), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_08), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_SD_B0_03), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_30), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_SD_B1_11), +}; +const mcu_periph_obj_t mcu_sai_rx_sync_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_15), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_28), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_04), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_07), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_SD_B0_01), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_30), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_SD_B1_10), +}; +const mcu_periph_obj_t mcu_sai_tx_bclk_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_11), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_26), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_01), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_04), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_SD_B0_04), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_33), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_SD_B0_06), +}; +const mcu_periph_obj_t mcu_sai_tx_data0_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_12), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_25), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_03), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_06), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_SD_B0_04), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_32), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_SD_B1_08), +}; +const mcu_periph_obj_t mcu_sai_tx_sync_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_10), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_27), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_02), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_05), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_SD_B0_06), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_34), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_SD_B1_07), +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h index 9074987cd8..31ac10e651 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h @@ -25,8 +25,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H -#define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H +#pragma once extern LPI2C_Type *const mcu_i2c_banks[4]; @@ -48,4 +47,9 @@ extern const mcu_periph_obj_t mcu_uart_cts_list[10]; extern const mcu_pwm_obj_t mcu_pwm_list[39]; -#endif // MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIP_H +extern const mcu_periph_obj_t mcu_sai_rx_bclk_list[7]; +extern const mcu_periph_obj_t mcu_sai_rx_data0_list[7]; +extern const mcu_periph_obj_t mcu_sai_rx_sync_list[7]; +extern const mcu_periph_obj_t mcu_sai_tx_bclk_list[7]; +extern const mcu_periph_obj_t mcu_sai_tx_data0_list[7]; +extern const mcu_periph_obj_t mcu_sai_tx_sync_list[7]; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c index b6efe5e6a9..8c038bdb71 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c @@ -306,3 +306,59 @@ const mcu_pwm_obj_t mcu_pwm_list[67] = { PWM_PIN(PWM4, kPWM_Module_3, kPWM_PwmB, IOMUXC_GPIO_EMC_18_FLEXPWM4_PWMB03, &pin_GPIO_EMC_18), }; + +const mcu_periph_obj_t mcu_sai_rx_bclk_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_11), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_B0_15), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_SD_B1_05), + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_EMC_10), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_AD_B0_06), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_35), + PERIPH_PIN(3, 8, 0, 0, &pin_GPIO_SD_B1_00), +}; + +const mcu_periph_obj_t mcu_sai_rx_data0_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_B1_00), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_12), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_06), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_AD_B0_08), + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_EMC_08), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_33), + PERIPH_PIN(3, 8, 0, 0, &pin_GPIO_SD_B1_00), +}; +const mcu_periph_obj_t mcu_sai_rx_sync_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_11), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_B0_15), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_SD_B1_05), + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_EMC_09), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_AD_B0_06), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_34), + PERIPH_PIN(3, 8, 0, 0, &pin_GPIO_SD_B1_05), +}; +const mcu_periph_obj_t mcu_sai_tx_bclk_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_SD_B1_08), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_B1_02), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_14), + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_AD_B0_05), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_06), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_38), + PERIPH_PIN(3, 8, 0, 0, &pin_GPIO_SD_B1_03), +}; +const mcu_periph_obj_t mcu_sai_tx_data0_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_13), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_B1_01), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_SD_B1_07), + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_EMC_04), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_AD_B0_09), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_36), + PERIPH_PIN(3, 8, 0, 0, &pin_GPIO_SD_B1_01), +}; +const mcu_periph_obj_t mcu_sai_tx_sync_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_15), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_B1_03), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_SD_B1_09), + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_AD_B0_04), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_05), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_39), + PERIPH_PIN(3, 8, 0, 0, &pin_GPIO_SD_B1_02), +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h index 9a06a491f9..ab8eb22678 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h @@ -47,4 +47,11 @@ extern const mcu_periph_obj_t mcu_uart_cts_list[9]; extern const mcu_pwm_obj_t mcu_pwm_list[67]; +extern const mcu_periph_obj_t mcu_sai_rx_bclk_list[7]; +extern const mcu_periph_obj_t mcu_sai_rx_data0_list[7]; +extern const mcu_periph_obj_t mcu_sai_rx_sync_list[7]; +extern const mcu_periph_obj_t mcu_sai_tx_bclk_list[7]; +extern const mcu_periph_obj_t mcu_sai_tx_data0_list[7]; +extern const mcu_periph_obj_t mcu_sai_tx_sync_list[7]; + #endif // MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1062_PERIPHERALS_MIMXRT1011_PERIPH_H diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/periph.h index 818b203da4..8184d5b135 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/periph.h @@ -31,7 +31,7 @@ #include "pins.h" typedef struct { - uint8_t bank_idx : 4; + uint8_t bank_idx : 4; // e.g. the peripheral number uint8_t mux_mode : 4; uint32_t input_reg; uint8_t input_idx; diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 55bf72352d..feb8566aad 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -36,6 +36,10 @@ #include "fsl_device_registers.h" +#if CIRCUITPY_AUDIOBUSIO +#include "common-hal/audiobusio/__init__.h" +#endif + #include "common-hal/microcontroller/Pin.h" #include "common-hal/pwmio/PWMOut.h" #include "common-hal/rtc/RTC.h" @@ -414,8 +418,7 @@ void reset_port(void) { audioout_reset(); #endif #if CIRCUITPY_AUDIOBUSIO - i2sout_reset(); - // pdmin_reset(); + i2s_reset(); #endif #if CIRCUITPY_TOUCHIO && CIRCUITPY_TOUCHIO_USE_NATIVE From 04bb0513df068ae3091bcc9c3b83a6ff9598b89a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 21 Mar 2023 11:58:51 -0500 Subject: [PATCH 19/90] enable audiomixer --- ports/mimxrt10xx/mpconfigport.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 787c3c7929..8597fc068b 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -15,6 +15,7 @@ CIRCUITPY_AUDIOBUSIO = 1 CIRCUITPY_AUDIOBUSIO_PDMIN = 0 CIRCUITPY_AUDIOCORE = 1 CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_AUDIOMIXER = 1 CIRCUITPY_BUSDEVICE = 1 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 From f40504b7bc16b538fdb2a34e3dc6b7c5e9e3b3f4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 21 Mar 2023 12:17:17 -0500 Subject: [PATCH 20/90] enable MP3 --- ports/mimxrt10xx/mpconfigport.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 8597fc068b..a952460259 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -16,6 +16,7 @@ CIRCUITPY_AUDIOBUSIO_PDMIN = 0 CIRCUITPY_AUDIOCORE = 1 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOMIXER = 1 +CIRCUITPY_AUDIOMP3 = 1 CIRCUITPY_BUSDEVICE = 1 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 From 57188885d3dc895f691956cfd2dd6e76eb889b94 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 22 Mar 2023 14:08:03 -0400 Subject: [PATCH 21/90] Swap ESP32 RX and TX pins on Metro M7 1011 --- ports/mimxrt10xx/boards/metro_m7_1011/pins.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/pins.c b/ports/mimxrt10xx/boards/metro_m7_1011/pins.c index 886909e1dd..675773798c 100644 --- a/ports/mimxrt10xx/boards/metro_m7_1011/pins.c +++ b/ports/mimxrt10xx/boards/metro_m7_1011/pins.c @@ -38,8 +38,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_GPIO0), MP_ROM_PTR(&pin_GPIO_SD_05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY), MP_ROM_PTR(&pin_GPIO_AD_11) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_GPIO_AD_07) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_GPIO_09) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_GPIO_10) }, + // These RX and TX are from the point of view of the i.MX microcontroller. + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_GPIO_09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_GPIO_10) }, // SPI { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_AD_06) }, From a280c010c2e5f99868ab43ef00042d7d32922a74 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 22 Mar 2023 11:14:38 -0700 Subject: [PATCH 22/90] Fix tricolor epd and add EPD feather --- .../adafruit_feather_rp2040_epd/board.c | 29 +++++++++++ .../mpconfigboard.h | 15 ++++++ .../mpconfigboard.mk | 9 ++++ .../pico-sdk-configboard.h | 4 ++ .../boards/adafruit_feather_rp2040_epd/pins.c | 51 +++++++++++++++++++ shared-module/displayio/EPaperDisplay.c | 6 ++- 6 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_epd/board.c create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_epd/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_epd/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_epd/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_epd/pins.c diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/board.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/mpconfigboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/mpconfigboard.h new file mode 100644 index 0000000000..356f0f5b54 --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/mpconfigboard.h @@ -0,0 +1,15 @@ +#define MICROPY_HW_BOARD_NAME "Adafruit Feather RP2040 EPD" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO20) +#define MICROPY_HW_NEOPIXEL (&pin_GPIO21) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO14) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO15) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO8) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO1) +#define DEFAULT_UART_BUS_TX (&pin_GPIO0) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/mpconfigboard.mk b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/mpconfigboard.mk new file mode 100644 index 0000000000..3b457b93cb --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/mpconfigboard.mk @@ -0,0 +1,9 @@ +USB_VID = 0x239A +USB_PID = 0x812C +USB_PRODUCT = "Feather RP2040 EPD" +USB_MANUFACTURER = "Adafruit" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ" diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/pico-sdk-configboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/pico-sdk-configboard.h @@ -0,0 +1,4 @@ +// Put board-specific pico-sdk definitions here. This file must exist. + +// Allow extra time for xosc to start. +#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64 diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/pins.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/pins.c new file mode 100644 index 0000000000..22ae43adad --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/pins.c @@ -0,0 +1,51 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_EPD_BUSY), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_EPD_RESET), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_EPD_DC), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_EPD_CS), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_EPD_SCK), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_EPD_MOSI), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 289fc47a68..74f828aea8 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -60,6 +60,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t const mcu_pin_obj_t *busy_pin, bool busy_state, mp_float_t seconds_per_frame, bool chip_select, bool grayscale, bool acep, bool two_byte_sequence_length) { uint16_t color_depth = 1; + bool core_grayscale = true; if (highlight_color != 0x000000) { self->core.colorspace.tricolor = true; self->core.colorspace.tricolor_hue = displayio_colorconverter_compute_hue(highlight_color); @@ -70,9 +71,10 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t color_depth = 4; // bits. 7 colors + clean self->acep = acep; grayscale = false; + core_grayscale = false; } - displayio_display_core_construct(&self->core, bus, width, height, ram_width, ram_height, colstart, rowstart, rotation, color_depth, grayscale, true, 1, true, true); + displayio_display_core_construct(&self->core, bus, width, height, ram_width, ram_height, colstart, rowstart, rotation, color_depth, core_grayscale, true, 1, true, true); self->set_column_window_command = set_column_window_command; self->set_row_window_command = set_row_window_command; @@ -340,7 +342,7 @@ STATIC bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t * memset(mask, 0, mask_length * sizeof(mask[0])); memset(buffer, 0, buffer_size * sizeof(buffer[0])); - if (self->grayscale) { + if (!self->acep) { self->core.colorspace.grayscale = true; self->core.colorspace.grayscale_bit = 7; } From 16c8dad0784c13ad039508bba8397da5c61f377f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 22 Mar 2023 11:54:43 -0700 Subject: [PATCH 23/90] Fix Pallete cache for grayscale and tricolor epd --- shared-module/displayio/Palette.c | 14 +++++++++++--- shared-module/displayio/Palette.h | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/shared-module/displayio/Palette.c b/shared-module/displayio/Palette.c index a2ddc285fd..c61b9ebc82 100644 --- a/shared-module/displayio/Palette.c +++ b/shared-module/displayio/Palette.c @@ -81,7 +81,13 @@ void displayio_palette_get_color(displayio_palette_t *self, const _displayio_col } // Cache results when not dithering. - if (!self->dither && self->colors[palette_index].cached_colorspace == colorspace) { + _displayio_color_t *color = &self->colors[palette_index]; + // Check the grayscale settings because EPaperDisplay will change them on + // the same object. + if (!self->dither && + color->cached_colorspace == colorspace && + color->cached_colorspace_grayscale_bit == colorspace->grayscale_bit && + color->cached_colorspace_grayscale == colorspace->grayscale) { output_color->pixel = self->colors[palette_index].cached_color; return; } @@ -90,8 +96,10 @@ void displayio_palette_get_color(displayio_palette_t *self, const _displayio_col rgb888_pixel.pixel = self->colors[palette_index].rgb888; displayio_convert_color(colorspace, self->dither, &rgb888_pixel, output_color); if (!self->dither) { - self->colors[palette_index].cached_colorspace = colorspace; - self->colors[palette_index].cached_color = output_color->pixel; + color->cached_colorspace = colorspace; + color->cached_color = output_color->pixel; + color->cached_colorspace_grayscale = colorspace->grayscale; + color->cached_colorspace_grayscale_bit = colorspace->grayscale_bit; } } diff --git a/shared-module/displayio/Palette.h b/shared-module/displayio/Palette.h index e9b449c4e7..050423d052 100644 --- a/shared-module/displayio/Palette.h +++ b/shared-module/displayio/Palette.h @@ -51,6 +51,8 @@ typedef struct { uint32_t rgb888; const _displayio_colorspace_t *cached_colorspace; uint32_t cached_color; + uint8_t cached_colorspace_grayscale_bit; + bool cached_colorspace_grayscale; bool transparent; // This may have additional bits added later for blending. } _displayio_color_t; From e05f0ba3b2eba583a88a18bf4de95ebee3125a16 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 22 Mar 2023 14:32:00 -0500 Subject: [PATCH 24/90] Revert "Correctly raise OS error in socketpool_socket_recv_into()" This reverts commit 7e6e824d5655026906b6515070aeb604d2ef3426. Fixes #7770 The change in #7623 needs to be revered; the raise-site added in #7632 is the correct one and the one in socketpool needs to be reverted. This is not affecting 8.0.x because #7623 was not back-ported to there before we realized it was not a full fix. Both #7770 and #7606 should be re-tested. I didn't test. --- ports/raspberrypi/common-hal/socketpool/Socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/common-hal/socketpool/Socket.c b/ports/raspberrypi/common-hal/socketpool/Socket.c index e2b82264ba..fe12f461fb 100644 --- a/ports/raspberrypi/common-hal/socketpool/Socket.c +++ b/ports/raspberrypi/common-hal/socketpool/Socket.c @@ -1109,7 +1109,7 @@ int socketpool_socket_recv_into(socketpool_socket_obj_t *socket, break; } if (ret == (unsigned)-1) { - mp_raise_OSError(_errno); + return -_errno; } return ret; } From 127a7092bf9927eaff84274983e72412a2faa7b5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 22 Mar 2023 16:09:56 -0500 Subject: [PATCH 25/90] use `values` in this error message ... matching the documentation of struct.pack, which has `def pack(fmt: str, *values: Any)` as the signature. --- shared-module/struct/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/struct/__init__.c b/shared-module/struct/__init__.c index b595504969..11e122915c 100644 --- a/shared-module/struct/__init__.c +++ b/shared-module/struct/__init__.c @@ -167,7 +167,7 @@ void shared_modules_struct_pack_into(mp_obj_t fmt_in, byte *p, byte *end_p, size } fmt++; } - (void)mp_arg_validate_length(n_args, i, MP_QSTR_args); + (void)mp_arg_validate_length(n_args, i, MP_QSTR_values); } mp_obj_tuple_t *shared_modules_struct_unpack_from(mp_obj_t fmt_in, byte *p, byte *end_p, bool exact_size) { From 8b9f5e7f531d8e7dbcff41723bc7c1fb3c1f1614 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 11 Mar 2023 09:44:35 -0600 Subject: [PATCH 26/90] Remove del obj and add deinited --- shared-bindings/gifio/OnDiskGif.c | 36 +++++++++++++++++++++++++++++++ shared-bindings/gifio/OnDiskGif.h | 2 ++ shared-module/gifio/OnDiskGif.c | 8 ++++++- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/shared-bindings/gifio/OnDiskGif.c b/shared-bindings/gifio/OnDiskGif.c index 7fb3fcf2bd..3eb56a1c32 100644 --- a/shared-bindings/gifio/OnDiskGif.c +++ b/shared-bindings/gifio/OnDiskGif.c @@ -30,6 +30,8 @@ #include "py/runtime.h" #include "py/objproperty.h" +#include "shared/runtime/context_manager_helpers.h" +#include "shared-bindings/util.h" #include "supervisor/shared/translate/translate.h" #include "shared-bindings/gifio/OnDiskGif.h" @@ -125,11 +127,34 @@ STATIC mp_obj_t gifio_ondiskgif_make_new(const mp_obj_type_t *type, size_t n_arg return MP_OBJ_FROM_PTR(self); } +STATIC void check_for_deinit(gifio_ondiskgif_t *self) { + if (common_hal_gifio_ondiskgif_deinited(self)) { + raise_deinited_error(); + } +} + +//| def __enter__(self) -> OnDiskGif: +//| """No-op used by Context Managers.""" +//| ... +// Provided by context manager helper. + +//| def __exit__(self) -> None: +//| """Automatically deinitializes the GIF when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +STATIC mp_obj_t gifio_ondiskgif_obj___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + common_hal_gifio_ondiskgif_deinit(args[0]); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gifio_ondiskgif___exit___obj, 4, 4, gifio_ondiskgif_obj___exit__); + //| width: int //| """Width of the gif. (read only)""" STATIC mp_obj_t gifio_ondiskgif_obj_get_width(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return MP_OBJ_NEW_SMALL_INT(common_hal_gifio_ondiskgif_get_width(self)); } @@ -143,6 +168,7 @@ MP_PROPERTY_GETTER(gifio_ondiskgif_width_obj, STATIC mp_obj_t gifio_ondiskgif_obj_get_height(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return MP_OBJ_NEW_SMALL_INT(common_hal_gifio_ondiskgif_get_height(self)); } @@ -155,6 +181,8 @@ MP_PROPERTY_GETTER(gifio_ondiskgif_height_obj, //| """The bitmap used to hold the current frame.""" STATIC mp_obj_t gifio_ondiskgif_obj_get_bitmap(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + + check_for_deinit(self); return common_hal_gifio_ondiskgif_get_bitmap(self); } @@ -168,6 +196,7 @@ MP_PROPERTY_GETTER(gifio_ondiskgif_bitmap_obj, STATIC mp_obj_t gifio_ondiskgif_obj_next_frame(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return mp_obj_new_float((float)common_hal_gifio_ondiskgif_next_frame(self, true) / 1000); } @@ -179,6 +208,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(gifio_ondiskgif_next_frame_obj, gifio_ondiskgif_obj_ne STATIC mp_obj_t gifio_ondiskgif_obj_get_duration(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return mp_obj_new_float((float)common_hal_gifio_ondiskgif_get_duration(self) / 1000); } @@ -192,6 +222,7 @@ MP_PROPERTY_GETTER(gifio_ondiskgif_duration_obj, STATIC mp_obj_t gifio_ondiskgif_obj_get_frame_count(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return MP_OBJ_NEW_SMALL_INT(common_hal_gifio_ondiskgif_get_frame_count(self)); } @@ -205,6 +236,7 @@ MP_PROPERTY_GETTER(gifio_ondiskgif_frame_count_obj, STATIC mp_obj_t gifio_ondiskgif_obj_get_min_delay(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return mp_obj_new_float((float)common_hal_gifio_ondiskgif_get_min_delay(self) / 1000); } @@ -219,6 +251,7 @@ MP_PROPERTY_GETTER(gifio_ondiskgif_min_delay_obj, STATIC mp_obj_t gifio_ondiskgif_obj_get_max_delay(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return mp_obj_new_float((float)common_hal_gifio_ondiskgif_get_max_delay(self) / 1000); } @@ -228,6 +261,9 @@ MP_PROPERTY_GETTER(gifio_ondiskgif_max_delay_obj, (mp_obj_t)&gifio_ondiskgif_get_max_delay_obj); STATIC const mp_rom_map_elem_t gifio_ondiskgif_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&gifio_ondiskgif_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&gifio_ondiskgif___exit___obj) }, { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&gifio_ondiskgif_height_obj) }, { MP_ROM_QSTR(MP_QSTR_bitmap), MP_ROM_PTR(&gifio_ondiskgif_bitmap_obj) }, { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&gifio_ondiskgif_width_obj) }, diff --git a/shared-bindings/gifio/OnDiskGif.h b/shared-bindings/gifio/OnDiskGif.h index 4ecbfca495..6776466e8d 100644 --- a/shared-bindings/gifio/OnDiskGif.h +++ b/shared-bindings/gifio/OnDiskGif.h @@ -45,4 +45,6 @@ int32_t common_hal_gifio_ondiskgif_get_duration(gifio_ondiskgif_t *self); int32_t common_hal_gifio_ondiskgif_get_frame_count(gifio_ondiskgif_t *self); int32_t common_hal_gifio_ondiskgif_get_min_delay(gifio_ondiskgif_t *self); int32_t common_hal_gifio_ondiskgif_get_max_delay(gifio_ondiskgif_t *self); +void common_hal_gifio_ondiskgif_deinit(gifio_ondiskgif_t *self); +bool common_hal_gifio_ondiskgif_deinited(gifio_ondiskgif_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_ONDISKGIF_H diff --git a/shared-module/gifio/OnDiskGif.c b/shared-module/gifio/OnDiskGif.c index 234b7f8198..eb8afb52ab 100644 --- a/shared-module/gifio/OnDiskGif.c +++ b/shared-module/gifio/OnDiskGif.c @@ -154,7 +154,13 @@ void common_hal_gifio_ondiskgif_construct(gifio_ondiskgif_t *self, pyb_file_obj_ self->min_delay = info.iMinDelay; self->max_delay = info.iMaxDelay; - // mp_printf(&mp_plat_print, "GIF_init returned %d %x\n", result, bitmap->data); +void common_hal_gifio_ondiskgif_deinit(gifio_ondiskgif_t *self) { + self->file = NULL; + self->bitmap = NULL; +} + +bool common_hal_gifio_ondiskgif_deinited(gifio_ondiskgif_t *self) { + return self->bitmap == NULL; } uint16_t common_hal_gifio_ondiskgif_get_height(gifio_ondiskgif_t *self) { From 07e83674c90b28c522df7b84417db583568ef9b4 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Tue, 14 Mar 2023 18:02:53 -0500 Subject: [PATCH 27/90] Add deinit to displayio.Bitmap --- shared-bindings/displayio/Bitmap.c | 28 ++++++++++++++++++++++++++-- shared-bindings/displayio/Bitmap.h | 2 ++ shared-module/displayio/Bitmap.c | 7 +++++++ shared-module/gifio/OnDiskGif.c | 1 + 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 65551f4e0d..718e1c334c 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -84,11 +84,19 @@ STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } + +STATIC void check_for_deinit(displayio_bitmap_t *self) { + if (common_hal_displayio_bitmap_deinited(self)) { + raise_deinited_error(); + } +} + //| width: int //| """Width of the bitmap. (read only)""" STATIC mp_obj_t displayio_bitmap_obj_get_width(mp_obj_t self_in) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_bitmap_get_width(self)); } @@ -102,6 +110,7 @@ MP_PROPERTY_GETTER(displayio_bitmap_width_obj, STATIC mp_obj_t displayio_bitmap_obj_get_height(mp_obj_t self_in) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_bitmap_get_height(self)); } @@ -134,6 +143,7 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val } displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); if (mp_obj_is_type(index_obj, &mp_type_slice)) { // TODO(tannewt): Implement subscr after slices support start, stop and step tuples. @@ -214,6 +224,7 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); displayio_bitmap_t *self = MP_OBJ_TO_PTR(pos_args[0]); + check_for_deinit(self); int16_t x = args[ARG_x].u_int; int16_t y = args[ARG_y].u_int; @@ -288,6 +299,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_blit_obj, 1, displayio_bitmap_obj_bl //| ... STATIC mp_obj_t displayio_bitmap_obj_fill(mp_obj_t self_in, mp_obj_t value_obj) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); mp_uint_t value = (mp_uint_t)mp_obj_get_int(value_obj); if ((value >> common_hal_displayio_bitmap_get_bits_per_value(self)) != 0) { @@ -318,9 +330,10 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_bitmap_fill_obj, displayio_bitmap_obj_fill); //| notified of the "dirty rectangle" that encloses all modified //| pixels.""" //| ... -//| STATIC mp_obj_t displayio_bitmap_obj_dirty(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(pos_args[0]); + check_for_deinit(self); + enum { ARG_x1, ARG_y1, ARG_x2, ARG_y2 }; static const mp_arg_t allowed_args[] = { { MP_QSTR_x1, MP_ARG_INT, {.u_int = 0} }, @@ -344,13 +357,24 @@ STATIC mp_obj_t displayio_bitmap_obj_dirty(size_t n_args, const mp_obj_t *pos_ar } MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_dirty_obj, 0, displayio_bitmap_obj_dirty); +//| def deinit(self) -> None: +//| """Release resources allocated by Bitmap.""" +//| ... +//| +STATIC mp_obj_t displayio_bitmap_obj_deinit(mp_obj_t self_in) { + displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_displayio_bitmap_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(displayio_bitmap_deinit_obj, displayio_bitmap_obj_deinit); + STATIC const mp_rom_map_elem_t displayio_bitmap_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&displayio_bitmap_height_obj) }, { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&displayio_bitmap_width_obj) }, { MP_ROM_QSTR(MP_QSTR_blit), MP_ROM_PTR(&displayio_bitmap_blit_obj) }, { MP_ROM_QSTR(MP_QSTR_fill), MP_ROM_PTR(&displayio_bitmap_fill_obj) }, { MP_ROM_QSTR(MP_QSTR_dirty), MP_ROM_PTR(&displayio_bitmap_dirty_obj) }, - + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&displayio_bitmap_deinit_obj) }, }; STATIC MP_DEFINE_CONST_DICT(displayio_bitmap_locals_dict, displayio_bitmap_locals_dict_table); diff --git a/shared-bindings/displayio/Bitmap.h b/shared-bindings/displayio/Bitmap.h index 074f7dfa5c..b35f4eadbc 100644 --- a/shared-bindings/displayio/Bitmap.h +++ b/shared-bindings/displayio/Bitmap.h @@ -48,5 +48,7 @@ void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16 uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *bitmap, int16_t x, int16_t y); void common_hal_displayio_bitmap_fill(displayio_bitmap_t *bitmap, uint32_t value); int common_hal_displayio_bitmap_get_buffer(displayio_bitmap_t *self, mp_buffer_info_t *bufinfo, mp_uint_t flags); +void common_hal_displayio_bitmap_deinit(displayio_bitmap_t *self); +bool common_hal_displayio_bitmap_deinited(displayio_bitmap_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_BITMAP_H diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index dc82d04e05..94981cbd4f 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -79,6 +79,13 @@ void common_hal_displayio_bitmap_construct_from_buffer(displayio_bitmap_t *self, self->dirty_area.y2 = height; } +void common_hal_displayio_bitmap_deinit(displayio_bitmap_t *self) { + self->data = NULL; +} + +bool common_hal_displayio_bitmap_deinited(displayio_bitmap_t *self) { + return self->data == NULL; +} uint16_t common_hal_displayio_bitmap_get_height(displayio_bitmap_t *self) { return self->height; diff --git a/shared-module/gifio/OnDiskGif.c b/shared-module/gifio/OnDiskGif.c index eb8afb52ab..4c4a6b1f00 100644 --- a/shared-module/gifio/OnDiskGif.c +++ b/shared-module/gifio/OnDiskGif.c @@ -156,6 +156,7 @@ void common_hal_gifio_ondiskgif_construct(gifio_ondiskgif_t *self, pyb_file_obj_ void common_hal_gifio_ondiskgif_deinit(gifio_ondiskgif_t *self) { self->file = NULL; + common_hal_displayio_bitmap_deinit(self->bitmap); self->bitmap = NULL; } From aa423cc1c63341b2476d0b8368f68d68d5e24ae5 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 18 Mar 2023 09:21:40 -0500 Subject: [PATCH 28/90] Free memory allocated by bitmap obj --- shared-module/displayio/Bitmap.c | 6 ++++++ shared-module/displayio/Bitmap.h | 1 + 2 files changed, 7 insertions(+) diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index 94981cbd4f..8b578005c6 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -50,6 +50,9 @@ void common_hal_displayio_bitmap_construct_from_buffer(displayio_bitmap_t *self, self->stride = stride(width, bits_per_value); if (!data) { data = m_malloc(self->stride * height * sizeof(uint32_t), false); + self->data_alloc = true; + } else { + self->data_alloc = false; } self->data = data; self->read_only = read_only; @@ -80,6 +83,9 @@ void common_hal_displayio_bitmap_construct_from_buffer(displayio_bitmap_t *self, } void common_hal_displayio_bitmap_deinit(displayio_bitmap_t *self) { + if (self->data_alloc) { + m_free(self->data); + } self->data = NULL; } diff --git a/shared-module/displayio/Bitmap.h b/shared-module/displayio/Bitmap.h index 0373ae80c5..2025e56282 100644 --- a/shared-module/displayio/Bitmap.h +++ b/shared-module/displayio/Bitmap.h @@ -45,6 +45,7 @@ typedef struct { displayio_area_t dirty_area; uint16_t bitmask; bool read_only; + bool data_alloc; // did bitmap allocate data or someone else } displayio_bitmap_t; void displayio_bitmap_finish_refresh(displayio_bitmap_t *self); From 2c1e2061db5e12f6a7a8ba173bda432966e33806 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 18 Mar 2023 09:28:41 -0500 Subject: [PATCH 29/90] Change free function --- shared-module/displayio/Bitmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index 8b578005c6..094b2288a4 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -29,6 +29,7 @@ #include #include "py/runtime.h" +#include "py/gc.h" enum { ALIGN_BITS = 8 * sizeof(uint32_t) }; @@ -84,7 +85,7 @@ void common_hal_displayio_bitmap_construct_from_buffer(displayio_bitmap_t *self, void common_hal_displayio_bitmap_deinit(displayio_bitmap_t *self) { if (self->data_alloc) { - m_free(self->data); + gc_free(self->data); } self->data = NULL; } From 3020893ba2718acbd4b936688b87c753ccc8d7a4 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 18 Mar 2023 10:01:41 -0500 Subject: [PATCH 30/90] Tweak to try to reduce low space builds --- shared-module/displayio/Bitmap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index 094b2288a4..4a439e56c0 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -49,11 +49,10 @@ void common_hal_displayio_bitmap_construct_from_buffer(displayio_bitmap_t *self, self->width = width; self->height = height; self->stride = stride(width, bits_per_value); + self->data_alloc = false; if (!data) { data = m_malloc(self->stride * height * sizeof(uint32_t), false); self->data_alloc = true; - } else { - self->data_alloc = false; } self->data = data; self->read_only = read_only; From 2365f9b3bee1828500f5eb572a737e26e7d63b63 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 22 Mar 2023 12:41:38 -0400 Subject: [PATCH 31/90] shrink SAMD21 builds; rework shrink logic in Makefile --- ports/atmel-samd/Makefile | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 68beeaf129..84cb4d0dcc 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -59,6 +59,7 @@ INC += -I. \ ifeq ($(CHIP_FAMILY), samd21) PERIPHERALS_CHIP_FAMILY=samd21 OPTIMIZATION_FLAGS ?= -Os + # TinyUSB defines CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 endif @@ -101,24 +102,26 @@ ifeq ($(DEBUG), 1) endif else CFLAGS += -DNDEBUG - # -finline-limit can shrink the image size. - # -finline-limit=80 or so is similar to not having it on. - # There is no simple default value, though. - # Do a default shrink for small builds. - ifndef CFLAGS_INLINE_LIMIT - ifeq ($(CIRCUITPY_FULL_BUILD),0) - CFLAGS_INLINE_LIMIT = 50 + # Do a default shrink for small builds, including all SAMD21 builds. + ifeq ($(CIRCUITPY_FULL_BUILD),0) + SHRINK_BUILD = 1 + else + ifeq ($(CHIP_FAMILY), samd21) + SHRINK_BUILD = 1 endif endif - ifdef CFLAGS_INLINE_LIMIT - CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT) + # -finline-limit can shrink the image size. + # -finline-limit=80 or so is similar to not having it on. + # There is no simple default value, though. + ifeq ($(SHRINK_BUILD), 1) + CFLAGS += -finline-limit=45 endif - ifeq ($(CIRCUITPY_FULL_BUILD),0) - CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20 - endif + # We used to do this but it seems to not reduce space any more, at least in gcc 11. + # Leave it here, commented out, just for reference. + # --param inline-unit-growth=15 --param max-inline-insns-auto=20 ifdef CFLAGS_BOARD CFLAGS += $(CFLAGS_BOARD) From 98ebc676ce273734d5818b7910cb5b6ded4017ee Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Wed, 22 Mar 2023 18:00:18 -0500 Subject: [PATCH 32/90] Added documentation about freeing a GIF --- shared-bindings/gifio/OnDiskGif.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shared-bindings/gifio/OnDiskGif.c b/shared-bindings/gifio/OnDiskGif.c index 3eb56a1c32..cc7112c04c 100644 --- a/shared-bindings/gifio/OnDiskGif.c +++ b/shared-bindings/gifio/OnDiskGif.c @@ -98,6 +98,14 @@ //| display_bus.send(42, struct.pack(">hh", 0, odg.bitmap.width - 1)) //| display_bus.send(43, struct.pack(">hh", 0, odg.bitmap.height - 1)) //| display_bus.send(44, d.bitmap) +//| +//| # The following optional code will free the OnDiskGif and allocated resources +//| # after use. This may be required before loading a new GIF in situations +//| # where RAM is limited and the first GIF took most of the RAM. +//| odg.deinit() +//| odg = None +//| gc.collect() +//| //| """ //| //| def __init__(self, file: str) -> None: From e993d0f3c3bb68852faff35b7e5458f013a0cff0 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Wed, 22 Mar 2023 20:19:09 -0500 Subject: [PATCH 33/90] Missing brace --- shared-module/gifio/OnDiskGif.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-module/gifio/OnDiskGif.c b/shared-module/gifio/OnDiskGif.c index 4c4a6b1f00..aeb4f7bb74 100644 --- a/shared-module/gifio/OnDiskGif.c +++ b/shared-module/gifio/OnDiskGif.c @@ -32,6 +32,7 @@ #include "py/mperrno.h" #include "py/runtime.h" + static int32_t GIFReadFile(GIFFILE *pFile, uint8_t *pBuf, int32_t iLen) { // mp_printf(&mp_plat_print, "GifReadFile len %d ", iLen); uint32_t iBytesRead; @@ -153,6 +154,7 @@ void common_hal_gifio_ondiskgif_construct(gifio_ondiskgif_t *self, pyb_file_obj_ self->frame_count = info.iFrameCount; self->min_delay = info.iMinDelay; self->max_delay = info.iMaxDelay; +} void common_hal_gifio_ondiskgif_deinit(gifio_ondiskgif_t *self) { self->file = NULL; From 45599258c9cc64225bbba7110bfc60d2b4e1fd94 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 22 Mar 2023 22:00:59 -0400 Subject: [PATCH 34/90] fix missing close brace --- shared-module/gifio/OnDiskGif.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-module/gifio/OnDiskGif.c b/shared-module/gifio/OnDiskGif.c index 4c4a6b1f00..309b48eca6 100644 --- a/shared-module/gifio/OnDiskGif.c +++ b/shared-module/gifio/OnDiskGif.c @@ -153,6 +153,7 @@ void common_hal_gifio_ondiskgif_construct(gifio_ondiskgif_t *self, pyb_file_obj_ self->frame_count = info.iFrameCount; self->min_delay = info.iMinDelay; self->max_delay = info.iMaxDelay; +} void common_hal_gifio_ondiskgif_deinit(gifio_ondiskgif_t *self) { self->file = NULL; From 52631bb1c5664da8080b56a049c8cdb67b08ff00 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Wed, 22 Mar 2023 22:30:38 -0500 Subject: [PATCH 35/90] Restore OnDiskGif deinit --- shared-bindings/gifio/OnDiskGif.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/shared-bindings/gifio/OnDiskGif.c b/shared-bindings/gifio/OnDiskGif.c index cc7112c04c..ed14cf9fe8 100644 --- a/shared-bindings/gifio/OnDiskGif.c +++ b/shared-bindings/gifio/OnDiskGif.c @@ -268,6 +268,17 @@ MP_DEFINE_CONST_FUN_OBJ_1(gifio_ondiskgif_get_max_delay_obj, gifio_ondiskgif_obj MP_PROPERTY_GETTER(gifio_ondiskgif_max_delay_obj, (mp_obj_t)&gifio_ondiskgif_get_max_delay_obj); +//| def deinit(self) -> None: +//| """Release resources allocated by OnDiskGif.""" +//| ... +//| +STATIC mp_obj_t gifio_ondiskgif_obj_deinit(mp_obj_t self_in) { + gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_gifio_ondiskgif_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(gifio_ondiskgif_deinit_obj, gifio_ondiskgif_obj_deinit); + STATIC const mp_rom_map_elem_t gifio_ondiskgif_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&gifio_ondiskgif_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, From a8abe8e70518f0ced9069614cf81e51d1473b704 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 20 Mar 2023 13:36:08 +0700 Subject: [PATCH 36/90] remove lib from exludes, fix all remaining typos --- .codespell/exclude-file.txt | 7 +++++++ .codespell/ignore-words.txt | 3 +++ .pre-commit-config.yaml | 6 +++++- .../s140_nrf52_7.0.1_API/include/nrf_svc.h | 2 +- ports/raspberrypi/mpconfigport.mk | 4 ++-- ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h | 2 +- py/emitbc.c | 4 ++-- py/emitnative.c | 2 +- py/scope.h | 2 +- shared-bindings/socketpool/SocketPool.c | 1 - tests/basics/int_big1.py | 2 +- tests/basics/with_return.py | 4 ++-- tests/feature_check/README | 2 +- tests/misc/non_compliant.py | 2 +- 14 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.codespell/exclude-file.txt b/.codespell/exclude-file.txt index e69de29bb2..9f49d9ae0c 100644 --- a/.codespell/exclude-file.txt +++ b/.codespell/exclude-file.txt @@ -0,0 +1,7 @@ +#define MICROPY_HW_BOARD_NAME "BLOK" +USB_PRODUCT = "BLOK" + uint32_t THI = (*(uint32_t *)FUSES_HOT_TEMP_VAL_INT_ADDR & FUSES_HOT_TEMP_VAL_INT_Msk) >> FUSES_HOT_TEMP_VAL_INT_Pos; + float TH = THI + convert_dec_to_frac(THD); +print(binascii.b2a_base64(b"fo")) + # again, neither will "there" or "wither", since they have "the" +i1Qb$TE"rl diff --git a/.codespell/ignore-words.txt b/.codespell/ignore-words.txt index 5a54e22f0d..f2a8dc2be5 100644 --- a/.codespell/ignore-words.txt +++ b/.codespell/ignore-words.txt @@ -7,6 +7,7 @@ pris synopsys reenable dout +inout wel iput hsi @@ -17,3 +18,5 @@ dum deque deques extint +shs +pass-thru diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1695a883b4..f8cc372d0f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,11 @@ repos: hooks: - id: codespell #args: [-w] - exclude: ^(locale/|lib/) + exclude: | + (?x)^( + locale/| + lib/ + ) - repo: local hooks: - id: translations diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h index 293001eccf..629739ed75 100644 --- a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h @@ -48,7 +48,7 @@ extern "C" { /** @brief Supervisor call declaration. * * A call to a function marked with @ref SVCALL, will trigger a Supervisor Call (SVC) Exception. - * The SVCs with SVC numbers 0x00-0x0F are forwared to the application. All other SVCs are handled by the SoftDevice. + * The SVCs with SVC numbers 0x00-0x0F are forwarded to the application. All other SVCs are handled by the SoftDevice. * * @param[in] number The SVC number to be used. * @param[in] return_type The return type of the SVC function. diff --git a/ports/raspberrypi/mpconfigport.mk b/ports/raspberrypi/mpconfigport.mk index c5de2a439d..21dde6d239 100644 --- a/ports/raspberrypi/mpconfigport.mk +++ b/ports/raspberrypi/mpconfigport.mk @@ -21,11 +21,11 @@ CIRCUITPY_ROTARYIO ?= 1 CIRCUITPY_ROTARYIO_SOFTENCODER = 1 # Things that need to be implemented. -# Use PWM interally +# Use PWM internally CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CTARGET = 1 CIRCUITPY_NVM = 1 -# Use PIO interally +# Use PIO internally CIRCUITPY_PULSEIO ?= 1 CIRCUITPY_WATCHDOG ?= 1 diff --git a/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h index ce2c397d47..31a8133b63 100644 --- a/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h +++ b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h @@ -148,7 +148,7 @@ typedef struct MemsAudio_STM32L4SAIPDM_t { pdm_data_available_t pdm_data_available; /** - * @brief A cound of the number of PDM clients in use. + * @brief A count of the number of PDM clients in use. */ uint32_t SAI1_client; diff --git a/py/emitbc.c b/py/emitbc.c index 8f7b1d5b72..80d0bf489b 100644 --- a/py/emitbc.c +++ b/py/emitbc.c @@ -253,7 +253,7 @@ STATIC void emit_write_bytecode_byte_obj(emit_t *emit, int stack_adj, byte b, mp emit_write_bytecode_byte(emit, stack_adj, b); emit->bytecode_offset = (size_t)MP_ALIGN(emit->bytecode_offset, sizeof(mp_obj_t)); mp_obj_t *c = (mp_obj_t *)emit_get_cur_to_write_bytecode(emit, sizeof(mp_obj_t)); - // Verify thar c is already uint-aligned + // Verify that c is already uint-aligned assert(c == MP_ALIGN(c, sizeof(mp_obj_t))); *c = obj; #endif @@ -269,7 +269,7 @@ STATIC void emit_write_bytecode_byte_raw_code(emit_t *emit, int stack_adj, byte emit_write_bytecode_byte(emit, stack_adj, b); emit->bytecode_offset = (size_t)MP_ALIGN(emit->bytecode_offset, sizeof(void *)); void **c = (void **)emit_get_cur_to_write_bytecode(emit, sizeof(void *)); - // Verify thar c is already uint-aligned + // Verify that c is already uint-aligned assert(c == MP_ALIGN(c, sizeof(void *))); *c = rc; #endif diff --git a/py/emitnative.c b/py/emitnative.c index 5946fcd341..7d615d5816 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -944,7 +944,7 @@ STATIC void emit_access_stack(emit_t *emit, int pos, vtype_kind_t *vtype, int re } // does an efficient X=pop(); discard(); push(X) -// needs a (non-temp) register in case the poped element was stored in the stack +// needs a (non-temp) register in case the popped element was stored in the stack STATIC void emit_fold_stack_top(emit_t *emit, int reg_dest) { stack_info_t *si = &emit->stack_info[emit->stack_size - 2]; si[0] = si[1]; diff --git a/py/scope.h b/py/scope.h index 8b05421072..b189260a37 100644 --- a/py/scope.h +++ b/py/scope.h @@ -49,7 +49,7 @@ typedef struct _id_info_t { uint8_t kind; uint8_t flags; // when it's an ID_INFO_KIND_LOCAL this is the unique number of the local - // whet it's an ID_INFO_KIND_CELL/FREE this is the unique number of the closed over variable + // when it's an ID_INFO_KIND_CELL/FREE this is the unique number of the closed over variable uint16_t local_num; qstr qst; } id_info_t; diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 3023721378..f056c741f3 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -52,7 +52,6 @@ //| returned by :py:attr:`wifi.radio` //| """ //| ... -//| STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 1, 1, false); diff --git a/tests/basics/int_big1.py b/tests/basics/int_big1.py index 40d16c455b..01d58f7233 100644 --- a/tests/basics/int_big1.py +++ b/tests/basics/int_big1.py @@ -1,4 +1,4 @@ -# to test arbitrariy precision integers +# to test arbitrarily precision integers x = 1000000000000000000000000000000 xn = -1000000000000000000000000000000 diff --git a/tests/basics/with_return.py b/tests/basics/with_return.py index fd848f1331..6f36d9ad03 100644 --- a/tests/basics/with_return.py +++ b/tests/basics/with_return.py @@ -30,7 +30,7 @@ def f(): return (i, j) print(f()) -# multiple for loops within nested withs +# multiple for loops within nested with(s) def f(): with CtxMgr(1): for i in [1, 2]: @@ -41,7 +41,7 @@ def f(): return (i, j, k, l) print(f()) -# multiple for loops that are optimised, and nested withs +# multiple for loops that are optimised, and nested with(s) def f(): with CtxMgr(1): for i in range(1, 3): diff --git a/tests/feature_check/README b/tests/feature_check/README index 3b7b6cba41..0f55e7ece4 100644 --- a/tests/feature_check/README +++ b/tests/feature_check/README @@ -1,4 +1,4 @@ This directory doesn't contain real tests, but code snippets to detect -various interpreter features, which can't be/inconvenient to detecte by +various interpreter features, which can't be/inconvenient to detected by other means. Scripts here are executed by run-tests.py at the beginning of testsuite to decide what other test groups to run/exclude. diff --git a/tests/misc/non_compliant.py b/tests/misc/non_compliant.py index 1c3706ec33..ecd4f10391 100644 --- a/tests/misc/non_compliant.py +++ b/tests/misc/non_compliant.py @@ -39,7 +39,7 @@ try: except NotImplementedError: print("NotImplementedError") -# uPy raises TypeError, shold be ValueError +# uPy raises TypeError, should be ValueError try: "%c" % b"\x01\x02" except (TypeError, ValueError): From bce1e7e28000abfcf45507db7e8106c982c1b910 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 23 Mar 2023 14:01:20 +0700 Subject: [PATCH 37/90] Revert changes in lib/ --- lib/cmsis/inc/core_armv81mml.h | 4 +-- lib/cmsis/inc/core_sc300.h | 2 +- lib/cmsis/inc/mpu_armv8.h | 2 +- lib/libm_dbl/__rem_pio2_large.c | 6 ++--- lib/libm_dbl/fmod.c | 2 +- lib/libm_dbl/sqrt.c | 2 +- lib/littlefs/lfs1.h | 12 ++++----- lib/littlefs/lfs2.c | 6 ++--- lib/littlefs/lfs2.h | 14 +++++----- lib/oofatfs/diskio.h | 4 +-- lib/oofatfs/ff.c | 48 ++++++++++++++++----------------- lib/oofatfs/ff.h | 2 +- lib/oofatfs/ffconf.h | 6 ++--- lib/oofatfs/ffunicode.c | 2 +- lib/sdmmc/sdmmc_io.c | 2 +- lib/uzlib/tinflate.c | 2 +- 16 files changed, 58 insertions(+), 58 deletions(-) diff --git a/lib/cmsis/inc/core_armv81mml.h b/lib/cmsis/inc/core_armv81mml.h index 48428fd650..9425dbc321 100644 --- a/lib/cmsis/inc/core_armv81mml.h +++ b/lib/cmsis/inc/core_armv81mml.h @@ -2162,7 +2162,7 @@ __STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ reg_value = (reg_value | ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << 8U) ); /* Insert write key and priority group */ + (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */ SCB->AIRCR = reg_value; } @@ -2536,7 +2536,7 @@ __STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup) reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ reg_value = (reg_value | ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << 8U) ); /* Insert write key and priority group */ + (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */ SCB_NS->AIRCR = reg_value; } diff --git a/lib/cmsis/inc/core_sc300.h b/lib/cmsis/inc/core_sc300.h index cbbac7e82c..5478ea74a5 100644 --- a/lib/cmsis/inc/core_sc300.h +++ b/lib/cmsis/inc/core_sc300.h @@ -1467,7 +1467,7 @@ __STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ reg_value = (reg_value | ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << 8U) ); /* Insert write key and priority group */ + (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */ SCB->AIRCR = reg_value; } diff --git a/lib/cmsis/inc/mpu_armv8.h b/lib/cmsis/inc/mpu_armv8.h index 84fdd323ae..8002738606 100644 --- a/lib/cmsis/inc/mpu_armv8.h +++ b/lib/cmsis/inc/mpu_armv8.h @@ -84,7 +84,7 @@ * \param SH Defines the Shareability domain for this memory region. * \param RO Read-Only: Set to 1 for a read-only memory region. * \param NP Non-Privileged: Set to 1 for a non-privileged memory region. -* \param XN eXecute Never: Set to 1 for a non-executable memory region. +* \oaram XN eXecute Never: Set to 1 for a non-executable memory region. */ #define ARM_MPU_RBAR(BASE, SH, RO, NP, XN) \ ((BASE & MPU_RBAR_BASE_Msk) | \ diff --git a/lib/libm_dbl/__rem_pio2_large.c b/lib/libm_dbl/__rem_pio2_large.c index 2d1904efc3..958f28c255 100644 --- a/lib/libm_dbl/__rem_pio2_large.c +++ b/lib/libm_dbl/__rem_pio2_large.c @@ -40,14 +40,14 @@ * z = (z-x[i])*2**24 * * - * y[] output result in an array of double precision numbers. + * y[] ouput result in an array of double precision numbers. * The dimension of y[] is: * 24-bit precision 1 * 53-bit precision 2 * 64-bit precision 2 * 113-bit precision 3 * The actual value is the sum of them. Thus for 113-bit - * precision, one may have to do something like: + * precison, one may have to do something like: * * long double t,w,r_head, r_tail; * t = (long double)y[2] + (long double)y[1]; @@ -78,7 +78,7 @@ * jk+1 must be 2 larger than you might expect so that our * recomputation test works. (Up to 24 bits in the integer * part (the 24 bits of it that we compute) and 23 bits in - * the fraction part may be lost to cancellation before we + * the fraction part may be lost to cancelation before we * recompute.) * * jz local integer variable indicating the number of diff --git a/lib/libm_dbl/fmod.c b/lib/libm_dbl/fmod.c index cf03aacdb2..6849722bac 100644 --- a/lib/libm_dbl/fmod.c +++ b/lib/libm_dbl/fmod.c @@ -9,7 +9,7 @@ double fmod(double x, double y) int sx = ux.i>>63; uint64_t i; - /* in the following uxi should be ux.i, but then gcc wrongly adds */ + /* in the followings uxi should be ux.i, but then gcc wrongly adds */ /* float load/store to inner loops ruining performance and code size */ uint64_t uxi = ux.i; diff --git a/lib/libm_dbl/sqrt.c b/lib/libm_dbl/sqrt.c index 194b09fb52..b277567385 100644 --- a/lib/libm_dbl/sqrt.c +++ b/lib/libm_dbl/sqrt.c @@ -37,7 +37,7 @@ * If (2) is false, then q = q ; otherwise q = q + 2 . * i+1 i i+1 i * - * With some algebraic manipulation, it is not difficult to see + * With some algebric manipulation, it is not difficult to see * that (2) is equivalent to * -(i+1) * s + 2 <= y (3) diff --git a/lib/littlefs/lfs1.h b/lib/littlefs/lfs1.h index 08f0b193c8..355c145d08 100644 --- a/lib/littlefs/lfs1.h +++ b/lib/littlefs/lfs1.h @@ -94,7 +94,7 @@ enum lfs1_open_flags { LFS1_F_DIRTY = 0x10000, // File does not match storage LFS1_F_WRITING = 0x20000, // File has been written since last flush LFS1_F_READING = 0x40000, // File has been read since last flush - LFS1_F_ERRED = 0x80000, // An error occurred during write + LFS1_F_ERRED = 0x80000, // An error occured during write }; // File seek flags @@ -111,25 +111,25 @@ struct lfs1_config { // information to the block device operations void *context; - // Read a region in a block. Negative error codes are propagated + // Read a region in a block. Negative error codes are propogated // to the user. int (*read)(const struct lfs1_config *c, lfs1_block_t block, lfs1_off_t off, void *buffer, lfs1_size_t size); // Program a region in a block. The block must have previously - // been erased. Negative error codes are propagated to the user. + // been erased. Negative error codes are propogated to the user. // May return LFS1_ERR_CORRUPT if the block should be considered bad. int (*prog)(const struct lfs1_config *c, lfs1_block_t block, lfs1_off_t off, const void *buffer, lfs1_size_t size); // Erase a block. A block must be erased before being programmed. // The state of an erased block is undefined. Negative error codes - // are propagated to the user. + // are propogated to the user. // May return LFS1_ERR_CORRUPT if the block should be considered bad. int (*erase)(const struct lfs1_config *c, lfs1_block_t block); // Sync the state of the underlying block device. Negative error codes - // are propagated to the user. + // are propogated to the user. int (*sync)(const struct lfs1_config *c); // Minimum size of a block read. This determines the size of read buffers. @@ -484,7 +484,7 @@ int lfs1_dir_rewind(lfs1_t *lfs1, lfs1_dir_t *dir); // Returns a negative error code on failure. int lfs1_traverse(lfs1_t *lfs1, int (*cb)(void*, lfs1_block_t), void *data); -// Prunes any recoverable errors that may have occurred in the filesystem +// Prunes any recoverable errors that may have occured in the filesystem // // Not needed to be called by user unless an operation is interrupted // but the filesystem is still mounted. This is already called on first diff --git a/lib/littlefs/lfs2.c b/lib/littlefs/lfs2.c index 7f3519acd2..39bd2f0d1c 100644 --- a/lib/littlefs/lfs2.c +++ b/lib/littlefs/lfs2.c @@ -1449,7 +1449,7 @@ static int lfs2_dir_alloc(lfs2_t *lfs2, lfs2_mdir_t *dir) { } } - // zero for reproducibility in case initial block is unreadable + // zero for reproducability in case initial block is unreadable dir->rev = 0; // rather than clobbering one of the blocks we just pretend @@ -1643,7 +1643,7 @@ static int lfs2_dir_compact(lfs2_t *lfs2, return err; } - // whelp, we tried, if we ran out of space there's not much + // welp, we tried, if we ran out of space there's not much // we can do, we'll error later if we've become frozen if (!err) { end = begin; @@ -4037,7 +4037,7 @@ static int lfs2_fs_relocate(lfs2_t *lfs2, lfs2_fs_prepmove(lfs2, 0x3ff, NULL); } - // replace bad pair, either we clean up desync, or no desync occurred + // replace bad pair, either we clean up desync, or no desync occured lfs2_pair_tole32(newpair); err = lfs2_dir_commit(lfs2, &parent, LFS2_MKATTRS( {LFS2_MKTAG_IF(moveid != 0x3ff, diff --git a/lib/littlefs/lfs2.h b/lib/littlefs/lfs2.h index b819aaa3b5..f3b66d76ff 100644 --- a/lib/littlefs/lfs2.h +++ b/lib/littlefs/lfs2.h @@ -159,34 +159,34 @@ struct lfs2_config { // information to the block device operations void *context; - // Read a region in a block. Negative error codes are propagated + // Read a region in a block. Negative error codes are propogated // to the user. int (*read)(const struct lfs2_config *c, lfs2_block_t block, lfs2_off_t off, void *buffer, lfs2_size_t size); // Program a region in a block. The block must have previously - // been erased. Negative error codes are propagated to the user. + // been erased. Negative error codes are propogated to the user. // May return LFS2_ERR_CORRUPT if the block should be considered bad. int (*prog)(const struct lfs2_config *c, lfs2_block_t block, lfs2_off_t off, const void *buffer, lfs2_size_t size); // Erase a block. A block must be erased before being programmed. // The state of an erased block is undefined. Negative error codes - // are propagated to the user. + // are propogated to the user. // May return LFS2_ERR_CORRUPT if the block should be considered bad. int (*erase)(const struct lfs2_config *c, lfs2_block_t block); // Sync the state of the underlying block device. Negative error codes - // are propagated to the user. + // are propogated to the user. int (*sync)(const struct lfs2_config *c); #ifdef LFS2_THREADSAFE // Lock the underlying block device. Negative error codes - // are propagated to the user. + // are propogated to the user. int (*lock)(const struct lfs2_config *c); // Unlock the underlying block device. Negative error codes - // are propagated to the user. + // are propogated to the user. int (*unlock)(const struct lfs2_config *c); #endif @@ -479,7 +479,7 @@ int lfs2_stat(lfs2_t *lfs2, const char *path, struct lfs2_info *info); // Returns the size of the attribute, or a negative error code on failure. // Note, the returned size is the size of the attribute on disk, irrespective // of the size of the buffer. This can be used to dynamically allocate a buffer -// or check for existence. +// or check for existance. lfs2_ssize_t lfs2_getattr(lfs2_t *lfs2, const char *path, uint8_t type, void *buffer, lfs2_size_t size); diff --git a/lib/oofatfs/diskio.h b/lib/oofatfs/diskio.h index 00768cac72..d886bdd9cc 100644 --- a/lib/oofatfs/diskio.h +++ b/lib/oofatfs/diskio.h @@ -3,7 +3,7 @@ */ /*-----------------------------------------------------------------------/ -/ Low level disk interface module include file (C)ChaN, 2014 / +/ Low level disk interface modlue include file (C)ChaN, 2014 / /-----------------------------------------------------------------------*/ #ifndef _DISKIO_DEFINED @@ -42,7 +42,7 @@ DRESULT disk_ioctl (void *drv, BYTE cmd, void* buff); #define STA_PROTECT 0x04 /* Write protected */ -/* Command code for disk_ioctrl function */ +/* Command code for disk_ioctrl fucntion */ /* Generic command (Used by FatFs) */ #define CTRL_SYNC 0 /* Complete pending write process (needed at FF_FS_READONLY == 0) */ diff --git a/lib/oofatfs/ff.c b/lib/oofatfs/ff.c index a4c17f0560..dbcfa3efc3 100644 --- a/lib/oofatfs/ff.c +++ b/lib/oofatfs/ff.c @@ -996,7 +996,7 @@ static FRESULT dec_lock ( /* Decrement object open counter */ if (n == 0) Files[i].fs = 0; /* Delete the entry if open count gets zero */ res = FR_OK; } else { - res = FR_INT_ERR; /* Invalid index number */ + res = FR_INT_ERR; /* Invalid index nunber */ } return res; } @@ -1990,7 +1990,7 @@ static void gen_numname ( seq = (UINT)sr; } - /* itoa (hexadecimal) */ + /* itoa (hexdecimal) */ i = 7; do { c = (BYTE)((seq % 16) + '0'); @@ -2098,7 +2098,7 @@ static DWORD xsum32 ( /* Returns 32-bit checksum */ /*------------------------------------------------------*/ static void get_xfileinfo ( - BYTE* dirb, /* Pointer to the directory entry block 85+C0+C1s */ + BYTE* dirb, /* Pointer to the direcotry entry block 85+C0+C1s */ FILINFO* fno /* Buffer to store the extracted file information */ ) { @@ -2135,16 +2135,16 @@ static void get_xfileinfo ( /*-----------------------------------*/ -/* exFAT: Get a directory entry block */ +/* exFAT: Get a directry entry block */ /*-----------------------------------*/ static FRESULT load_xdir ( /* FR_INT_ERR: invalid entry block */ - DIR* dp /* Reading directory object pointing top of the entry block to load */ + DIR* dp /* Reading direcotry object pointing top of the entry block to load */ ) { FRESULT res; UINT i, sz_ent; - BYTE* dirb = dp->obj.fs->dirbuf; /* Pointer to the on-memory directory entry block 85+C0+C1s */ + BYTE* dirb = dp->obj.fs->dirbuf; /* Pointer to the on-memory direcotry entry block 85+C0+C1s */ /* Load file-directory entry */ @@ -2208,7 +2208,7 @@ static void init_alloc_info ( /*------------------------------------------------*/ static FRESULT load_obj_xdir ( - DIR* dp, /* Blank directory object to be used to access containing directory */ + DIR* dp, /* Blank directory object to be used to access containing direcotry */ const FFOBJID* obj /* Object with its containing directory information */ ) { @@ -2237,18 +2237,18 @@ static FRESULT load_obj_xdir ( /*----------------------------------------*/ static FRESULT store_xdir ( - DIR* dp /* Pointer to the directory object */ + DIR* dp /* Pointer to the direcotry object */ ) { FRESULT res; UINT nent; - BYTE* dirb = dp->obj.fs->dirbuf; /* Pointer to the directory entry block 85+C0+C1s */ + BYTE* dirb = dp->obj.fs->dirbuf; /* Pointer to the direcotry entry block 85+C0+C1s */ /* Create set sum */ st_word(dirb + XDIR_SetSum, xdir_sum(dirb)); nent = dirb[XDIR_NumSec] + 1; - /* Store the directory entry block to the directory */ + /* Store the direcotry entry block to the directory */ res = dir_sdi(dp, dp->blk_ofs); while (res == FR_OK) { res = move_window(dp->obj.fs, dp->sect); @@ -2265,11 +2265,11 @@ static FRESULT store_xdir ( /*-------------------------------------------*/ -/* exFAT: Create a new directory entry block */ +/* exFAT: Create a new directory enrty block */ /*-------------------------------------------*/ static void create_xdir ( - BYTE* dirb, /* Pointer to the directory entry block buffer */ + BYTE* dirb, /* Pointer to the direcotry entry block buffer */ const WCHAR* lfn /* Pointer to the object name */ ) { @@ -2690,7 +2690,7 @@ static void get_fileinfo ( fno->altname[di] = 0; /* Terminate the SFN (null string means SFN is invalid) */ if (fno->fname[0] == 0) { /* If LFN is invalid, altname[] needs to be copied to fname[] */ - if (di == 0) { /* If LFN and SFN both are invalid, this object is inaccessible */ + if (di == 0) { /* If LFN and SFN both are invalid, this object is inaccesible */ fno->fname[di++] = '?'; } else { for (si = di = 0, lcf = NS_BODY; fno->altname[si]; si++, di++) { /* Copy altname[] to fname[] with case information */ @@ -2764,7 +2764,7 @@ static DWORD get_achar ( /* Get a character and advances ptr */ static int pattern_matching ( /* 0:not matched, 1:matched */ const TCHAR* pat, /* Matching pattern */ - const TCHAR* name, /* String to be tested */ + const TCHAR* nam, /* String to be tested */ int skip, /* Number of pre-skip chars (number of ?s) */ int inf /* Infinite search (* specified) */ ) @@ -2775,12 +2775,12 @@ static int pattern_matching ( /* 0:not matched, 1:matched */ while (skip--) { /* Pre-skip name chars */ - if (!get_achar(&name)) return 0; /* Branch mismatched if less name chars */ + if (!get_achar(&nam)) return 0; /* Branch mismatched if less name chars */ } if (*pat == 0 && inf) return 1; /* (short circuit) */ do { - pp = pat; np = name; /* Top of pattern and name to match */ + pp = pat; np = nam; /* Top of pattern and name to match */ for (;;) { if (*pp == '?' || *pp == '*') { /* Wildcard? */ nm = nx = 0; @@ -2795,7 +2795,7 @@ static int pattern_matching ( /* 0:not matched, 1:matched */ if (pc != nc) break; /* Branch mismatched? */ if (pc == 0) return 1; /* Branch matched? (matched at end of both strings) */ } - get_achar(&name); /* name++ */ + get_achar(&nam); /* nam++ */ } while (inf && nc); /* Retry until end of name if infinite search is specified */ return 0; @@ -3183,7 +3183,7 @@ static FRESULT find_volume ( /* FR_OK(0): successful, !=0: an error occurred fmt = bsect ? check_fs(fs, bsect) : 3; /* Check the partition */ } while (LD2PT(fs) == 0 && fmt >= 2 && ++i < 4); } - if (fmt == 4) return FR_DISK_ERR; /* An error occurred in the disk I/O layer */ + if (fmt == 4) return FR_DISK_ERR; /* An error occured in the disk I/O layer */ if (fmt >= 2) return FR_NO_FILESYSTEM; /* No FAT volume is found */ /* An FAT volume is found (bsect). Following code initializes the filesystem object */ @@ -3221,7 +3221,7 @@ static FRESULT find_volume ( /* FR_OK(0): successful, !=0: an error occurred fs->volbase = bsect; fs->database = bsect + ld_dword(fs->win + BPB_DataOfsEx); fs->fatbase = bsect + ld_dword(fs->win + BPB_FatOfsEx); - if (maxlba < (QWORD)fs->database + nclst * fs->csize) return FR_NO_FILESYSTEM; /* (Volume size must not be smaller than the size required) */ + if (maxlba < (QWORD)fs->database + nclst * fs->csize) return FR_NO_FILESYSTEM; /* (Volume size must not be smaller than the size requiered) */ fs->dirbase = ld_dword(fs->win + BPB_RootClusEx); /* Get bitmap location and check if it is contiguous (implementation assumption) */ @@ -3365,7 +3365,7 @@ static FRESULT validate ( /* Returns FR_OK or FR_INVALID_OBJECT */ if (obj && obj->fs && obj->fs->fs_type && obj->id == obj->fs->id) { /* Test if the object is valid */ #if FF_FS_REENTRANT if (lock_fs(obj->fs)) { /* Obtain the filesystem object */ - if (disk_ioctl(obj->fs->drv, IOCTL_STATUS, &stat) == RES_OK && !(stat & STA_NOINIT)) { /* Test if the physical drive is kept initialized */ + if (disk_ioctl(obj->fs->drv, IOCTL_STATUS, &stat) == RES_OK && !(stat & STA_NOINIT)) { /* Test if the phsical drive is kept initialized */ res = FR_OK; } else { unlock_fs(obj->fs, FR_OK); @@ -3374,7 +3374,7 @@ static FRESULT validate ( /* Returns FR_OK or FR_INVALID_OBJECT */ res = FR_TIMEOUT; } #else - if (disk_ioctl(obj->fs->drv, IOCTL_STATUS, &stat) == RES_OK && !(stat & STA_NOINIT)) { /* Test if the physical drive is kept initialized */ + if (disk_ioctl(obj->fs->drv, IOCTL_STATUS, &stat) == RES_OK && !(stat & STA_NOINIT)) { /* Test if the phsical drive is kept initialized */ res = FR_OK; } #endif @@ -3528,7 +3528,7 @@ FRESULT f_open ( } } else { /* Open an existing file */ - if (res == FR_OK) { /* Is the object existing? */ + if (res == FR_OK) { /* Is the object exsiting? */ if (dj.obj.attr & AM_DIR) { /* File open against a directory */ res = FR_NO_FILE; } else { @@ -4339,7 +4339,7 @@ FRESULT f_opendir ( FREE_NAMBUF(); if (res == FR_NO_FILE) res = FR_NO_PATH; } - if (res != FR_OK) dp->obj.fs = 0; /* Invalidate the directory object if function failed */ + if (res != FR_OK) dp->obj.fs = 0; /* Invalidate the directory object if function faild */ LEAVE_FF(fs, res); } @@ -4779,7 +4779,7 @@ FRESULT f_mkdir ( st_clust(fs, fs->win + SZDIRE, pcl); fs->wflag = 1; } - res = dir_register(&dj); /* Register the object to the parent directory */ + res = dir_register(&dj); /* Register the object to the parent directoy */ } } if (res == FR_OK) { diff --git a/lib/oofatfs/ff.h b/lib/oofatfs/ff.h index fe731eb694..b133d770db 100644 --- a/lib/oofatfs/ff.h +++ b/lib/oofatfs/ff.h @@ -240,7 +240,7 @@ typedef struct { WORD ftime; /* Modified time */ BYTE fattrib; /* File attribute */ #if FF_USE_LFN - TCHAR altname[FF_SFN_BUF + 1];/* Alternative file name */ + TCHAR altname[FF_SFN_BUF + 1];/* Altenative file name */ TCHAR fname[FF_LFN_BUF + 1]; /* Primary file name */ #else TCHAR fname[12 + 1]; /* File name */ diff --git a/lib/oofatfs/ffconf.h b/lib/oofatfs/ffconf.h index bcd7ee5baf..52ff6d0a7a 100644 --- a/lib/oofatfs/ffconf.h +++ b/lib/oofatfs/ffconf.h @@ -188,7 +188,7 @@ #define FF_LFN_BUF 255 #define FF_SFN_BUF 12 /* This set of options defines size of file name members in the FILINFO structure -/ which is used to read out directory items. These values should be sufficient for +/ which is used to read out directory items. These values should be suffcient for / the file names to read. The maximum possible length of the read file name depends / on character encoding. When LFN is not enabled, these options have no effect. */ @@ -251,7 +251,7 @@ / number and only an FAT volume found on the physical drive will be mounted. / When this function is enabled (1), each logical drive number can be bound to / arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk() -/ function will be available. */ +/ funciton will be available. */ #define FF_MIN_SS 512 @@ -316,7 +316,7 @@ #define FF_NORTC_MON 1 #define FF_NORTC_MDAY 1 #define FF_NORTC_YEAR 2018 -/* The option FF_FS_NORTC switches timestamp function. If the system does not have +/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have / any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable / the timestamp function. Every object modified by FatFs will have a fixed timestamp / defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time. diff --git a/lib/oofatfs/ffunicode.c b/lib/oofatfs/ffunicode.c index ce60b42193..a04577616a 100644 --- a/lib/oofatfs/ffunicode.c +++ b/lib/oofatfs/ffunicode.c @@ -3,7 +3,7 @@ /*------------------------------------------------------------------------*/ /* This module will occupy a huge memory in the .const section when the / / FatFs is configured for LFN with DBCS. If the system has any Unicode / -/ utility for the code conversion, this module should be modified to use / +/ utilitiy for the code conversion, this module should be modified to use / / that function to avoid silly memory consumption. / /-------------------------------------------------------------------------*/ /* diff --git a/lib/sdmmc/sdmmc_io.c b/lib/sdmmc/sdmmc_io.c index 68c804982b..17ab291515 100644 --- a/lib/sdmmc/sdmmc_io.c +++ b/lib/sdmmc/sdmmc_io.c @@ -282,7 +282,7 @@ sdmmc_err_t sdmmc_io_rw_extended(sdmmc_card_t* card, int func, return SDMMC_ERR_INVALID_SIZE; } if (datalen == max_byte_transfer_size) { - count = 0; // See 5.3.1 SDIO simplified spec + count = 0; // See 5.3.1 SDIO simplifed spec } else { count = datalen; } diff --git a/lib/uzlib/tinflate.c b/lib/uzlib/tinflate.c index fbee7ce721..045952c755 100644 --- a/lib/uzlib/tinflate.c +++ b/lib/uzlib/tinflate.c @@ -597,7 +597,7 @@ next_blk: if (res == TINF_DONE && !d->bfinal) { /* the block has ended (without producing more data), but we - can't return without data, so start processing next block */ + can't return without data, so start procesing next block */ goto next_blk; } From 66129311f4a9e60ea00739dc95e0ba0db7f4c51d Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 23 Mar 2023 14:19:36 +0700 Subject: [PATCH 38/90] fix pre-commit format --- shared-bindings/socketpool/SocketPool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index f056c741f3..3023721378 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -52,6 +52,7 @@ //| returned by :py:attr:`wifi.radio` //| """ //| ... +//| STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 1, 1, false); From b38c0a4dc1e47b9b585d9d5fd5d9c3868ad126bf Mon Sep 17 00:00:00 2001 From: ozgurbostan Date: Thu, 23 Mar 2023 14:27:15 +0300 Subject: [PATCH 39/90] Add new boards (deneyapkart/1a/g) --- ports/espressif/boards/deneyap_kart/board.c | 34 +++++++ .../boards/deneyap_kart/mpconfigboard.h | 50 ++++++++++ .../boards/deneyap_kart/mpconfigboard.mk | 8 ++ ports/espressif/boards/deneyap_kart/pins.c | 99 +++++++++++++++++++ ports/espressif/boards/deneyap_kart/sdkconfig | 19 ++++ .../espressif/boards/deneyap_kart_1a/board.c | 34 +++++++ .../boards/deneyap_kart_1a/mpconfigboard.h | 50 ++++++++++ .../boards/deneyap_kart_1a/mpconfigboard.mk | 8 ++ ports/espressif/boards/deneyap_kart_1a/pins.c | 97 ++++++++++++++++++ .../boards/deneyap_kart_1a/sdkconfig | 19 ++++ ports/espressif/boards/deneyap_kart_g/board.c | 31 ++++++ .../boards/deneyap_kart_g/mpconfigboard.h | 44 +++++++++ .../boards/deneyap_kart_g/mpconfigboard.mk | 8 ++ ports/espressif/boards/deneyap_kart_g/pins.c | 51 ++++++++++ .../espressif/boards/deneyap_kart_g/sdkconfig | 5 + 15 files changed, 557 insertions(+) create mode 100644 ports/espressif/boards/deneyap_kart/board.c create mode 100644 ports/espressif/boards/deneyap_kart/mpconfigboard.h create mode 100644 ports/espressif/boards/deneyap_kart/mpconfigboard.mk create mode 100644 ports/espressif/boards/deneyap_kart/pins.c create mode 100644 ports/espressif/boards/deneyap_kart/sdkconfig create mode 100644 ports/espressif/boards/deneyap_kart_1a/board.c create mode 100644 ports/espressif/boards/deneyap_kart_1a/mpconfigboard.h create mode 100644 ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk create mode 100644 ports/espressif/boards/deneyap_kart_1a/pins.c create mode 100644 ports/espressif/boards/deneyap_kart_1a/sdkconfig create mode 100644 ports/espressif/boards/deneyap_kart_g/board.c create mode 100644 ports/espressif/boards/deneyap_kart_g/mpconfigboard.h create mode 100644 ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk create mode 100644 ports/espressif/boards/deneyap_kart_g/pins.c create mode 100644 ports/espressif/boards/deneyap_kart_g/sdkconfig diff --git a/ports/espressif/boards/deneyap_kart/board.c b/ports/espressif/boards/deneyap_kart/board.c new file mode 100644 index 0000000000..8c0c8b8b0b --- /dev/null +++ b/ports/espressif/boards/deneyap_kart/board.c @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2023 Radio Sound, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_kart/mpconfigboard.h b/ports/espressif/boards/deneyap_kart/mpconfigboard.h new file mode 100644 index 0000000000..c2251c3dcb --- /dev/null +++ b/ports/espressif/boards/deneyap_kart/mpconfigboard.h @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Deneyap Kart" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO4) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO15, .sda = &pin_GPIO4}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO19, .mosi = &pin_GPIO5, .miso = &pin_GPIO18}} + +#define CIRCUITPY_BOARD_UART (0) + +// For entering safe mode, use BUT button +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +// Explanation of how a user got into safe mode +// #define BOARD_USER_SAFE_MODE_ACTION translate("You pressed the BUT button at start up.") + +// UART pins attached to the USB-serial converter chip +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/deneyap_kart/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart/mpconfigboard.mk new file mode 100644 index 0000000000..c98cdb87b6 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart/mpconfigboard.mk @@ -0,0 +1,8 @@ +CIRCUITPY_CREATOR_ID = 0x00001209 +CIRCUITPY_CREATION_ID = 0x0032D001 + +IDF_TARGET = esp32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/deneyap_kart/pins.c b/ports/espressif/boards/deneyap_kart/pins.c new file mode 100644 index 0000000000..9408d4470c --- /dev/null +++ b/ports/espressif/boards/deneyap_kart/pins.c @@ -0,0 +1,99 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // External pins are in silkscreen order, from top to bottom, right side, then left side + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_CAMD4), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_CAMD3), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_LEDG), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_LEDR), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_CAMD5), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_CAMD2), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_CAMD6), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_CAMPC), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GPKEY), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_IMUSD), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_LEDB), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_IMUSC), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_T5), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_MICC), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_T4), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_MICD), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_T3), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_T2), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_CAMV), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_CAMH), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_CAMD9), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_CAMD8), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_T0), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_CAMXC), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_T1), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_CAMSD), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_CAMSC), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_CAMD7), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_kart/sdkconfig b/ports/espressif/boards/deneyap_kart/sdkconfig new file mode 100644 index 0000000000..c98c5de68d --- /dev/null +++ b/ports/espressif/boards/deneyap_kart/sdkconfig @@ -0,0 +1,19 @@ +CONFIG_ESP32_SPIRAM_SUPPORT=y +# +# SPI RAM config +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=8388608 +CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +CONFIG_SPIRAM_IGNORE_NOTFOUND=y +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set +CONFIG_SPIRAM_CACHE_WORKAROUND=y \ No newline at end of file diff --git a/ports/espressif/boards/deneyap_kart_1a/board.c b/ports/espressif/boards/deneyap_kart_1a/board.c new file mode 100644 index 0000000000..8c0c8b8b0b --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a/board.c @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2023 Radio Sound, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.h b/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.h new file mode 100644 index 0000000000..ba7c216c89 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.h @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Deneyap Kart 1A" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO13) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO15, .sda = &pin_GPIO4}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO19, .mosi = &pin_GPIO5, .miso = &pin_GPIO18}} + +#define CIRCUITPY_BOARD_UART (0) + +// For entering safe mode, use BUT button +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +// Explanation of how a user got into safe mode +// #define BOARD_USER_SAFE_MODE_ACTION translate("You pressed the BUT button at start up.") + +// UART pins attached to the USB-serial converter chip +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk new file mode 100644 index 0000000000..8b3da63e5b --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk @@ -0,0 +1,8 @@ +CIRCUITPY_CREATOR_ID = 0x00001209 +CIRCUITPY_CREATION_ID = 0x0032D002 + +IDF_TARGET = esp32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/deneyap_kart_1a/pins.c b/ports/espressif/boards/deneyap_kart_1a/pins.c new file mode 100644 index 0000000000..c4b1d51840 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a/pins.c @@ -0,0 +1,97 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // External pins are in silkscreen order, from top to bottom, right side, then left side + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_CAMD4), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_CAMD3), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_CAMD5), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_CAMD2), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_CAMD6), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_CAMPC), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GPKEY), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_SDMI), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_T5), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_RGBLED), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_T4), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_SDCS), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_T3), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_SDMO), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_T2), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_SDCK), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_CAMV), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_CAMH), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_CAMD9), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_CAMD8), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_T0), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_CAMXC), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_T1), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_CAMSD), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_CAMSC), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_CAMD7), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_kart_1a/sdkconfig b/ports/espressif/boards/deneyap_kart_1a/sdkconfig new file mode 100644 index 0000000000..c98c5de68d --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a/sdkconfig @@ -0,0 +1,19 @@ +CONFIG_ESP32_SPIRAM_SUPPORT=y +# +# SPI RAM config +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=8388608 +CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +CONFIG_SPIRAM_IGNORE_NOTFOUND=y +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set +CONFIG_SPIRAM_CACHE_WORKAROUND=y \ No newline at end of file diff --git a/ports/espressif/boards/deneyap_kart_g/board.c b/ports/espressif/boards/deneyap_kart_g/board.c new file mode 100644 index 0000000000..9b26fe466d --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_g/board.c @@ -0,0 +1,31 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/board.h" + + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_kart_g/mpconfigboard.h b/ports/espressif/boards/deneyap_kart_g/mpconfigboard.h new file mode 100644 index 0000000000..ce2969bbda --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_g/mpconfigboard.h @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * Copyright (c) 2021 skieast/Bruce Segal + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Board setup +#define MICROPY_HW_BOARD_NAME "Deneyap Kart G" +#define MICROPY_HW_MCU_NAME "ESP32-C3FN4" + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO2, .sda = &pin_GPIO8}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO4, .mosi = &pin_GPIO6, .miso = &pin_GPIO5}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}} + +// For entering safe mode +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9) + +#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1) diff --git a/ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk new file mode 100644 index 0000000000..c01e84611b --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk @@ -0,0 +1,8 @@ +CIRCUITPY_CREATOR_ID = 0x00001209 +CIRCUITPY_CREATION_ID = 0x0032D003 + +IDF_TARGET = esp32c3 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/deneyap_kart_g/pins.c b/ports/espressif/boards/deneyap_kart_g/pins.c new file mode 100644 index 0000000000..c8b7ef4996 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_g/pins.c @@ -0,0 +1,51 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GPKEY), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_BT), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_RGBLED), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_PWM2), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_kart_g/sdkconfig b/ports/espressif/boards/deneyap_kart_g/sdkconfig new file mode 100644 index 0000000000..a988de5fea --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_g/sdkconfig @@ -0,0 +1,5 @@ +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="DeneyapKartG" +# end of LWIP From b947605ab781cb5e7435223681b70c5e1260c6b0 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 23 Mar 2023 09:24:11 -0400 Subject: [PATCH 40/90] Touch up --- ports/espressif/boards/m5stack_stick_c/board.c | 2 +- tests/basics/int_big1.py | 2 +- tests/basics/with_return.py | 4 ++-- tools/preprocess_frozen_modules.py | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ports/espressif/boards/m5stack_stick_c/board.c b/ports/espressif/boards/m5stack_stick_c/board.c index 88d0287419..ae29c9fa76 100644 --- a/ports/espressif/boards/m5stack_stick_c/board.c +++ b/ports/espressif/boards/m5stack_stick_c/board.c @@ -193,7 +193,7 @@ static bool pmic_init(void) { } // Reg: 12h - // Enable EXTENT, DCDC1, LDO2 and LDO3 + // Enable CTRL_EXTEN, DCDC1, LDO2 and LDO3 write_buf[0] = AXP192_DCDC13_LDO23_CTRL; write_buf[1] = AXP192_DCDC13_LDO23_CTRL_EXTEN | AXP192_DCDC13_LDO23_CTRL_LDO3 | diff --git a/tests/basics/int_big1.py b/tests/basics/int_big1.py index 01d58f7233..f6e4b61d1d 100644 --- a/tests/basics/int_big1.py +++ b/tests/basics/int_big1.py @@ -1,4 +1,4 @@ -# to test arbitrarily precision integers +# to test arbitrary precision integers x = 1000000000000000000000000000000 xn = -1000000000000000000000000000000 diff --git a/tests/basics/with_return.py b/tests/basics/with_return.py index 6f36d9ad03..af65a5b984 100644 --- a/tests/basics/with_return.py +++ b/tests/basics/with_return.py @@ -30,7 +30,7 @@ def f(): return (i, j) print(f()) -# multiple for loops within nested with(s) +# multiple for loops within nested with statements def f(): with CtxMgr(1): for i in [1, 2]: @@ -41,7 +41,7 @@ def f(): return (i, j, k, l) print(f()) -# multiple for loops that are optimised, and nested with(s) +# multiple for loops that are optimised, and nested with statements def f(): with CtxMgr(1): for i in range(1, 3): diff --git a/tools/preprocess_frozen_modules.py b/tools/preprocess_frozen_modules.py index 80ab547f3b..eb835961f6 100755 --- a/tools/preprocess_frozen_modules.py +++ b/tools/preprocess_frozen_modules.py @@ -21,10 +21,10 @@ def version_string(path=None, *, valid_semver=False): version = tag.strip().decode("utf-8", "strict") except subprocess.CalledProcessError: describe = subprocess.check_output("git describe --tags", shell=True, cwd=path) - tag, additional_commits, committish = ( + tag, additional_commits, commit_ish = ( describe.strip().decode("utf-8", "strict").rsplit("-", maxsplit=2) ) - committish = committish[1:] + commit_ish = commit_ish[1:] if valid_semver: version_info = semver.parse_version_info(tag) if not version_info.prerelease: @@ -33,12 +33,12 @@ def version_string(path=None, *, valid_semver=False): + "-alpha.0.plus." + additional_commits + "+" - + committish + + commit_ish ) else: - version = tag + ".plus." + additional_commits + "+" + committish + version = tag + ".plus." + additional_commits + "+" + commit_ish else: - version = committish + version = commit_ish return version From b50c80e3d93775561a314c0712195760547bb18c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Mar 2023 09:12:46 -0500 Subject: [PATCH 41/90] remove unused macro --- ports/mimxrt10xx/common-hal/audiobusio/__init__.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c index 2be6c6bcbb..515c39a268 100644 --- a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c +++ b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c @@ -38,11 +38,6 @@ #define SAI_CLOCK_FREQ (CLOCK_GetFreq(kCLOCK_AudioPllClk) / (SAI_CLOCK_SOURCE_DIVIDER + 1U) / \ (SAI_CLOCK_SOURCE_PRE_DIVIDER + 1U)) -// must match what's in clocks.c (but that's a C file so there's no way to include it) -// This is 480MMHz * (18/17) / 8 (around 63.5MHz) and there's no partiuclar -// logic to this value that I was able to determine. -#define BOARD_BOOTCLOCKRUN_SAI1_CLK_ROOT 63529411UL - #define AUDIO_BUFFER_FRAME_COUNT (128) // in uint32_t; there are 4, giving 2048 bytes. In all they hold 10ms @ stereo 16-bit 48kHz before all buffers drain /* From 47e1abdbc7ba23dac7b6596bacd22416002649ec Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 6 Mar 2023 16:04:39 -0600 Subject: [PATCH 42/90] Add IncrementalEncoder for mimxrt1011 .. and write a general 'pin change interrupt' facility to power it This uses the same quadrature state machine as atmel-samd, nrf, and rp2040. The 1011 doesn't have a dedicated encoder peripheral, so we go the pin-change + software route. --- .../common-hal/digitalio/DigitalInOut.c | 2 +- .../common-hal/digitalio/DigitalInOut.h | 2 + .../common-hal/microcontroller/Pin.c | 98 +++++++++++++++++++ .../common-hal/microcontroller/Pin.h | 4 + .../common-hal/rotaryio/IncrementalEncoder.c | 87 ++++++++++++++++ .../common-hal/rotaryio/IncrementalEncoder.h | 44 +++++++++ .../mimxrt10xx/common-hal/rotaryio/__init__.c | 0 .../mimxrt10xx/common-hal/rotaryio/__init__.h | 0 ports/mimxrt10xx/mpconfigport.mk | 3 +- 9 files changed, 238 insertions(+), 2 deletions(-) create mode 100644 ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.c create mode 100644 ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.h create mode 100644 ports/mimxrt10xx/common-hal/rotaryio/__init__.c create mode 100644 ports/mimxrt10xx/common-hal/rotaryio/__init__.h diff --git a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c index 3445cf42a0..2b4a78948e 100644 --- a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +++ b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c @@ -40,7 +40,7 @@ #define IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 5U -STATIC void pin_config(const mcu_pin_obj_t *pin, bool open_drain, digitalio_pull_t pull) { +void pin_config(const mcu_pin_obj_t *pin, bool open_drain, digitalio_pull_t pull) { IOMUXC_SetPinConfig(0, 0, 0, 0, pin->cfg_reg, IOMUXC_SW_PAD_CTL_PAD_HYS(1) | IOMUXC_SW_PAD_CTL_PAD_PUS((pull == PULL_UP) ? 2 : 0) diff --git a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.h b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.h index 4c19de20b6..06adb93cb8 100644 --- a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.h +++ b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.h @@ -40,4 +40,6 @@ typedef struct { digitalio_pull_t pull; } digitalio_digitalinout_obj_t; +void pin_config(const mcu_pin_obj_t *pin, bool open_drain, digitalio_pull_t pull); + #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_DIGITALIO_DIGITALINOUT_H diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index 3c8c7f2b27..9d55382306 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -84,6 +84,7 @@ void common_hal_reset_pin(const mcu_pin_obj_t *pin) { return; } + disable_pin_change_interrupt(pin); never_reset_pins[pin->mux_idx] = false; claimed_pins[pin->mux_idx] = false; *(uint32_t *)pin->mux_reg = pin->mux_reset; @@ -116,3 +117,100 @@ void claim_pin(const mcu_pin_obj_t *pin) { void common_hal_mcu_pin_reset_number(uint8_t pin_no) { common_hal_reset_pin((mcu_pin_obj_t *)(mcu_pin_globals.map.table[pin_no].value)); } + +/* Array of GPIO peripheral base address. */ +static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; +static uint32_t GPIO_GetInstance(GPIO_Type *base) { + uint32_t instance; + + /* Find the instance index from base address mappings. */ + for (instance = 0U; instance < ARRAY_SIZE(s_gpioBases); instance++) + { + if (s_gpioBases[instance] == base) { + break; + } + } + + assert(instance < ARRAY_SIZE(s_gpioBases)); + + return instance; +} + +/* to find IRQ based on GPIO */ +static const IRQn_Type low_irqs[] = GPIO_COMBINED_LOW_IRQS; +static const IRQn_Type high_irqs[] = GPIO_COMBINED_HIGH_IRQS; + +typedef struct { + gpio_change_interrupt_t *func; + void *data; +} pin_change_interrupt_data; + +volatile static pin_change_interrupt_data pcid[MP_ARRAY_SIZE(s_gpioBases)][32]; + +void enable_pin_change_interrupt(const mcu_pin_obj_t *pin, gpio_change_interrupt_t func, void *data) { + int instance = GPIO_GetInstance(pin->gpio); + volatile pin_change_interrupt_data *pci = &pcid[instance][pin->number]; + common_hal_mcu_disable_interrupts(); + pci->data = data; + pci->func = func; + IRQn_Type irq = pin->number < 16 ? low_irqs[instance] : high_irqs[instance]; + if (irq != NotAvail_IRQn) { + EnableIRQ(irq); + } + pin->gpio->IMR |= (1 << pin->number); + common_hal_mcu_enable_interrupts(); +} + +void disable_pin_change_interrupt(const mcu_pin_obj_t *pin) { + volatile pin_change_interrupt_data *pci = &pcid[GPIO_GetInstance(pin->gpio)][pin->number]; + common_hal_mcu_disable_interrupts(); + pin->gpio->IMR &= ~(1 << pin->number); + pci->data = NULL; + pci->func = NULL; + pin->gpio->ISR = (1 << pin->number); // acknowledge any pending interrupt + common_hal_mcu_enable_interrupts(); +} + +static void pin_change_interrupt_common(uint32_t isr, volatile pin_change_interrupt_data *pcr) { + for (uint32_t i = 0; i < 32; i++) { + if (isr & (1 << i)) { + pin_change_interrupt_data cb = pcr[i]; + if (cb.func) { + cb.func(cb.data); + } + } + } +} + +#define GPIO_INTERRUPT_HANDLER(name, ptr, instance, offset) \ + void name(void); \ + __attribute__((used)) void name(void) { \ + uint32_t isr = ptr->ISR; \ + ptr->ISR = isr; \ + pin_change_interrupt_common(isr, pcid[instance]); \ + } + +#if defined(GPIO1) +GPIO_INTERRUPT_HANDLER(GPIO1_Combined_0_15_IRQHandler, GPIO1, 1, 0); +GPIO_INTERRUPT_HANDLER(GPIO1_Combined_16_31_IRQHandler, GPIO1, 1, 16); +#endif +#if defined(GPIO2) +GPIO_INTERRUPT_HANDLER(GPIO2_Combined_0_15_IRQHandler, GPIO2, 2, 0); +GPIO_INTERRUPT_HANDLER(GPIO2_Combined_16_31_IRQHandler, GPIO2, 2, 16); +#endif +#if defined(GPIO3) +GPIO_INTERRUPT_HANDLER(GPIO3_Combined_0_15_IRQHandler, GPIO3, 3, 0); +GPIO_INTERRUPT_HANDLER(GPIO3_Combined_16_31_IRQHandler, GPIO3, 3, 16); +#endif +#if defined(GPIO4) +GPIO_INTERRUPT_HANDLER(GPIO4_Combined_0_15_IRQHandler, GPIO4, 4, 0); +GPIO_INTERRUPT_HANDLER(GPIO4_Combined_16_31_IRQHandler, GPIO4, 4, 16); +#endif +#if defined(GPIO5) +GPIO_INTERRUPT_HANDLER(GPIO5_Combined_0_15_IRQHandler, GPIO5, 5, 0); +GPIO_INTERRUPT_HANDLER(GPIO5_Combined_16_31_IRQHandler, GPIO5, 5, 16); +#endif +#if defined(GPIO6) +GPIO_INTERRUPT_HANDLER(GPIO6_Combined_0_15_IRQHandler, GPIO6, 6, 0); +GPIO_INTERRUPT_HANDLER(GPIO6_Combined_16_31_IRQHandler, GPIO6, 6, 16); +#endif diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h index 1bfbe41a18..cbcce13e2b 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h @@ -45,4 +45,8 @@ extern const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[]; // the port-default reset behavior. extern bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin); +typedef void (gpio_change_interrupt_t)(void *data); +void disable_pin_change_interrupt(const mcu_pin_obj_t *pin); +void enable_pin_change_interrupt(const mcu_pin_obj_t *pin, gpio_change_interrupt_t func, void *data); + #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.c b/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.c new file mode 100644 index 0000000000..dab74c1ce9 --- /dev/null +++ b/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.c @@ -0,0 +1,87 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Nick Moore for Adafruit Industries + * Copyright (c) 2023 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "common-hal/digitalio/DigitalInOut.h" +#include "common-hal/rotaryio/IncrementalEncoder.h" +#include "shared-module/rotaryio/IncrementalEncoder.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/rotaryio/IncrementalEncoder.h" + +#include "py/runtime.h" + +#include "fsl_gpio.h" +static void encoder_change(void *self_in) { + rotaryio_incrementalencoder_obj_t *self = self_in; + + bool value_a = GPIO_PinRead(self->pin_a->gpio, self->pin_a->number); + bool value_b = GPIO_PinRead(self->pin_b->gpio, self->pin_b->number); + uint8_t new_state = (value_a << 1) | value_b; + shared_module_softencoder_state_update(self, new_state); +} + +void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencoder_obj_t *self, + const mcu_pin_obj_t *pin_a, const mcu_pin_obj_t *pin_b) { + + self->pin_a = pin_a; + self->pin_b = pin_b; + + // GPIO is always IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 until proven otherwise +#define IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 5U + IOMUXC_SetPinMux(pin_a->mux_reg, IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5, 0, 0, 0, 0); + IOMUXC_SetPinMux(pin_b->mux_reg, IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5, 0, 0, 0, 0); + + const gpio_pin_config_t config = { kGPIO_DigitalInput, 0, kGPIO_IntRisingOrFallingEdge }; + GPIO_PinInit(pin_a->gpio, pin_a->number, &config); + GPIO_PinInit(pin_b->gpio, pin_b->number, &config); + + enable_pin_change_interrupt(pin_a, encoder_change, self); + enable_pin_change_interrupt(pin_b, encoder_change, self); + + pin_config(pin_a, false, PULL_UP); + pin_config(pin_b, false, PULL_UP); + + claim_pin(pin_a); + claim_pin(pin_b); +} + +bool common_hal_rotaryio_incrementalencoder_deinited(rotaryio_incrementalencoder_obj_t *self) { + return !self->pin_a; +} + +void common_hal_rotaryio_incrementalencoder_deinit(rotaryio_incrementalencoder_obj_t *self) { + if (common_hal_rotaryio_incrementalencoder_deinited(self)) { + return; + } + disable_pin_change_interrupt(self->pin_a); + disable_pin_change_interrupt(self->pin_b); + + common_hal_reset_pin(self->pin_a); + common_hal_reset_pin(self->pin_b); + + self->pin_a = NULL; + self->pin_b = NULL; +} diff --git a/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.h b/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.h new file mode 100644 index 0000000000..920b32cba9 --- /dev/null +++ b/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.h @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2023 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t *pin_a, *pin_b; + uint8_t state; // + int8_t sub_count; // count intermediate transitions between detents + int8_t divisor; // Number of quadrature edges required per count + mp_int_t position; +} rotaryio_incrementalencoder_obj_t; + + +void incrementalencoder_interrupt_handler(uint8_t channel); diff --git a/ports/mimxrt10xx/common-hal/rotaryio/__init__.c b/ports/mimxrt10xx/common-hal/rotaryio/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/mimxrt10xx/common-hal/rotaryio/__init__.h b/ports/mimxrt10xx/common-hal/rotaryio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 236d5b9966..15a0a0e466 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -20,7 +20,8 @@ CIRCUITPY_I2CTARGET = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PARALLELDISPLAY = 0 CIRCUITPY_PULSEIO = 0 -CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_ROTARYIO = 1 +CIRCUITPY_ROTARYIO_SOFTENCODER = 1 CIRCUITPY_USB_MIDI = 1 LONGINT_IMPL = MPZ From d247e5c6c97a5e88af86dfb73daeb54e1642bba3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 7 Mar 2023 10:37:08 -0600 Subject: [PATCH 43/90] Add the ability for a port to gc things, collect pin change objects that way --- main.c | 6 ++++++ ports/mimxrt10xx/common-hal/microcontroller/Pin.c | 7 +++++++ ports/mimxrt10xx/common-hal/microcontroller/Pin.h | 1 + ports/mimxrt10xx/supervisor/port.c | 4 ++++ supervisor/port.h | 4 ++++ 5 files changed, 22 insertions(+) diff --git a/main.c b/main.c index 7b805b57b0..6ff6202d6d 100644 --- a/main.c +++ b/main.c @@ -1111,6 +1111,8 @@ void gc_collect(void) { // have lost their references in the VM even though they are mounted. gc_collect_root((void **)&MP_STATE_VM(vfs_mount_table), sizeof(mp_vfs_mount_t) / sizeof(mp_uint_t)); + port_gc_collect(); + background_callback_gc_collect(); #if CIRCUITPY_ALARM @@ -1143,6 +1145,10 @@ void gc_collect(void) { gc_collect_end(); } +// Ports may provide an implementation of this function if it is needed +MP_WEAK void port_gc_collect() { +} + void NORETURN nlr_jump_fail(void *val) { reset_into_safe_mode(SAFE_MODE_NLR_JUMP_FAIL); while (true) { diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index 9d55382306..fc455d7a27 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -28,6 +28,8 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" +#include "py/gc.h" + STATIC bool claimed_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; STATIC bool never_reset_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; @@ -147,6 +149,11 @@ typedef struct { volatile static pin_change_interrupt_data pcid[MP_ARRAY_SIZE(s_gpioBases)][32]; +// The 'data' pointers may be to gc objects, they must be kept alive. +void pin_gc_collect() { + gc_collect_root((void **)&pcid, sizeof(pcid) / sizeof(void *)); +} + void enable_pin_change_interrupt(const mcu_pin_obj_t *pin, gpio_change_interrupt_t func, void *data) { int instance = GPIO_GetInstance(pin->gpio); volatile pin_change_interrupt_data *pci = &pcid[instance][pin->number]; diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h index cbcce13e2b..f75f4fbbee 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h @@ -48,5 +48,6 @@ extern bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin); typedef void (gpio_change_interrupt_t)(void *data); void disable_pin_change_interrupt(const mcu_pin_obj_t *pin); void enable_pin_change_interrupt(const mcu_pin_obj_t *pin, gpio_change_interrupt_t func, void *data); +void pin_gc_collect(void); #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 55bf72352d..1e46159829 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -555,6 +555,10 @@ void port_idle_until_interrupt(void) { common_hal_mcu_enable_interrupts(); } +void port_gc_collect(void) { + pin_gc_collect(); +} + // Catch faults where the memory access violates MPU settings. void MemManage_Handler(void); __attribute__((used)) void PLACE_IN_ITCM(MemManage_Handler)(void) { diff --git a/supervisor/port.h b/supervisor/port.h index 70bdcb0170..b50179e4de 100644 --- a/supervisor/port.h +++ b/supervisor/port.h @@ -128,4 +128,8 @@ void port_post_boot_py(bool heap_valid); // A default weak implementation is provided that does nothing. void port_boot_info(void); +// Some ports want to mark additional pointers as gc roots. +// A default weak implementation is provided that does nothing. +void port_gc_collect(void); + #endif // MICROPY_INCLUDED_SUPERVISOR_PORT_H From de74b634725a464e82795ed9e48f2562b9eb3fd7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Mar 2023 09:28:14 -0500 Subject: [PATCH 44/90] move pin change interrupt stuff to peripherals --- ports/mimxrt10xx/Makefile | 1 + .../common-hal/microcontroller/Pin.c | 97 ------------------- .../common-hal/microcontroller/Pin.h | 3 - .../common-hal/rotaryio/IncrementalEncoder.c | 2 +- .../mimxrt10xx/peripherals/mimxrt10xx/pins.c | 94 ++++++++++++++++++ .../mimxrt10xx/peripherals/mimxrt10xx/pins.h | 10 ++ 6 files changed, 106 insertions(+), 101 deletions(-) create mode 100644 ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index d8d12b74da..542014e91a 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -136,6 +136,7 @@ SRC_C += \ peripherals/mimxrt10xx/$(CHIP_FAMILY)/clocks.c \ peripherals/mimxrt10xx/$(CHIP_FAMILY)/periph.c \ peripherals/mimxrt10xx/$(CHIP_FAMILY)/pins.c \ + peripherals/mimxrt10xx/pins.c \ reset.c \ supervisor/flexspi_nor_flash_ops.c diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index fc455d7a27..a5c491ee7d 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -120,104 +120,7 @@ void common_hal_mcu_pin_reset_number(uint8_t pin_no) { common_hal_reset_pin((mcu_pin_obj_t *)(mcu_pin_globals.map.table[pin_no].value)); } -/* Array of GPIO peripheral base address. */ -static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; -static uint32_t GPIO_GetInstance(GPIO_Type *base) { - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_gpioBases); instance++) - { - if (s_gpioBases[instance] == base) { - break; - } - } - - assert(instance < ARRAY_SIZE(s_gpioBases)); - - return instance; -} - -/* to find IRQ based on GPIO */ -static const IRQn_Type low_irqs[] = GPIO_COMBINED_LOW_IRQS; -static const IRQn_Type high_irqs[] = GPIO_COMBINED_HIGH_IRQS; - -typedef struct { - gpio_change_interrupt_t *func; - void *data; -} pin_change_interrupt_data; - -volatile static pin_change_interrupt_data pcid[MP_ARRAY_SIZE(s_gpioBases)][32]; - // The 'data' pointers may be to gc objects, they must be kept alive. void pin_gc_collect() { gc_collect_root((void **)&pcid, sizeof(pcid) / sizeof(void *)); } - -void enable_pin_change_interrupt(const mcu_pin_obj_t *pin, gpio_change_interrupt_t func, void *data) { - int instance = GPIO_GetInstance(pin->gpio); - volatile pin_change_interrupt_data *pci = &pcid[instance][pin->number]; - common_hal_mcu_disable_interrupts(); - pci->data = data; - pci->func = func; - IRQn_Type irq = pin->number < 16 ? low_irqs[instance] : high_irqs[instance]; - if (irq != NotAvail_IRQn) { - EnableIRQ(irq); - } - pin->gpio->IMR |= (1 << pin->number); - common_hal_mcu_enable_interrupts(); -} - -void disable_pin_change_interrupt(const mcu_pin_obj_t *pin) { - volatile pin_change_interrupt_data *pci = &pcid[GPIO_GetInstance(pin->gpio)][pin->number]; - common_hal_mcu_disable_interrupts(); - pin->gpio->IMR &= ~(1 << pin->number); - pci->data = NULL; - pci->func = NULL; - pin->gpio->ISR = (1 << pin->number); // acknowledge any pending interrupt - common_hal_mcu_enable_interrupts(); -} - -static void pin_change_interrupt_common(uint32_t isr, volatile pin_change_interrupt_data *pcr) { - for (uint32_t i = 0; i < 32; i++) { - if (isr & (1 << i)) { - pin_change_interrupt_data cb = pcr[i]; - if (cb.func) { - cb.func(cb.data); - } - } - } -} - -#define GPIO_INTERRUPT_HANDLER(name, ptr, instance, offset) \ - void name(void); \ - __attribute__((used)) void name(void) { \ - uint32_t isr = ptr->ISR; \ - ptr->ISR = isr; \ - pin_change_interrupt_common(isr, pcid[instance]); \ - } - -#if defined(GPIO1) -GPIO_INTERRUPT_HANDLER(GPIO1_Combined_0_15_IRQHandler, GPIO1, 1, 0); -GPIO_INTERRUPT_HANDLER(GPIO1_Combined_16_31_IRQHandler, GPIO1, 1, 16); -#endif -#if defined(GPIO2) -GPIO_INTERRUPT_HANDLER(GPIO2_Combined_0_15_IRQHandler, GPIO2, 2, 0); -GPIO_INTERRUPT_HANDLER(GPIO2_Combined_16_31_IRQHandler, GPIO2, 2, 16); -#endif -#if defined(GPIO3) -GPIO_INTERRUPT_HANDLER(GPIO3_Combined_0_15_IRQHandler, GPIO3, 3, 0); -GPIO_INTERRUPT_HANDLER(GPIO3_Combined_16_31_IRQHandler, GPIO3, 3, 16); -#endif -#if defined(GPIO4) -GPIO_INTERRUPT_HANDLER(GPIO4_Combined_0_15_IRQHandler, GPIO4, 4, 0); -GPIO_INTERRUPT_HANDLER(GPIO4_Combined_16_31_IRQHandler, GPIO4, 4, 16); -#endif -#if defined(GPIO5) -GPIO_INTERRUPT_HANDLER(GPIO5_Combined_0_15_IRQHandler, GPIO5, 5, 0); -GPIO_INTERRUPT_HANDLER(GPIO5_Combined_16_31_IRQHandler, GPIO5, 5, 16); -#endif -#if defined(GPIO6) -GPIO_INTERRUPT_HANDLER(GPIO6_Combined_0_15_IRQHandler, GPIO6, 6, 0); -GPIO_INTERRUPT_HANDLER(GPIO6_Combined_16_31_IRQHandler, GPIO6, 6, 16); -#endif diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h index f75f4fbbee..57df61c691 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h @@ -45,9 +45,6 @@ extern const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[]; // the port-default reset behavior. extern bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin); -typedef void (gpio_change_interrupt_t)(void *data); -void disable_pin_change_interrupt(const mcu_pin_obj_t *pin); -void enable_pin_change_interrupt(const mcu_pin_obj_t *pin, gpio_change_interrupt_t func, void *data); void pin_gc_collect(void); #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.c b/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.c index dab74c1ce9..043b791b4d 100644 --- a/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.c @@ -33,7 +33,7 @@ #include "py/runtime.h" -#include "fsl_gpio.h" +#include "sdk/drivers/igpio/fsl_gpio.h" static void encoder_change(void *self_in) { rotaryio_incrementalencoder_obj_t *self = self_in; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c new file mode 100644 index 0000000000..1f2d5321e9 --- /dev/null +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c @@ -0,0 +1,94 @@ +#include "peripherals/mimxrt10xx/pins.h" + +/* Array of GPIO peripheral base address. */ +static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; +static uint32_t GPIO_GetInstance(GPIO_Type *base) { + uint32_t instance; + + /* Find the instance index from base address mappings. */ + for (instance = 0U; instance < ARRAY_SIZE(s_gpioBases); instance++) + { + if (s_gpioBases[instance] == base) { + break; + } + } + + assert(instance < ARRAY_SIZE(s_gpioBases)); + + return instance; +} + + +/* to find IRQ based on GPIO */ +static const IRQn_Type low_irqs[] = GPIO_COMBINED_LOW_IRQS; +static const IRQn_Type high_irqs[] = GPIO_COMBINED_HIGH_IRQS; + +volatile pin_change_interrupt_data pcid[MP_ARRAY_SIZE(s_gpioBases)][32]; + +void enable_pin_change_interrupt(const mcu_pin_obj_t *pin, gpio_change_interrupt_t func, void *data) { + int instance = GPIO_GetInstance(pin->gpio); + volatile pin_change_interrupt_data *pci = &pcid[instance][pin->number]; + common_hal_mcu_disable_interrupts(); + pci->data = data; + pci->func = func; + IRQn_Type irq = pin->number < 16 ? low_irqs[instance] : high_irqs[instance]; + if (irq != NotAvail_IRQn) { + EnableIRQ(irq); + } + pin->gpio->IMR |= (1 << pin->number); + common_hal_mcu_enable_interrupts(); +} + +void disable_pin_change_interrupt(const mcu_pin_obj_t *pin) { + volatile pin_change_interrupt_data *pci = &pcid[GPIO_GetInstance(pin->gpio)][pin->number]; + common_hal_mcu_disable_interrupts(); + pin->gpio->IMR &= ~(1 << pin->number); + pci->data = NULL; + pci->func = NULL; + pin->gpio->ISR = (1 << pin->number); // acknowledge any pending interrupt + common_hal_mcu_enable_interrupts(); +} + +static void pin_change_interrupt_common(uint32_t isr, volatile pin_change_interrupt_data *pcr) { + for (uint32_t i = 0; i < 32; i++) { + if (isr & (1 << i)) { + pin_change_interrupt_data cb = pcr[i]; + if (cb.func) { + cb.func(cb.data); + } + } + } +} + +#define GPIO_INTERRUPT_HANDLER(name, ptr, instance, offset) \ + void name(void); \ + __attribute__((used)) void name(void) { \ + uint32_t isr = ptr->ISR; \ + ptr->ISR = isr; \ + pin_change_interrupt_common(isr, pcid[instance]); \ + } + +#if defined(GPIO1) +GPIO_INTERRUPT_HANDLER(GPIO1_Combined_0_15_IRQHandler, GPIO1, 1, 0); +GPIO_INTERRUPT_HANDLER(GPIO1_Combined_16_31_IRQHandler, GPIO1, 1, 16); +#endif +#if defined(GPIO2) +GPIO_INTERRUPT_HANDLER(GPIO2_Combined_0_15_IRQHandler, GPIO2, 2, 0); +GPIO_INTERRUPT_HANDLER(GPIO2_Combined_16_31_IRQHandler, GPIO2, 2, 16); +#endif +#if defined(GPIO3) +GPIO_INTERRUPT_HANDLER(GPIO3_Combined_0_15_IRQHandler, GPIO3, 3, 0); +GPIO_INTERRUPT_HANDLER(GPIO3_Combined_16_31_IRQHandler, GPIO3, 3, 16); +#endif +#if defined(GPIO4) +GPIO_INTERRUPT_HANDLER(GPIO4_Combined_0_15_IRQHandler, GPIO4, 4, 0); +GPIO_INTERRUPT_HANDLER(GPIO4_Combined_16_31_IRQHandler, GPIO4, 4, 16); +#endif +#if defined(GPIO5) +GPIO_INTERRUPT_HANDLER(GPIO5_Combined_0_15_IRQHandler, GPIO5, 5, 0); +GPIO_INTERRUPT_HANDLER(GPIO5_Combined_16_31_IRQHandler, GPIO5, 5, 16); +#endif +#if defined(GPIO6) +GPIO_INTERRUPT_HANDLER(GPIO6_Combined_0_15_IRQHandler, GPIO6, 6, 0); +GPIO_INTERRUPT_HANDLER(GPIO6_Combined_16_31_IRQHandler, GPIO6, 6, 16); +#endif diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h index 82cb0dc69e..76a8d03e08 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h @@ -72,6 +72,16 @@ typedef struct { .pad_reset = p_pad_reset, \ } +typedef void (gpio_change_interrupt_t)(void *data); +typedef struct { + gpio_change_interrupt_t *func; + void *data; +} pin_change_interrupt_data; +extern volatile pin_change_interrupt_data pcid[MP_ARRAY_SIZE((GPIO_Type *const[])GPIO_BASE_PTRS)][32]; + +void disable_pin_change_interrupt(const mcu_pin_obj_t *pin); +void enable_pin_change_interrupt(const mcu_pin_obj_t *pin, gpio_change_interrupt_t func, void *data); + #ifdef MIMXRT1011_SERIES #include "MIMXRT1011/pins.h" #elif defined(MIMXRT1021_SERIES) From c45db1c1eb0a71b8378c4007fb23b4dfe24c2059 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Mar 2023 09:56:14 -0500 Subject: [PATCH 45/90] incrementalencoder: give it a finaliser --- shared-bindings/rotaryio/IncrementalEncoder.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index fae55db317..ec2a281157 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -76,7 +76,7 @@ STATIC mp_obj_t rotaryio_incrementalencoder_make_new(const mp_obj_type_t *type, const mcu_pin_obj_t *pin_b = validate_obj_is_free_pin(args[ARG_pin_b].u_obj, MP_QSTR_pin_b); // Make long-lived because some implementations use a pointer to the object as interrupt-handler data. - rotaryio_incrementalencoder_obj_t *self = m_new_ll_obj(rotaryio_incrementalencoder_obj_t); + rotaryio_incrementalencoder_obj_t *self = m_new_ll_obj_with_finaliser(rotaryio_incrementalencoder_obj_t); self->base.type = &rotaryio_incrementalencoder_type; common_hal_rotaryio_incrementalencoder_construct(self, pin_a, pin_b); @@ -171,6 +171,7 @@ MP_PROPERTY_GETSET(rotaryio_incrementalencoder_position_obj, STATIC const mp_rom_map_elem_t rotaryio_incrementalencoder_locals_dict_table[] = { // Methods { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&rotaryio_incrementalencoder_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&rotaryio_incrementalencoder_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&rotaryio_incrementalencoder___exit___obj) }, { MP_ROM_QSTR(MP_QSTR_position), MP_ROM_PTR(&rotaryio_incrementalencoder_position_obj) }, From 50ba218afb199685e96a43ef8333cba76d0a691f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Mar 2023 09:57:32 -0500 Subject: [PATCH 46/90] PulseIn, Counter: give finali(s/z)ers to these types too for similar reasons, an interrupt handler might point at these objects, and we can worry less about it if the object deinits when it is GC'd. --- shared-bindings/countio/Counter.c | 3 ++- shared-bindings/pulseio/PulseIn.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/shared-bindings/countio/Counter.c b/shared-bindings/countio/Counter.c index 4f0e0a692f..fc60994f5c 100644 --- a/shared-bindings/countio/Counter.c +++ b/shared-bindings/countio/Counter.c @@ -57,7 +57,7 @@ STATIC mp_obj_t countio_counter_make_new(const mp_obj_type_t *type, size_t n_arg const countio_edge_t edge = validate_edge(args[ARG_edge].u_obj, MP_QSTR_edge); const digitalio_pull_t pull = validate_pull(args[ARG_pull].u_obj, MP_QSTR_pull); // Make long-lived because some implementations use a pointer to the object as interrupt-handler data. - countio_counter_obj_t *self = m_new_ll_obj(countio_counter_obj_t); + countio_counter_obj_t *self = m_new_ll_obj_with_finaliser(countio_counter_obj_t); self->base.type = &countio_counter_type; common_hal_countio_counter_construct(self, pin, edge, pull); @@ -134,6 +134,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(countio_counter_reset_obj, countio_counter_reset); STATIC const mp_rom_map_elem_t countio_counter_locals_dict_table[] = { // Methods { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&countio_counter_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&countio_counter_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&countio_counter___exit___obj) }, { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&countio_counter_count_obj) }, diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index 81edc48bfd..3510f11289 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -89,7 +89,7 @@ STATIC mp_obj_t pulseio_pulsein_make_new(const mp_obj_type_t *type, size_t n_arg const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[ARG_pin].u_obj, MP_QSTR_pin); // Make object long-lived to avoid moving between imports - pulseio_pulsein_obj_t *self = m_new_ll_obj(pulseio_pulsein_obj_t); + pulseio_pulsein_obj_t *self = m_new_ll_obj_with_finaliser(pulseio_pulsein_obj_t); self->base.type = &pulseio_pulsein_type; common_hal_pulseio_pulsein_construct(self, pin, args[ARG_maxlen].u_int, @@ -277,6 +277,7 @@ STATIC mp_obj_t pulsein_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t va STATIC const mp_rom_map_elem_t pulseio_pulsein_locals_dict_table[] = { // Methods { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&pulseio_pulsein_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&pulseio_pulsein_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&pulseio_pulsein___exit___obj) }, { MP_ROM_QSTR(MP_QSTR_pause), MP_ROM_PTR(&pulseio_pulsein_pause_obj) }, From b235b50647845f4eb624c70785b385943a4a2821 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Mar 2023 09:58:40 -0500 Subject: [PATCH 47/90] mimxrt: no longer need to collect the pin chainge interrupt ptrs .. the objects on the gc heap are guaranteed to be alive, as their finali(s/z)er will disable the interrupt. --- ports/mimxrt10xx/common-hal/microcontroller/Pin.c | 5 ----- ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c | 7 ++++++- ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h | 6 ------ ports/mimxrt10xx/supervisor/port.c | 4 ---- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index a5c491ee7d..f888152af1 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -119,8 +119,3 @@ void claim_pin(const mcu_pin_obj_t *pin) { void common_hal_mcu_pin_reset_number(uint8_t pin_no) { common_hal_reset_pin((mcu_pin_obj_t *)(mcu_pin_globals.map.table[pin_no].value)); } - -// The 'data' pointers may be to gc objects, they must be kept alive. -void pin_gc_collect() { - gc_collect_root((void **)&pcid, sizeof(pcid) / sizeof(void *)); -} diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c index 1f2d5321e9..d052711033 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c @@ -1,5 +1,10 @@ #include "peripherals/mimxrt10xx/pins.h" +typedef struct { + gpio_change_interrupt_t *func; + void *data; +} pin_change_interrupt_data; + /* Array of GPIO peripheral base address. */ static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; static uint32_t GPIO_GetInstance(GPIO_Type *base) { @@ -23,7 +28,7 @@ static uint32_t GPIO_GetInstance(GPIO_Type *base) { static const IRQn_Type low_irqs[] = GPIO_COMBINED_LOW_IRQS; static const IRQn_Type high_irqs[] = GPIO_COMBINED_HIGH_IRQS; -volatile pin_change_interrupt_data pcid[MP_ARRAY_SIZE(s_gpioBases)][32]; +static volatile pin_change_interrupt_data pcid[MP_ARRAY_SIZE(s_gpioBases)][32]; void enable_pin_change_interrupt(const mcu_pin_obj_t *pin, gpio_change_interrupt_t func, void *data) { int instance = GPIO_GetInstance(pin->gpio); diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h index 76a8d03e08..0457a09a1a 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h @@ -73,12 +73,6 @@ typedef struct { } typedef void (gpio_change_interrupt_t)(void *data); -typedef struct { - gpio_change_interrupt_t *func; - void *data; -} pin_change_interrupt_data; -extern volatile pin_change_interrupt_data pcid[MP_ARRAY_SIZE((GPIO_Type *const[])GPIO_BASE_PTRS)][32]; - void disable_pin_change_interrupt(const mcu_pin_obj_t *pin); void enable_pin_change_interrupt(const mcu_pin_obj_t *pin, gpio_change_interrupt_t func, void *data); diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 1e46159829..55bf72352d 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -555,10 +555,6 @@ void port_idle_until_interrupt(void) { common_hal_mcu_enable_interrupts(); } -void port_gc_collect(void) { - pin_gc_collect(); -} - // Catch faults where the memory access violates MPU settings. void MemManage_Handler(void); __attribute__((used)) void PLACE_IN_ITCM(MemManage_Handler)(void) { From 1525672146d071a95766b1208ebe62c8e69858ce Mon Sep 17 00:00:00 2001 From: Jose David M Date: Thu, 23 Mar 2023 11:18:03 +0000 Subject: [PATCH 48/90] Translated using Weblate (Spanish) Currently translated at 100.0% (1004 of 1004 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/es.po b/locale/es.po index cf81206c3d..0201f7f78c 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-03-09 10:38+0000\n" +"PO-Revision-Date: 2023-03-23 17:26+0000\n" "Last-Translator: Jose David M \n" "Language-Team: \n" "Language: es\n" @@ -1292,7 +1292,7 @@ msgstr "BSSID inválido" #: main.c msgid "Invalid CIRCUITPY_PYSTACK_SIZE\n" -msgstr "" +msgstr "CIRCUITPY_PYSTACK_SIZE inválido\n" #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" From da0df8a692b4a6d4d8f4b74f30a9c98e13cfedfa Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Wed, 22 Mar 2023 22:18:49 +0000 Subject: [PATCH 49/90] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (1004 of 1004 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index bef3ea8849..c998d04270 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-03-08 07:10+0000\n" +"PO-Revision-Date: 2023-03-23 17:26+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1288,7 +1288,7 @@ msgstr "BSSID Inválido" #: main.c msgid "Invalid CIRCUITPY_PYSTACK_SIZE\n" -msgstr "" +msgstr "CIRCUITPY_PYSTACK_SIZE inválido\n" #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" From 24aea014752bd6de6d873025eb1b3354b3281984 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Thu, 23 Mar 2023 13:08:50 +0000 Subject: [PATCH 50/90] Translated using Weblate (Swedish) Currently translated at 100.0% (1004 of 1004 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 3c2c9f6520..66318a01b1 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-03-08 07:10+0000\n" +"PO-Revision-Date: 2023-03-23 17:26+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -1273,7 +1273,7 @@ msgstr "Ogiltig BSSID" #: main.c msgid "Invalid CIRCUITPY_PYSTACK_SIZE\n" -msgstr "" +msgstr "Ogiltig CIRCUITPY_PYSTACK_SIZE\n" #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" From ff242e6198b486adf03c27f6f666c2c5708945ea Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 23 Mar 2023 18:26:38 +0100 Subject: [PATCH 51/90] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 45 +++++++++++++++++----------------- locale/cs.po | 40 ++++++++++++++----------------- locale/de_DE.po | 52 ++++++++++++++++++++++------------------ locale/el.po | 37 ++++++++++++---------------- locale/en_GB.po | 48 +++++++++++++++++++------------------ locale/es.po | 52 ++++++++++++++++++++++------------------ locale/fil.po | 40 ++++++++++++++----------------- locale/fr.po | 52 ++++++++++++++++++++++------------------ locale/hi.po | 37 ++++++++++++---------------- locale/it_IT.po | 40 ++++++++++++++----------------- locale/ja.po | 48 +++++++++++++++++++------------------ locale/ko.po | 37 ++++++++++++---------------- locale/nl.po | 48 +++++++++++++++++++------------------ locale/pl.po | 48 +++++++++++++++++++------------------ locale/pt_BR.po | 52 ++++++++++++++++++++++------------------ locale/ru.po | 40 ++++++++++++++----------------- locale/sv.po | 52 ++++++++++++++++++++++------------------ locale/tr.po | 37 ++++++++++++---------------- locale/zh_Latn_pinyin.po | 52 ++++++++++++++++++++++------------------ 19 files changed, 428 insertions(+), 429 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index a136f6e498..0affac3ed4 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -183,10 +183,6 @@ msgstr "%q harus <= %d" msgid "%q must be >= %d" msgstr "%q harus >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -195,6 +191,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1233,7 +1233,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1531,10 +1532,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Tidak ada kunci yang ditentukan" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Tidak ada dukungan bilangan bulat yang panjang" @@ -1961,8 +1958,8 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Pindai sudah dalam proses. Hentikan dengan stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2274,6 +2271,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2309,11 +2311,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2768,7 +2765,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3068,8 +3065,8 @@ msgid "extra positional arguments given" msgstr "argumen posisi ekstra telah diberikan" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4143,10 +4140,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4403,6 +4396,12 @@ msgstr "zi harus berjenis float" msgid "zi must be of shape (n_section, 2)" msgstr "Zi harus berbentuk (n_section, 2)" +#~ msgid "No key was specified" +#~ msgstr "Tidak ada kunci yang ditentukan" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Pindai sudah dalam proses. Hentikan dengan stop_scan." + #~ msgid "Supply at least one UART pin" #~ msgstr "Berikan setidaknya satu pin UART" diff --git a/locale/cs.po b/locale/cs.po index 1d666730ec..7af7d489b1 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -184,10 +184,6 @@ msgstr "%q musí být <= %d" msgid "%q must be >= %d" msgstr "%q musí být >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -196,6 +192,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1233,7 +1233,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1531,10 +1532,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Nebyl zadán klíč" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1950,7 +1947,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2263,6 +2260,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2298,11 +2300,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2755,7 +2752,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3055,8 +3052,8 @@ msgid "extra positional arguments given" msgstr "" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4129,10 +4126,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4389,6 +4382,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "No key was specified" +#~ msgstr "Nebyl zadán klíč" + #~ msgid "%q pin invalid" #~ msgstr "pin %q není platný" diff --git a/locale/de_DE.po b/locale/de_DE.po index f6bc0b789e..fb676d621e 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -187,10 +187,6 @@ msgstr "%q muss <= %d sein" msgid "%q must be >= %d" msgstr "%q muss >= %d sein" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -200,6 +196,10 @@ msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" "%q muss ein Byte-Array oder ein array vom Typ 'h', 'H', 'b', oder 'B' sein" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1252,7 +1252,8 @@ msgstr "Der Interne WatchDog Timer ist abgelaufen." msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "Ungültiger %q" @@ -1551,10 +1552,6 @@ msgstr "Nicht in Programm" msgid "No in or out in program" msgstr "Kein Ein oder Aus in Programm" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Es wurde kein Schlüssel angegeben" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Keine langen Integer (long) unterstützt" @@ -1979,8 +1976,8 @@ msgstr "Maßstabs-Abmeßungen müssen durch 3 teilbar sein" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Scannen bereits in Bearbeitung. Stoppe mit stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2298,6 +2295,11 @@ msgstr "Unbekannter BLE-Fehler bei %s:%d: %d" msgid "Unknown BLE error: %d" msgstr "Unbekannter BLE-Fehler: %d" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2333,11 +2335,6 @@ msgstr "Unbekannter Systemfirmware Fehler: %04x" msgid "Unknown system firmware error: %d" msgstr "Unbekannter System-Firmware-Fehler: %d" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "Unbekannter Fehlercode %d" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2808,7 +2805,7 @@ msgstr "Kann Blockgröße von 512 nicht setzen" msgid "can't set attribute" msgstr "kann Attribut nicht setzen" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3116,8 +3113,8 @@ msgid "extra positional arguments given" msgstr "Es wurden zusätzliche Argumente ohne Schlüsselwort angegeben" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "Die Datei muss eine im Byte-Modus geöffnete Datei sein" @@ -4203,10 +4200,6 @@ msgstr "Zeitstempel außerhalb des Bereichs für Plattform time_t" msgid "tobytes can be invoked for dense arrays only" msgstr "tobytes kann nur für dichte Arrays aufgerufen werden" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "zu viele Argumente mit dem angegebenen Format" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "zu viele Dimensionen" @@ -4465,6 +4458,19 @@ msgstr "zi muss eine Gleitkommazahl sein" msgid "zi must be of shape (n_section, 2)" msgstr "zi muss die Form (n_section, 2) haben" +#~ msgid "No key was specified" +#~ msgstr "Es wurde kein Schlüssel angegeben" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Scannen bereits in Bearbeitung. Stoppe mit stop_scan." + +#, c-format +#~ msgid "Unkown error code %d" +#~ msgstr "Unbekannter Fehlercode %d" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "zu viele Argumente mit dem angegebenen Format" + #~ msgid "" #~ "\n" #~ "Invalid CIRCUITPY_PYSTACK_SIZE\n" diff --git a/locale/el.po b/locale/el.po index f2382feb94..ab4b2d9b90 100644 --- a/locale/el.po +++ b/locale/el.po @@ -188,10 +188,6 @@ msgstr "%q πρέπει να είναι <= %d" msgid "%q must be >= %d" msgstr "%q πρέπει να είναι >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -200,6 +196,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q πρέπει να είναι bytearray ή array τύπου 'h', 'H', 'b', ή 'B'" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1242,7 +1242,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1540,10 +1541,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1958,7 +1955,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2271,6 +2268,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2306,11 +2308,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2763,7 +2760,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3063,8 +3060,8 @@ msgid "extra positional arguments given" msgstr "" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4137,10 +4134,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 45131d1dcb..e2d9cd9f13 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -187,10 +187,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "%q must be >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -199,6 +195,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1234,7 +1234,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "Invalid %q" @@ -1532,10 +1533,6 @@ msgstr "No in in program" msgid "No in or out in program" msgstr "No in or out in program" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "No key was specified" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "No long integer support" @@ -1956,8 +1953,8 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2269,6 +2266,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2304,11 +2306,6 @@ msgstr "Unknown system firmware error: %04x" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2763,7 +2760,7 @@ msgstr "can't set 512 block size" msgid "can't set attribute" msgstr "can't set attribute" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3066,8 +3063,8 @@ msgid "extra positional arguments given" msgstr "extra positional arguments given" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "file must be a file opened in byte mode" @@ -4140,10 +4137,6 @@ msgstr "timestamp out of range for platform time_t" msgid "tobytes can be invoked for dense arrays only" msgstr "tobytes can be invoked for dense arrays only" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "too many arguments provided with the given format" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "too many dimensions" @@ -4400,6 +4393,15 @@ msgstr "zi must be of float type" msgid "zi must be of shape (n_section, 2)" msgstr "zi must be of shape (n_section, 2)" +#~ msgid "No key was specified" +#~ msgstr "No key was specified" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Scan already in progess. Stop with stop_scan." + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "too many arguments provided with the given format" + #~ msgid "Supply at least one UART pin" #~ msgstr "Supply at least one UART pin" diff --git a/locale/es.po b/locale/es.po index 0201f7f78c..ebd1ea4a2b 100644 --- a/locale/es.po +++ b/locale/es.po @@ -195,10 +195,6 @@ msgstr "%q debe ser <= %d" msgid "%q must be >= %d" msgstr "%q debe ser >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "%q debe ser un arreglo de tipo 'H'" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "%q debe ser un bytearray o array de tipo 'H' o 'B'" @@ -207,6 +203,10 @@ msgstr "%q debe ser un bytearray o array de tipo 'H' o 'B'" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q debe ser un byte-matriz o matriz de tipo 'h', 'H', 'b', o 'B'" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "%q debe ser un arreglo de tipo 'H'" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1267,7 +1267,8 @@ msgstr "El temporizador interno watchdog terminó." msgid "Interrupt error." msgstr "Error de interrupción." -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "%q inválido" @@ -1569,10 +1570,6 @@ msgstr "No hay \"in\" en el programa" msgid "No in or out in program" msgstr "No hay \"in\" o \"out\" en el programa" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "No se especificó ninguna llave" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "No hay soporte de entero largo" @@ -2000,8 +1997,8 @@ msgstr "Las dimensiones de escala debe ser divisibles por 3" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Escaneo en progreso. Usa stop_scan para detener." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2320,6 +2317,11 @@ msgstr "Error BLE desconocido en %s:%d: %d" msgid "Unknown BLE error: %d" msgstr "Error BLE desconocido: %d" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2355,11 +2357,6 @@ msgstr "Error desconocido en el firmware sistema: %04x" msgid "Unknown system firmware error: %d" msgstr "Error del sistema de firmware desconocido: %d" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "Codigo de error desconocido: %d" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2823,7 +2820,7 @@ msgstr "no se puede definir un tamaño de bloque de 512" msgid "can't set attribute" msgstr "no se puede asignar el atributo" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "no se puede configurar el attributo '%q'" @@ -3131,8 +3128,8 @@ msgid "extra positional arguments given" msgstr "argumento posicional adicional dado" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "el archivo deberia ser una archivo abierto en modo byte" @@ -4213,10 +4210,6 @@ msgstr "timestamp fuera de rango para plataform time_t" msgid "tobytes can be invoked for dense arrays only" msgstr "tobytes solo pueden ser invocados por arrays densos" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "demasiados argumentos provistos con el formato dado" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "demasiadas dimensiones" @@ -4473,6 +4466,19 @@ msgstr "zi debe ser de tipo flotante" msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" +#~ msgid "No key was specified" +#~ msgstr "No se especificó ninguna llave" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Escaneo en progreso. Usa stop_scan para detener." + +#, c-format +#~ msgid "Unkown error code %d" +#~ msgstr "Codigo de error desconocido: %d" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "demasiados argumentos provistos con el formato dado" + #~ msgid "" #~ "\n" #~ "Invalid CIRCUITPY_PYSTACK_SIZE\n" diff --git a/locale/fil.po b/locale/fil.po index 591620e6c4..86677af69b 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -181,10 +181,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -193,6 +189,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1233,7 +1233,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1531,10 +1532,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1951,7 +1948,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2265,6 +2262,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2300,11 +2302,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2761,7 +2758,7 @@ msgstr "" msgid "can't set attribute" msgstr "hindi ma i-set ang attribute" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3069,8 +3066,8 @@ msgid "extra positional arguments given" msgstr "dagdag na positional argument na ibinigay" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "file ay dapat buksan sa byte mode" @@ -4150,10 +4147,6 @@ msgstr "wala sa sakop ng timestamp ang platform time_t" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "masyadong maraming mga argumento na ibinigay sa ibinigay na format" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4412,6 +4405,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "too many arguments provided with the given format" +#~ msgstr "masyadong maraming mga argumento na ibinigay sa ibinigay na format" + #~ msgid "Expected a %q" #~ msgstr "Umasa ng %q" diff --git a/locale/fr.po b/locale/fr.po index 4ebcc918bf..812f09b454 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -192,10 +192,6 @@ msgstr "%q doit être <= %d" msgid "%q must be >= %d" msgstr "%q doit être >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "%q doit être un bytearray ou matrice de type 'H' ou 'B'" @@ -204,6 +200,10 @@ msgstr "%q doit être un bytearray ou matrice de type 'H' ou 'B'" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q doit être a bytearray ou array de type 'h', 'H', 'b', ou 'B'" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1273,7 +1273,8 @@ msgstr "Le minuteur du watchdog interne a expiré." msgid "Interrupt error." msgstr "Erreur d'interruption." -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "%q invalide" @@ -1575,10 +1576,6 @@ msgstr "Programme n'a pas de \"in\"" msgid "No in or out in program" msgstr "Programme n'a aucun \"in\" ni \"out\"" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Aucune clé n'a été spécifiée" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Pas de support pour chiffre entier long" @@ -2006,8 +2003,8 @@ msgstr "La dimension d'échelle doit être un multiple de 3" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Scan déjà en cours. Arrêtez avec stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2326,6 +2323,11 @@ msgstr "Erreur BLE inconnue à %s:%d : %d" msgid "Unknown BLE error: %d" msgstr "Erreur BLE inconnue : %d" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2361,11 +2363,6 @@ msgstr "Faute inconnue du logiciel système : %04x" msgid "Unknown system firmware error: %d" msgstr "Erreur du logiciel système inconnue : %d" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "Erreur inconnue %d" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2833,7 +2830,7 @@ msgstr "impossible de définir une taille de bloc de 512" msgid "can't set attribute" msgstr "attribut non modifiable" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "attribut '%q' non modifiable" @@ -3145,8 +3142,8 @@ msgid "extra positional arguments given" msgstr "argument(s) positionnel(s) supplémentaire(s) donné(s)" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "le fichier doit être un fichier ouvert en mode 'byte'" @@ -4232,10 +4229,6 @@ msgstr "timestamp hors bornes pour 'time_t' de la plateforme" msgid "tobytes can be invoked for dense arrays only" msgstr "tobytes ne peut être appelée que pour des matrices dense" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "trop d'arguments fournis avec ce format" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "Trop de dimensions" @@ -4492,6 +4485,19 @@ msgstr "zi doit être de type float" msgid "zi must be of shape (n_section, 2)" msgstr "zi doit être de forme (n_section, 2)" +#~ msgid "No key was specified" +#~ msgstr "Aucune clé n'a été spécifiée" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Scan déjà en cours. Arrêtez avec stop_scan." + +#, c-format +#~ msgid "Unkown error code %d" +#~ msgstr "Erreur inconnue %d" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "trop d'arguments fournis avec ce format" + #~ msgid "" #~ "\n" #~ "Invalid CIRCUITPY_PYSTACK_SIZE\n" diff --git a/locale/hi.po b/locale/hi.po index 2b9825e4b8..75efddc294 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -180,10 +180,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -192,6 +188,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1221,7 +1221,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1519,10 +1520,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1935,7 +1932,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2248,6 +2245,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2283,11 +2285,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2740,7 +2737,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3040,8 +3037,8 @@ msgid "extra positional arguments given" msgstr "" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4114,10 +4111,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 84bc790df4..e8d32b163e 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -184,10 +184,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -196,6 +192,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1235,7 +1235,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1534,10 +1535,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1958,7 +1955,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2272,6 +2269,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2307,11 +2309,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2769,7 +2766,7 @@ msgstr "" msgid "can't set attribute" msgstr "impossibile impostare attributo" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3074,8 +3071,8 @@ msgid "extra positional arguments given" msgstr "argomenti posizonali extra dati" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4160,10 +4157,6 @@ msgstr "timestamp è fuori intervallo per il time_t della piattaforma" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "troppi argomenti forniti con il formato specificato" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4422,6 +4415,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "too many arguments provided with the given format" +#~ msgstr "troppi argomenti forniti con il formato specificato" + #~ msgid "%q pin invalid" #~ msgstr "%q pin non valido" diff --git a/locale/ja.po b/locale/ja.po index 081dd57e9f..f90abd66da 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -187,10 +187,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -199,6 +195,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1234,7 +1234,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "不正な %q" @@ -1532,10 +1533,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "キーが指定されていません" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "long integerに対応していません" @@ -1951,8 +1948,8 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "既にスキャン進行中。stop_scanで停止してください" +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2265,6 +2262,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2300,11 +2302,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2757,7 +2754,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3061,8 +3058,8 @@ msgid "extra positional arguments given" msgstr "余分な位置引数が与えられました" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "fileはバイトモードで開かれたファイルでなければなりません" @@ -4138,10 +4135,6 @@ msgstr "timestampがプラットフォームのtime_tの範囲外" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "指定された書式に対して引数が多すぎます" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4398,6 +4391,15 @@ msgstr "ziはfloat値でなければなりません" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "No key was specified" +#~ msgstr "キーが指定されていません" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "既にスキャン進行中。stop_scanで停止してください" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "指定された書式に対して引数が多すぎます" + #~ msgid "Supply at least one UART pin" #~ msgstr "少なくとも1つのUARTピンが必要" diff --git a/locale/ko.po b/locale/ko.po index 7668d8c8a3..fbb45ed195 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -181,10 +181,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -193,6 +189,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1224,7 +1224,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1522,10 +1523,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1938,7 +1935,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2252,6 +2249,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2287,11 +2289,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2744,7 +2741,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3044,8 +3041,8 @@ msgid "extra positional arguments given" msgstr "" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4118,10 +4115,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 61c96a877d..f9faf2a6a5 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -180,10 +180,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -192,6 +188,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1229,7 +1229,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "Ongeldige %q" @@ -1527,10 +1528,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Een sleutel was niet gespecificeerd" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Geen lange integer ondersteuning" @@ -1956,8 +1953,8 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Scan wordt al uitvoerd. Stop met stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2269,6 +2266,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2304,11 +2306,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2768,7 +2765,7 @@ msgstr "kan geen 512 blokgrootte instellen" msgid "can't set attribute" msgstr "kan attribute niet instellen" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3070,8 +3067,8 @@ msgid "extra positional arguments given" msgstr "extra positionele argumenten gegeven" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "bestand moet een bestand zijn geopend in byte modus" @@ -4148,10 +4145,6 @@ msgstr "timestamp buiten bereik voor platform time_t" msgid "tobytes can be invoked for dense arrays only" msgstr "tobytes kunnen alleen ingeroepen worden voor gesloten arrays" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "te veel argumenten opgegeven bij dit formaat" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4408,6 +4401,15 @@ msgstr "zi moet van type float zijn" msgid "zi must be of shape (n_section, 2)" msgstr "zi moet vorm (n_section, 2) hebben" +#~ msgid "No key was specified" +#~ msgstr "Een sleutel was niet gespecificeerd" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Scan wordt al uitvoerd. Stop met stop_scan." + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "te veel argumenten opgegeven bij dit formaat" + #~ msgid "Supply at least one UART pin" #~ msgstr "Geef op zijn minst 1 UART pin op" diff --git a/locale/pl.po b/locale/pl.po index 642e5f99de..4fc4337a55 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -182,10 +182,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -194,6 +190,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1229,7 +1229,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "Nieprawidłowe %q" @@ -1527,10 +1528,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Nie określono klucza" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1943,8 +1940,8 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Skanuj już w toku. Zatrzymaj za pomocą stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2256,6 +2253,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2291,11 +2293,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2748,7 +2745,7 @@ msgstr "" msgid "can't set attribute" msgstr "nie można ustawić atrybutu" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3049,8 +3046,8 @@ msgid "extra positional arguments given" msgstr "nadmiarowe argumenty pozycyjne" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "file musi być otwarte w trybie bajtowym" @@ -4124,10 +4121,6 @@ msgstr "timestamp poza zakresem dla time_t na tej platformie" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "zbyt wiele argumentów podanych dla tego formatu" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4384,6 +4377,15 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "No key was specified" +#~ msgstr "Nie określono klucza" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Skanuj już w toku. Zatrzymaj za pomocą stop_scan." + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "zbyt wiele argumentów podanych dla tego formatu" + #~ msgid "Supply at least one UART pin" #~ msgstr "Podaj co najmniej jeden pin UART" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index c998d04270..88ccd57c4e 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -193,10 +193,6 @@ msgstr "%q deve ser <= %d" msgid "%q must be >= %d" msgstr "o %q deve ser >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "%q deve ser uma matriz do tipo 'H'" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "%q deve ser um bytearray ou uma matriz do tipo 'H' ou 'B'" @@ -205,6 +201,10 @@ msgstr "%q deve ser um bytearray ou uma matriz do tipo 'H' ou 'B'" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q deve ser um bytearray ou uma matriz do tipo 'h', 'H', 'b', ou 'B'" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "%q deve ser uma matriz do tipo 'H'" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1263,7 +1263,8 @@ msgstr "O temporizador do watchdog interno expirou." msgid "Interrupt error." msgstr "Erro de interrupção." -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "%q Inválido" @@ -1561,10 +1562,6 @@ msgstr "Sem entrada no programa" msgid "No in or out in program" msgstr "Sem entrada ou saída no programa" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Nenhuma chave foi definida" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Não há compatibilidade com inteiro longo" @@ -1994,8 +1991,8 @@ msgstr "As dimensões da escala devem ser poder ser divididas por 3" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "O escaneamento já está em andamento. Interrompa com stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2314,6 +2311,11 @@ msgstr "Houve um erro BLE desconhecido em %s:%d: %d" msgid "Unknown BLE error: %d" msgstr "Houve um erro BLE desconhecido: %d" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2349,11 +2351,6 @@ msgstr "Erro desconhecido do firmware: %04x" msgid "Unknown system firmware error: %d" msgstr "Ocorreu um erro desconhecido no firmware do sistema: %d" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "Código de erro desconhecido %d" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2819,7 +2816,7 @@ msgstr "não é possível definir o tamanho de 512 blocos" msgid "can't set attribute" msgstr "não é possível definir o atributo" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "não é possível definir o atributo '%q'" @@ -3128,8 +3125,8 @@ msgid "extra positional arguments given" msgstr "argumentos extra posicionais passados" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "o arquivo deve ser um arquivo aberto no modo byte" @@ -4213,10 +4210,6 @@ msgstr "timestamp fora do intervalo para a plataforma time_t" msgid "tobytes can be invoked for dense arrays only" msgstr "os tobytes podem ser invocados apenas nas matrizes densas" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "Muitos argumentos fornecidos com o formato dado" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "dimensões demais" @@ -4473,6 +4466,19 @@ msgstr "zi deve ser de um tipo float" msgid "zi must be of shape (n_section, 2)" msgstr "zi deve estar na forma (n_section, 2)" +#~ msgid "No key was specified" +#~ msgstr "Nenhuma chave foi definida" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "O escaneamento já está em andamento. Interrompa com stop_scan." + +#, c-format +#~ msgid "Unkown error code %d" +#~ msgstr "Código de erro desconhecido %d" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "Muitos argumentos fornecidos com o formato dado" + #~ msgid "" #~ "\n" #~ "Invalid CIRCUITPY_PYSTACK_SIZE\n" diff --git a/locale/ru.po b/locale/ru.po index 2ad4b094a2..c2e6ccc265 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -187,10 +187,6 @@ msgstr "%q должно быть <= %d" msgid "%q must be >= %d" msgstr "%q должно быть >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "%q должно быть bytearray или array типа 'H' или 'B'" @@ -199,6 +195,10 @@ msgstr "%q должно быть bytearray или array типа 'H' или 'B'" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q должно быть bytearray или array типа 'h', 'H', 'b', или 'B'" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1266,7 +1266,8 @@ msgstr "Внутренний сторожевой таймер истек." msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "Недопустимый %q" @@ -1567,10 +1568,6 @@ msgstr "Нет in в программе" msgid "No in or out in program" msgstr "В программе отсутствует ввод или вывод" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Ключ не был указан" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Нет поддержки длинных целых чисел (long integer)" @@ -1996,7 +1993,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2311,6 +2308,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2346,11 +2348,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2803,7 +2800,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3103,8 +3100,8 @@ msgid "extra positional arguments given" msgstr "" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4177,10 +4174,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4437,6 +4430,9 @@ msgstr "zi должно быть типа float" msgid "zi must be of shape (n_section, 2)" msgstr "zi должен иметь форму (n_section, 2)" +#~ msgid "No key was specified" +#~ msgstr "Ключ не был указан" + #~ msgid "Supply at least one UART pin" #~ msgstr "Предоставьте хотяб один пин UART" diff --git a/locale/sv.po b/locale/sv.po index 66318a01b1..da13d25599 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -192,10 +192,6 @@ msgstr "%q måste vara <= %d" msgid "%q must be >= %d" msgstr "%q måste vara >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "%q måste vara en array av typen 'H'" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "%q måste vara en bytearray eller array av typen 'H' eller 'B'" @@ -206,6 +202,10 @@ msgstr "" "%q måste vara en bytearray eller en array av typen \"h\", \"H\", \"b\" eller " "\"B\"" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "%q måste vara en array av typen 'H'" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1248,7 +1248,8 @@ msgstr "Intern watchdog-timer har löpt ut." msgid "Interrupt error." msgstr "Interrupt-fel." -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "Ogiltig %q" @@ -1547,10 +1548,6 @@ msgstr "Inget in i programmet" msgid "No in or out in program" msgstr "Inget in eller ut i programmet" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Ingen nyckel angavs" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Inget stöd för långt heltal" @@ -1975,8 +1972,8 @@ msgstr "Skaldimension måste vara delbar med 3" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Skanning pågår redan. Avsluta med stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2290,6 +2287,11 @@ msgstr "Okänt BLE-fel vid %s:%d: %d" msgid "Unknown BLE error: %d" msgstr "Okänt BLE-fel: %d" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2325,11 +2327,6 @@ msgstr "Okänt systemfirmwarefel: %04x" msgid "Unknown system firmware error: %d" msgstr "Okänt fel i systemets firmware: %d" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "Okänd felkod %d" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2790,7 +2787,7 @@ msgstr "kan inte sätta blockstorlek 512" msgid "can't set attribute" msgstr "kan inte att ange attribut" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "kan inte sätta attribut '%q'" @@ -3097,8 +3094,8 @@ msgid "extra positional arguments given" msgstr "extra positions-argument angivna" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "filen måste vara en fil som öppnats i byte-läge" @@ -4175,10 +4172,6 @@ msgstr "timestamp utom räckvidd för plattformens \"time_t\"" msgid "tobytes can be invoked for dense arrays only" msgstr "tobyte kan enbart anropas för täta matriser" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "för många argument för det givna formatet" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "för många dimensioner" @@ -4435,6 +4428,19 @@ msgstr "zi måste vara av typ float" msgid "zi must be of shape (n_section, 2)" msgstr "zi måste vara i formen (n_section, 2)" +#~ msgid "No key was specified" +#~ msgstr "Ingen nyckel angavs" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Skanning pågår redan. Avsluta med stop_scan." + +#, c-format +#~ msgid "Unkown error code %d" +#~ msgstr "Okänd felkod %d" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "för många argument för det givna formatet" + #~ msgid "" #~ "\n" #~ "Invalid CIRCUITPY_PYSTACK_SIZE\n" diff --git a/locale/tr.po b/locale/tr.po index bd9d746940..62c5fc9dc2 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -188,10 +188,6 @@ msgstr "%q <= %d olmalıdır" msgid "%q must be >= %d" msgstr "%q >= %d olmalıdır" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "%q 'H' ya da 'B' tipi bir bytearray ya da array olmalıdır" @@ -200,6 +196,10 @@ msgstr "%q 'H' ya da 'B' tipi bir bytearray ya da array olmalıdır" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q 'h', 'H', 'b' ya da 'B' tipi bir bytearray ya da array olmalı" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1239,7 +1239,8 @@ msgstr "Dahili bekçi zamanlayıcısının süresi doldu." msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "Geçersiz %q" @@ -1538,10 +1539,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1957,7 +1954,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2270,6 +2267,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2305,11 +2307,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2762,7 +2759,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3062,8 +3059,8 @@ msgid "extra positional arguments given" msgstr "" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4136,10 +4133,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 72df0f5aed..98876f3cdb 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -195,10 +195,6 @@ msgstr "%q bìxū <= %d" msgid "%q must be >= %d" msgstr "%q bìxū >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "%q bì xū shì lèi xíng wéi 'H' de shù zǔ" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "%q bì xū shì zì jié shù zǔ huò lèi xíng wéi 'H' huò 'B' de shù zǔ" @@ -208,6 +204,10 @@ msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" "%q bì xū shì zì jié shù zǔ huò lèi xíng wéi 'h', 'H', 'b', huò 'B' de shù zǔ" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "%q bì xū shì lèi xíng wéi 'H' de shù zǔ" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -1255,7 +1255,8 @@ msgstr "Nèibù kān mén gǒu dìngshí qì chāoshí." msgid "Interrupt error." msgstr "zhōng duàn cuò wù." -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "wú xiào %q" @@ -1554,10 +1555,6 @@ msgstr "chéng xù zhōng méi yǒu" msgid "No in or out in program" msgstr "chéng xù zhōng méi yǒu jìn chū" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Wèi zhǐdìng mì yào" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Méiyǒu zhǎng zhěngshù zhīchí" @@ -1980,8 +1977,8 @@ msgstr "bǐ lì chǐ cùn bì xū chú yǐ 3" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Zhèngzài jìn háng sǎomiáo. Shǐyòng stop_scan tíngzhǐ." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2295,6 +2292,11 @@ msgstr "%s:%d: %d chù chū xiàn wèi zhī BLE cuò wù" msgid "Unknown BLE error: %d" msgstr "wèi zhī de BLE cuò wù: %d" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2330,11 +2332,6 @@ msgstr "wèi zhī xì tǒng gù jiàn cuò wù: %04x" msgid "Unknown system firmware error: %d" msgstr "wèi zhī de xì tǒng gù jiàn cuò wù: %d" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "wèi zhī cuò wù dài %d" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2795,7 +2792,7 @@ msgstr "wúfǎ shèzhì 512 kuài dàxiǎo" msgid "can't set attribute" msgstr "wúfǎ shèzhì shǔxìng" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "wú fǎ shè zhì shǔ xìng '%q'" @@ -3103,8 +3100,8 @@ msgid "extra positional arguments given" msgstr "gěi chūle éwài de wèizhì cānshù" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "wénjiàn bìxū shì zài zì jié móshì xià dǎkāi de wénjiàn" @@ -4181,10 +4178,6 @@ msgstr "time_t shíjiān chuō chāochū píngtái fànwéi" msgid "tobytes can be invoked for dense arrays only" msgstr "tobytes zhǐ néng duì mì jí shù zǔ diào yòng" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "tígōng jǐ dìng géshì de cānshù tài duō" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "chǐ cùn tài duō" @@ -4441,6 +4434,19 @@ msgstr "zi bìxū wèi fú diǎn xíng" msgid "zi must be of shape (n_section, 2)" msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" +#~ msgid "No key was specified" +#~ msgstr "Wèi zhǐdìng mì yào" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Zhèngzài jìn háng sǎomiáo. Shǐyòng stop_scan tíngzhǐ." + +#, c-format +#~ msgid "Unkown error code %d" +#~ msgstr "wèi zhī cuò wù dài %d" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "tígōng jǐ dìng géshì de cānshù tài duō" + #~ msgid "" #~ "\n" #~ "Invalid CIRCUITPY_PYSTACK_SIZE\n" From e2565e2305df87c12f115514d66634ba9bfdfd60 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Mar 2023 14:00:14 -0500 Subject: [PATCH 52/90] mimxrt10xx: Add PWMAudioOut .. via a peripheral known as the "MQS" (medium quality sound). It uses an ~192kHz PWM signal to generate audio. It sounds OK on a small speaker with no amplifier. There's a small pop when starting/stopping audio, as is typical. --- .../mimxrt10xx/common-hal/audiobusio/I2SOut.h | 4 +- .../common-hal/audiobusio/__init__.c | 1 + .../common-hal/audiopwmio/PWMAudioOut.c | 159 ++++++++++++++++++ .../common-hal/audiopwmio/PWMAudioOut.h | 43 +++++ .../common-hal/audiopwmio/__init__.c | 0 .../common-hal/audiopwmio/__init__.h | 0 ports/mimxrt10xx/mpconfigport.mk | 1 + .../mimxrt10xx/MIMXRT1011/periph.c | 18 +- .../mimxrt10xx/MIMXRT1011/periph.h | 3 + .../mimxrt10xx/MIMXRT1021/periph.c | 10 ++ .../mimxrt10xx/MIMXRT1021/periph.h | 3 + .../mimxrt10xx/MIMXRT1062/periph.c | 10 ++ .../mimxrt10xx/MIMXRT1062/periph.h | 3 + 13 files changed, 246 insertions(+), 9 deletions(-) create mode 100644 ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c create mode 100644 ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h create mode 100644 ports/mimxrt10xx/common-hal/audiopwmio/__init__.c create mode 100644 ports/mimxrt10xx/common-hal/audiopwmio/__init__.h diff --git a/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h index c4194402be..2473eb4cab 100644 --- a/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h +++ b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h @@ -26,15 +26,13 @@ #pragma once +#if CIRCUITPY_AUDIOBUSIO_I2SOUT #include "supervisor/background_callback.h" #include "common-hal/microcontroller/Pin.h" #include "common-hal/audiobusio/__init__.h" // Some boards don't implement I2SOut, so suppress any routines from here. -#if CIRCUITPY_AUDIOBUSIO_I2SOUT - -#include "sdk/drivers/sai/fsl_sai.h" typedef struct { mp_obj_base_t base; diff --git a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c index 515c39a268..f2de99f004 100644 --- a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c +++ b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c @@ -284,6 +284,7 @@ static void i2s_fill_buffer(i2s_t *self) { static void i2s_callback_fun(void *self_in) { i2s_t *self = self_in; + mp_printf(&mp_plat_print, "."); i2s_fill_buffer(self); } diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c new file mode 100644 index 0000000000..dd50c7950a --- /dev/null +++ b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c @@ -0,0 +1,159 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include + +#include "mpconfigport.h" + +#include "py/gc.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "common-hal/audiobusio/__init__.h" +#include "common-hal/audiopwmio/PWMAudioOut.h" +#include "shared-bindings/audiopwmio/PWMAudioOut.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/translate/translate.h" +#include "supervisor/shared/tick.h" + +// Where required we use identifier names that are required by NXP's +// API, even though they do not conform to the naming standards that Adafruit +// strives to adhere to. https://www.adafruit.com/blacklivesmatter +#include "sdk/drivers/sai/fsl_sai.h" + +STATIC void config_periph_pin(const mcu_periph_obj_t *periph) { + if (!periph) { + return; + } + if (periph->pin->mux_reg) { + IOMUXC_SetPinMux( + periph->pin->mux_reg, periph->mux_mode, + periph->input_reg, periph->input_idx, + 0, + 1); + } + + IOMUXC_SetPinConfig(0, 0, 0, 0, + periph->pin->cfg_reg, + IOMUXC_SW_PAD_CTL_PAD_HYS(0) + | IOMUXC_SW_PAD_CTL_PAD_PUS(0) + | IOMUXC_SW_PAD_CTL_PAD_PUE(0) + | IOMUXC_SW_PAD_CTL_PAD_PKE(1) + | IOMUXC_SW_PAD_CTL_PAD_ODE(0) + | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) + | IOMUXC_SW_PAD_CTL_PAD_DSE(4) + | IOMUXC_SW_PAD_CTL_PAD_SRE(0)); +} + +static void config_mqs(void) { + CCM->CCGR0 = (CCM->CCGR0 & (~CCM_CCGR0_CG2_MASK)) | CCM_CCGR0_CG2(3); /* Enable MQS hmclk. */ + + IOMUXC_MQSEnterSoftwareReset(IOMUXC_GPR, true); /* Reset MQS. */ + IOMUXC_MQSEnterSoftwareReset(IOMUXC_GPR, false); /* Release reset MQS. */ + IOMUXC_MQSEnable(IOMUXC_GPR, true); /* Enable MQS. */ + IOMUXC_MQSConfig(IOMUXC_GPR, kIOMUXC_MqsPwmOverSampleRate64, 0u); /* 98.304MHz/64/(0+1) = 1.536MHz + Higher frequency PWM involves less low frequen cy harmonic.*/ + +} + +// Caller validates that pins are free. +void common_hal_audiopwmio_pwmaudioout_construct(audiopwmio_pwmaudioout_obj_t *self, + const mcu_pin_obj_t *left_channel, const mcu_pin_obj_t *right_channel, uint16_t default_value) { + + int instance = -1; + const mcu_periph_obj_t *left_periph = find_pin_function(mcu_mqs_left_list, left_channel, &instance, MP_QSTR_left_channel); + const mcu_periph_obj_t *right_periph = find_pin_function(mcu_mqs_right_list, right_channel, &instance, MP_QSTR_right_channel); + + mp_printf(&mp_plat_print, "note: peripheral %d\n", instance); + sai_transceiver_t config; + SAI_GetClassicI2SConfig(&config, kSAI_WordWidth16bits, kSAI_Stereo, 1U << 0u); + config.frameSync.frameSyncEarly = false; + config.frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; + // config.syncMode = kSAI_ModeAsync; + config.fifo.fifoPacking = kSAI_FifoPackingDisabled; + // These identifier names are required by NXP's API, even though they do + // not conform to the naming standards that Adafruit strives to adhere to. + // https://www.adafruit.com/blacklivesmatter + // config.masterSlave = kSAI_Master; + port_i2s_initialize(&self->i2s, instance, &config); + + self->left_channel = left_channel; + self->right_channel = right_channel; + claim_pin(left_channel); + claim_pin(right_channel); + config_periph_pin(left_periph); + config_periph_pin(right_periph); + config_mqs(); +} + +bool common_hal_audiopwmio_pwmaudioout_deinited(audiopwmio_pwmaudioout_obj_t *self) { + return port_i2s_deinited(&self->i2s); +} + +void common_hal_audiopwmio_pwmaudioout_deinit(audiopwmio_pwmaudioout_obj_t *self) { + if (common_hal_audiopwmio_pwmaudioout_deinited(self)) { + return; + } + + port_i2s_deinit(&self->i2s); + + common_hal_reset_pin(self->left_channel); + self->left_channel = NULL; + + common_hal_reset_pin(self->right_channel); + self->right_channel = NULL; + + IOMUXC_MQSEnterSoftwareReset(IOMUXC_GPR, true); /* Reset MQS. */ + CCM->CCGR0 = CCM->CCGR0 & (~CCM_CCGR0_CG2_MASK); /* Disable MQS hmclk. */ +} + +void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t *self, + mp_obj_t sample, bool loop) { + if (common_hal_audiopwmio_pwmaudioout_get_playing(self)) { + common_hal_audiopwmio_pwmaudioout_stop(self); + } + port_i2s_play(&self->i2s, sample, loop); +} + +void common_hal_audiopwmio_pwmaudioout_pause(audiopwmio_pwmaudioout_obj_t *self) { + port_i2s_pause(&self->i2s); +} + +void common_hal_audiopwmio_pwmaudioout_resume(audiopwmio_pwmaudioout_obj_t *self) { + port_i2s_resume(&self->i2s); +} + +bool common_hal_audiopwmio_pwmaudioout_get_paused(audiopwmio_pwmaudioout_obj_t *self) { + return port_i2s_get_paused(&self->i2s); +} + +void common_hal_audiopwmio_pwmaudioout_stop(audiopwmio_pwmaudioout_obj_t *self) { + port_i2s_stop(&self->i2s); +} + +bool common_hal_audiopwmio_pwmaudioout_get_playing(audiopwmio_pwmaudioout_obj_t *self) { + return port_i2s_get_playing(&self->i2s); +} diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h new file mode 100644 index 0000000000..27cebc649b --- /dev/null +++ b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#if CIRCUITPY_AUDIOBUSIO_I2SOUT +#include "supervisor/background_callback.h" +#include "common-hal/microcontroller/Pin.h" + +#include "common-hal/audiobusio/__init__.h" + +// Some boards don't implement I2SOut, so suppress any routines from here. + +typedef struct { + mp_obj_base_t base; + i2s_t i2s; + const mcu_pin_obj_t *left_channel, *right_channel; +} audiopwmio_pwmaudioout_obj_t; + +#endif diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/__init__.c b/ports/mimxrt10xx/common-hal/audiopwmio/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/__init__.h b/ports/mimxrt10xx/common-hal/audiopwmio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index a952460259..f7ab3d8130 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -17,6 +17,7 @@ CIRCUITPY_AUDIOCORE = 1 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOMIXER = 1 CIRCUITPY_AUDIOMP3 = 1 +CIRCUITPY_AUDIOPWMIO = 1 CIRCUITPY_BUSDEVICE = 1 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c index fbbf65c8a5..b67f7b1179 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c @@ -169,25 +169,31 @@ const mcu_pwm_obj_t mcu_pwm_list[20] = { const mcu_periph_obj_t mcu_sai_rx_bclk_list[] = { PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_08), - PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_00), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_00), }; const mcu_periph_obj_t mcu_sai_rx_data0_list[] = { PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_03), - PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_03), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_03), }; const mcu_periph_obj_t mcu_sai_rx_sync_list[] = { PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_02), - PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_04), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_04), }; const mcu_periph_obj_t mcu_sai_tx_bclk_list[] = { PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_06), - PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_01), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_01), }; const mcu_periph_obj_t mcu_sai_tx_data0_list[] = { PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_04), - PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_02), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_02), }; const mcu_periph_obj_t mcu_sai_tx_sync_list[] = { PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_07), - PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_00), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_00), +}; +const mcu_periph_obj_t mcu_mqs_left_list[] = { + PERIPH_PIN(3, 4, 0, 0, &pin_GPIO_AD_01), +}; +const mcu_periph_obj_t mcu_mqs_right_list[] = { + PERIPH_PIN(3, 4, 0, 0, &pin_GPIO_AD_02), }; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h index 109717528f..045e33ca0e 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h @@ -54,4 +54,7 @@ extern const mcu_periph_obj_t mcu_sai_tx_bclk_list[2]; extern const mcu_periph_obj_t mcu_sai_tx_data0_list[2]; extern const mcu_periph_obj_t mcu_sai_tx_sync_list[2]; +extern const mcu_periph_obj_t mcu_mqs_left_list[1]; +extern const mcu_periph_obj_t mcu_mqs_right_list[1]; + #endif // MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1011_PERIPHERALS_MIMXRT1011_PERIPH_H diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c index b80fcf5065..59bd3cc105 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c @@ -311,3 +311,13 @@ const mcu_periph_obj_t mcu_sai_tx_sync_list[] = { PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_34), PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_SD_B1_07), }; +const mcu_periph_obj_t mcu_mqs_left_list[] = { + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_AD_B0_07), + PERIPH_PIN(3, 2, 0, 0, &pin_GPIO_EMC_17), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_38), +}; +const mcu_periph_obj_t mcu_mqs_right_list[] = { + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_AD_B0_06), + PERIPH_PIN(3, 2, 0, 0, &pin_GPIO_EMC_16), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_37), +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h index 31ac10e651..51c97b3eef 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h @@ -53,3 +53,6 @@ extern const mcu_periph_obj_t mcu_sai_rx_sync_list[7]; extern const mcu_periph_obj_t mcu_sai_tx_bclk_list[7]; extern const mcu_periph_obj_t mcu_sai_tx_data0_list[7]; extern const mcu_periph_obj_t mcu_sai_tx_sync_list[7]; + +extern const mcu_periph_obj_t mcu_mqs_left_list[3]; +extern const mcu_periph_obj_t mcu_mqs_right_list[3]; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c index 8c038bdb71..c43f4eb96b 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c @@ -362,3 +362,13 @@ const mcu_periph_obj_t mcu_sai_tx_sync_list[] = { PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_39), PERIPH_PIN(3, 8, 0, 0, &pin_GPIO_SD_B1_02), }; +const mcu_periph_obj_t mcu_mqs_left_list[] = { + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_14), + PERIPH_PIN(3, 2, 0, 0, &pin_GPIO_B0_01), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_AD_B0_05), +}; +const mcu_periph_obj_t mcu_mqs_right_list[] = { + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_13), + PERIPH_PIN(3, 2, 0, 0, &pin_GPIO_B0_00), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_AD_B0_04), +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h index ab8eb22678..28ea8e3742 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h @@ -54,4 +54,7 @@ extern const mcu_periph_obj_t mcu_sai_tx_bclk_list[7]; extern const mcu_periph_obj_t mcu_sai_tx_data0_list[7]; extern const mcu_periph_obj_t mcu_sai_tx_sync_list[7]; +extern const mcu_periph_obj_t mcu_mqs_left_list[3]; +extern const mcu_periph_obj_t mcu_mqs_right_list[3]; + #endif // MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1062_PERIPHERALS_MIMXRT1011_PERIPH_H From e1c8a3062a0c5000162ff8730dcb28dc2637a78c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Mar 2023 21:06:53 -0500 Subject: [PATCH 53/90] remove debugging print --- ports/mimxrt10xx/common-hal/audiobusio/__init__.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c index f2de99f004..515c39a268 100644 --- a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c +++ b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c @@ -284,7 +284,6 @@ static void i2s_fill_buffer(i2s_t *self) { static void i2s_callback_fun(void *self_in) { i2s_t *self = self_in; - mp_printf(&mp_plat_print, "."); i2s_fill_buffer(self); } From 0c0e06c940848e9bf26642272e5bb2eb0fa1352a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Mar 2023 21:10:04 -0500 Subject: [PATCH 54/90] remove comment that was copypasted --- ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h index 27cebc649b..b9e4279927 100644 --- a/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h +++ b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h @@ -32,8 +32,6 @@ #include "common-hal/audiobusio/__init__.h" -// Some boards don't implement I2SOut, so suppress any routines from here. - typedef struct { mp_obj_base_t base; i2s_t i2s; From b1d9331367b4717996cf4c353a18212491dcfa5b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Mar 2023 21:11:05 -0500 Subject: [PATCH 55/90] move comment next to its associated #if --- ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h index 2473eb4cab..319e52c159 100644 --- a/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h +++ b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h @@ -26,14 +26,13 @@ #pragma once +// Some boards don't implement I2SOut, so suppress any routines from here. #if CIRCUITPY_AUDIOBUSIO_I2SOUT #include "supervisor/background_callback.h" #include "common-hal/microcontroller/Pin.h" #include "common-hal/audiobusio/__init__.h" -// Some boards don't implement I2SOut, so suppress any routines from here. - typedef struct { mp_obj_base_t base; i2s_t i2s; From c5a6fd97b0bd602ec6d057683fb253f7418b9f18 Mon Sep 17 00:00:00 2001 From: Ozgur BOSTAN <79173593+ozgurbostan@users.noreply.github.com> Date: Fri, 24 Mar 2023 09:43:49 +0300 Subject: [PATCH 56/90] Update sdkconfig Add missing new line --- ports/espressif/boards/deneyap_kart/sdkconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/deneyap_kart/sdkconfig b/ports/espressif/boards/deneyap_kart/sdkconfig index c98c5de68d..7ec0461dcf 100644 --- a/ports/espressif/boards/deneyap_kart/sdkconfig +++ b/ports/espressif/boards/deneyap_kart/sdkconfig @@ -16,4 +16,4 @@ CONFIG_SPIRAM_USE_MEMMAP=y CONFIG_SPIRAM_MEMTEST=y # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set # CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set -CONFIG_SPIRAM_CACHE_WORKAROUND=y \ No newline at end of file +CONFIG_SPIRAM_CACHE_WORKAROUND=y From 8814e0f4f7660be9a17b8acd836be19e545dfbf7 Mon Sep 17 00:00:00 2001 From: Ozgur BOSTAN <79173593+ozgurbostan@users.noreply.github.com> Date: Fri, 24 Mar 2023 15:34:17 +0300 Subject: [PATCH 57/90] Update sdkconfig Add missing new line --- ports/espressif/boards/deneyap_kart_1a/sdkconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/deneyap_kart_1a/sdkconfig b/ports/espressif/boards/deneyap_kart_1a/sdkconfig index c98c5de68d..7ec0461dcf 100644 --- a/ports/espressif/boards/deneyap_kart_1a/sdkconfig +++ b/ports/espressif/boards/deneyap_kart_1a/sdkconfig @@ -16,4 +16,4 @@ CONFIG_SPIRAM_USE_MEMMAP=y CONFIG_SPIRAM_MEMTEST=y # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set # CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set -CONFIG_SPIRAM_CACHE_WORKAROUND=y \ No newline at end of file +CONFIG_SPIRAM_CACHE_WORKAROUND=y From a2b2158bcbb1a4031fb47bca8dedf4c07b11a133 Mon Sep 17 00:00:00 2001 From: Jose David M Date: Thu, 23 Mar 2023 20:35:44 +0000 Subject: [PATCH 58/90] Translated using Weblate (Spanish) Currently translated at 100.0% (1002 of 1002 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/es.po b/locale/es.po index ebd1ea4a2b..9578e4048a 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-03-23 17:26+0000\n" +"PO-Revision-Date: 2023-03-25 02:42+0000\n" "Last-Translator: Jose David M \n" "Language-Team: \n" "Language: es\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.16.2-dev\n" +"X-Generator: Weblate 4.17-dev\n" #: main.c msgid "" @@ -1998,7 +1998,7 @@ msgstr "Las dimensiones de escala debe ser divisibles por 3" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progress. Stop with stop_scan." -msgstr "" +msgstr "Escaneo en progreso. Usa stop_scan para detenerlo." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2320,7 +2320,7 @@ msgstr "Error BLE desconocido: %d" #: ports/raspberrypi/common-hal/wifi/__init__.c #, c-format msgid "Unknown error code %d" -msgstr "" +msgstr "Código de error desconocido %d" #: shared-bindings/wifi/Radio.c #, c-format From 277edddf2a8c9e50b559dbd9088a536e88568241 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Fri, 24 Mar 2023 02:02:08 +0000 Subject: [PATCH 59/90] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (1002 of 1002 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 88ccd57c4e..a684aacfb1 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-03-23 17:26+0000\n" +"PO-Revision-Date: 2023-03-25 02:42+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.16.2-dev\n" +"X-Generator: Weblate 4.17-dev\n" #: main.c msgid "" @@ -1992,7 +1992,7 @@ msgstr "As dimensões da escala devem ser poder ser divididas por 3" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progress. Stop with stop_scan." -msgstr "" +msgstr "Digitalização já em andamento. Pare com stop_scan." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2314,7 +2314,7 @@ msgstr "Houve um erro BLE desconhecido: %d" #: ports/raspberrypi/common-hal/wifi/__init__.c #, c-format msgid "Unknown error code %d" -msgstr "" +msgstr "Código de erro desconhecido %d" #: shared-bindings/wifi/Radio.c #, c-format From 6effaef9b45c407e9178f436432e01bef73dcc06 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Thu, 23 Mar 2023 17:30:20 +0000 Subject: [PATCH 60/90] Translated using Weblate (Swedish) Currently translated at 100.0% (1002 of 1002 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index da13d25599..bbbe1ad4fb 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-03-23 17:26+0000\n" +"PO-Revision-Date: 2023-03-25 02:42+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.16.2-dev\n" +"X-Generator: Weblate 4.17-dev\n" #: main.c msgid "" @@ -1973,7 +1973,7 @@ msgstr "Skaldimension måste vara delbar med 3" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progress. Stop with stop_scan." -msgstr "" +msgstr "Skanning pågår redan. Stoppa med stop_scan." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2290,7 +2290,7 @@ msgstr "Okänt BLE-fel: %d" #: ports/raspberrypi/common-hal/wifi/__init__.c #, c-format msgid "Unknown error code %d" -msgstr "" +msgstr "Okänd felkod %d" #: shared-bindings/wifi/Radio.c #, c-format From 94f487c08d132645f25d282ce151e2ebe82f3815 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 24 Mar 2023 22:45:12 -0400 Subject: [PATCH 61/90] handle older versions of git for make fetch-submodules; add remove-submodules --- Makefile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 50c86fc128..d0f1fcb3d0 100644 --- a/Makefile +++ b/Makefile @@ -324,9 +324,24 @@ clean-stm: $(MAKE) -C ports/stm BOARD=feather_stm32f405_express clean -# Do blobless partial clones of submodules to save time and space. +# If available, do blobless partial clones of submodules to save time and space. # A blobless partial clone lazily fetches data as needed, but has all the metadata available (tags, etc.) # so it does not have the idiosyncrasies of a shallow clone. +# +# If not available, do a fetch that will fail, and then fix it up with a second fetch. +# (Only works for git servers that allow sha fetches.) .PHONY: fetch-submodules fetch-submodules: - git submodule update --init --filter=blob:none + git submodule sync + ##################################################################################### + # NOTE: Ideally, use git version 2.36.0 or later, to do partial clones of submodules. + # If an older git is used, submodules will be cloned with a shallow clone of depth 1. + # You will see a git usage message first if the git version is too old to do + # clones of submodules. + ##################################################################################### + git submodule update --init --filter=blob:none || git submodule update --init -N --depth 1 || git submodule foreach 'git fetch --tags --depth 1 origin $$sha1 && git checkout -q $$sha1' || echo 'make fetch-submodules FAILED' + +.PHONY: remove-submodules +remove-submodules: + git submodule deinit -f --all + rm -rf .git/modules/* From 730a2a9c2c9b43bfdfda86fb61111bd46e5eedfd Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Sat, 25 Mar 2023 13:09:35 +0530 Subject: [PATCH 62/90] remove certain excludes from pre-commit --- .pre-commit-config.yaml | 4 ++-- .../espressif/boards/adafruit_qtpy_esp32s3_nopsram/sdkconfig | 1 - ports/espressif/boards/espressif_esp32_eye/sdkconfig | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ab0279f7d7..942a51afdc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,9 +8,9 @@ repos: hooks: - id: check-yaml - id: end-of-file-fixer - exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/espressif/esp-idf-config/.*|ports/espressif/boards/.*/sdkconfig)' + exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)' - id: trailing-whitespace - exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/.*)' + exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/generate_errors.diff)' - repo: https://github.com/codespell-project/codespell rev: v2.2.4 hooks: diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/sdkconfig b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/sdkconfig index a162344cfb..9d924272ec 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/sdkconfig +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/sdkconfig @@ -5,4 +5,3 @@ CONFIG_ESP32S3_SPIRAM_SUPPORT=n # CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" # end of LWIP - diff --git a/ports/espressif/boards/espressif_esp32_eye/sdkconfig b/ports/espressif/boards/espressif_esp32_eye/sdkconfig index a73d92e0a2..26db1e8087 100644 --- a/ports/espressif/boards/espressif_esp32_eye/sdkconfig +++ b/ports/espressif/boards/espressif_esp32_eye/sdkconfig @@ -69,4 +69,3 @@ CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX=32768 # CONFIG_ESP_CONSOLE_UART_TX_GPIO=1 CONFIG_ESP_CONSOLE_UART_RX_GPIO=3 - From efeaa1ad20a9977117169a9670707e17e767bd8a Mon Sep 17 00:00:00 2001 From: Ozgur BOSTAN <79173593+ozgurbostan@users.noreply.github.com> Date: Sun, 26 Mar 2023 01:02:08 +0300 Subject: [PATCH 63/90] Update mpconfigboard.mk of Deneyap Kart --- ports/espressif/boards/deneyap_kart/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/deneyap_kart/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart/mpconfigboard.mk index c98cdb87b6..ea8c9a8522 100644 --- a/ports/espressif/boards/deneyap_kart/mpconfigboard.mk +++ b/ports/espressif/boards/deneyap_kart/mpconfigboard.mk @@ -1,5 +1,5 @@ -CIRCUITPY_CREATOR_ID = 0x00001209 -CIRCUITPY_CREATION_ID = 0x0032D001 +CIRCUITPY_CREATOR_ID = 0x19231923 +CIRCUITPY_CREATION_ID = 0x00320001 IDF_TARGET = esp32 From c8b329c4eeafcfd7350fe75652b2193a72e3bbcd Mon Sep 17 00:00:00 2001 From: Ozgur BOSTAN <79173593+ozgurbostan@users.noreply.github.com> Date: Sun, 26 Mar 2023 01:03:01 +0300 Subject: [PATCH 64/90] Update mpconfigboard.mk of Deneyap Kart 1A --- ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk index 8b3da63e5b..976083217e 100644 --- a/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk +++ b/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk @@ -1,5 +1,5 @@ -CIRCUITPY_CREATOR_ID = 0x00001209 -CIRCUITPY_CREATION_ID = 0x0032D002 +CIRCUITPY_CREATOR_ID = 0x19231923 +CIRCUITPY_CREATION_ID = 0x00320002 IDF_TARGET = esp32 From 872495ef36a49c939d0e46f147476b1f4d904cf7 Mon Sep 17 00:00:00 2001 From: Ozgur BOSTAN <79173593+ozgurbostan@users.noreply.github.com> Date: Sun, 26 Mar 2023 01:03:40 +0300 Subject: [PATCH 65/90] Update mpconfigboard.mk Deneyap Kart G --- ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk index c01e84611b..a470d7a088 100644 --- a/ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk +++ b/ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk @@ -1,5 +1,5 @@ -CIRCUITPY_CREATOR_ID = 0x00001209 -CIRCUITPY_CREATION_ID = 0x0032D003 +CIRCUITPY_CREATOR_ID = 0x19231923 +CIRCUITPY_CREATION_ID = 0x00C30001 IDF_TARGET = esp32c3 From 297d9d0a8152299d95d7c04cf07a409d2a955d66 Mon Sep 17 00:00:00 2001 From: ozgurbostan Date: Sun, 26 Mar 2023 14:54:34 +0300 Subject: [PATCH 66/90] Add new boards (deneyapmini/v2 and deneyapkart1a) --- .../boards/deneyap_kart_1a_v2/board.c | 32 +++++++ .../boards/deneyap_kart_1a_v2/mpconfigboard.h | 47 ++++++++++ .../deneyap_kart_1a_v2/mpconfigboard.mk | 12 +++ .../boards/deneyap_kart_1a_v2/pins.c | 73 +++++++++++++++ .../boards/deneyap_kart_1a_v2/sdkconfig | 47 ++++++++++ ports/espressif/boards/deneyap_mini/board.c | 31 +++++++ .../boards/deneyap_mini/mpconfigboard.h | 39 ++++++++ .../boards/deneyap_mini/mpconfigboard.mk | 12 +++ ports/espressif/boards/deneyap_mini/pins.c | 89 +++++++++++++++++++ ports/espressif/boards/deneyap_mini/sdkconfig | 4 + .../espressif/boards/deneyap_mini_v2/board.c | 32 +++++++ .../boards/deneyap_mini_v2/mpconfigboard.h | 39 ++++++++ .../boards/deneyap_mini_v2/mpconfigboard.mk | 11 +++ ports/espressif/boards/deneyap_mini_v2/pins.c | 85 ++++++++++++++++++ .../boards/deneyap_mini_v2/sdkconfig | 37 ++++++++ 15 files changed, 590 insertions(+) create mode 100644 ports/espressif/boards/deneyap_kart_1a_v2/board.c create mode 100644 ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.h create mode 100644 ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.mk create mode 100644 ports/espressif/boards/deneyap_kart_1a_v2/pins.c create mode 100644 ports/espressif/boards/deneyap_kart_1a_v2/sdkconfig create mode 100644 ports/espressif/boards/deneyap_mini/board.c create mode 100644 ports/espressif/boards/deneyap_mini/mpconfigboard.h create mode 100644 ports/espressif/boards/deneyap_mini/mpconfigboard.mk create mode 100644 ports/espressif/boards/deneyap_mini/pins.c create mode 100644 ports/espressif/boards/deneyap_mini/sdkconfig create mode 100644 ports/espressif/boards/deneyap_mini_v2/board.c create mode 100644 ports/espressif/boards/deneyap_mini_v2/mpconfigboard.h create mode 100644 ports/espressif/boards/deneyap_mini_v2/mpconfigboard.mk create mode 100644 ports/espressif/boards/deneyap_mini_v2/pins.c create mode 100644 ports/espressif/boards/deneyap_mini_v2/sdkconfig diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/board.c b/ports/espressif/boards/deneyap_kart_1a_v2/board.c new file mode 100644 index 0000000000..2287dbaaa7 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/board.c @@ -0,0 +1,32 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.h b/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.h new file mode 100644 index 0000000000..088bfbfd41 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Deneyap Kart 1A v2" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO33) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO21) + +#define MICROPY_HW_LED_STATUS (&pin_GPIO13) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO4) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO3) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO38) +#define DEFAULT_UART_BUS_TX (&pin_GPIO39) + +#define DOUBLE_TAP_PIN (&pin_GPIO34) diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.mk new file mode 100644 index 0000000000..1ec7c73185 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.mk @@ -0,0 +1,12 @@ +USB_VID = 0x239A +USB_PID = 0x8148 + +USB_PRODUCT = "Deneyap Kart 1A v2" +USB_MANUFACTURER = "Turkish Technology Team Foundation" + +IDF_TARGET = esp32s3 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESPCAMERA = 0 diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/pins.c b/ports/espressif/boards/deneyap_kart_1a_v2/pins.c new file mode 100644 index 0000000000..cf4c915e7f --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/pins.c @@ -0,0 +1,73 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_I2C_POWER), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/sdkconfig b/ports/espressif/boards/deneyap_kart_1a_v2/sdkconfig new file mode 100644 index 0000000000..4e99a09f2e --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/sdkconfig @@ -0,0 +1,47 @@ +# +# Component config +# +# +# ESP32S3-Specific +# +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +# CONFIG_SPIRAM_MODE_QUAD is not set +CONFIG_SPIRAM_MODE_OCT=y +# CONFIG_SPIRAM_TYPE_AUTO is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=8388608 +# +# PSRAM Clock and CS IO for ESP32S3 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM Clock and CS IO for ESP32S3 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_120M is not set +CONFIG_SPIRAM_SPEED_80M=y +# CONFIG_SPIRAM_SPEED_40M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# end of SPI RAM config + +# end of ESP32S3-Specific + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" +# end of LWIP + +# end of Component config diff --git a/ports/espressif/boards/deneyap_mini/board.c b/ports/espressif/boards/deneyap_mini/board.c new file mode 100644 index 0000000000..ac27ce4970 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/board.c @@ -0,0 +1,31 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_mini/mpconfigboard.h b/ports/espressif/boards/deneyap_mini/mpconfigboard.h new file mode 100644 index 0000000000..0e47285238 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/mpconfigboard.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Deneyap Mini" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO37, .sda = &pin_GPIO36}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO38, .mosi = &pin_GPIO40, .miso = &pin_GPIO39}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO43, .rx = &pin_GPIO44}} diff --git a/ports/espressif/boards/deneyap_mini/mpconfigboard.mk b/ports/espressif/boards/deneyap_mini/mpconfigboard.mk new file mode 100644 index 0000000000..f6944b7d7a --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/mpconfigboard.mk @@ -0,0 +1,12 @@ +USB_VID = 0x303A +USB_PID = 0x8142 + +USB_PRODUCT = "Deneyap Mini" +USB_MANUFACTURER = "Turkish Technology Team Foundation" + +IDF_TARGET = esp32s2 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESPCAMERA = 0 diff --git a/ports/espressif/boards/deneyap_mini/pins.c b/ports/espressif/boards/deneyap_mini/pins.c new file mode 100644 index 0000000000..6c04661467 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/pins.c @@ -0,0 +1,89 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_MO), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO40) }, + + { MP_ROM_QSTR(MP_QSTR_MI), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_MC), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_SC), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_SD), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_DA1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_DA0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_BT), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GPKEY), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_LEDB), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_LEDG), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_LEDR), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_T0), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_T1), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_T2), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_T3), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_T4), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_T5), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_mini/sdkconfig b/ports/espressif/boards/deneyap_mini/sdkconfig new file mode 100644 index 0000000000..7dfaf3052c --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/sdkconfig @@ -0,0 +1,4 @@ +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="DeneyapMini" +# end of LWIP diff --git a/ports/espressif/boards/deneyap_mini_v2/board.c b/ports/espressif/boards/deneyap_mini_v2/board.c new file mode 100644 index 0000000000..2287dbaaa7 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/board.c @@ -0,0 +1,32 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.h b/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.h new file mode 100644 index 0000000000..be6cbd86b7 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Deneyap Mini v2" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO37, .sda = &pin_GPIO36}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO38, .mosi = &pin_GPIO40, .miso = &pin_GPIO39}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO43, .rx = &pin_GPIO44}} diff --git a/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.mk b/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.mk new file mode 100644 index 0000000000..fa9c6b40ea --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x303A +USB_PID = 0x8145 + +USB_PRODUCT = "Deneyap Mini v2" +USB_MANUFACTURER = "Turkish Technology Team Foundation" + +IDF_TARGET = esp32s2 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/deneyap_mini_v2/pins.c b/ports/espressif/boards/deneyap_mini_v2/pins.c new file mode 100644 index 0000000000..ab3250769d --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/pins.c @@ -0,0 +1,85 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_MO), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO40) }, + + { MP_ROM_QSTR(MP_QSTR_MI), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_MC), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_SC), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_SD), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_DA1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_DA0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GPKEY), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_RGBLED), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_T0), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_T1), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_T2), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_T3), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_T4), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_T5), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_T6), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_mini_v2/sdkconfig b/ports/espressif/boards/deneyap_mini_v2/sdkconfig new file mode 100644 index 0000000000..613b744ef2 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/sdkconfig @@ -0,0 +1,37 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 +# end of SPI RAM config + +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="DeneyapMini_v2" +# end of LWIP From d9c4050f9263ca0f62a20f4c36362b8d31221865 Mon Sep 17 00:00:00 2001 From: Luc Date: Sat, 25 Mar 2023 22:01:49 +0000 Subject: [PATCH 67/90] Translated using Weblate (German) Currently translated at 96.0% (962 of 1002 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/de/ --- locale/de_DE.po | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index fb676d621e..68b1152895 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -6,14 +6,14 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-03-01 17:39+0000\n" -"Last-Translator: Ettore Atalan \n" +"PO-Revision-Date: 2023-03-26 22:37+0000\n" +"Last-Translator: Luc \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.16\n" +"X-Generator: Weblate 4.17-dev\n" #: main.c msgid "" @@ -198,7 +198,7 @@ msgstr "" #: ports/espressif/common-hal/analogbufio/BufferedIn.c msgid "%q must be array of type 'H'" -msgstr "" +msgstr "%q muss ein Array vom Typ 'H' sein" #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c @@ -526,7 +526,7 @@ msgstr "Sucht bereits nach Wifi-Netzwerken" #: shared-module/os/getenv.c #, c-format msgid "An error occurred while retrieving '%s':\n" -msgstr "" +msgstr "Ein Fehler ist aufgetreten beim Abfragen von '%s':\n" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" @@ -826,11 +826,11 @@ msgstr "" #: shared-bindings/bitmaptools/__init__.c msgid "Coordinate arrays have different lengths" -msgstr "" +msgstr "Koordinaten-Arrays haben unterschiedliche Längen" #: shared-bindings/bitmaptools/__init__.c msgid "Coordinate arrays types have different sizes" -msgstr "" +msgstr "Typen der Koordinaten-Arrays haben unterschiedliche Längen" #: py/persistentcode.c msgid "Corrupt .mpy file" @@ -951,7 +951,7 @@ msgstr "Fehler in regex" #: supervisor/shared/safe_mode.c msgid "Error in safemode.py." -msgstr "" +msgstr "Fehler in safemode.py." #: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c msgid "Error: Failure to bind" @@ -1028,7 +1028,7 @@ msgstr "Interner Flash konnte nicht geschrieben werden." #: supervisor/shared/safe_mode.c msgid "Fault detected by hardware." -msgstr "" +msgstr "Hardware hat Fehler festgestellt." #: py/moduerrno.c msgid "File exists" @@ -1250,7 +1250,7 @@ msgstr "Der Interne WatchDog Timer ist abgelaufen." #: supervisor/shared/safe_mode.c msgid "Interrupt error." -msgstr "" +msgstr "Interrupt Fehler." #: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c #: shared-bindings/digitalio/DigitalInOut.c @@ -1278,7 +1278,7 @@ msgstr "Ungültige BSSID" #: main.c msgid "Invalid CIRCUITPY_PYSTACK_SIZE\n" -msgstr "" +msgstr "Ungültiger Wert CIRCUITPY_PYSTACK_SIZE\n" #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" @@ -1977,7 +1977,7 @@ msgstr "Maßstabs-Abmeßungen müssen durch 3 teilbar sein" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progress. Stop with stop_scan." -msgstr "" +msgstr "Scan läuft schon. Stoppen mit stop_scan." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c From 19429d3626c7396b6ce064ea844e98081e53a0bb Mon Sep 17 00:00:00 2001 From: Neradoc Date: Mon, 27 Mar 2023 16:58:44 +0200 Subject: [PATCH 68/90] espnow.Peer: fix argument types and default values --- ports/espressif/bindings/espnow/ESPNow.c | 2 +- ports/espressif/bindings/espnow/Peer.c | 24 ++++++++---------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/ports/espressif/bindings/espnow/ESPNow.c b/ports/espressif/bindings/espnow/ESPNow.c index 513966e1e8..06c186d210 100644 --- a/ports/espressif/bindings/espnow/ESPNow.c +++ b/ports/espressif/bindings/espnow/ESPNow.c @@ -53,7 +53,7 @@ static void espnow_check_for_deinit(espnow_obj_t *self) { //| class ESPNow: //| """Provides access to the ESP-NOW protocol.""" //| -//| def __init__(self, buffer_size: Optional[int], phy_rate: Optional[int]) -> None: +//| def __init__(self, buffer_size: int = 526, phy_rate: Optional[int] = None) -> None: //| """Allocate and initialize `ESPNow` instance as a singleton. //| //| :param int buffer_size: The size of the internal ring buffer. Default: 526 bytes. diff --git a/ports/espressif/bindings/espnow/Peer.c b/ports/espressif/bindings/espnow/Peer.c index ca756409a6..89766dbf11 100644 --- a/ports/espressif/bindings/espnow/Peer.c +++ b/ports/espressif/bindings/espnow/Peer.c @@ -40,6 +40,7 @@ //| def __init__( //| self, //| mac: bytes, +//| *, //| lmk: Optional[bytes], //| channel: int = 0, //| interface: int = 0, @@ -58,10 +59,10 @@ STATIC mp_obj_t espnow_peer_make_new(const mp_obj_type_t *type, size_t n_args, s enum { ARG_mac, ARG_lmk, ARG_channel, ARG_interface, ARG_encrypt }; static const mp_arg_t allowed_args[] = { { MP_QSTR_mac, MP_ARG_OBJ | MP_ARG_REQUIRED }, - { MP_QSTR_lmk, MP_ARG_OBJ, { .u_obj = mp_const_none } }, - { MP_QSTR_channel, MP_ARG_INT, { .u_obj = mp_const_none } }, - { MP_QSTR_interface,MP_ARG_INT, { .u_obj = mp_const_none } }, - { MP_QSTR_encrypt, MP_ARG_BOOL,{ .u_obj = mp_const_none } }, + { MP_QSTR_lmk, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = mp_const_none } }, + { MP_QSTR_channel, MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 0 } }, + { MP_QSTR_interface,MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 0 } }, + { MP_QSTR_encrypt, MP_ARG_BOOL | MP_ARG_KW_ONLY,{ .u_bool = false } }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; @@ -77,20 +78,11 @@ STATIC mp_obj_t espnow_peer_make_new(const mp_obj_type_t *type, size_t n_args, s memcpy(self->peer_info.peer_addr, common_hal_espnow_get_bytes_len(args[ARG_mac].u_obj, ESP_NOW_ETH_ALEN), ESP_NOW_ETH_ALEN); - const mp_obj_t channel = args[ARG_channel].u_obj; - if (channel != mp_const_none) { - self->peer_info.channel = mp_arg_validate_int_range(mp_obj_get_int(channel), 0, 14, MP_QSTR_channel); - } + self->peer_info.channel = mp_arg_validate_int_range(args[ARG_channel].u_int, 0, 14, MP_QSTR_channel); - const mp_obj_t interface = args[ARG_interface].u_obj; - if (interface != mp_const_none) { - self->peer_info.ifidx = (wifi_interface_t)mp_arg_validate_int_range(mp_obj_get_int(interface), 0, 1, MP_QSTR_interface); - } + self->peer_info.ifidx = (wifi_interface_t)mp_arg_validate_int_range(args[ARG_interface].u_int, 0, 1, MP_QSTR_interface); - const mp_obj_t encrypt = args[ARG_encrypt].u_obj; - if (encrypt != mp_const_none) { - self->peer_info.encrypt = mp_obj_is_true(encrypt); - } + self->peer_info.encrypt = args[ARG_encrypt].u_bool; const mp_obj_t lmk = args[ARG_lmk].u_obj; if (lmk != mp_const_none) { From d6a067b0e564cc9d40d7782541393c5fe63f99e2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 27 Mar 2023 10:52:23 -0500 Subject: [PATCH 69/90] Make PWMAudioOut object ll, have finaliser .. for reasons stated in the comment --- shared-bindings/audiopwmio/PWMAudioOut.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index b4cea75184..56c6412bc6 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -114,7 +114,12 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_make_new(const mp_obj_type_t *type, size_ validate_obj_is_free_pin_or_none(args[ARG_right_channel].u_obj, MP_QSTR_right_channel); // create AudioOut object from the given pin - audiopwmio_pwmaudioout_obj_t *self = m_new_obj(audiopwmio_pwmaudioout_obj_t); + // The object is made long-lived because many implementations keep + // a pointer to the object (e.g., for the interrupt handler), which + // will not work properly if the object is moved. It is created + // with a finaliser as some ports use these (rather than 'reset' functions) + // to ensure resources are collected at interpreter shutdown. + audiopwmio_pwmaudioout_obj_t *self = m_new_ll_obj_with_finaliser(audiopwmio_pwmaudioout_obj_t); self->base.type = &audiopwmio_pwmaudioout_type; common_hal_audiopwmio_pwmaudioout_construct(self, left_channel_pin, right_channel_pin, args[ARG_quiescent_value].u_int); @@ -249,6 +254,7 @@ MP_PROPERTY_GETTER(audiopwmio_pwmaudioout_paused_obj, STATIC const mp_rom_map_elem_t audiopwmio_pwmaudioout_locals_dict_table[] = { // Methods { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&audiopwmio_pwmaudioout_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&audiopwmio_pwmaudioout_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&audiopwmio_pwmaudioout___exit___obj) }, { MP_ROM_QSTR(MP_QSTR_play), MP_ROM_PTR(&audiopwmio_pwmaudioout_play_obj) }, From 9d090ee73eabe5a84eb7f2aeacad431b4994cd29 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 27 Mar 2023 10:52:52 -0500 Subject: [PATCH 70/90] get rid of another debug print --- ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c index dd50c7950a..8650522b41 100644 --- a/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c @@ -87,7 +87,6 @@ void common_hal_audiopwmio_pwmaudioout_construct(audiopwmio_pwmaudioout_obj_t *s const mcu_periph_obj_t *left_periph = find_pin_function(mcu_mqs_left_list, left_channel, &instance, MP_QSTR_left_channel); const mcu_periph_obj_t *right_periph = find_pin_function(mcu_mqs_right_list, right_channel, &instance, MP_QSTR_right_channel); - mp_printf(&mp_plat_print, "note: peripheral %d\n", instance); sai_transceiver_t config; SAI_GetClassicI2SConfig(&config, kSAI_WordWidth16bits, kSAI_Stereo, 1U << 0u); config.frameSync.frameSyncEarly = false; From 1fad969389ee76138c4ae3834724e2bde550ae78 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sun, 17 Jul 2022 10:17:05 +0200 Subject: [PATCH 71/90] add unsigned ints and 64 bit types to msgpack change msgpack error message when format invalid --- locale/circuitpython.pot | 8 +++--- shared-module/msgpack/__init__.c | 42 +++++++++++++++++++++++++------- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 55ab977e97..b5026f7829 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -400,10 +400,6 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1271,6 +1267,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index d32550722c..3a34731d77 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -102,6 +102,16 @@ STATIC uint32_t read4(msgpack_stream_t *s) { return res; } +STATIC uint64_t read8(msgpack_stream_t *s) { + uint64_t res = 0; + read(s, &res, 8); + int n = 1; + if (*(char *)&n == 1) { + res = __builtin_bswap64(res); + } + return res; +} + STATIC size_t read_size(msgpack_stream_t *s, uint8_t len_index) { size_t res = 0; switch (len_index) { @@ -207,7 +217,7 @@ STATIC void pack_bin(msgpack_stream_t *s, const uint8_t *data, size_t len) { } } -STATIC void pack_ext(msgpack_stream_t *s, int8_t code, const uint8_t *data, size_t len) { +STATIC void pack_ext(msgpack_stream_t *s, int8_t code, const uint8_t *data, size_t len) { if (len == 1) { write1(s, 0xd4); } else if (len == 2) { @@ -424,22 +434,39 @@ STATIC mp_obj_t unpack(msgpack_stream_t *s, mp_obj_t ext_hook, bool use_list) { return unpack_bytes(s, read_size(s, code - 0xc4)); } case 0xcc: // uint8 + return MP_OBJ_NEW_SMALL_INT((uint8_t)read1(s)); case 0xd0: // int8 return MP_OBJ_NEW_SMALL_INT((int8_t)read1(s)); case 0xcd: // uint16 + return MP_OBJ_NEW_SMALL_INT((uint16_t)read2(s)); case 0xd1: // int16 return MP_OBJ_NEW_SMALL_INT((int16_t)read2(s)); case 0xce: // uint32 + return mp_obj_new_int_from_uint((uint32_t)read4(s)); case 0xd2: // int32 - return MP_OBJ_NEW_SMALL_INT((int32_t)read4(s)); - case 0xca: { - union Float { mp_float_t f; - uint32_t u; + return mp_obj_new_int((int32_t)read4(s)); + case 0xcf: // uint 64 + return mp_obj_new_int_from_ull((uint64_t)read8(s)); + case 0xd3: // int 64 + return mp_obj_new_int_from_ll((int64_t)read8(s)); + case 0xca: { // float + union Float { + mp_float_t f; + uint32_t u; }; union Float data; data.u = read4(s); return mp_obj_new_float(data.f); } + case 0xcb: { // double + union Double { + uint64_t u; + double d; + }; + union Double data; + data.u = read8(s); + return mp_obj_new_float_from_d(data.d); + } case 0xd9: case 0xda: case 0xdb: { @@ -483,11 +510,8 @@ STATIC mp_obj_t unpack(msgpack_stream_t *s, mp_obj_t ext_hook, bool use_list) { // ext 8, 16, 32 return unpack_ext(s, read_size(s, code - 0xc7), ext_hook); case 0xc1: // never used - case 0xcb: // float 64 - case 0xcf: // uint 64 - case 0xd3: // int 64 default: - mp_raise_NotImplementedError(translate("64 bit types")); + mp_raise_ValueError(translate("Invalid format")); } } From 16854ae57084659390ed14f1dc69afa4f5547bc6 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Mon, 27 Mar 2023 16:29:03 -0400 Subject: [PATCH 72/90] Add BUTTON, reorganise pins. --- .../raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c index e014ace05a..368f96b6fe 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c @@ -19,8 +19,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, @@ -31,10 +32,12 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_CKN), MP_ROM_PTR(&pin_GPIO16) }, { MP_ROM_QSTR(MP_QSTR_CKP), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_D0N), MP_ROM_PTR(&pin_GPIO18) }, From ca23f1e1acf573d8922bef35df2d4235f26d3aad Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 27 Mar 2023 16:52:01 -0500 Subject: [PATCH 73/90] attempt to fix missing jquery in RTD --- conf.py | 1 + requirements-doc.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/conf.py b/conf.py index 7b3b4ca585..ea5072ae4c 100644 --- a/conf.py +++ b/conf.py @@ -77,6 +77,7 @@ needs_sphinx = '1.3' extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', + "sphinxcontrib.jquery", 'sphinxcontrib.rsvgconverter', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', diff --git a/requirements-doc.txt b/requirements-doc.txt index 43e99fa32f..0489dc0b9f 100644 --- a/requirements-doc.txt +++ b/requirements-doc.txt @@ -13,6 +13,7 @@ sphinx!=5.2.0.post0 sphinx-autoapi sphinx-rtd-theme sphinxcontrib-svg2pdfconverter +sphinxcontrib-jquery readthedocs-sphinx-search myst-parser From 89bd5fae616ec6d403d820bb470a5375789ccf5d Mon Sep 17 00:00:00 2001 From: CDario Date: Tue, 28 Mar 2023 06:28:56 +0000 Subject: [PATCH 74/90] Add M5stack AtomS3 Lite --- .../boards/m5stack_atoms3_lite/board.c | 29 +++++++++++++ .../m5stack_atoms3_lite/mpconfigboard.h | 36 ++++++++++++++++ .../m5stack_atoms3_lite/mpconfigboard.mk | 11 +++++ .../boards/m5stack_atoms3_lite/pins.c | 42 +++++++++++++++++++ .../boards/m5stack_atoms3_lite/sdkconfig | 7 ++++ 5 files changed, 125 insertions(+) create mode 100644 ports/espressif/boards/m5stack_atoms3_lite/board.c create mode 100644 ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.h create mode 100644 ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.mk create mode 100644 ports/espressif/boards/m5stack_atoms3_lite/pins.c create mode 100644 ports/espressif/boards/m5stack_atoms3_lite/sdkconfig diff --git a/ports/espressif/boards/m5stack_atoms3_lite/board.c b/ports/espressif/boards/m5stack_atoms3_lite/board.c new file mode 100644 index 0000000000..164430c88c --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.h b/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.h new file mode 100644 index 0000000000..43dd436345 --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.h @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "M5Stack AtomS3 Lite" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO35) + +#define CIRCUITPY_BOARD_I2C (2) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO39, .sda = &pin_GPIO38}, \ + {.scl = &pin_GPIO1, .sda = &pin_GPIO2}} diff --git a/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.mk b/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.mk new file mode 100644 index 0000000000..8bb5ab76d8 --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x303A +USB_PID = 0x815F +USB_PRODUCT = "M5Stack AtomS3 Lite" +USB_MANUFACTURER = "M5Stack" + +IDF_TARGET = esp32s3 + +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB +CIRCUITPY_ESPCAMERA = 0 diff --git a/ports/espressif/boards/m5stack_atoms3_lite/pins.c b/ports/espressif/boards/m5stack_atoms3_lite/pins.c new file mode 100644 index 0000000000..052c15e69f --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/pins.c @@ -0,0 +1,42 @@ +#include "shared-bindings/board/__init__.h" + +CIRCUITPY_BOARD_BUS_SINGLETON(porta_i2c, i2c, 1) + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_PORTA_SCL), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_PORTA_SDA), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_IR_LED), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_PORTA_I2C), MP_ROM_PTR(&board_porta_i2c_obj) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/m5stack_atoms3_lite/sdkconfig b/ports/espressif/boards/m5stack_atoms3_lite/sdkconfig new file mode 100644 index 0000000000..9d924272ec --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/sdkconfig @@ -0,0 +1,7 @@ +CONFIG_ESP32S3_SPIRAM_SUPPORT=n + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" +# end of LWIP From a481c564da37beeaa5d88b08a33103901b803839 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Tue, 28 Mar 2023 14:00:03 +0200 Subject: [PATCH 75/90] change Peer(encrypt=) to encrypted to match the property --- ports/espressif/bindings/espnow/Peer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/espressif/bindings/espnow/Peer.c b/ports/espressif/bindings/espnow/Peer.c index 89766dbf11..5c21dafc4c 100644 --- a/ports/espressif/bindings/espnow/Peer.c +++ b/ports/espressif/bindings/espnow/Peer.c @@ -44,7 +44,7 @@ //| lmk: Optional[bytes], //| channel: int = 0, //| interface: int = 0, -//| encrypt: bool = False, +//| encrypted: bool = False, //| ) -> None: //| """Construct a new peer object. //| @@ -52,17 +52,17 @@ //| :param bytes lmk: The Local Master Key (lmk) of the peer. //| :param int channel: The peer's channel. Default: 0 ie. use the current channel. //| :param int interface: The WiFi interface to use. Default: 0 ie. STA. -//| :param bool encrypt: Whether or not to use encryption. +//| :param bool encrypted: Whether or not to use encryption. //| """ //| ... STATIC mp_obj_t espnow_peer_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { - enum { ARG_mac, ARG_lmk, ARG_channel, ARG_interface, ARG_encrypt }; + enum { ARG_mac, ARG_lmk, ARG_channel, ARG_interface, ARG_encrypted }; static const mp_arg_t allowed_args[] = { { MP_QSTR_mac, MP_ARG_OBJ | MP_ARG_REQUIRED }, { MP_QSTR_lmk, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = mp_const_none } }, { MP_QSTR_channel, MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 0 } }, { MP_QSTR_interface,MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 0 } }, - { MP_QSTR_encrypt, MP_ARG_BOOL | MP_ARG_KW_ONLY,{ .u_bool = false } }, + { MP_QSTR_encrypted,MP_ARG_BOOL | MP_ARG_KW_ONLY, { .u_bool = false } }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; @@ -82,7 +82,7 @@ STATIC mp_obj_t espnow_peer_make_new(const mp_obj_type_t *type, size_t n_args, s self->peer_info.ifidx = (wifi_interface_t)mp_arg_validate_int_range(args[ARG_interface].u_int, 0, 1, MP_QSTR_interface); - self->peer_info.encrypt = args[ARG_encrypt].u_bool; + self->peer_info.encrypt = args[ARG_encrypted].u_bool; const mp_obj_t lmk = args[ARG_lmk].u_obj; if (lmk != mp_const_none) { From 02c628a3c70870557c83477a78b6a85a87f40bb7 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Tue, 28 Mar 2023 14:36:43 +0200 Subject: [PATCH 76/90] Update ports/espressif/bindings/espnow/ESPNow.c Co-authored-by: MicroDev <70126934+microdev1@users.noreply.github.com> --- ports/espressif/bindings/espnow/ESPNow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/bindings/espnow/ESPNow.c b/ports/espressif/bindings/espnow/ESPNow.c index 06c186d210..32676bc9be 100644 --- a/ports/espressif/bindings/espnow/ESPNow.c +++ b/ports/espressif/bindings/espnow/ESPNow.c @@ -53,7 +53,7 @@ static void espnow_check_for_deinit(espnow_obj_t *self) { //| class ESPNow: //| """Provides access to the ESP-NOW protocol.""" //| -//| def __init__(self, buffer_size: int = 526, phy_rate: Optional[int] = None) -> None: +//| def __init__(self, buffer_size: int = 526, phy_rate: int = 0) -> None: //| """Allocate and initialize `ESPNow` instance as a singleton. //| //| :param int buffer_size: The size of the internal ring buffer. Default: 526 bytes. From f7c2599c293dde3e790adc4cb337ae1e9195261e Mon Sep 17 00:00:00 2001 From: Luc Date: Mon, 27 Mar 2023 19:20:28 +0000 Subject: [PATCH 77/90] Translated using Weblate (German) Currently translated at 100.0% (1002 of 1002 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/de/ --- locale/de_DE.po | 163 ++++++++++++++++++++++++++---------------------- 1 file changed, 87 insertions(+), 76 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 68b1152895..98d4f651de 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-03-26 22:37+0000\n" +"PO-Revision-Date: 2023-03-28 14:18+0000\n" "Last-Translator: Luc \n" "Language: de_DE\n" "MIME-Version: 1.0\n" @@ -37,12 +37,17 @@ msgid "" "Please file an issue with your program at https://github.com/adafruit/" "circuitpython/issues." msgstr "" +"\n" +"Bitte erstellen Sie ein Problem (Issue) für Ihr Programm unter https://github" +".com/adafruit/circuitpython/issues." #: supervisor/shared/safe_mode.c msgid "" "\n" "Press reset to exit safe mode.\n" msgstr "" +"\n" +"Drücke Reset, um den Sicherheitsmodus zu beenden.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -189,7 +194,7 @@ msgstr "%q muss >= %d sein" #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" -msgstr "" +msgstr "%q muss ein Bytearray oder ein Array vom Typ 'H' oder 'B' sein" #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" @@ -602,7 +607,7 @@ msgstr "Bitmap-Grösse und Bits pro Wert müssen übereinstimmen" #: supervisor/shared/safe_mode.c msgid "Boot device must be first (interface #0)." -msgstr "" +msgstr "Boot-Device muss an erster Stelle kommen (Interface #0)." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" @@ -792,9 +797,8 @@ msgstr "" "Die Frequenz eines bereits verwendeten Timers kann nicht variiert werden" #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -#, fuzzy msgid "Cannot wake on pin edge, only level" -msgstr "Kann nicht durch \"Pin edge\" geweckt werden nur durch \"level\"" +msgstr "Kann nicht durch Flanke an Pin geweckt werden, sondern nur durch Pegel" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." @@ -1121,12 +1125,13 @@ msgstr "Hardware in Benutzung, probiere alternative Pins" #: supervisor/shared/safe_mode.c msgid "Heap allocation when VM not running." -msgstr "" +msgstr "Allokation auf Heap während VM nicht läuft." #: supervisor/shared/safe_mode.c msgid "" "Heap was corrupted because the stack was too small. Increase stack size." msgstr "" +"Heap wurde beschädigt, weil der Stack zu klein war. Bitte Stack vergrößern." #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -1325,7 +1330,7 @@ msgstr "Ungültiger Zustand" #: shared-module/os/getenv.c msgid "Invalid unicode escape" -msgstr "" +msgstr "Ungültiges Unicode-Escape-Zeichen" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" @@ -1720,7 +1725,7 @@ msgstr "Zeit für Vorgang abgelaufen" #: ports/raspberrypi/common-hal/mdns/Server.c msgid "Out of MDNS service slots" -msgstr "" +msgstr "Keine freien Slots für MDNS-Dienst mehr verfügbar" #: ports/espressif/common-hal/espidf/__init__.c msgid "Out of memory" @@ -1826,7 +1831,7 @@ msgstr "Polygone brauchen mindestens 3 Punkte" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "Der Präfix-Puffer muss sich auf dem Heap befinden" +msgstr "Präfix-Puffer muss sich auf dem Heap befinden" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload.\n" @@ -1874,7 +1879,7 @@ msgstr "RNG DeInit-Fehler" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "RNG Init-Fehler" +msgstr "RNG-Init-Fehler" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c @@ -2015,7 +2020,7 @@ msgstr "SocketPool kann nur mit wifi.radio verwendet werden" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "Quell- und Zielbuffer müssen gleich lang sein" +msgstr "Quell- und Zielpuffer müssen gleich lang sein" #: shared-bindings/paralleldisplay/ParallelBus.c msgid "Specify exactly one of data0 or data_pins" @@ -2035,7 +2040,7 @@ msgstr "Stereo rechts muss sich auf PWM-Kanal B befinden" #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Stopping AP is not supported." -msgstr "" +msgstr "Das Stoppen des AP wird nicht unterstützt." #: shared-bindings/alarm/time/TimeAlarm.c msgid "Supply one of monotonic_time or epoch_time" @@ -2052,6 +2057,8 @@ msgstr "Zeitüberschreitung beim Auslesen der Temperatur" #: supervisor/shared/safe_mode.c msgid "The `microcontroller` module was used to boot into safe mode." msgstr "" +"Das 'microcontroller'-Modul wurde benutzt, um in den Sichheitsmodus zu " +"booten." #: py/obj.c msgid "The above exception was the direct cause of the following exception:" @@ -2065,6 +2072,8 @@ msgstr "Die Länge von rgb_pins muss 6, 12, 18, 24 oder 30 betragen" #: supervisor/shared/safe_mode.c msgid "The power dipped. Make sure you are providing enough power." msgstr "" +"Die Spannung ist eingebrochen. Stelle sicher, dass genügend Leistung " +"verfügbar ist." #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -2073,7 +2082,7 @@ msgstr "" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" -msgstr "Die Kanalanzahl des Samples stimmt nicht mit der des Mixers überein" +msgstr "Die Kanalanzahl des Samples stimmt nicht mit der des Mischers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" @@ -2081,12 +2090,11 @@ msgstr "Die Abtastrate der Probe stimmt nicht mit der des Mischers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" -msgstr "" -"Die Art des Vorzeichens des Samples stimmt nicht mit dem des Mixers überein" +msgstr "Der Vorzeichentyp des Samples stimmt nicht mit dem des Mixers überein" #: supervisor/shared/safe_mode.c msgid "Third-party firmware fatal error." -msgstr "" +msgstr "Fataler Fehler bei Drittanbieter-Firmware." #: shared-module/imagecapture/ParallelImageCapture.c msgid "This microcontroller does not support continuous capture." @@ -2106,7 +2114,7 @@ msgstr "Die Kachelhöhe muss die Bitmaphöhe genau teilen" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "Kachel index außerhalb der Grenzen" +msgstr "Kachelindex außerhalb der Grenzen" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" @@ -2133,7 +2141,7 @@ msgstr "Zu viele Kanäle im sample." #: shared-module/displayio/__init__.c msgid "Too many display busses" -msgstr "Zu viele Display Busse" +msgstr "Zu viele Anzeigebusse" #: shared-module/displayio/__init__.c msgid "Too many displays" @@ -2169,7 +2177,7 @@ msgstr "UART-Initialisierung" #: ports/raspberrypi/common-hal/busio/UART.c msgid "UART peripheral in use" -msgstr "" +msgstr "UART-Endgerät in Benutzung" #: ports/stm/common-hal/busio/UART.c msgid "UART re-init" @@ -2220,12 +2228,12 @@ msgstr "Konnte keine Buffer für Vorzeichenumwandlung allozieren" #: supervisor/shared/safe_mode.c msgid "Unable to allocate the heap." -msgstr "" +msgstr "Keine Allokation auf dem Heap möglich." #: ports/espressif/common-hal/analogbufio/BufferedIn.c #, c-format msgid "Unable to configure ADC DMA controller, ErrorCode:%d" -msgstr "" +msgstr "ADC-DMA-Controller konnte nicht konfiguriert werden, Fehlercode: %d" #: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" @@ -2248,7 +2256,7 @@ msgstr "Parser konnte nicht gestartet werden" #: ports/espressif/common-hal/analogbufio/BufferedIn.c #, c-format msgid "Unable to initialize ADC DMA controller, ErrorCode:%d" -msgstr "" +msgstr "ADC-DMA-Controller konnte nicht initialisiert werden, Fehlercode: %d" #: shared-module/displayio/OnDiskBitmap.c msgid "Unable to read color palette data" @@ -2257,7 +2265,7 @@ msgstr "Konnte Farbpalettendaten nicht lesen" #: ports/espressif/common-hal/analogbufio/BufferedIn.c #, c-format msgid "Unable to start ADC DMA controller, ErrorCode:%d" -msgstr "" +msgstr "ADC-DMA-Controller konnte nicht gestartet werden, Fehlercode: %d" #: ports/espressif/common-hal/mdns/Server.c #: ports/raspberrypi/common-hal/mdns/Server.c @@ -2298,7 +2306,7 @@ msgstr "Unbekannter BLE-Fehler: %d" #: ports/raspberrypi/common-hal/wifi/__init__.c #, c-format msgid "Unknown error code %d" -msgstr "" +msgstr "Unbekannter Fehlercode %d" #: shared-bindings/wifi/Radio.c #, c-format @@ -2376,7 +2384,7 @@ msgstr "Update fehlgeschlagen" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length != required fixed length" -msgstr "Wert Länge != Erforderliche feste Länge" +msgstr "Länge des Wertes != Erforderliche feste Länge" #: ports/espressif/common-hal/_bleio/Characteristic.c #: ports/espressif/common-hal/_bleio/Descriptor.c @@ -2437,11 +2445,11 @@ msgstr "Wi-Fi: " #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is in access point mode." -msgstr "" +msgstr "Das Wifi ist im Accesspoint-Modus." #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is in station mode." -msgstr "" +msgstr "Das Wifi ist im Station-Modus." #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is not enabled" @@ -2454,59 +2462,59 @@ msgstr "Aufgeweckt durch Alarm.\n" #: ports/espressif/common-hal/_bleio/PacketBuffer.c #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "Schreiben nicht unterstüzt für diese Charakteristik" +msgstr "Schreiben für diese Charakteristik nicht unterstützt" #: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h #: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h #: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "You pressed both buttons at start up." -msgstr "" +msgstr "Beide Knöpfe wurden beim Starten gedrückt." #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h #: ports/espressif/boards/m5stack_stick_c/mpconfigboard.h msgid "You pressed button A at start up." -msgstr "" +msgstr "Knopf A wurde beim Starten gedrückt." #: supervisor/shared/safe_mode.c msgid "You pressed the BOOT button at start up" -msgstr "" +msgstr "Der BOOT-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/adafruit_huzzah32_breakout/mpconfigboard.h msgid "You pressed the GPIO0 button at start up." -msgstr "" +msgstr "Der GPIO0-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h msgid "You pressed the Rec button at start up." -msgstr "" +msgstr "Der Rec-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." -msgstr "" +msgstr "Der SW38-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h msgid "You pressed the VOLUME button at start up." -msgstr "" +msgstr "Der VOLUME-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/m5stack_atom_echo/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_matrix/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_u/mpconfigboard.h msgid "You pressed the central button at start up." -msgstr "" +msgstr "Der zentrale Knopf wurde beim Starten gedrückt." #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h msgid "You pressed the left button at start up." -msgstr "" +msgstr "Der linke Knopf wurde beim Starten gedrückt." #: supervisor/shared/safe_mode.c msgid "You pressed the reset button during boot." -msgstr "" +msgstr "Der Reset-Knopf wurde beim Booten gedrückt." #: supervisor/shared/micropython.c msgid "[truncated due to length]" -msgstr "" +msgstr "[abgeschnitten wegen der Länge]" #: py/objtype.c msgid "__init__() should return None" @@ -2579,7 +2587,7 @@ msgstr "Das Array hat zu viele Dimensionen" #: extmod/ulab/code/ndarray.c msgid "array is too big" -msgstr "" +msgstr "Array ist zu groß" #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c @@ -2794,8 +2802,8 @@ msgstr "kann keinen relativen Import durchführen" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" msgstr "" -"Nicht \"None\" Werte können nicht an einen gerade gestarteten Generator " -"gesendet werden" +"Nicht-None-Wert kann nicht an einen gerade gestarteten Generator gesendet " +"werden" #: shared-module/sdcardio/SDCard.c msgid "can't set 512 block size" @@ -2807,7 +2815,7 @@ msgstr "kann Attribut nicht setzen" #: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" -msgstr "" +msgstr "Attribut '%q' kann nicht gesetzt werden" #: py/emitnative.c msgid "can't store '%q'" @@ -2877,7 +2885,7 @@ msgstr "Kanal wird erneut initialisiert" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" -msgstr "(char) Zeichenpuffer zu klein" +msgstr "Zeichenpuffer zu klein" #: py/modbuiltins.c msgid "chr() arg not in range(0x110000)" @@ -2943,7 +2951,7 @@ msgstr "Convolve-Argumente müssen ndarrays sein" #: extmod/ulab/code/numpy/filter.c msgid "convolve arguments must not be empty" -msgstr "Convolve Argumente dürfen nicht leer sein" +msgstr "Faltungsargumente dürfen nicht leer sein" #: extmod/ulab/code/numpy/io/io.c msgid "corrupted file" @@ -2994,8 +3002,8 @@ msgstr "default ist keine Funktion" msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" msgstr "" -"Der Zielbuffer muss ein Bytearray oder ein Array vom Typ 'B' für bit_depth = " -"8 sein" +"Zielpuffer muss ein Bytearray oder ein Array vom Typ 'B' für bit_depth = 8 " +"sein" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" @@ -3055,7 +3063,7 @@ msgstr "leere Sequenz" #: py/objstr.c msgid "end of format while looking for conversion specifier" -msgstr "Ende des Formats wärend der Suche nach einem conversion specifier" +msgstr "Ende des Formats bei der Suche nach einem Konvertierungsspezifizierer" #: shared-bindings/alarm/time/TimeAlarm.c msgid "epoch_time not supported on this board" @@ -3071,6 +3079,8 @@ msgid "" "espcamera.Camera requires reserved PSRAM to be configured. See the " "documentation for instructions." msgstr "" +"espcamera.Camera benötigt reservierten PSRAM um konfiguriert zu werden. " +"Siehe Dokumentation für Anweisungen." #: py/runtime.c msgid "exceptions must derive from BaseException" @@ -3290,7 +3300,7 @@ msgstr "Index ist außerhalb der Grenzen" #: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" -msgstr "" +msgstr "Index muss tuple oder int sein" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c @@ -3482,7 +3492,7 @@ msgstr "issubclass() arg 2 muss eine Klasse oder ein Tupel von Klassen sein" #: extmod/ulab/code/numpy/linalg/linalg.c msgid "iterations did not converge" -msgstr "Iterationen sind nicht konvergiert (converged)" +msgstr "Iterationen sind nicht konvergiert" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" @@ -3550,7 +3560,7 @@ msgstr "mDNS funktioniert nur mit integriertem WiFi" #: py/parse.c msgid "malformed f-string" -msgstr "fehlformatierter f-string" +msgstr "fehlerhafter F-String" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" @@ -3634,7 +3644,7 @@ msgstr "Mehrfache Vererbung nicht unterstützt" #: py/emitnative.c msgid "must raise an object" -msgstr "muss ein Objekt verursachen (raise)" +msgstr "muss ein Objekt aufwerfen (raise)" #: py/modbuiltins.c msgid "must use keyword argument for key function" @@ -3654,7 +3664,7 @@ msgstr "native Methode zu groß" #: py/emitnative.c msgid "native yield" -msgstr "native Ausbeute (yield)" +msgstr "natives yield" #: py/runtime.c #, c-format @@ -3667,15 +3677,15 @@ msgstr "negative Fakultät" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" -msgstr "negative Potenz ohne Gleitkomma (float) Unterstützung" +msgstr "negative Potenz ohne Gleitkomma(float)-Unterstützung" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" -msgstr "Negative shift Anzahl" +msgstr "Negative Anzahl an Verschiebungen" #: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" -msgstr "" +msgstr "verschachtelter Index muss int sein" #: shared-module/sdcardio/SDCard.c msgid "no SD card" @@ -3683,11 +3693,11 @@ msgstr "keine SD-Karte" #: py/vm.c msgid "no active exception to reraise" -msgstr "Keine aktive Ausnahme zu verusachen (raise)" +msgstr "Keine aktive Ausnahme zum Wiederaufwerfen (reraise)" #: py/compile.c msgid "no binding for nonlocal found" -msgstr "Kein Binding für nonlocal gefunden" +msgstr "Keine Bindung für nichtlokale Variable gefunden" #: shared-module/msgpack/__init__.c msgid "no default packer" @@ -3717,7 +3727,7 @@ msgstr "kein solches Attribut" #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" -msgstr "non-UUID gefunden in service_uuids_whitelist" +msgstr "Nicht-UUID in service_uuids_whitelist gefunden" #: py/compile.c msgid "non-default argument follows default argument" @@ -3733,7 +3743,7 @@ msgstr "Nicht-Schlüsselwort arg nach * / **" #: py/compile.c msgid "non-keyword arg after keyword arg" -msgstr "Nicht-Schlüsselwort Argument nach Schlüsselwort Argument" +msgstr "Nicht-Schlüsselwort-Argument nach Schlüsselwort-Argument" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "non-zero timeout must be > 0.01" @@ -3750,11 +3760,12 @@ msgstr "keine 128-bit UUID" #: py/objstr.c msgid "not all arguments converted during string formatting" msgstr "" -"Nicht alle Argumente wurden während der Formatierung des Strings konvertiert" +"Nicht alle Argumente wurden während der Formatierung der Zeichenfolge " +"konvertiert" #: py/objstr.c msgid "not enough arguments for format string" -msgstr "Nicht genügend Argumente für den Formatierungs-String" +msgstr "Nicht genügend Argumente für die Formatzeichenfolge" #: extmod/ulab/code/numpy/carray/carray_tools.c msgid "not implemented for complex dtype" @@ -3850,11 +3861,11 @@ msgstr "nur Mono wird unterstützt" #: extmod/ulab/code/numpy/create.c msgid "only ndarrays can be concatenated" -msgstr "" +msgstr "nur ndarrays können aneinandergehängt werden" #: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only oversample=64 is supported" -msgstr "" +msgstr "nur oversample=64 wird unterstützt" #: ports/nrf/common-hal/audiobusio/PDMIn.c #: ports/stm/common-hal/audiobusio/PDMIn.c @@ -3891,7 +3902,7 @@ msgstr "Operation wird nur für boolesche 1D-Arrays implementiert" #: extmod/ulab/code/numpy/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "Die Operation ist für ndarrays nicht implementiert" +msgstr "Operation ist auf ndarrays nicht implementiert" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" @@ -3943,7 +3954,7 @@ msgstr "Die Parameter müssen Register der Reihenfolge a2 bis a5 sein" #: py/emitinlinethumb.c msgid "parameters must be registers in sequence r0 to r3" -msgstr "Die Parameter müssen Register der Reihenfolge r0 bis r3 sein" +msgstr "Parameter müssen Register im Bereich von r0 bis r3 sein" #: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "pixel coordinates out of bounds" @@ -3984,7 +3995,7 @@ msgstr "pow() drittes Argument darf nicht 0 sein" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "pow() mit 3 Argumenten erfordert Integer" +msgstr "pow() mit 3 Argumenten erfordert ganze Zahlen" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" @@ -4016,7 +4027,7 @@ msgstr "Rückgabewert-Beschreibung muss ein Identifier sein" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "Rückgabe erwartet '%q', aber '%q' erhalten" +msgstr "Rückgabe (return) erwartet '%q', hat aber '%q' erhalten" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -4026,7 +4037,7 @@ msgstr "rgb_pins[%d] dupliziert eine andere Pinbelegung" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "rgb_pins [%d] befindet sich nicht am selben Port wie clock" +msgstr "rgb_pins[%d] befindet sich nicht am selben Port wie clock" #: extmod/ulab/code/numpy/numerical.c msgid "roll argument must be an ndarray" @@ -4063,7 +4074,7 @@ msgstr "kurze Lektüre" #: py/objstr.c msgid "sign not allowed in string format specifier" -msgstr "Vorzeichen nicht erlaubt in einem String formatierungs specifier" +msgstr "Vorzeichen im Zeichenfolgenformatbezeichner nicht zulässig" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" @@ -4095,7 +4106,7 @@ msgstr "weicher reboot\n" #: extmod/ulab/code/numpy/numerical.c msgid "sort argument must be an ndarray" -msgstr "sortierungs Argument muss ein ndarray sein" +msgstr "Sortierungsargument muss ein ndarray sein" #: extmod/ulab/code/scipy/signal/signal.c msgid "sos array must be of shape (n_section, 6)" @@ -4215,7 +4226,7 @@ msgstr "zu viele Lokale für die native Methode" #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" -msgstr "zu viele Werte zum Auspacken (erwartet %d)" +msgstr "zu viele Werte zum Auspacken (%d erwartet)" #: extmod/ulab/code/numpy/approx.c msgid "trapz is defined for 1D arrays of equal length" @@ -4249,7 +4260,7 @@ msgstr "Typ ist kein akzeptierter Basis-Typ" #: py/objgenerator.c py/runtime.c msgid "type object '%q' has no attribute '%q'" -msgstr "Typ vom Objekt '%q' hat kein Attribut '%q'" +msgstr "Typ-Objekt '%q' hat kein Attribut '%q'" #: py/objtype.c msgid "type takes 1 or 3 arguments" @@ -4279,7 +4290,7 @@ msgstr "unerwartetes Schlüsselwort-Argument '%q'" #: py/lexer.c msgid "unicode name escapes" -msgstr "Unicode Name ausgebrochen (escaped)" +msgstr "Escaping von Unicode-Namen" #: py/parse.c msgid "unindent doesn't match any outer indent level" @@ -4288,7 +4299,7 @@ msgstr "unindent stimmt mit keiner äußeren Einrückungsebene überein" #: py/objstr.c #, c-format msgid "unknown conversion specifier %c" -msgstr "unbekannter Konvertierungs specifier %c" +msgstr "unbekannter Konvertierungsspezifizierer %c" #: py/objstr.c msgid "unknown format code '%c' for object of type '%q'" @@ -4305,7 +4316,7 @@ msgstr "unbekannter Typ '%q'" #: py/objstr.c #, c-format msgid "unmatched '%c' in format" -msgstr "" +msgstr "'%c' in Format konnte nicht zugeordnet werden" #: py/objtype.c py/runtime.c msgid "unreadable attribute" From 128a4f9697de2c86668f4f3087536feca29f088c Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 28 Mar 2023 16:18:27 +0200 Subject: [PATCH 78/90] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 8 ++++---- locale/cs.po | 11 +++++++---- locale/de_DE.po | 15 +++++++++------ locale/el.po | 13 ++++++++----- locale/en_GB.po | 11 +++++++---- locale/es.po | 11 +++++++---- locale/fil.po | 8 ++++---- locale/fr.po | 11 +++++++---- locale/hi.po | 8 ++++---- locale/it_IT.po | 11 +++++++---- locale/ja.po | 8 ++++---- locale/ko.po | 8 ++++---- locale/nl.po | 8 ++++---- locale/pl.po | 8 ++++---- locale/pt_BR.po | 11 +++++++---- locale/ru.po | 11 +++++++---- locale/sv.po | 11 +++++++---- locale/tr.po | 11 +++++++---- locale/zh_Latn_pinyin.po | 11 +++++++---- 19 files changed, 115 insertions(+), 79 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 0affac3ed4..21d3e4a4c2 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -403,10 +403,6 @@ msgstr "0.0 ke kompleks berpangkat" msgid "3-arg pow() not supported" msgstr "pow() 3-arg tidak didukung" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1283,6 +1279,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ukuran potongan format tidak valid" diff --git a/locale/cs.po b/locale/cs.po index 7af7d489b1..a8d09ade34 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -404,10 +404,6 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "pow() nepodporuje 3 argumenty" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 bit typy" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1283,6 +1279,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "Chybný data_pin[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Neplatná velikost bloku" @@ -4382,6 +4382,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "64 bit types" +#~ msgstr "64 bit typy" + #~ msgid "No key was specified" #~ msgstr "Nebyl zadán klíč" diff --git a/locale/de_DE.po b/locale/de_DE.po index 98d4f651de..ab543ccea4 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -38,8 +38,8 @@ msgid "" "circuitpython/issues." msgstr "" "\n" -"Bitte erstellen Sie ein Problem (Issue) für Ihr Programm unter https://github" -".com/adafruit/circuitpython/issues." +"Bitte erstellen Sie ein Problem (Issue) für Ihr Programm unter https://" +"github.com/adafruit/circuitpython/issues." #: supervisor/shared/safe_mode.c msgid "" @@ -414,10 +414,6 @@ msgstr "0.0 zu einer komplexen Potenz" msgid "3-arg pow() not supported" msgstr "3-arg pow() wird nicht unterstützt" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 bit-Typen" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1307,6 +1303,10 @@ msgstr "Ungültiges Byte %.*s" msgid "Invalid data_pins[%d]" msgstr "Ungültige data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ungültige format chunk size" @@ -4469,6 +4469,9 @@ msgstr "zi muss eine Gleitkommazahl sein" msgid "zi must be of shape (n_section, 2)" msgstr "zi muss die Form (n_section, 2) haben" +#~ msgid "64 bit types" +#~ msgstr "64 bit-Typen" + #~ msgid "No key was specified" #~ msgstr "Es wurde kein Schlüssel angegeben" diff --git a/locale/el.po b/locale/el.po index ab4b2d9b90..3336cbae67 100644 --- a/locale/el.po +++ b/locale/el.po @@ -408,11 +408,6 @@ msgstr "0.0 σε μία σύνθετη δύναμη" msgid "3-arg pow() not supported" msgstr "pow() με 3 παραμέτρους δεν υποστηρίζεται" -#: shared-module/msgpack/__init__.c -#, fuzzy -msgid "64 bit types" -msgstr "64 bit τύποι" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1292,6 +1287,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" @@ -4390,6 +4389,10 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#, fuzzy +#~ msgid "64 bit types" +#~ msgstr "64 bit τύποι" + #~ msgid "%q pin invalid" #~ msgstr "%q άκυρο pin" diff --git a/locale/en_GB.po b/locale/en_GB.po index e2d9cd9f13..9c26f47d45 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -407,10 +407,6 @@ msgstr "0.0 to a complex power" msgid "3-arg pow() not supported" msgstr "3-arg pow() not supported" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 bit types" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1284,6 +1280,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "Invalid data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Invalid format chunk size" @@ -4393,6 +4393,9 @@ msgstr "zi must be of float type" msgid "zi must be of shape (n_section, 2)" msgstr "zi must be of shape (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "64 bit types" + #~ msgid "No key was specified" #~ msgstr "No key was specified" diff --git a/locale/es.po b/locale/es.po index 9578e4048a..d5db9c0c88 100644 --- a/locale/es.po +++ b/locale/es.po @@ -415,10 +415,6 @@ msgstr "0.0 a una potencia compleja" msgid "3-arg pow() not supported" msgstr "pow() con 3 argumentos no soportado" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "tipos de 64 bit" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1317,6 +1313,10 @@ msgstr "byte %.*s Inválido" msgid "Invalid data_pins[%d]" msgstr "Inválidos los data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Formato de fragmento de formato no válido" @@ -4466,6 +4466,9 @@ msgstr "zi debe ser de tipo flotante" msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" +#~ msgid "64 bit types" +#~ msgstr "tipos de 64 bit" + #~ msgid "No key was specified" #~ msgstr "No se especificó ninguna llave" diff --git a/locale/fil.po b/locale/fil.po index 86677af69b..f83cfb1173 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -402,10 +402,6 @@ msgstr "0.0 para sa complex power" msgid "3-arg pow() not supported" msgstr "3-arg pow() hindi suportado" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1283,6 +1279,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Mali ang format ng chunk size" diff --git a/locale/fr.po b/locale/fr.po index 812f09b454..e536cbd346 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -412,10 +412,6 @@ msgstr "0.0 à une puissance complexe" msgid "3-arg pow() not supported" msgstr "pow() non supporté avec 3 paramètres" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "types à 64 bit" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1323,6 +1319,10 @@ msgstr "Octet invalide %.*s" msgid "Invalid data_pins[%d]" msgstr "data_pins[%d] invalide" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Taille de bloc de formatage invalide" @@ -4485,6 +4485,9 @@ msgstr "zi doit être de type float" msgid "zi must be of shape (n_section, 2)" msgstr "zi doit être de forme (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "types à 64 bit" + #~ msgid "No key was specified" #~ msgstr "Aucune clé n'a été spécifiée" diff --git a/locale/hi.po b/locale/hi.po index 75efddc294..977cd4986a 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -400,10 +400,6 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1271,6 +1267,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index e8d32b163e..b4e998f698 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -405,10 +405,6 @@ msgstr "0.0 elevato alla potenza di un numero complesso" msgid "3-arg pow() not supported" msgstr "pow() con tre argmomenti non supportata" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "Tipo 64 bits" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1285,6 +1281,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" @@ -4415,6 +4415,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "64 bit types" +#~ msgstr "Tipo 64 bits" + #~ msgid "too many arguments provided with the given format" #~ msgstr "troppi argomenti forniti con il formato specificato" diff --git a/locale/ja.po b/locale/ja.po index f90abd66da..ab8ca26d28 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -407,10 +407,6 @@ msgstr "0.0を複素数でべき乗" msgid "3-arg pow() not supported" msgstr "引数3つのpow()は非対応" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1284,6 +1280,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "フォーマットチャンクのサイズが不正" diff --git a/locale/ko.po b/locale/ko.po index fbb45ed195..21b5cdecd6 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -401,10 +401,6 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1274,6 +1270,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "형식 청크 크기가 잘못되었습니다" diff --git a/locale/nl.po b/locale/nl.po index f9faf2a6a5..50a0ab6d99 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -400,10 +400,6 @@ msgstr "0.0 tot een complexe macht" msgid "3-arg pow() not supported" msgstr "3-arg pow() niet ondersteund" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1279,6 +1275,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ongeldig formaat stuk grootte" diff --git a/locale/pl.po b/locale/pl.po index 4fc4337a55..e873e45a51 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -402,10 +402,6 @@ msgstr "0.0 do potęgi zespolonej" msgid "3-arg pow() not supported" msgstr "3-argumentowy pow() jest niewspierany" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1279,6 +1275,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Zła wielkość fragmentu formatu" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index a684aacfb1..6968cfbb84 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -417,10 +417,6 @@ msgstr "0,0 para uma potência complexa" msgid "3-arg pow() not supported" msgstr "3-arg pow() não compatível" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "Tipos 64 bit" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1313,6 +1309,10 @@ msgstr "Byte %.*s inválido" msgid "Invalid data_pins[%d]" msgstr "data_pins[%d] inválido" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Tamanho do pedaço de formato inválido" @@ -4466,6 +4466,9 @@ msgstr "zi deve ser de um tipo float" msgid "zi must be of shape (n_section, 2)" msgstr "zi deve estar na forma (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "Tipos 64 bit" + #~ msgid "No key was specified" #~ msgstr "Nenhuma chave foi definida" diff --git a/locale/ru.po b/locale/ru.po index c2e6ccc265..e2c1eae4f1 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -407,10 +407,6 @@ msgstr "0.0 в комплексную степень" msgid "3-arg pow() not supported" msgstr "3-аргументный pow() не поддерживается" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64-битные типы" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1316,6 +1312,10 @@ msgstr "Неверный байт %.*s" msgid "Invalid data_pins[%d]" msgstr "Неверный data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Неверный размер блока формата" @@ -4430,6 +4430,9 @@ msgstr "zi должно быть типа float" msgid "zi must be of shape (n_section, 2)" msgstr "zi должен иметь форму (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "64-битные типы" + #~ msgid "No key was specified" #~ msgstr "Ключ не был указан" diff --git a/locale/sv.po b/locale/sv.po index bbbe1ad4fb..1cef8c6d7a 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -414,10 +414,6 @@ msgstr "0,0 till ett komplext nummer" msgid "3-arg pow() not supported" msgstr "3-arguments pow() stöds inte" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64-bitars typer" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1298,6 +1294,10 @@ msgstr "Ogiltig byte %.*s" msgid "Invalid data_pins[%d]" msgstr "Ogiltig data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ogiltig formatsegmentstorlek" @@ -4428,6 +4428,9 @@ msgstr "zi måste vara av typ float" msgid "zi must be of shape (n_section, 2)" msgstr "zi måste vara i formen (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "64-bitars typer" + #~ msgid "No key was specified" #~ msgstr "Ingen nyckel angavs" diff --git a/locale/tr.po b/locale/tr.po index 62c5fc9dc2..f785cff4fc 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -409,10 +409,6 @@ msgstr "0.0'dan bir karmaşık güce" msgid "3-arg pow() not supported" msgstr "3-argümanlı pow() desteklenmemektedir" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 bit tipler" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1290,6 +1286,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "Geçersiz veri_pini [%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Geçersiz biçim yığın boyutu" @@ -4389,6 +4389,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "64 bit types" +#~ msgstr "64 bit tipler" + #~ msgid "%q pin invalid" #~ msgstr "%q pini geçersiz" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 98876f3cdb..2246687ef3 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -416,10 +416,6 @@ msgstr "0.0 de fùshù cì mì" msgid "3-arg pow() not supported" msgstr "bù zhī chí 3-arg pow()" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 wèi lèixíng" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1305,6 +1301,10 @@ msgstr "wú xiào zì jié %.*s" msgid "Invalid data_pins[%d]" msgstr "wú xiào data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Géshì kuài dàxiǎo wúxiào" @@ -4434,6 +4434,9 @@ msgstr "zi bìxū wèi fú diǎn xíng" msgid "zi must be of shape (n_section, 2)" msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" +#~ msgid "64 bit types" +#~ msgstr "64 wèi lèixíng" + #~ msgid "No key was specified" #~ msgstr "Wèi zhǐdìng mì yào" From cb5e1a1e981a970744d0a53626addfb608c9091d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 28 Mar 2023 09:20:54 -0500 Subject: [PATCH 79/90] mimxrt: Fix output frequency for samples that don't divide 192kHz This makes all the samples from Dan's collection register as 440Hz when playing on pwmio or i2sout, using https://webaudiodemos.appspot.com/pitchdetect/index.html to detect the frequency played (all should show as A 440Hz; an error of up to 20 "cents" should be treated as OK) There's an audible carrier with PWM output and the 8kHz samples. This is probably a limitation of the peripheral which is documented as being for input signals of 44 kHz or 48 kHz; the carrier frequency is a fixed multiple of the sample frequency. Closes #7800 --- .../common-hal/audiobusio/__init__.c | 59 +++++++++++++++++-- shared-bindings/audiopwmio/PWMAudioOut.c | 4 ++ 2 files changed, 57 insertions(+), 6 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c index 515c39a268..13ae64d27c 100644 --- a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c +++ b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c @@ -42,18 +42,23 @@ /* * AUDIO PLL setting: Frequency = Fref * (DIV_SELECT + NUM / DENOM) - * = 24 * (32 + 77/100) - * = 786.48 MHz + * = 24 * (32 + 96 / 125) = 24 * (32.768) + * = 786.432 MHz = 48kHz * 16384 + * + * This default clocking is used during initial configuration; it also works well for + * frequencies that evenly divide 192kHz, such as 8/12/24/48kHz. However, it doesn't work + * well for 44.1/22/11kHz, so there's the possibility of using a different + * setting when playing a particular sample. */ const clock_audio_pll_config_t audioPllConfig = { .loopDivider = 32, /* PLL loop divider. Valid range for DIV_SELECT divider value: 27~54. */ .postDivider = 1, /* Divider after the PLL, should only be 1, 2, 4, 8, 16. */ - .numerator = 77, /* 30 bit numerator of fractional loop divider. */ - .denominator = 100, /* 30 bit denominator of fractional loop divider */ + .numerator = 96, /* 30 bit numerator of fractional loop divider. */ + .denominator = 125, /* 30 bit denominator of fractional loop divider */ }; static I2S_Type *const i2s_instances[] = I2S_BASE_PTRS; -static uint8_t i2s_in_use; +static uint8_t i2s_in_use, i2s_playing; static I2S_Type *SAI_GetPeripheral(int idx) { if (idx < 0 || idx >= (int)MP_ARRAY_SIZE(i2s_instances)) { @@ -344,7 +349,11 @@ void port_i2s_deinit(i2s_t *self) { } SAI_TransferAbortSend(self->peripheral, &self->handle); i2s_clock_off(self->peripheral); - i2s_in_use &= ~(1 << SAI_GetInstance(self->peripheral)); + + uint32_t instance_mask = 1 << SAI_GetInstance(self->peripheral); + i2s_in_use &= ~instance_mask; + i2s_playing &= ~instance_mask; + if (!i2s_in_use) { CCM_ANALOG->PLL_AUDIO = CCM_ANALOG_PLL_AUDIO_BYPASS_MASK | CCM_ANALOG_PLL_AUDIO_POWERDOWN_MASK | CCM_ANALOG_PLL_AUDIO_BYPASS_CLK_SRC(kCLOCK_PllClkSrc24M); } @@ -354,13 +363,51 @@ void port_i2s_deinit(i2s_t *self) { } } +static uint32_t gcd(uint32_t a, uint32_t b) { + while (b) { + uint32_t tmp = a % b; + a = b; + b = tmp; + } + return a; +} + +static void set_sai_clocking_for_sample_rate(uint32_t sample_rate) { + mp_arg_validate_int_range((mp_uint_t)sample_rate, 4000, 192000, MP_QSTR_sample_rate); + + uint32_t target_rate = sample_rate; + // ensure the PWM rate of MQS will be adequately high + while (target_rate < 175000) { + target_rate <<= 1; + } + target_rate *= 4096; // various prescalers divide by this much + uint32_t div = gcd(target_rate % 24000000, 24000000); + clock_audio_pll_config_t config = { + .loopDivider = target_rate / 24000000, + .postDivider = 1, + .numerator = (target_rate % 24000000) / div, + .denominator = 24000000 / div, + }; + CLOCK_InitAudioPll(&config); +} + void port_i2s_play(i2s_t *self, mp_obj_t sample, bool loop) { self->sample = sample; self->loop = loop; self->bytes_per_sample = audiosample_bits_per_sample(sample) / 8; self->channel_count = audiosample_channel_count(sample); + int instance = SAI_GetInstance(self->peripheral); + i2s_playing |= (1 << instance); uint32_t sample_rate = audiosample_sample_rate(sample); if (sample_rate != self->sample_rate) { + if (__builtin_popcount(i2s_playing) <= 1) { + // as this is the first/only i2s instance playing audio, we can + // safely change the overall clock used by the SAI peripheral, to + // get more accurate frequency reproduction. If another i2s + // instance is playing, then we can't touch the audio PLL and have + // to live with what we can get, which may be inaccurate + set_sai_clocking_for_sample_rate(sample_rate); + } SAI_TxSetBitClockRate(self->peripheral, SAI_CLOCK_FREQ, sample_rate, 16, 2); self->sample_rate = sample_rate; } diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index 56c6412bc6..f05fbfdfe9 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -56,6 +56,10 @@ //| :param int quiescent_value: The output value when no signal is present. Samples should start //| and end with this value to prevent audible popping. //| +//| **Limitations:** On mimxrt10xx, low sample rates may have an audible +//| "carrier" frequency. The manufacturer datasheet states that the "MQS" peripheral +//| is intended for 44 kHz or 48kHz input signals. +//| //| Simple 8ksps 440 Hz sin wave:: //| //| import audiocore From d28932934482cd5df5871d8276adc1cc812e9fc4 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 28 Mar 2023 11:02:17 -0400 Subject: [PATCH 80/90] Handle HID OUT reports with no report ID --- shared-module/usb_hid/Device.c | 44 +++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index 680bb83893..6f530bfef8 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -293,24 +293,40 @@ uint16_t tud_hid_get_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t // Callback invoked when we receive Set_Report request through control endpoint void tud_hid_set_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t const *buffer, uint16_t bufsize) { (void)itf; - if (report_type == HID_REPORT_TYPE_INVALID) { - report_id = buffer[0]; - buffer++; - bufsize--; + + usb_hid_device_obj_t *hid_device = NULL; + size_t id_idx; + + if (report_id == 0 && report_type == HID_REPORT_TYPE_INVALID) { + // This could be a report with a non-zero report ID in the first byte, or + // it could be for report ID 0. + // Heuristic: see if there's a device with report ID 0, and if its report length matches + // the size of the incoming buffer. In that case, assume the first byte is not the report ID, + // but is data. Otherwise use the first byte as the report id. + if (usb_hid_get_device_with_report_id(0, &hid_device, &id_idx) && + hid_device && + hid_device->out_report_buffers[id_idx] && + hid_device->out_report_lengths[id_idx] == bufsize) { + // Use as is, with report_id 0. + } else { + // No matching report ID 0, so use the first byte as the report ID. + report_id = buffer[0]; + buffer++; + bufsize--; + } } else if (report_type != HID_REPORT_TYPE_OUTPUT && report_type != HID_REPORT_TYPE_FEATURE) { return; } - usb_hid_device_obj_t *hid_device; - size_t id_idx; - // Find device with this report id, and get the report id index. - if (usb_hid_get_device_with_report_id(report_id, &hid_device, &id_idx)) { + // report_id might be changed due to parsing above, so test again. + if ((report_id == 0 && report_type == HID_REPORT_TYPE_INVALID) || + // Fetch the matching device if we don't already have the report_id 0 device. + (usb_hid_get_device_with_report_id(report_id, &hid_device, &id_idx) && + hid_device && + hid_device->out_report_buffers[id_idx] && + hid_device->out_report_lengths[id_idx] == bufsize)) { // If a report of the correct size has been read, save it in the proper OUT report buffer. - if (hid_device && - hid_device->out_report_buffers[id_idx] && - hid_device->out_report_lengths[id_idx] >= bufsize) { - memcpy(hid_device->out_report_buffers[id_idx], buffer, bufsize); - hid_device->out_report_buffers_updated[id_idx] = true; - } + memcpy(hid_device->out_report_buffers[id_idx], buffer, bufsize); + hid_device->out_report_buffers_updated[id_idx] = true; } } From 2a4383e633766e01c4c07149161def59c11a576e Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Tue, 28 Mar 2023 15:23:19 -0400 Subject: [PATCH 81/90] Add Feather RP2040 RFM, update DVI. --- .../mpconfigboard.h | 2 +- .../boards/adafruit_feather_rp2040_dvi/pins.c | 32 ++++++----- .../adafruit_feather_rp2040_rfm/board.c | 29 ++++++++++ .../mpconfigboard.h | 14 +++++ .../mpconfigboard.mk | 9 +++ .../pico-sdk-configboard.h | 4 ++ .../boards/adafruit_feather_rp2040_rfm/pins.c | 57 +++++++++++++++++++ 7 files changed, 131 insertions(+), 16 deletions(-) create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/board.c create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pins.c diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/mpconfigboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/mpconfigboard.h index 06cfaf37f6..55b69b4ad8 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/mpconfigboard.h +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/mpconfigboard.h @@ -1,7 +1,7 @@ #define MICROPY_HW_BOARD_NAME "Adafruit Feather RP2040 DVI" #define MICROPY_HW_MCU_NAME "rp2040" -#define MICROPY_HW_NEOPIXEL (&pin_GPIO16) +#define MICROPY_HW_NEOPIXEL (&pin_GPIO4) #define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c index 368f96b6fe..c8b4e3474f 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c @@ -9,22 +9,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO24) }, { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO15) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO8) }, - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO1) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, - - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, - - { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO7) }, - { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO7) }, - { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, - - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, @@ -32,6 +17,23 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/board.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.h new file mode 100644 index 0000000000..fff88cc1fa --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.h @@ -0,0 +1,14 @@ +#define MICROPY_HW_BOARD_NAME "Adafruit Feather RP2040 RFM" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO4) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO14) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO15) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO8) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO1) +#define DEFAULT_UART_BUS_TX (&pin_GPIO0) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.mk b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.mk new file mode 100644 index 0000000000..161a2b5c2e --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.mk @@ -0,0 +1,9 @@ +USB_VID = 0x239A +USB_PID = 0x812E +USB_PRODUCT = "Feather RP2040 RFM" +USB_MANUFACTURER = "Adafruit" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ" diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pico-sdk-configboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pico-sdk-configboard.h @@ -0,0 +1,4 @@ +// Put board-specific pico-sdk definitions here. This file must exist. + +// Allow extra time for xosc to start. +#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64 diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pins.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pins.c new file mode 100644 index 0000000000..71679fb53b --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pins.c @@ -0,0 +1,57 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_RFM_CS), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_RFM_RST), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO5), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO3), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO4), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO0), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO1), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO2), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 11082435f1d6c916d6274e77e842c0d10cbbff6a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 28 Mar 2023 16:05:17 -0400 Subject: [PATCH 82/90] shrink SAMD21 builds by a few hundred bytes --- ports/atmel-samd/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 343dcf7d63..31e69f36c9 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -116,12 +116,12 @@ else # -finline-limit=80 or so is similar to not having it on. # There is no simple default value, though. ifeq ($(SHRINK_BUILD), 1) - CFLAGS += -finline-limit=45 + CFLAGS += -finline-limit=45 --param max-inline-insns-auto=110 endif # We used to do this but it seems to not reduce space any more, at least in gcc 11. # Leave it here, commented out, just for reference. - # --param inline-unit-growth=15 --param max-inline-insns-auto=20 + # --param inline-unit-growth=15 ifdef CFLAGS_BOARD CFLAGS += $(CFLAGS_BOARD) From b2535496b08849d93cec582d5894a748b60cbb96 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 28 Mar 2023 16:28:31 -0400 Subject: [PATCH 83/90] use max-inline-insns-auto=110 only on SAMD21 --- ports/atmel-samd/Makefile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 31e69f36c9..ca906ab98f 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -104,19 +104,16 @@ else CFLAGS += -DNDEBUG # Do a default shrink for small builds, including all SAMD21 builds. - ifeq ($(CIRCUITPY_FULL_BUILD),0) - SHRINK_BUILD = 1 - else - ifeq ($(CHIP_FAMILY), samd21) - SHRINK_BUILD = 1 - endif - endif - # -finline-limit can shrink the image size. # -finline-limit=80 or so is similar to not having it on. # There is no simple default value, though. - ifeq ($(SHRINK_BUILD), 1) - CFLAGS += -finline-limit=45 --param max-inline-insns-auto=110 + ifeq ($(CIRCUITPY_FULL_BUILD),0) + CFLAGS += -finline-limit=45 + else + ifeq ($(CHIP_FAMILY), samd21) + # max-inline-insns-auto increases the size of SAMD51 builds. + CFLAGS += -finline-limit=45 --param max-inline-insns-auto=110 + endif endif # We used to do this but it seems to not reduce space any more, at least in gcc 11. From f14861c2457f3f9d3c8610ca48c080f63c787b66 Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Wed, 29 Mar 2023 09:49:35 +0530 Subject: [PATCH 84/90] fix espnow reinit, remove todos and improve docs --- ports/espressif/bindings/espidf/__init__.c | 14 ++++++++++---- ports/espressif/bindings/espnow/ESPNow.c | 10 +++++++--- ports/espressif/bindings/espnow/Peer.c | 5 +---- ports/espressif/bindings/espnow/Peers.c | 2 -- ports/espressif/bindings/espnow/__init__.c | 5 ++--- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/ports/espressif/bindings/espidf/__init__.c b/ports/espressif/bindings/espidf/__init__.c index c1ef9da1e0..65b7f12a18 100644 --- a/ports/espressif/bindings/espidf/__init__.c +++ b/ports/espressif/bindings/espidf/__init__.c @@ -34,6 +34,8 @@ #include "nvs_flash.h" #include "components/heap/include/esp_heap_caps.h" +//| import builtins +//| //| """Direct access to a few ESP-IDF details. This module *should not* include any functionality //| that could be implemented by other frameworks. It should only include ESP-IDF specific //| things.""" @@ -95,6 +97,13 @@ STATIC void espidf_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_pr mp_obj_exception_print(print, o_in, kind); } +//| class IDFError(builtins.OSError): +//| """Raised when an ``ESP-IDF`` function returns an error code. +//| `esp_err_t `_ +//| """ +//| +//| ... +//| const mp_obj_type_t mp_type_espidf_IDFError = { { &mp_type_type }, .name = MP_QSTR_IDFError, @@ -104,11 +113,8 @@ const mp_obj_type_t mp_type_espidf_IDFError = { .parent = &mp_type_OSError, }; - -//| import builtins -//| //| class MemoryError(builtins.MemoryError): -//| """Raised when an ESP IDF memory allocation fails.""" +//| """Raised when an ``ESP-IDF`` memory allocation fails.""" //| //| ... //| diff --git a/ports/espressif/bindings/espnow/ESPNow.c b/ports/espressif/bindings/espnow/ESPNow.c index 32676bc9be..78d80924fd 100644 --- a/ports/espressif/bindings/espnow/ESPNow.c +++ b/ports/espressif/bindings/espnow/ESPNow.c @@ -57,7 +57,9 @@ static void espnow_check_for_deinit(espnow_obj_t *self) { //| """Allocate and initialize `ESPNow` instance as a singleton. //| //| :param int buffer_size: The size of the internal ring buffer. Default: 526 bytes. -//| :param int phy_rate: The ESP-NOW physical layer rate. Default: 1 Mbps.""" +//| :param int phy_rate: The ESP-NOW physical layer rate. Default: 1 Mbps. +//| `wifi_phy_rate_t `_ +//| """ //| ... STATIC mp_obj_t espnow_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { enum { ARG_buffer_size, ARG_phy_rate }; @@ -71,7 +73,7 @@ STATIC mp_obj_t espnow_make_new(const mp_obj_type_t *type, size_t n_args, size_t espnow_obj_t *self = MP_STATE_PORT(espnow_singleton); - if (self != NULL) { + if (!common_hal_espnow_deinited(self)) { mp_raise_RuntimeError(translate("Already running")); } @@ -244,7 +246,9 @@ MP_PROPERTY_GETTER(espnow_buffer_size_obj, (mp_obj_t)&espnow_get_buffer_size_obj); //| phy_rate: int -//| """The ESP-NOW physical layer rate.""" +//| """The ESP-NOW physical layer rate. +//| `wifi_phy_rate_t `_ +//| """ //| STATIC mp_obj_t espnow_get_phy_rate(const mp_obj_t self_in) { espnow_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/ports/espressif/bindings/espnow/Peer.c b/ports/espressif/bindings/espnow/Peer.c index 5c21dafc4c..f69bec01e6 100644 --- a/ports/espressif/bindings/espnow/Peer.c +++ b/ports/espressif/bindings/espnow/Peer.c @@ -31,9 +31,6 @@ #include "bindings/espnow/Peer.h" #include "common-hal/espnow/__init__.h" -// TODO: check peer already exist -// TODO: check peer doesn't exist - //| class Peer: //| """A data class to store parameters specific to a peer.""" //| @@ -62,7 +59,7 @@ STATIC mp_obj_t espnow_peer_make_new(const mp_obj_type_t *type, size_t n_args, s { MP_QSTR_lmk, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = mp_const_none } }, { MP_QSTR_channel, MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 0 } }, { MP_QSTR_interface,MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 0 } }, - { MP_QSTR_encrypted,MP_ARG_BOOL | MP_ARG_KW_ONLY, { .u_bool = false } }, + { MP_QSTR_encrypted,MP_ARG_BOOL | MP_ARG_KW_ONLY,{ .u_bool = false } }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; diff --git a/ports/espressif/bindings/espnow/Peers.c b/ports/espressif/bindings/espnow/Peers.c index 15d07c09d0..6fda9aed7a 100644 --- a/ports/espressif/bindings/espnow/Peers.c +++ b/ports/espressif/bindings/espnow/Peers.c @@ -35,8 +35,6 @@ #include "esp_now.h" -// TODO: Check for deinit - //| class Peers: //| """Maintains a `list` of `Peer` internally and only exposes a subset of `list` methods.""" //| diff --git a/ports/espressif/bindings/espnow/__init__.c b/ports/espressif/bindings/espnow/__init__.c index da15be49ea..3135858601 100644 --- a/ports/espressif/bindings/espnow/__init__.c +++ b/ports/espressif/bindings/espnow/__init__.c @@ -33,9 +33,8 @@ //| """ESP-NOW Module //| //| The `espnow` module provides an interface to the -//| `ESP-NOW `_ -//| protocol provided by Espressif on its SoCs -//| (`API docs `_). +//| `ESP-NOW `_ +//| protocol provided by Espressif on its SoCs. //| //| **Sender** //| From cc3d0f6fa15bf3532ad99f289db29555a9e37858 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 29 Mar 2023 10:03:56 -0500 Subject: [PATCH 85/90] getenv: treat a read error like eof Otherwise, the following would occur: * settings.toml is in the process of being written by host computer * soft-reset begins * web workflow tries to grab CIRCUITPY_WIFI_SSID, but loops forever because FAT filesystem is in inconsistent state and file reads error * settings.toml write by host computer never completes and the filesystem remains corrupt * restarting yields a soft-bricked device, because startup reads CIRCUITPY_WIFI_SSID again --- shared-module/os/getenv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/os/getenv.c b/shared-module/os/getenv.c index 870973c5d2..6585aeb88c 100644 --- a/shared-module/os/getenv.c +++ b/shared-module/os/getenv.c @@ -72,7 +72,7 @@ STATIC void close_file(file_arg *active_file) { // nothing } STATIC bool is_eof(file_arg *active_file) { - return f_eof(active_file); + return f_eof(active_file) | f_error(active_file); } // Return 0 if there is no next character (EOF). From a8bbb21eeb5bcdab5eb71be3793c6efd3dd0622d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 29 Mar 2023 10:09:01 -0500 Subject: [PATCH 86/90] Use short-circuiting or (also may save some code size) Co-authored-by: Dan Halbert --- shared-module/os/getenv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/os/getenv.c b/shared-module/os/getenv.c index 6585aeb88c..76cbf48dae 100644 --- a/shared-module/os/getenv.c +++ b/shared-module/os/getenv.c @@ -72,7 +72,7 @@ STATIC void close_file(file_arg *active_file) { // nothing } STATIC bool is_eof(file_arg *active_file) { - return f_eof(active_file) | f_error(active_file); + return f_eof(active_file) || f_error(active_file); } // Return 0 if there is no next character (EOF). From 173bc198c604aa9d3475bed79acdaaf57f47f5dc Mon Sep 17 00:00:00 2001 From: Gregory Neverov <42853258+gneverov@users.noreply.github.com> Date: Wed, 29 Mar 2023 11:49:32 -0700 Subject: [PATCH 87/90] don't set tcp_err callback for listen sockets --- ports/raspberrypi/common-hal/socketpool/Socket.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/raspberrypi/common-hal/socketpool/Socket.c b/ports/raspberrypi/common-hal/socketpool/Socket.c index fe12f461fb..0696cc7ae9 100644 --- a/ports/raspberrypi/common-hal/socketpool/Socket.c +++ b/ports/raspberrypi/common-hal/socketpool/Socket.c @@ -706,8 +706,6 @@ bool socketpool_socket(socketpool_socketpool_obj_t *self, case MOD_NETWORK_SOCK_STREAM: { // Register the socket object as our callback argument. tcp_arg(socket->pcb.tcp, (void *)socket); - // Register our error callback. - tcp_err(socket->pcb.tcp, _lwip_tcp_error); break; } case MOD_NETWORK_SOCK_DGRAM: { @@ -916,10 +914,11 @@ void socketpool_socket_close(socketpool_socket_obj_t *socket) { case SOCKETPOOL_SOCK_STREAM: { // Deregister callback (pcb.tcp is set to NULL below so must deregister now) tcp_arg(socket->pcb.tcp, NULL); - tcp_err(socket->pcb.tcp, NULL); - tcp_recv(socket->pcb.tcp, NULL); if (socket->pcb.tcp->state != LISTEN) { + tcp_err(socket->pcb.tcp, NULL); + tcp_recv(socket->pcb.tcp, NULL); + // Schedule a callback to abort the connection if it's not cleanly closed after // the given timeout. The callback must be set before calling tcp_close since // the latter may free the pcb; if it doesn't then the callback will be active. @@ -977,6 +976,7 @@ void common_hal_socketpool_socket_connect(socketpool_socket_obj_t *socket, // Register our receive callback. MICROPY_PY_LWIP_ENTER tcp_recv(socket->pcb.tcp, _lwip_tcp_recv); + tcp_err(socket->pcb.tcp, _lwip_tcp_error); socket->state = STATE_CONNECTING; err = tcp_connect(socket->pcb.tcp, &dest, port, _lwip_tcp_connected); if (err != ERR_OK) { From 1a5afd485bfa5aa5269a25d0ab40ab47413cf3f6 Mon Sep 17 00:00:00 2001 From: Ted Hess Date: Wed, 29 Mar 2023 15:47:17 -0400 Subject: [PATCH 88/90] Allow web_workflow to startup after deep sleep alarm wakeup --- supervisor/shared/web_workflow/web_workflow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 2caacbd39b..75ab78bf03 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -261,6 +261,7 @@ void supervisor_start_web_workflow(void) { const mcu_reset_reason_t reset_reason = common_hal_mcu_processor_get_reset_reason(); if (reset_reason != RESET_REASON_POWER_ON && reset_reason != RESET_REASON_RESET_PIN && + reset_reason != RESET_REASON_DEEP_SLEEP_ALARM && reset_reason != RESET_REASON_UNKNOWN && reset_reason != RESET_REASON_SOFTWARE) { return; From b746fd05baad4daf776366d7cf9e833c159cd075 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 29 Mar 2023 23:58:54 +0300 Subject: [PATCH 89/90] 24Mhz -> 240Mhz --- ports/espressif/common-hal/microcontroller/Processor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/common-hal/microcontroller/Processor.c b/ports/espressif/common-hal/microcontroller/Processor.c index 1f09742955..c0e72c85b9 100644 --- a/ports/espressif/common-hal/microcontroller/Processor.c +++ b/ports/espressif/common-hal/microcontroller/Processor.c @@ -64,7 +64,7 @@ float common_hal_mcu_processor_get_voltage(void) { uint32_t common_hal_mcu_processor_get_frequency(void) { #if defined(CONFIG_IDF_TARGET_ESP32) - return CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ * 100000; + return CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ * 1000000; #elif defined(CONFIG_IDF_TARGET_ESP32C3) return CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ * 1000000; #elif defined(CONFIG_IDF_TARGET_ESP32S2) From a10ce2170c26e532080f99ecaeb753267c8bb912 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 29 Mar 2023 17:16:39 -0400 Subject: [PATCH 90/90] doc typo fix in OnDiskGif --- shared-bindings/gifio/OnDiskGif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/gifio/OnDiskGif.c b/shared-bindings/gifio/OnDiskGif.c index a16cb92b4e..f6acccfabf 100644 --- a/shared-bindings/gifio/OnDiskGif.c +++ b/shared-bindings/gifio/OnDiskGif.c @@ -97,7 +97,7 @@ //| //| display_bus.send(42, struct.pack(">hh", 0, odg.bitmap.width - 1)) //| display_bus.send(43, struct.pack(">hh", 0, odg.bitmap.height - 1)) -//| display_bus.send(44, d.bitmap) +//| display_bus.send(44, odg.bitmap) //| //| # The following optional code will free the OnDiskGif and allocated resources //| # after use. This may be required before loading a new GIF in situations