From a58bf235d8d90ca4ec185c296b2b95f5b11507ea Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 13 Feb 2022 16:38:53 -0600 Subject: [PATCH 01/98] raspberry: StateMachine: Add support for wrap=, wrap_target= --- .../bindings/rp2pio/StateMachine.c | 22 ++++++++++++-- .../bindings/rp2pio/StateMachine.h | 3 +- .../common-hal/audiobusio/I2SOut.c | 3 +- .../raspberrypi/common-hal/audiobusio/PDMIn.c | 5 ++-- .../imagecapture/ParallelImageCapture.c | 4 +-- .../common-hal/neopixel_write/__init__.c | 3 +- .../common-hal/paralleldisplay/ParallelBus.c | 5 ++-- .../raspberrypi/common-hal/pulseio/PulseIn.c | 3 +- .../common-hal/rotaryio/IncrementalEncoder.c | 4 ++- .../common-hal/rp2pio/StateMachine.c | 29 ++++++++++++------- .../common-hal/rp2pio/StateMachine.h | 4 +-- 11 files changed, 58 insertions(+), 27 deletions(-) diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index fb13821e35..557b15617d 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -87,7 +87,10 @@ //| auto_push: bool = False, //| push_threshold: int = 32, //| in_shift_right: bool = True, -//| user_interruptible: bool = True) -> None: +//| user_interruptible: bool = True, +//| wrap_target: int = 0, +//| wrap: int = -1, +//| ) -> None: //| //| """Construct a StateMachine object on the given pins with the given program. //| @@ -136,6 +139,10 @@ //| that causes an infinite loop, you will be able to interrupt the loop. //| However, if you are writing to a device that can get into a bad state if a read or write //| is interrupted, you may want to set this to False after your program has been vetted. +//| :param int wrap_target The target instruction number of automatic wrap. Defaults to the first instruction of the program. +//| :param int wrap The instruction after which to wrap to the ``wrap`` +//| instruction. As a special case, -1 (the default) indicates the +//| last instruction of the program. //| """ //| ... //| @@ -155,7 +162,9 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n ARG_auto_pull, ARG_pull_threshold, ARG_out_shift_right, ARG_wait_for_txstall, ARG_auto_push, ARG_push_threshold, ARG_in_shift_right, - ARG_user_interruptible,}; + ARG_user_interruptible, + ARG_wrap_target, + ARG_wrap,}; static const mp_arg_t allowed_args[] = { { MP_QSTR_program, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_frequency, MP_ARG_REQUIRED | MP_ARG_INT }, @@ -194,6 +203,9 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n { MP_QSTR_push_threshold, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 32} }, { MP_QSTR_in_shift_right, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, { MP_QSTR_user_interruptible, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, + + { MP_QSTR_wrap_target, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_wrap, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = -1} }, }; 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); @@ -254,6 +266,9 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n mp_raise_ValueError(translate("Init program size invalid")); } + int wrap = args[ARG_wrap].u_int; + int wrap_target = args[ARG_wrap_target].u_int; + common_hal_rp2pio_statemachine_construct(self, bufinfo.buf, bufinfo.len / 2, args[ARG_frequency].u_int, @@ -269,7 +284,8 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n args[ARG_auto_pull].u_bool, pull_threshold, args[ARG_out_shift_right].u_bool, args[ARG_wait_for_txstall].u_bool, args[ARG_auto_push].u_bool, push_threshold, args[ARG_in_shift_right].u_bool, - args[ARG_user_interruptible].u_bool); + args[ARG_user_interruptible].u_bool, + wrap_target, wrap); return MP_OBJ_FROM_PTR(self); } diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.h b/ports/raspberrypi/bindings/rp2pio/StateMachine.h index 3f3b8cf7d8..eb3f4addc5 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.h +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.h @@ -51,7 +51,8 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, bool auto_pull, uint8_t pull_threshold, bool out_shift_right, bool wait_for_txstall, bool auto_push, uint8_t push_threshold, bool in_shift_right, - bool user_interruptible); + bool user_interruptible, + int wrap_taget, int wrap); void common_hal_rp2pio_statemachine_deinit(rp2pio_statemachine_obj_t *self); bool common_hal_rp2pio_statemachine_deinited(rp2pio_statemachine_obj_t *self); diff --git a/ports/raspberrypi/common-hal/audiobusio/I2SOut.c b/ports/raspberrypi/common-hal/audiobusio/I2SOut.c index 8432e47a52..a7cce01640 100644 --- a/ports/raspberrypi/common-hal/audiobusio/I2SOut.c +++ b/ports/raspberrypi/common-hal/audiobusio/I2SOut.c @@ -134,7 +134,8 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t *self, false, 32, false, // shift out left to start with MSB false, // Wait for txstall false, 32, false, // in settings - false); // Not user-interruptible. + false, // Not user-interruptible. + 0, -1); // wrap settings self->playing = false; audio_dma_init(&self->dma); diff --git a/ports/raspberrypi/common-hal/audiobusio/PDMIn.c b/ports/raspberrypi/common-hal/audiobusio/PDMIn.c index 4b5694706f..de1b8a4b5e 100644 --- a/ports/raspberrypi/common-hal/audiobusio/PDMIn.c +++ b/ports/raspberrypi/common-hal/audiobusio/PDMIn.c @@ -63,7 +63,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self, // Use the state machine to manage pins. common_hal_rp2pio_statemachine_construct(&self->state_machine, - pdmin, sizeof(pdmin) / sizeof(pdmin[0]), + pdmin, MP_ARRAY_SIZE(pdmin), sample_rate * 32 * 2, // Frequency based on sample rate NULL, 0, NULL, 1, 0, 0xffffffff, // out pin @@ -78,7 +78,8 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self, false, 32, false, // out settings false, // Wait for txstall false, 32, true, // in settings - false); // Not user-interruptible. + false, // Not user-interruptible. + 0, -1); // wrap settings uint32_t actual_frequency = common_hal_rp2pio_statemachine_get_frequency(&self->state_machine); if (actual_frequency < MIN_MIC_CLOCK) { diff --git a/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c b/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c index 45a3766897..045441aedd 100644 --- a/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c +++ b/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c @@ -118,13 +118,13 @@ void common_hal_imagecapture_parallelimagecapture_construct(imagecapture_paralle false, 32, false, // out settings false, // wait for txstall true, 32, true, // in settings - false); // Not user-interruptible. + false, // Not user-interruptible. + 2, 5); // wrap settings PIO pio = self->state_machine.pio; uint8_t pio_index = pio_get_index(pio); uint sm = self->state_machine.state_machine; - rp2pio_statemachine_set_wrap(&self->state_machine, 2, 5); } void common_hal_imagecapture_parallelimagecapture_deinit(imagecapture_parallelimagecapture_obj_t *self) { diff --git a/ports/raspberrypi/common-hal/neopixel_write/__init__.c b/ports/raspberrypi/common-hal/neopixel_write/__init__.c index 09388af481..1acfed055c 100644 --- a/ports/raspberrypi/common-hal/neopixel_write/__init__.c +++ b/ports/raspberrypi/common-hal/neopixel_write/__init__.c @@ -78,7 +78,8 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout, false, 32, true, // RX setting we don't use false, // claim pins false, // Not user-interruptible. - false); // No sideset enable + false, // No sideset enable + 0, -1); // wrap if (!ok) { // Do nothing. Maybe bitbang? return; diff --git a/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c b/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c index 2e0ae4def2..4243eddab3 100644 --- a/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c +++ b/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c @@ -92,7 +92,7 @@ void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbu } common_hal_rp2pio_statemachine_construct(&self->state_machine, - parallel_program, sizeof(parallel_program) / sizeof(parallel_program[0]), + parallel_program, MP_ARRAY_SIZE(parallel_program), frequency * 2, // frequency multiplied by 2 as 2 PIO instructions NULL, 0, // init data0, 8, 0, 255, // first out pin, # out pins @@ -106,7 +106,8 @@ void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbu true, 8, true, // TX, auto pull every 8 bits. shift left to output msb first false, // wait for TX stall false, 32, true, // RX setting we don't use - false); // Not user-interruptible. + false, // Not user-interruptible. + 0, -1); // wrap settings common_hal_rp2pio_statemachine_never_reset(&self->state_machine); } diff --git a/ports/raspberrypi/common-hal/pulseio/PulseIn.c b/ports/raspberrypi/common-hal/pulseio/PulseIn.c index e507cd16e8..83edde25ad 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseIn.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseIn.c @@ -74,7 +74,8 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, true, 32, true, // RX auto-push every 32 bits false, // claim pins false, // Not user-interruptible. - false); // No sideset enable + false, // No sideset enable + 0, -1); // wrap settings if (!ok) { mp_raise_RuntimeError(translate("All state machines in use")); diff --git a/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c b/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c index 1f15b010f7..97749c8f14 100644 --- a/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c @@ -92,7 +92,9 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode false, 32, false, // out settings false, // Wait for txstall false, 32, false, // in settings - false); // Not user-interruptible. + false, // Not user-interruptible. + 0, MP_ARRAY_SIZE(encoder) - 1 // wrap settings + ); // We're guaranteed by the init code that some output will be available promptly uint8_t quiescent_state; diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index ac5a41652a..cd1d383008 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -165,7 +165,8 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, bool auto_push, uint8_t push_threshold, bool in_shift_right, bool claim_pins, bool user_interruptible, - bool sideset_enable + bool sideset_enable, + int wrap_target, int wrap ) { // Create a program id that isn't the pointer so we can store it without storing the original object. uint32_t program_id = ~((uint32_t)program); @@ -289,7 +290,18 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, if (jmp_pin != NULL) { sm_config_set_jmp_pin(&c, jmp_pin->number); } - sm_config_set_wrap(&c, program_offset, program_offset + program_len - 1); + + mp_arg_validate_int_range(wrap, -1, program_len - 1, MP_QSTR_wrap); + if (wrap == -1) { + wrap = program_len - 1; + } + + mp_arg_validate_int_range(wrap_target, 0, program_len - 1, MP_QSTR_wrap_target); + + wrap += program_offset; + wrap_target += program_offset; + + sm_config_set_wrap(&c, wrap_target, wrap); sm_config_set_in_shift(&c, in_shift_right, auto_push, push_threshold); sm_config_set_out_shift(&c, out_shift_right, auto_pull, pull_threshold); @@ -348,7 +360,8 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, bool auto_pull, uint8_t pull_threshold, bool out_shift_right, bool wait_for_txstall, bool auto_push, uint8_t push_threshold, bool in_shift_right, - bool user_interruptible) { + bool user_interruptible, + int wrap_target, int wrap) { // First, check that all pins are free OR already in use by any PIO if exclusive_pin_use is false. uint32_t pins_we_use = wait_gpio_mask; @@ -510,7 +523,8 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, auto_push, push_threshold, in_shift_right, true /* claim pins */, user_interruptible, - sideset_enable); + sideset_enable, + wrap_target, wrap); if (!ok) { mp_raise_RuntimeError(translate("All state machines in use")); } @@ -834,10 +848,3 @@ uint8_t rp2pio_statemachine_program_offset(rp2pio_statemachine_obj_t *self) { uint8_t sm = self->state_machine; return _current_program_offset[pio_index][sm]; } - -void rp2pio_statemachine_set_wrap(rp2pio_statemachine_obj_t *self, uint wrap_target, uint wrap) { - uint8_t sm = self->state_machine; - uint8_t offset = rp2pio_statemachine_program_offset(self); - - pio_sm_set_wrap(self->pio, sm, offset + wrap_target, offset + wrap); -} diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.h b/ports/raspberrypi/common-hal/rp2pio/StateMachine.h index 125e0fa68b..0e8e7a3806 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.h +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.h @@ -76,10 +76,10 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, bool auto_push, uint8_t push_threshold, bool in_shift_right, bool claim_pins, bool interruptible, - bool sideset_enable); + bool sideset_enable, + int wrap_target, int wrap); uint8_t rp2pio_statemachine_program_offset(rp2pio_statemachine_obj_t *self); -void rp2pio_statemachine_set_wrap(rp2pio_statemachine_obj_t *self, uint wrap_target, uint wrap); void rp2pio_statemachine_deinit(rp2pio_statemachine_obj_t *self, bool leave_pins); From 729fcf749ea3981349b949746e38365e156fdf79 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 15 Feb 2022 16:03:52 -0600 Subject: [PATCH 02/98] Fix doc markup --- ports/raspberrypi/bindings/rp2pio/StateMachine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index 557b15617d..98213be265 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -139,8 +139,8 @@ //| that causes an infinite loop, you will be able to interrupt the loop. //| However, if you are writing to a device that can get into a bad state if a read or write //| is interrupted, you may want to set this to False after your program has been vetted. -//| :param int wrap_target The target instruction number of automatic wrap. Defaults to the first instruction of the program. -//| :param int wrap The instruction after which to wrap to the ``wrap`` +//| :param int wrap_target: The target instruction number of automatic wrap. Defaults to the first instruction of the program. +//| :param int wrap: The instruction after which to wrap to the ``wrap`` //| instruction. As a special case, -1 (the default) indicates the //| last instruction of the program. //| """ From ba229f1007b82e614c62e106ba32cb628c45e378 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 19 Feb 2022 10:41:42 -0600 Subject: [PATCH 03/98] Initial commit of uzlib module --- lib/uzlib/uzlib.h | 2 + py/circuitpy_defns.mk | 16 +++++ py/circuitpy_mpconfig.mk | 4 ++ shared-bindings/uzlib/DecompIO.c | 86 ++++++++++++++++++++++++++ shared-bindings/uzlib/DecompIO.h | 37 +++++++++++ shared-bindings/uzlib/__init__.c | 72 ++++++++++++++++++++++ shared-bindings/uzlib/__init__.h | 32 ++++++++++ shared-module/uzlib/DecompIO.c | 101 +++++++++++++++++++++++++++++++ shared-module/uzlib/DecompIO.h | 44 ++++++++++++++ shared-module/uzlib/__init__.c | 100 ++++++++++++++++++++++++++++++ 10 files changed, 494 insertions(+) create mode 100644 shared-bindings/uzlib/DecompIO.c create mode 100644 shared-bindings/uzlib/DecompIO.h create mode 100644 shared-bindings/uzlib/__init__.c create mode 100644 shared-bindings/uzlib/__init__.h create mode 100644 shared-module/uzlib/DecompIO.c create mode 100644 shared-module/uzlib/DecompIO.h create mode 100644 shared-module/uzlib/__init__.c diff --git a/lib/uzlib/uzlib.h b/lib/uzlib/uzlib.h index 3a4a1ad160..7d8949543e 100644 --- a/lib/uzlib/uzlib.h +++ b/lib/uzlib/uzlib.h @@ -83,6 +83,8 @@ typedef struct { } TINF_TREE; struct uzlib_uncomp { + /* Point to the CircuitPython object that owns this decompression stream */ + void *self; /* Pointer to the next byte in the input buffer */ const unsigned char *source; /* Pointer to the next byte past the input buffer (source_limit = source + len) */ diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 15828f6616..044dc143c7 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -321,6 +321,9 @@ endif ifeq ($(CIRCUITPY_USTACK),1) SRC_PATTERNS += ustack/% endif +ifeq ($(CIRCUITPY_UZLIB),1) +SRC_PATTERNS += uzlib/% +endif ifeq ($(CIRCUITPY_VIDEOCORE),1) SRC_PATTERNS += videocore/% endif @@ -578,6 +581,8 @@ SRC_SHARED_MODULE_ALL = \ traceback/__init__.c \ uheap/__init__.c \ ustack/__init__.c \ + uzlib/__init__.c \ + uzlib/DecompIO.c \ vectorio/Circle.c \ vectorio/Polygon.c \ vectorio/Rectangle.c \ @@ -634,6 +639,17 @@ SRC_MOD += $(addprefix lib/protomatter/src/, \ $(BUILD)/lib/protomatter/src/core.o: CFLAGS += -include "shared-module/rgbmatrix/allocator.h" -DCIRCUITPY -Wno-missing-braces -Wno-missing-prototypes endif +ifeq ($(CIRCUITPY_UZLIB),1) +SRC_MOD += $(addprefix lib/uzlib/, \ + tinflate.c \ + tinfzlib.c \ + tinfgzip.c \ + adler32.c \ + crc32.c \ +) +$(BUILD)/lib/uzlib/tinflate.o: CFLAGS += -Wno-missing-braces -Wno-missing-prototypes +endif + # All possible sources are listed here, and are filtered by SRC_PATTERNS. SRC_SHARED_MODULE_INTERNAL = \ $(filter $(SRC_PATTERNS), \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 14852580e5..b4b6b8ddd7 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -446,6 +446,10 @@ CFLAGS += -DUSB_NUM_ENDPOINT_PAIRS=$(USB_NUM_ENDPOINT_PAIRS) CIRCUITPY_USTACK ?= 0 CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK) +# for decompressing utlities +CIRCUITPY_UZLIB ?= 1 +CFLAGS += -DCIRCUITPY_UZLIB=$(CIRCUITPY_UZLIB) + # ulab numerics library CIRCUITPY_ULAB ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB) diff --git a/shared-bindings/uzlib/DecompIO.c b/shared-bindings/uzlib/DecompIO.c new file mode 100644 index 0000000000..5151113385 --- /dev/null +++ b/shared-bindings/uzlib/DecompIO.c @@ -0,0 +1,86 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Mark Komus + * + * 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/obj.h" +#include "py/stream.h" +#include "py/runtime.h" +#include "shared-bindings/uzlib/DecompIO.h" +#include "shared-module/uzlib/DecompIO.h" + +STATIC mp_obj_t uzlib_decompio_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, 2, false); + mp_get_stream_raise(args[0], MP_STREAM_OP_READ); + + mp_obj_decompio_t *self = m_new_obj(mp_obj_decompio_t); + self->base.type = type; + memset(&self->decomp, 0, sizeof(self->decomp)); + + mp_int_t dict_opt = 0; + if (n_args > 1) { + dict_opt = mp_obj_get_int(args[1]); + } + + common_hal_uzlib_decompio_construct(self, args[0], dict_opt); + + return MP_OBJ_FROM_PTR(self); +} + +STATIC mp_uint_t uzlib_decompio_read(mp_obj_t self_in, void *buf, mp_uint_t size, int *errcode) { + mp_obj_decompio_t *self = MP_OBJ_TO_PTR(self_in); + if (self->eof) { + return 0; + } + + return common_hal_uzlib_decompio_read(self, buf, size, errcode); +} + +STATIC const mp_rom_map_elem_t decompio_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) }, + { MP_ROM_QSTR(MP_QSTR_readline), MP_ROM_PTR(&mp_stream_unbuffered_readline_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(decompio_locals_dict, decompio_locals_dict_table); + +STATIC const mp_stream_p_t decompio_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) + .read = uzlib_decompio_read, + .write = NULL, + .ioctl = NULL, + .is_text = false, +}; + +const mp_obj_type_t decompio_type = { + { &mp_type_type }, + .flags = MP_TYPE_FLAG_EXTENDED, + .name = MP_QSTR_DecompIO, + .make_new = uzlib_decompio_make_new, + .locals_dict = (void *)&decompio_locals_dict, + MP_TYPE_EXTENDED_FIELDS( + .protocol = &decompio_stream_p, + ), +}; diff --git a/shared-bindings/uzlib/DecompIO.h b/shared-bindings/uzlib/DecompIO.h new file mode 100644 index 0000000000..65f0c9d9ae --- /dev/null +++ b/shared-bindings/uzlib/DecompIO.h @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Mark Komus + * + * 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_UZLIB_DECOMPIO_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_UZLIB_DECOMPIO_H + +#include "shared-module/uzlib/DecompIO.h" + +extern const mp_obj_type_t decompio_type; + +extern void common_hal_uzlib_decompio_construct(mp_obj_decompio_t *self, mp_obj_t src_stream, mp_int_t dict_opt); +extern mp_uint_t common_hal_uzlib_decompio_read(mp_obj_decompio_t *self, void *buf, mp_uint_t size, int *errcode); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_UZLIB_DECOMPIO_H diff --git a/shared-bindings/uzlib/__init__.c b/shared-bindings/uzlib/__init__.c new file mode 100644 index 0000000000..c8fad450fb --- /dev/null +++ b/shared-bindings/uzlib/__init__.c @@ -0,0 +1,72 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Mark Komus + * + * 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 + +#include "py/obj.h" +#include "py/runtime.h" +#include "py/stream.h" +#include "py/mperrno.h" +#include "py/builtin.h" +#include "py/objtuple.h" +#include "py/binary.h" +#include "py/parsenum.h" + +#include "shared-bindings/uzlib/DecompIO.h" + +#include "supervisor/shared/translate.h" + +#include "shared-bindings/uzlib/__init__.h" +#include "shared-bindings/uzlib/DecompIO.h" + +STATIC mp_obj_t uzlib_decompress(size_t n_args, const mp_obj_t *args) { + // TODO: Check number of args + + bool is_zlib = true; + if (n_args > 1 && MP_OBJ_SMALL_INT_VALUE(args[1]) < 0) { + is_zlib = false; + } + + return common_hal_uzlib_decompress(args[0], is_zlib); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(uzlib_decompress_obj, 1, 3, uzlib_decompress); + +STATIC const mp_rom_map_elem_t uzlib_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_uzlib) }, + { MP_ROM_QSTR(MP_QSTR_decompress), MP_ROM_PTR(&uzlib_decompress_obj) }, + { MP_ROM_QSTR(MP_QSTR_DecompIO), MP_ROM_PTR(&decompio_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(uzlib_globals, uzlib_globals_table); + +const mp_obj_module_t uzlib_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&uzlib_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_uzlib, uzlib_module, CIRCUITPY_UZLIB); diff --git a/shared-bindings/uzlib/__init__.h b/shared-bindings/uzlib/__init__.h new file mode 100644 index 0000000000..b365317a94 --- /dev/null +++ b/shared-bindings/uzlib/__init__.h @@ -0,0 +1,32 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Mark Komus + * + * 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_UZLIB___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_UZLIB___INIT___H + +mp_obj_t common_hal_uzlib_decompress(mp_obj_t data, bool is_zlib); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_UZLIB___INIT___H diff --git a/shared-module/uzlib/DecompIO.c b/shared-module/uzlib/DecompIO.c new file mode 100644 index 0000000000..7df944f4e8 --- /dev/null +++ b/shared-module/uzlib/DecompIO.c @@ -0,0 +1,101 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Mark Komus + * + * 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 + +#include "py/obj.h" +#include "py/runtime.h" +#include "py/stream.h" +#include "py/mperrno.h" +#include "py/builtin.h" +#include "py/objtuple.h" +#include "py/binary.h" +#include "py/parsenum.h" + +#include "shared-bindings/uzlib/__init__.h" +#include "shared-bindings/uzlib/DecompIO.h" +#include "shared-module/uzlib/DecompIO.h" + +STATIC int read_src_stream(TINF_DATA *data) { + mp_obj_decompio_t *self = (mp_obj_decompio_t *)data->self; + + const mp_stream_p_t *stream = mp_get_stream_raise(self->src_stream, MP_STREAM_OP_READ); + int err; + byte c; + mp_uint_t out_sz = stream->read(self->src_stream, &c, 1, &err); + + if (out_sz == MP_STREAM_ERROR) { + mp_raise_OSError(err); + } + if (out_sz == 0) { + mp_raise_type(&mp_type_EOFError); + } + return c; +} + +void common_hal_uzlib_decompio_construct(mp_obj_decompio_t *self, mp_obj_t src_stream, mp_int_t dict_opt) { + self->decomp.self = self; + self->decomp.readSource = read_src_stream; + self->src_stream = src_stream; + self->eof = false; + + int dict_sz; + + if (dict_opt >= 16) { + int st = uzlib_gzip_parse_header(&self->decomp); + if (st != TINF_OK) { + goto header_error; + } + dict_sz = 1 << (dict_opt - 16); + } else if (dict_opt >= 0) { + dict_opt = uzlib_zlib_parse_header(&self->decomp); + if (dict_opt < 0) { + header_error: + mp_raise_ValueError(MP_ERROR_TEXT("compression header")); + } + dict_sz = 1 << dict_opt; + } else { + dict_sz = 1 << -dict_opt; + } + + uzlib_uncompress_init(&self->decomp, m_new(byte, dict_sz), dict_sz); +} + +mp_uint_t common_hal_uzlib_decompio_read(mp_obj_decompio_t *self, void *buf, mp_uint_t size, int *errcode) { + self->decomp.dest = buf; + self->decomp.dest_limit = (unsigned char *)buf + size; + int st = uzlib_uncompress_chksum(&self->decomp); + if (st == TINF_DONE) { + self->eof = true; + } + if (st < 0) { + *errcode = MP_EINVAL; + return MP_STREAM_ERROR; + } + return self->decomp.dest - (byte *)buf; +} diff --git a/shared-module/uzlib/DecompIO.h b/shared-module/uzlib/DecompIO.h new file mode 100644 index 0000000000..9ca583dbb8 --- /dev/null +++ b/shared-module/uzlib/DecompIO.h @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Mark Komus + * + * 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. + */ + +#ifndef SHARED_MODULE_UZLIB_DECOMPIO_H +#define SHARED_MODULE_UZLIB_DECOMPIO_H + +#include +#include + +#include "py/obj.h" +#define UZLIB_CONF_PARANOID_CHECKS (1) +#include "lib/uzlib/tinf.h" + +typedef struct _mp_obj_decompio_t { + mp_obj_base_t base; + mp_obj_t src_stream; + TINF_DATA decomp; + bool eof; +} mp_obj_decompio_t; + +#endif /* SHARED_MODULE_UZLIB_DECOMPIO_H */ diff --git a/shared-module/uzlib/__init__.c b/shared-module/uzlib/__init__.c new file mode 100644 index 0000000000..3fe75c69b1 --- /dev/null +++ b/shared-module/uzlib/__init__.c @@ -0,0 +1,100 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Mark Komus + * + * 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 + +#include "py/obj.h" +#include "py/runtime.h" +#include "py/stream.h" +#include "py/mperrno.h" +#include "py/builtin.h" +#include "py/objtuple.h" +#include "py/binary.h" +#include "py/parsenum.h" + +#include "shared-bindings/uzlib/__init__.h" + +#define UZLIB_CONF_PARANOID_CHECKS (1) +#include "lib/uzlib/tinf.h" + +#if 0 // print debugging info +#define DEBUG_printf DEBUG_printf +#else // don't print debugging info +#define DEBUG_printf(...) (void)0 +#endif + +mp_obj_t common_hal_uzlib_decompress(mp_obj_t data, bool is_zlib) { + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(data, &bufinfo, MP_BUFFER_READ); + + TINF_DATA *decomp = m_new_obj(TINF_DATA); + memset(decomp, 0, sizeof(*decomp)); + DEBUG_printf("sizeof(TINF_DATA)=" UINT_FMT "\n", sizeof(*decomp)); + uzlib_uncompress_init(decomp, NULL, 0); + mp_uint_t dest_buf_size = (bufinfo.len + 15) & ~15; + byte *dest_buf = m_new(byte, dest_buf_size); + + decomp->dest = dest_buf; + decomp->dest_limit = dest_buf + dest_buf_size; + DEBUG_printf("uzlib: Initial out buffer: " UINT_FMT " bytes\n", decomp->destSize); + decomp->source = bufinfo.buf; + decomp->source_limit = (unsigned char *)bufinfo.buf + bufinfo.len; + int st; + + if (is_zlib) { + st = uzlib_zlib_parse_header(decomp); + if (st < 0) { + goto error; + } + } + + while (1) { + st = uzlib_uncompress_chksum(decomp); + if (st < 0) { + goto error; + } + if (st == TINF_DONE) { + break; + } + size_t offset = decomp->dest - dest_buf; + dest_buf = m_renew(byte, dest_buf, dest_buf_size, dest_buf_size + 256); + dest_buf_size += 256; + decomp->dest = dest_buf + offset; + decomp->dest_limit = dest_buf + offset + 256; + } + + mp_uint_t final_sz = decomp->dest - dest_buf; + DEBUG_printf("uzlib: Resizing from " UINT_FMT " to final size: " UINT_FMT " bytes\n", dest_buf_size, final_sz); + dest_buf = (byte *)m_renew(byte, dest_buf, dest_buf_size, final_sz); + mp_obj_t res = mp_obj_new_bytearray_by_ref(final_sz, dest_buf); + m_del_obj(TINF_DATA, decomp); + return res; + +error: + mp_raise_type_arg(&mp_type_ValueError, MP_OBJ_NEW_SMALL_INT(st)); +} From 664e02535b1661e687afecd7886382126d4c8ede Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sun, 20 Feb 2022 15:32:44 -0600 Subject: [PATCH 04/98] Renaming and documentation --- locale/circuitpython.pot | 2 +- py/circuitpy_defns.mk | 10 +- py/circuitpy_mpconfig.mk | 4 +- shared-bindings/uzlib/DecompIO.c | 86 -------------- shared-bindings/uzlib/__init__.c | 72 ----------- shared-bindings/zlib/DecompIO.c | 132 +++++++++++++++++++++ shared-bindings/{uzlib => zlib}/DecompIO.h | 12 +- shared-bindings/zlib/__init__.c | 89 ++++++++++++++ shared-bindings/{uzlib => zlib}/__init__.h | 8 +- shared-module/{uzlib => zlib}/DecompIO.c | 10 +- shared-module/{uzlib => zlib}/DecompIO.h | 6 +- shared-module/{uzlib => zlib}/__init__.c | 8 +- 12 files changed, 251 insertions(+), 188 deletions(-) delete mode 100644 shared-bindings/uzlib/DecompIO.c delete mode 100644 shared-bindings/uzlib/__init__.c create mode 100644 shared-bindings/zlib/DecompIO.c rename shared-bindings/{uzlib => zlib}/DecompIO.h (73%) create mode 100644 shared-bindings/zlib/__init__.c rename shared-bindings/{uzlib => zlib}/__init__.h (83%) rename shared-module/{uzlib => zlib}/DecompIO.c (89%) rename shared-module/{uzlib => zlib}/DecompIO.h (92%) rename shared-module/{uzlib => zlib}/__init__.c (90%) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 336dd49daf..776c0291b3 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -3016,7 +3016,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "" diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 044dc143c7..07a8d2fd86 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -321,8 +321,8 @@ endif ifeq ($(CIRCUITPY_USTACK),1) SRC_PATTERNS += ustack/% endif -ifeq ($(CIRCUITPY_UZLIB),1) -SRC_PATTERNS += uzlib/% +ifeq ($(CIRCUITPY_ZLIB),1) +SRC_PATTERNS += zlib/% endif ifeq ($(CIRCUITPY_VIDEOCORE),1) SRC_PATTERNS += videocore/% @@ -581,8 +581,8 @@ SRC_SHARED_MODULE_ALL = \ traceback/__init__.c \ uheap/__init__.c \ ustack/__init__.c \ - uzlib/__init__.c \ - uzlib/DecompIO.c \ + zlib/__init__.c \ + zlib/DecompIO.c \ vectorio/Circle.c \ vectorio/Polygon.c \ vectorio/Rectangle.c \ @@ -639,7 +639,7 @@ SRC_MOD += $(addprefix lib/protomatter/src/, \ $(BUILD)/lib/protomatter/src/core.o: CFLAGS += -include "shared-module/rgbmatrix/allocator.h" -DCIRCUITPY -Wno-missing-braces -Wno-missing-prototypes endif -ifeq ($(CIRCUITPY_UZLIB),1) +ifeq ($(CIRCUITPY_ZLIB),1) SRC_MOD += $(addprefix lib/uzlib/, \ tinflate.c \ tinfzlib.c \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index b4b6b8ddd7..bd4e8fe3c7 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -447,8 +447,8 @@ CIRCUITPY_USTACK ?= 0 CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK) # for decompressing utlities -CIRCUITPY_UZLIB ?= 1 -CFLAGS += -DCIRCUITPY_UZLIB=$(CIRCUITPY_UZLIB) +CIRCUITPY_ZLIB ?= 1 +CFLAGS += -DCIRCUITPY_ZLIB=$(CIRCUITPY_ZLIB) # ulab numerics library CIRCUITPY_ULAB ?= $(CIRCUITPY_FULL_BUILD) diff --git a/shared-bindings/uzlib/DecompIO.c b/shared-bindings/uzlib/DecompIO.c deleted file mode 100644 index 5151113385..0000000000 --- a/shared-bindings/uzlib/DecompIO.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2022 Mark Komus - * - * 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/obj.h" -#include "py/stream.h" -#include "py/runtime.h" -#include "shared-bindings/uzlib/DecompIO.h" -#include "shared-module/uzlib/DecompIO.h" - -STATIC mp_obj_t uzlib_decompio_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, 2, false); - mp_get_stream_raise(args[0], MP_STREAM_OP_READ); - - mp_obj_decompio_t *self = m_new_obj(mp_obj_decompio_t); - self->base.type = type; - memset(&self->decomp, 0, sizeof(self->decomp)); - - mp_int_t dict_opt = 0; - if (n_args > 1) { - dict_opt = mp_obj_get_int(args[1]); - } - - common_hal_uzlib_decompio_construct(self, args[0], dict_opt); - - return MP_OBJ_FROM_PTR(self); -} - -STATIC mp_uint_t uzlib_decompio_read(mp_obj_t self_in, void *buf, mp_uint_t size, int *errcode) { - mp_obj_decompio_t *self = MP_OBJ_TO_PTR(self_in); - if (self->eof) { - return 0; - } - - return common_hal_uzlib_decompio_read(self, buf, size, errcode); -} - -STATIC const mp_rom_map_elem_t decompio_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) }, - { MP_ROM_QSTR(MP_QSTR_readline), MP_ROM_PTR(&mp_stream_unbuffered_readline_obj) }, -}; - -STATIC MP_DEFINE_CONST_DICT(decompio_locals_dict, decompio_locals_dict_table); - -STATIC const mp_stream_p_t decompio_stream_p = { - MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) - .read = uzlib_decompio_read, - .write = NULL, - .ioctl = NULL, - .is_text = false, -}; - -const mp_obj_type_t decompio_type = { - { &mp_type_type }, - .flags = MP_TYPE_FLAG_EXTENDED, - .name = MP_QSTR_DecompIO, - .make_new = uzlib_decompio_make_new, - .locals_dict = (void *)&decompio_locals_dict, - MP_TYPE_EXTENDED_FIELDS( - .protocol = &decompio_stream_p, - ), -}; diff --git a/shared-bindings/uzlib/__init__.c b/shared-bindings/uzlib/__init__.c deleted file mode 100644 index c8fad450fb..0000000000 --- a/shared-bindings/uzlib/__init__.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2022 Mark Komus - * - * 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 - -#include "py/obj.h" -#include "py/runtime.h" -#include "py/stream.h" -#include "py/mperrno.h" -#include "py/builtin.h" -#include "py/objtuple.h" -#include "py/binary.h" -#include "py/parsenum.h" - -#include "shared-bindings/uzlib/DecompIO.h" - -#include "supervisor/shared/translate.h" - -#include "shared-bindings/uzlib/__init__.h" -#include "shared-bindings/uzlib/DecompIO.h" - -STATIC mp_obj_t uzlib_decompress(size_t n_args, const mp_obj_t *args) { - // TODO: Check number of args - - bool is_zlib = true; - if (n_args > 1 && MP_OBJ_SMALL_INT_VALUE(args[1]) < 0) { - is_zlib = false; - } - - return common_hal_uzlib_decompress(args[0], is_zlib); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(uzlib_decompress_obj, 1, 3, uzlib_decompress); - -STATIC const mp_rom_map_elem_t uzlib_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_uzlib) }, - { MP_ROM_QSTR(MP_QSTR_decompress), MP_ROM_PTR(&uzlib_decompress_obj) }, - { MP_ROM_QSTR(MP_QSTR_DecompIO), MP_ROM_PTR(&decompio_type) }, -}; - -STATIC MP_DEFINE_CONST_DICT(uzlib_globals, uzlib_globals_table); - -const mp_obj_module_t uzlib_module = { - .base = { &mp_type_module }, - .globals = (mp_obj_dict_t *)&uzlib_globals, -}; - -MP_REGISTER_MODULE(MP_QSTR_uzlib, uzlib_module, CIRCUITPY_UZLIB); diff --git a/shared-bindings/zlib/DecompIO.c b/shared-bindings/zlib/DecompIO.c new file mode 100644 index 0000000000..7416bcd9da --- /dev/null +++ b/shared-bindings/zlib/DecompIO.c @@ -0,0 +1,132 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Mark Komus + * + * 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/obj.h" +#include "py/stream.h" +#include "py/runtime.h" +#include "shared-bindings/zlib/DecompIO.h" +#include "shared-module/zlib/DecompIO.h" + +//| class DecompIO: +//| """A stream wrapper which allows transparent decompression of compressed data in +//| another stream. This allows to process compressed streams with data larger +//| than available heap size. +//| +//| *wbits* is DEFLATE dictionary window size used during compression (8-15, the +//| dictionary size is power of 2 of that value). Additionally, if value is positive, +//| *data* is assumed to be zlib stream (with zlib header). Otherwise, if it's +//| negative, it's assumed to be raw DEFLATE stream. *wbits* values 24..31 (16 + 8..15) +//| mean that input stream has gzip header.""" +//| +//| def __init__(self, stream: IO[AnyStr], wbits: Optional[int] = 0) -> None: +//| """Creates a DecompIO object to decompress stream data. +//| """ +//| ... +//| + +// These are standard stream methods. Code is in py/stream.c. +// +//| def read(self, nbytes: Optional[int] = None) -> Optional[bytes]: +//| """Read characters. If ``nbytes`` is specified then read at most that many +//| bytes. Otherwise, read everything that arrives until the connection +//| times out. Providing the number of bytes expected is highly recommended +//| because it will be faster. +//| +//| :return: Data read +//| :rtype: bytes or None""" +//| ... +//| +//| def readinto(self, buf: WriteableBuffer, nbytes: Optional[int] = None) -> Optional[bytes]: +//| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most +//| that many bytes. Otherwise, read at most ``len(buf)`` bytes. +//| +//| :return: number of bytes read and stored into ``buf`` +//| :rtype: bytes or None""" +//| ... +//| +//| def readline(self, nbytes: Optional[int] = None) -> Optional[bytes]: +//| """Read and return one line from the stream. The line terminator is always b'\n'. +//| If ``nbytes`` is specified then read at most that many bytes. +//| +//| :return: Data read +//| :rtype: bytes or None""" +//| ... +//| + +STATIC mp_obj_t zlib_decompio_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, 2, false); + mp_get_stream_raise(args[0], MP_STREAM_OP_READ); + + mp_obj_decompio_t *self = m_new_obj(mp_obj_decompio_t); + self->base.type = type; + memset(&self->decomp, 0, sizeof(self->decomp)); + + mp_int_t dict_opt = 0; + if (n_args > 1) { + dict_opt = mp_obj_get_int(args[1]); + } + + common_hal_zlib_decompio_construct(self, args[0], dict_opt); + + return MP_OBJ_FROM_PTR(self); +} + +STATIC mp_uint_t zlib_decompio_read(mp_obj_t self_in, void *buf, mp_uint_t size, int *errcode) { + mp_obj_decompio_t *self = MP_OBJ_TO_PTR(self_in); + if (self->eof) { + return 0; + } + + return common_hal_zlib_decompio_read(self, buf, size, errcode); +} + +STATIC const mp_rom_map_elem_t decompio_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) }, + { MP_ROM_QSTR(MP_QSTR_readline), MP_ROM_PTR(&mp_stream_unbuffered_readline_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(decompio_locals_dict, decompio_locals_dict_table); + +STATIC const mp_stream_p_t decompio_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) + .read = zlib_decompio_read, + .write = NULL, + .ioctl = NULL, + .is_text = false, +}; + +const mp_obj_type_t decompio_type = { + { &mp_type_type }, + .flags = MP_TYPE_FLAG_EXTENDED, + .name = MP_QSTR_DecompIO, + .make_new = zlib_decompio_make_new, + .locals_dict = (void *)&decompio_locals_dict, + MP_TYPE_EXTENDED_FIELDS( + .protocol = &decompio_stream_p, + ), +}; diff --git a/shared-bindings/uzlib/DecompIO.h b/shared-bindings/zlib/DecompIO.h similarity index 73% rename from shared-bindings/uzlib/DecompIO.h rename to shared-bindings/zlib/DecompIO.h index 65f0c9d9ae..65a90cbfb8 100644 --- a/shared-bindings/uzlib/DecompIO.h +++ b/shared-bindings/zlib/DecompIO.h @@ -24,14 +24,14 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_UZLIB_DECOMPIO_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_UZLIB_DECOMPIO_H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_ZLIB_DECOMPIO_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_ZLIB_DECOMPIO_H -#include "shared-module/uzlib/DecompIO.h" +#include "shared-module/zlib/DecompIO.h" extern const mp_obj_type_t decompio_type; -extern void common_hal_uzlib_decompio_construct(mp_obj_decompio_t *self, mp_obj_t src_stream, mp_int_t dict_opt); -extern mp_uint_t common_hal_uzlib_decompio_read(mp_obj_decompio_t *self, void *buf, mp_uint_t size, int *errcode); +extern void common_hal_zlib_decompio_construct(mp_obj_decompio_t *self, mp_obj_t src_stream, mp_int_t dict_opt); +extern mp_uint_t common_hal_zlib_decompio_read(mp_obj_decompio_t *self, void *buf, mp_uint_t size, int *errcode); -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_UZLIB_DECOMPIO_H +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_ZLIB_DECOMPIO_H diff --git a/shared-bindings/zlib/__init__.c b/shared-bindings/zlib/__init__.c new file mode 100644 index 0000000000..4e85ad2c89 --- /dev/null +++ b/shared-bindings/zlib/__init__.c @@ -0,0 +1,89 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Mark Komus + * + * 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 + +#include "py/obj.h" +#include "py/runtime.h" +#include "py/stream.h" +#include "py/mperrno.h" +#include "py/builtin.h" +#include "py/objtuple.h" +#include "py/binary.h" +#include "py/parsenum.h" + +#include "shared-bindings/zlib/DecompIO.h" +#include "shared-bindings/zlib/__init__.h" + +#include "supervisor/shared/translate.h" + +//| """zlib decompression functionality +//| +//| The `zlib` module allows limited functionality similar to the CPython zlib library. +//| This module allows to decompress binary data compressed with DEFLATE algorithm +//| (commonly used in zlib library and gzip archiver). Compression is not yet implemented.""" +//| + +//| def zlib_decompress(data: bytes, wbits: Optional[int] = 0, bufsize: Optional[int] = 0) -> bytes: +//| """Return decompressed *data* as bytes. *wbits* is DEFLATE dictionary window +//| size used during compression (8-15, the dictionary size is power of 2 of +//| that value). Additionally, if value is positive, *data* is assumed to be +//| zlib stream (with zlib header). Otherwise, if it's negative, it's assumed +//| to be raw DEFLATE stream. *bufsize* parameter is for compatibility with +//| CPython and is ignored. +//| +//| :param ~bytes data: data to be decompressed +//| :param ~int wbits: DEFLATE dictionary window size used during compression +//| :param ~int bufsize: ignored for compatibility with CPython only +//| """ +//| ... +//| +STATIC mp_obj_t zlib_decompress(size_t n_args, const mp_obj_t *args) { + bool is_zlib = true; + if (n_args > 1 && MP_OBJ_SMALL_INT_VALUE(args[1]) < 0) { + is_zlib = false; + } + + return common_hal_zlib_decompress(args[0], is_zlib); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(zlib_decompress_obj, 1, 3, zlib_decompress); + +STATIC const mp_rom_map_elem_t zlib_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_zlib) }, + { MP_ROM_QSTR(MP_QSTR_decompress), MP_ROM_PTR(&zlib_decompress_obj) }, + { MP_ROM_QSTR(MP_QSTR_DecompIO), MP_ROM_PTR(&decompio_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(zlib_globals, zlib_globals_table); + +const mp_obj_module_t zlib_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&zlib_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_zlib, zlib_module, CIRCUITPY_ZLIB); diff --git a/shared-bindings/uzlib/__init__.h b/shared-bindings/zlib/__init__.h similarity index 83% rename from shared-bindings/uzlib/__init__.h rename to shared-bindings/zlib/__init__.h index b365317a94..232d08e294 100644 --- a/shared-bindings/uzlib/__init__.h +++ b/shared-bindings/zlib/__init__.h @@ -24,9 +24,9 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_UZLIB___INIT___H -#define MICROPY_INCLUDED_SHARED_BINDINGS_UZLIB___INIT___H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_ZLIB___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_ZLIB___INIT___H -mp_obj_t common_hal_uzlib_decompress(mp_obj_t data, bool is_zlib); +mp_obj_t common_hal_zlib_decompress(mp_obj_t data, bool is_zlib); -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_UZLIB___INIT___H +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_ZLIB___INIT___H diff --git a/shared-module/uzlib/DecompIO.c b/shared-module/zlib/DecompIO.c similarity index 89% rename from shared-module/uzlib/DecompIO.c rename to shared-module/zlib/DecompIO.c index 7df944f4e8..b182304f19 100644 --- a/shared-module/uzlib/DecompIO.c +++ b/shared-module/zlib/DecompIO.c @@ -37,9 +37,9 @@ #include "py/binary.h" #include "py/parsenum.h" -#include "shared-bindings/uzlib/__init__.h" -#include "shared-bindings/uzlib/DecompIO.h" -#include "shared-module/uzlib/DecompIO.h" +#include "shared-bindings/zlib/__init__.h" +#include "shared-bindings/zlib/DecompIO.h" +#include "shared-module/zlib/DecompIO.h" STATIC int read_src_stream(TINF_DATA *data) { mp_obj_decompio_t *self = (mp_obj_decompio_t *)data->self; @@ -58,7 +58,7 @@ STATIC int read_src_stream(TINF_DATA *data) { return c; } -void common_hal_uzlib_decompio_construct(mp_obj_decompio_t *self, mp_obj_t src_stream, mp_int_t dict_opt) { +void common_hal_zlib_decompio_construct(mp_obj_decompio_t *self, mp_obj_t src_stream, mp_int_t dict_opt) { self->decomp.self = self; self->decomp.readSource = read_src_stream; self->src_stream = src_stream; @@ -86,7 +86,7 @@ void common_hal_uzlib_decompio_construct(mp_obj_decompio_t *self, mp_obj_t src_s uzlib_uncompress_init(&self->decomp, m_new(byte, dict_sz), dict_sz); } -mp_uint_t common_hal_uzlib_decompio_read(mp_obj_decompio_t *self, void *buf, mp_uint_t size, int *errcode) { +mp_uint_t common_hal_zlib_decompio_read(mp_obj_decompio_t *self, void *buf, mp_uint_t size, int *errcode) { self->decomp.dest = buf; self->decomp.dest_limit = (unsigned char *)buf + size; int st = uzlib_uncompress_chksum(&self->decomp); diff --git a/shared-module/uzlib/DecompIO.h b/shared-module/zlib/DecompIO.h similarity index 92% rename from shared-module/uzlib/DecompIO.h rename to shared-module/zlib/DecompIO.h index 9ca583dbb8..51e64cc1c0 100644 --- a/shared-module/uzlib/DecompIO.h +++ b/shared-module/zlib/DecompIO.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef SHARED_MODULE_UZLIB_DECOMPIO_H -#define SHARED_MODULE_UZLIB_DECOMPIO_H +#ifndef SHARED_MODULE_ZLIB_DECOMPIO_H +#define SHARED_MODULE_ZLIB_DECOMPIO_H #include #include @@ -41,4 +41,4 @@ typedef struct _mp_obj_decompio_t { bool eof; } mp_obj_decompio_t; -#endif /* SHARED_MODULE_UZLIB_DECOMPIO_H */ +#endif /* SHARED_MODULE_ZLIB_DECOMPIO_H */ diff --git a/shared-module/uzlib/__init__.c b/shared-module/zlib/__init__.c similarity index 90% rename from shared-module/uzlib/__init__.c rename to shared-module/zlib/__init__.c index 3fe75c69b1..a057e6e2f7 100644 --- a/shared-module/uzlib/__init__.c +++ b/shared-module/zlib/__init__.c @@ -37,7 +37,7 @@ #include "py/binary.h" #include "py/parsenum.h" -#include "shared-bindings/uzlib/__init__.h" +#include "shared-bindings/zlib/__init__.h" #define UZLIB_CONF_PARANOID_CHECKS (1) #include "lib/uzlib/tinf.h" @@ -48,7 +48,7 @@ #define DEBUG_printf(...) (void)0 #endif -mp_obj_t common_hal_uzlib_decompress(mp_obj_t data, bool is_zlib) { +mp_obj_t common_hal_zlib_decompress(mp_obj_t data, bool is_zlib) { mp_buffer_info_t bufinfo; mp_get_buffer_raise(data, &bufinfo, MP_BUFFER_READ); @@ -61,7 +61,7 @@ mp_obj_t common_hal_uzlib_decompress(mp_obj_t data, bool is_zlib) { decomp->dest = dest_buf; decomp->dest_limit = dest_buf + dest_buf_size; - DEBUG_printf("uzlib: Initial out buffer: " UINT_FMT " bytes\n", decomp->destSize); + DEBUG_printf("zlib: Initial out buffer: " UINT_FMT " bytes\n", decomp->destSize); decomp->source = bufinfo.buf; decomp->source_limit = (unsigned char *)bufinfo.buf + bufinfo.len; int st; @@ -89,7 +89,7 @@ mp_obj_t common_hal_uzlib_decompress(mp_obj_t data, bool is_zlib) { } mp_uint_t final_sz = decomp->dest - dest_buf; - DEBUG_printf("uzlib: Resizing from " UINT_FMT " to final size: " UINT_FMT " bytes\n", dest_buf_size, final_sz); + DEBUG_printf("zlib: Resizing from " UINT_FMT " to final size: " UINT_FMT " bytes\n", dest_buf_size, final_sz); dest_buf = (byte *)m_renew(byte, dest_buf, dest_buf_size, final_sz); mp_obj_t res = mp_obj_new_bytearray_by_ref(final_sz, dest_buf); m_del_obj(TINF_DATA, decomp); From 6f537e50c32367de05e5a4206ece979a7ece2691 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sun, 20 Feb 2022 16:03:25 -0600 Subject: [PATCH 05/98] Disable in M0 builds --- ports/atmel-samd/mpconfigport.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 82cc69728a..c6ad73c6a0 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -46,6 +46,7 @@ CIRCUITPY_SYNTHIO ?= 0 CIRCUITPY_TOUCHIO_USE_NATIVE ?= 1 CIRCUITPY_ULAB = 0 CIRCUITPY_VECTORIO = 0 +CIRCUITPY_ZLIB = 0 # TODO: In CircuitPython 8.0, turn this back on, after `busio.OneWire` is removed. # We'd like a smoother transition, but we can't afford the space to have both From 57d916c2491505f6db2accd4ccd5c462ef0e2c85 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sun, 20 Feb 2022 16:26:20 -0600 Subject: [PATCH 06/98] Doc fix --- shared-bindings/zlib/DecompIO.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/zlib/DecompIO.c b/shared-bindings/zlib/DecompIO.c index 7416bcd9da..78b01b5698 100644 --- a/shared-bindings/zlib/DecompIO.c +++ b/shared-bindings/zlib/DecompIO.c @@ -42,7 +42,7 @@ //| negative, it's assumed to be raw DEFLATE stream. *wbits* values 24..31 (16 + 8..15) //| mean that input stream has gzip header.""" //| -//| def __init__(self, stream: IO[AnyStr], wbits: Optional[int] = 0) -> None: +//| def __init__(self, stream: typing.IO, wbits: Optional[int] = 0) -> None: //| """Creates a DecompIO object to decompress stream data. //| """ //| ... From e7d99bda0cccfe561f4b710a9eb7235be0818551 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Mon, 21 Feb 2022 00:14:24 -0600 Subject: [PATCH 07/98] More doc fixes --- docs/library/zlib.rst | 2 ++ shared-bindings/zlib/DecompIO.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/library/zlib.rst b/docs/library/zlib.rst index 8f69f4b7c8..514b787bc4 100644 --- a/docs/library/zlib.rst +++ b/docs/library/zlib.rst @@ -5,6 +5,7 @@ .. module:: zlib :synopsis: zlib decompression + :noindex: |see_cpython_module| :mod:`cpython:zlib`. @@ -26,6 +27,7 @@ Functions CPython and is ignored. .. class:: DecompIO(stream, wbits=0, /) + :noindex: Create a ``stream`` wrapper which allows transparent decompression of compressed data in another *stream*. This allows to process compressed diff --git a/shared-bindings/zlib/DecompIO.c b/shared-bindings/zlib/DecompIO.c index 78b01b5698..a2c788fabe 100644 --- a/shared-bindings/zlib/DecompIO.c +++ b/shared-bindings/zlib/DecompIO.c @@ -69,7 +69,7 @@ //| ... //| //| def readline(self, nbytes: Optional[int] = None) -> Optional[bytes]: -//| """Read and return one line from the stream. The line terminator is always b'\n'. +//| """Read and return one line from the stream. The line terminator is always b'\\n'. //| If ``nbytes`` is specified then read at most that many bytes. //| //| :return: Data read From edee8e3409a8a1ceeabafa39b95bcf3add5a3d4e Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Mon, 21 Feb 2022 00:47:05 -0600 Subject: [PATCH 08/98] disable on some boards --- ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk | 1 + ports/nrf/boards/bluemicro833/mpconfigboard.mk | 1 + ports/nrf/boards/pca10100/mpconfigboard.mk | 1 + ports/nrf/boards/simmel/mpconfigboard.mk | 1 + ports/stm/boards/thunderpack_v12/mpconfigboard.mk | 1 + 5 files changed, 5 insertions(+) diff --git a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk index 81e1cd00cd..efefc3e4e7 100644 --- a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk @@ -20,3 +20,4 @@ CIRCUITPY_SHARPDISPLAY=0 CIRCUITPY_SDCARDIO=0 CIRCUITPY_BLEIO_HCI=0 CIRCUITPY_BLEIO=0 +CIRCUITPY_ZLIB=0 diff --git a/ports/nrf/boards/bluemicro833/mpconfigboard.mk b/ports/nrf/boards/bluemicro833/mpconfigboard.mk index b7594f0d89..1e72d8d7f7 100644 --- a/ports/nrf/boards/bluemicro833/mpconfigboard.mk +++ b/ports/nrf/boards/bluemicro833/mpconfigboard.mk @@ -40,6 +40,7 @@ CIRCUITPY_TOUCHIO = 0 CIRCUITPY_ULAB = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_VECTORIO = 0 +CIRCUITPY_ZLIB = 0 MICROPY_PY_ASYNC_AWAIT = 0 diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 59f2b217c3..95a2dd4d98 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -32,6 +32,7 @@ CIRCUITPY_SYNTHIO = 0 CIRCUITPY_ULAB = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_VECTORIO = 0 +CIRCUITPY_ZLIB = 0 MICROPY_PY_ASYNC_AWAIT = 0 diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index 67f5dfbd6d..bdafadceb7 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -42,6 +42,7 @@ CIRCUITPY_ULAB = 0 CIRCUITPY_USB_CDC = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_WATCHDOG = 1 +CIRCUITPY_ZLIB = 0 # Enable micropython.native #CIRCUITPY_ENABLE_MPY_NATIVE = 1 diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk index 16a0c60f2a..526415ca30 100644 --- a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk @@ -14,6 +14,7 @@ EXTERNAL_FLASH_DEVICES = GD25Q16C CIRCUITPY_NVM = 1 CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_BLEIO_HCI = 0 +CIRCUITPY_ZLIB = 0 MCU_SERIES = F4 MCU_VARIANT = STM32F411xE From ce4a0806b3d7ea63ec13fe60738211edf193d337 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Mon, 21 Feb 2022 10:24:13 -0600 Subject: [PATCH 09/98] Added test coverage --- .../unix/variants/coverage/mpconfigvariant.mk | 9 ++- tests/circuitpython/zlib_decompio.py | 33 ++++++++++ tests/circuitpython/zlib_decompio.py.exp | 12 ++++ tests/circuitpython/zlib_decompio_gz.py | 60 +++++++++++++++++++ tests/circuitpython/zlib_decompio_gz.py.exp | 13 ++++ tests/circuitpython/zlib_decompress.py | 60 +++++++++++++++++++ tests/unix/extra_coverage.py.exp | 2 +- 7 files changed, 186 insertions(+), 3 deletions(-) create mode 100644 tests/circuitpython/zlib_decompio.py create mode 100644 tests/circuitpython/zlib_decompio.py.exp create mode 100644 tests/circuitpython/zlib_decompio_gz.py create mode 100644 tests/circuitpython/zlib_decompio_gz.py.exp create mode 100644 tests/circuitpython/zlib_decompress.py diff --git a/ports/unix/variants/coverage/mpconfigvariant.mk b/ports/unix/variants/coverage/mpconfigvariant.mk index 7e8aabef5b..681cc16e19 100644 --- a/ports/unix/variants/coverage/mpconfigvariant.mk +++ b/ports/unix/variants/coverage/mpconfigvariant.mk @@ -38,6 +38,8 @@ SRC_BITMAP := \ shared-bindings/rainbowio/__init__.c \ shared-bindings/traceback/__init__.c \ shared-bindings/util.c \ + shared-bindings/zlib/__init__.c \ + shared-bindings/zlib/DecompIO.c \ shared-module/aesio/aes.c \ shared-module/aesio/__init__.c \ shared-module/bitmaptools/__init__.c \ @@ -46,7 +48,9 @@ SRC_BITMAP := \ shared-module/displayio/ColorConverter.c \ shared-module/displayio/ColorConverter.c \ shared-module/rainbowio/__init__.c \ - shared-module/traceback/__init__.c + shared-module/traceback/__init__.c \ + shared-module/zlib/__init__.c \ + shared-module/zlib/DecompIO.c $(info $(SRC_BITMAP)) SRC_C += $(SRC_BITMAP) @@ -57,7 +61,8 @@ CFLAGS += \ -DCIRCUITPY_DISPLAYIO_UNIX=1 \ -DCIRCUITPY_GIFIO=1 \ -DCIRCUITPY_RAINBOWIO=1 \ - -DCIRCUITPY_TRACEBACK=1 + -DCIRCUITPY_TRACEBACK=1 \ + -DCIRCUITPY_ZLIB=1 SRC_C += coverage.c SRC_CXX += coveragecpp.cpp diff --git a/tests/circuitpython/zlib_decompio.py b/tests/circuitpython/zlib_decompio.py new file mode 100644 index 0000000000..0ded0b6966 --- /dev/null +++ b/tests/circuitpython/zlib_decompio.py @@ -0,0 +1,33 @@ +try: + import zlib + import uio as io +except ImportError: + print("SKIP") + raise SystemExit + + +# Raw DEFLATE bitstream +buf = io.BytesIO(b"\xcbH\xcd\xc9\xc9\x07\x00") +inp = zlib.DecompIO(buf, -8) +print(buf.seek(0, 1)) +print(inp.read(1)) +print(buf.seek(0, 1)) +print(inp.read(2)) +print(inp.read()) +print(buf.seek(0, 1)) +print(inp.read(1)) +print(inp.read()) +print(buf.seek(0, 1)) + + +# zlib bitstream +inp = zlib.DecompIO(io.BytesIO(b"x\x9c30\xa0=\x00\x00\xb3q\x12\xc1")) +print(inp.read(10)) +print(inp.read()) + +# zlib bitstream, wrong checksum +inp = zlib.DecompIO(io.BytesIO(b"x\x9c30\xa0=\x00\x00\xb3q\x12\xc0")) +try: + print(inp.read()) +except OSError as e: + print(repr(e)) diff --git a/tests/circuitpython/zlib_decompio.py.exp b/tests/circuitpython/zlib_decompio.py.exp new file mode 100644 index 0000000000..3f5f360fa3 --- /dev/null +++ b/tests/circuitpython/zlib_decompio.py.exp @@ -0,0 +1,12 @@ +0 +b'h' +2 +b'el' +b'lo' +7 +b'' +b'' +7 +b'0000000000' +b'000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' +OSError(22,) diff --git a/tests/circuitpython/zlib_decompio_gz.py b/tests/circuitpython/zlib_decompio_gz.py new file mode 100644 index 0000000000..e752d50a84 --- /dev/null +++ b/tests/circuitpython/zlib_decompio_gz.py @@ -0,0 +1,60 @@ +try: + import zlib + import uio as io +except ImportError: + print("SKIP") + raise SystemExit + + +# gzip bitstream +buf = io.BytesIO( + b"\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00" +) +inp = zlib.DecompIO(buf, 16 + 8) +print(buf.seek(0, 1)) +print(inp.read(1)) +print(buf.seek(0, 1)) +print(inp.read(2)) +print(inp.read()) +print(buf.seek(0, 1)) +print(inp.read(1)) +print(inp.read()) +print(buf.seek(0, 1)) + +# Check FHCRC field +buf = io.BytesIO( + b"\x1f\x8b\x08\x02\x99\x0c\xe5W\x00\x03\x00\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00" +) +inp = zlib.DecompIO(buf, 16 + 8) +print(inp.read()) + +# Check FEXTRA field +buf = io.BytesIO( + b"\x1f\x8b\x08\x04\x99\x0c\xe5W\x00\x03\x01\x00X\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00" +) +inp = zlib.DecompIO(buf, 16 + 8) +print(inp.read()) + +# broken header +buf = io.BytesIO( + b"\x1f\x8c\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00" +) +try: + inp = zlib.DecompIO(buf, 16 + 8) +except ValueError: + print("ValueError") + +# broken crc32 +buf = io.BytesIO( + b"\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa7\x106\x05\x00\x00\x00" +) +inp = zlib.DecompIO(buf, 16 + 8) +try: + inp.read(6) +except OSError as e: + print(repr(e)) + +# broken uncompressed size - not checked so far +# buf = io.BytesIO(b'\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x06\x00\x00\x00') +# inp = zlib.DecompIO(buf, 16 + 8) +# inp.read(6) diff --git a/tests/circuitpython/zlib_decompio_gz.py.exp b/tests/circuitpython/zlib_decompio_gz.py.exp new file mode 100644 index 0000000000..20a30c82a3 --- /dev/null +++ b/tests/circuitpython/zlib_decompio_gz.py.exp @@ -0,0 +1,13 @@ +16 +b'h' +18 +b'el' +b'lo' +31 +b'' +b'' +31 +b'hello' +b'hello' +ValueError +OSError(22,) diff --git a/tests/circuitpython/zlib_decompress.py b/tests/circuitpython/zlib_decompress.py new file mode 100644 index 0000000000..05ea5868ee --- /dev/null +++ b/tests/circuitpython/zlib_decompress.py @@ -0,0 +1,60 @@ +try: + import zlib +except ImportError: + try: + import zlib as zlib + except ImportError: + print("SKIP") + raise SystemExit + +PATTERNS = [ + # Packed results produced by CPy's zlib.compress() + (b"0", b"x\x9c3\x00\x00\x001\x001"), + (b"a", b"x\x9cK\x04\x00\x00b\x00b"), + (b"0" * 100, b"x\x9c30\xa0=\x00\x00\xb3q\x12\xc1"), + ( + bytes(range(64)), + b"x\x9cc`dbfaec\xe7\xe0\xe4\xe2\xe6\xe1\xe5\xe3\x17\x10\x14\x12\x16\x11\x15\x13\x97\x90\x94\x92\x96\x91\x95\x93WPTRVQUS\xd7\xd0\xd4\xd2\xd6\xd1\xd5\xd370426153\xb7\xb0\xb4\xb2\xb6\xb1\xb5\xb3\x07\x00\xaa\xe0\x07\xe1", + ), + (b"hello", b"x\x01\x01\x05\x00\xfa\xffhello\x06,\x02\x15"), # compression level 0 + # adaptive/dynamic huffman tree + ( + b"13371813150|13764518736|12345678901", + b"x\x9c\x05\xc1\x81\x01\x000\x04\x04\xb1\x95\\\x1f\xcfn\x86o\x82d\x06Qq\xc8\x9d\xc5X}I}\x00\x951D>I}\x00\x951D>I}\x00\x951D>I}\x00\x951D", + b"x\x9c\x05\xc11\x01\x00\x00\x00\x010\x95\x14py\x84\x12C_\x9bR\x8cV\x8a\xd1J1Z)F\x1fw`\x089", + ), +] + +for unpacked, packed in PATTERNS: + assert zlib.decompress(packed) == unpacked + print(unpacked) + + +# Raw DEFLATE bitstream +v = b"\xcbH\xcd\xc9\xc9\x07\x00" +exp = b"hello" +out = zlib.decompress(v, -15) +assert out == exp +print(exp) +# Even when you ask CPython zlib.compress to produce Raw DEFLATE stream, +# it returns it with adler2 and oriignal size appended, as if it was a +# zlib stream. Make sure there're no random issues decompressing such. +v = b"\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00" +out = zlib.decompress(v, -15) +assert out == exp + +# this should error +try: + zlib.decompress(b"abc") +except Exception: + print("Exception") + +# invalid block type +try: + zlib.decompress(b"\x07", -15) # final-block, block-type=3 (invalid) +except Exception as er: + print("Exception") diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp index 4cce80a412..ea440166ca 100644 --- a/tests/unix/extra_coverage.py.exp +++ b/tests/unix/extra_coverage.py.exp @@ -39,7 +39,7 @@ sys termios traceback ubinascii uctypes uerrno uheapq uio ujson ulab uos urandom ure uselect ustruct utime -utimeq uzlib +utimeq uzlib zlib ime utime utimeq From f9d7f46d679a315f6756919a02b2defe021af6d6 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Wed, 23 Mar 2022 17:02:58 -0500 Subject: [PATCH 10/98] Removing DecompIO --- py/circuitpy_defns.mk | 1 - shared-bindings/zlib/DecompIO.c | 132 -------------------------------- shared-bindings/zlib/DecompIO.h | 37 --------- shared-bindings/zlib/__init__.c | 2 - shared-module/zlib/DecompIO.c | 101 ------------------------ shared-module/zlib/DecompIO.h | 44 ----------- 6 files changed, 317 deletions(-) delete mode 100644 shared-bindings/zlib/DecompIO.c delete mode 100644 shared-bindings/zlib/DecompIO.h delete mode 100644 shared-module/zlib/DecompIO.c delete mode 100644 shared-module/zlib/DecompIO.h diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 07a8d2fd86..3c9fe0f155 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -582,7 +582,6 @@ SRC_SHARED_MODULE_ALL = \ uheap/__init__.c \ ustack/__init__.c \ zlib/__init__.c \ - zlib/DecompIO.c \ vectorio/Circle.c \ vectorio/Polygon.c \ vectorio/Rectangle.c \ diff --git a/shared-bindings/zlib/DecompIO.c b/shared-bindings/zlib/DecompIO.c deleted file mode 100644 index a2c788fabe..0000000000 --- a/shared-bindings/zlib/DecompIO.c +++ /dev/null @@ -1,132 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2022 Mark Komus - * - * 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/obj.h" -#include "py/stream.h" -#include "py/runtime.h" -#include "shared-bindings/zlib/DecompIO.h" -#include "shared-module/zlib/DecompIO.h" - -//| class DecompIO: -//| """A stream wrapper which allows transparent decompression of compressed data in -//| another stream. This allows to process compressed streams with data larger -//| than available heap size. -//| -//| *wbits* is DEFLATE dictionary window size used during compression (8-15, the -//| dictionary size is power of 2 of that value). Additionally, if value is positive, -//| *data* is assumed to be zlib stream (with zlib header). Otherwise, if it's -//| negative, it's assumed to be raw DEFLATE stream. *wbits* values 24..31 (16 + 8..15) -//| mean that input stream has gzip header.""" -//| -//| def __init__(self, stream: typing.IO, wbits: Optional[int] = 0) -> None: -//| """Creates a DecompIO object to decompress stream data. -//| """ -//| ... -//| - -// These are standard stream methods. Code is in py/stream.c. -// -//| def read(self, nbytes: Optional[int] = None) -> Optional[bytes]: -//| """Read characters. If ``nbytes`` is specified then read at most that many -//| bytes. Otherwise, read everything that arrives until the connection -//| times out. Providing the number of bytes expected is highly recommended -//| because it will be faster. -//| -//| :return: Data read -//| :rtype: bytes or None""" -//| ... -//| -//| def readinto(self, buf: WriteableBuffer, nbytes: Optional[int] = None) -> Optional[bytes]: -//| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most -//| that many bytes. Otherwise, read at most ``len(buf)`` bytes. -//| -//| :return: number of bytes read and stored into ``buf`` -//| :rtype: bytes or None""" -//| ... -//| -//| def readline(self, nbytes: Optional[int] = None) -> Optional[bytes]: -//| """Read and return one line from the stream. The line terminator is always b'\\n'. -//| If ``nbytes`` is specified then read at most that many bytes. -//| -//| :return: Data read -//| :rtype: bytes or None""" -//| ... -//| - -STATIC mp_obj_t zlib_decompio_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, 2, false); - mp_get_stream_raise(args[0], MP_STREAM_OP_READ); - - mp_obj_decompio_t *self = m_new_obj(mp_obj_decompio_t); - self->base.type = type; - memset(&self->decomp, 0, sizeof(self->decomp)); - - mp_int_t dict_opt = 0; - if (n_args > 1) { - dict_opt = mp_obj_get_int(args[1]); - } - - common_hal_zlib_decompio_construct(self, args[0], dict_opt); - - return MP_OBJ_FROM_PTR(self); -} - -STATIC mp_uint_t zlib_decompio_read(mp_obj_t self_in, void *buf, mp_uint_t size, int *errcode) { - mp_obj_decompio_t *self = MP_OBJ_TO_PTR(self_in); - if (self->eof) { - return 0; - } - - return common_hal_zlib_decompio_read(self, buf, size, errcode); -} - -STATIC const mp_rom_map_elem_t decompio_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) }, - { MP_ROM_QSTR(MP_QSTR_readline), MP_ROM_PTR(&mp_stream_unbuffered_readline_obj) }, -}; - -STATIC MP_DEFINE_CONST_DICT(decompio_locals_dict, decompio_locals_dict_table); - -STATIC const mp_stream_p_t decompio_stream_p = { - MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) - .read = zlib_decompio_read, - .write = NULL, - .ioctl = NULL, - .is_text = false, -}; - -const mp_obj_type_t decompio_type = { - { &mp_type_type }, - .flags = MP_TYPE_FLAG_EXTENDED, - .name = MP_QSTR_DecompIO, - .make_new = zlib_decompio_make_new, - .locals_dict = (void *)&decompio_locals_dict, - MP_TYPE_EXTENDED_FIELDS( - .protocol = &decompio_stream_p, - ), -}; diff --git a/shared-bindings/zlib/DecompIO.h b/shared-bindings/zlib/DecompIO.h deleted file mode 100644 index 65a90cbfb8..0000000000 --- a/shared-bindings/zlib/DecompIO.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2022 Mark Komus - * - * 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. - */ - -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_ZLIB_DECOMPIO_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_ZLIB_DECOMPIO_H - -#include "shared-module/zlib/DecompIO.h" - -extern const mp_obj_type_t decompio_type; - -extern void common_hal_zlib_decompio_construct(mp_obj_decompio_t *self, mp_obj_t src_stream, mp_int_t dict_opt); -extern mp_uint_t common_hal_zlib_decompio_read(mp_obj_decompio_t *self, void *buf, mp_uint_t size, int *errcode); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_ZLIB_DECOMPIO_H diff --git a/shared-bindings/zlib/__init__.c b/shared-bindings/zlib/__init__.c index 4e85ad2c89..b75ef5e28f 100644 --- a/shared-bindings/zlib/__init__.c +++ b/shared-bindings/zlib/__init__.c @@ -37,7 +37,6 @@ #include "py/binary.h" #include "py/parsenum.h" -#include "shared-bindings/zlib/DecompIO.h" #include "shared-bindings/zlib/__init__.h" #include "supervisor/shared/translate.h" @@ -76,7 +75,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(zlib_decompress_obj, 1, 3, zlib_decom STATIC const mp_rom_map_elem_t zlib_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_zlib) }, { MP_ROM_QSTR(MP_QSTR_decompress), MP_ROM_PTR(&zlib_decompress_obj) }, - { MP_ROM_QSTR(MP_QSTR_DecompIO), MP_ROM_PTR(&decompio_type) }, }; STATIC MP_DEFINE_CONST_DICT(zlib_globals, zlib_globals_table); diff --git a/shared-module/zlib/DecompIO.c b/shared-module/zlib/DecompIO.c deleted file mode 100644 index b182304f19..0000000000 --- a/shared-module/zlib/DecompIO.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2022 Mark Komus - * - * 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 - -#include "py/obj.h" -#include "py/runtime.h" -#include "py/stream.h" -#include "py/mperrno.h" -#include "py/builtin.h" -#include "py/objtuple.h" -#include "py/binary.h" -#include "py/parsenum.h" - -#include "shared-bindings/zlib/__init__.h" -#include "shared-bindings/zlib/DecompIO.h" -#include "shared-module/zlib/DecompIO.h" - -STATIC int read_src_stream(TINF_DATA *data) { - mp_obj_decompio_t *self = (mp_obj_decompio_t *)data->self; - - const mp_stream_p_t *stream = mp_get_stream_raise(self->src_stream, MP_STREAM_OP_READ); - int err; - byte c; - mp_uint_t out_sz = stream->read(self->src_stream, &c, 1, &err); - - if (out_sz == MP_STREAM_ERROR) { - mp_raise_OSError(err); - } - if (out_sz == 0) { - mp_raise_type(&mp_type_EOFError); - } - return c; -} - -void common_hal_zlib_decompio_construct(mp_obj_decompio_t *self, mp_obj_t src_stream, mp_int_t dict_opt) { - self->decomp.self = self; - self->decomp.readSource = read_src_stream; - self->src_stream = src_stream; - self->eof = false; - - int dict_sz; - - if (dict_opt >= 16) { - int st = uzlib_gzip_parse_header(&self->decomp); - if (st != TINF_OK) { - goto header_error; - } - dict_sz = 1 << (dict_opt - 16); - } else if (dict_opt >= 0) { - dict_opt = uzlib_zlib_parse_header(&self->decomp); - if (dict_opt < 0) { - header_error: - mp_raise_ValueError(MP_ERROR_TEXT("compression header")); - } - dict_sz = 1 << dict_opt; - } else { - dict_sz = 1 << -dict_opt; - } - - uzlib_uncompress_init(&self->decomp, m_new(byte, dict_sz), dict_sz); -} - -mp_uint_t common_hal_zlib_decompio_read(mp_obj_decompio_t *self, void *buf, mp_uint_t size, int *errcode) { - self->decomp.dest = buf; - self->decomp.dest_limit = (unsigned char *)buf + size; - int st = uzlib_uncompress_chksum(&self->decomp); - if (st == TINF_DONE) { - self->eof = true; - } - if (st < 0) { - *errcode = MP_EINVAL; - return MP_STREAM_ERROR; - } - return self->decomp.dest - (byte *)buf; -} diff --git a/shared-module/zlib/DecompIO.h b/shared-module/zlib/DecompIO.h deleted file mode 100644 index 51e64cc1c0..0000000000 --- a/shared-module/zlib/DecompIO.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2022 Mark Komus - * - * 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. - */ - -#ifndef SHARED_MODULE_ZLIB_DECOMPIO_H -#define SHARED_MODULE_ZLIB_DECOMPIO_H - -#include -#include - -#include "py/obj.h" -#define UZLIB_CONF_PARANOID_CHECKS (1) -#include "lib/uzlib/tinf.h" - -typedef struct _mp_obj_decompio_t { - mp_obj_base_t base; - mp_obj_t src_stream; - TINF_DATA decomp; - bool eof; -} mp_obj_decompio_t; - -#endif /* SHARED_MODULE_ZLIB_DECOMPIO_H */ From 372306411adf223b61961b639a0d79e2d1d19494 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 25 Mar 2022 11:17:15 -0500 Subject: [PATCH 11/98] samd: Don't rely on RTC interrupt I instrumented RTC_Handler and determined that on SAMD51 it was possible for the interrupt to be delivered well before the actual overflow of the RTC COUNT register (e.g., a value as small as 0xffff_fffd could be seen at the time of overflow) Rather than depending on the overflow interrupt coming in at the same time as COUNT overflows (exactly), rely only on observed values of COUNT in _get_count, overflowing when it wraps around from a high value to a low one. With this change, PLUS a second change so that it is possible to warp the RTC counter close to an overflow and test in 20ms instead of 3 days, there was no problem detected over 20000+ overflows. Before, a substantial fraction (much greater than 10%) of overflows failed. Fixes #5985 Change to common-hal/rtc/RTC.c for time warping (plus make rtc_old_count non-static): ```patch void common_hal_rtc_set_calibration(int calibration) { + + common_hal_mcu_disable_interrupts(); + + RTC->MODE0.COUNT.reg = 0xffffff00; + rtc_old_count = 0; + do { + while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) { } + } + while(RTC->MODE0.COUNT.reg < 0xffffff00); + common_hal_mcu_enable_interrupts(); + + mp_printf(&mp_plat_print, "Warping RTC in calibration setter count=%08x rtc_old_count=%08x\n", RTC->MODE0.COUNT.reg, rtc_old_count); ``` Test program: ```python import time from rtc import RTC i = 0 while True: RTC().calibration = 1 # Warps to ~16ms before overflow, with patch to RTC code t0 = time.monotonic_ns() et = t0 + 20_000_000 # 20ms while (t1 := time.monotonic_ns()) < et: pass i += 1 print(f"{i:6d}: duration {t1-t0}") if t1-t0 > 200_000_000: break print() ``` --- ports/atmel-samd/supervisor/port.c | 50 ++++++++++++------------------ 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index cccef8be53..704d17c68d 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -247,7 +247,6 @@ static void rtc_init(void) { RTC_MODE0_CTRLA_COUNTSYNC; #endif - RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_OVF; // Set all peripheral interrupt priorities to the lowest priority by default. for (uint16_t i = 0; i < PERIPH_COUNT_IRQn; i++) { @@ -501,45 +500,34 @@ uint32_t port_get_saved_word(void) { // TODO: Move this to an RTC backup register so we can preserve it when only the BACKUP power domain // is enabled. static volatile uint64_t overflowed_ticks = 0; +static uint32_t rtc_old_count; static uint32_t _get_count(uint64_t *overflow_count) { - while (1) { - // Disable interrupts so we can grab the count and the overflow atomically. - common_hal_mcu_disable_interrupts(); - - #ifdef SAM_D5X_E5X - while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) { - } - #endif - // SAMD21 does continuous sync so we don't need to wait here. - - uint32_t count = RTC->MODE0.COUNT.reg; - if (overflow_count != NULL) { - *overflow_count = overflowed_ticks; - } - - bool overflow_pending = RTC->MODE0.INTFLAG.bit.OVF; - - common_hal_mcu_enable_interrupts(); - - if (!overflow_pending) { - return count; - } - - // Try again if overflow hasn't been processed yet. + #ifdef SAM_D5X_E5X + while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) { } + #endif + // SAMD21 does continuous sync so we don't need to wait here. + + uint32_t count = RTC->MODE0.COUNT.reg; + if (count < rtc_old_count) { + // Our RTC is 32 bits and we're clocking it at 16.384khz which is 16 (2 ** 4) subticks per + // tick. + overflowed_ticks += (1L << (32 - 4)); + } + rtc_old_count = count; + + if (overflow_count != NULL) { + *overflow_count = overflowed_ticks; + } + + return count; } volatile bool _woken_up; void RTC_Handler(void) { uint32_t intflag = RTC->MODE0.INTFLAG.reg; - if (intflag & RTC_MODE0_INTFLAG_OVF) { - RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_OVF; - // Our RTC is 32 bits and we're clocking it at 16.384khz which is 16 (2 ** 4) subticks per - // tick. - overflowed_ticks += (1L << (32 - 4)); - } #ifdef SAM_D5X_E5X if (intflag & RTC_MODE0_INTFLAG_PER2) { RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_PER2; From 0d3f45bef8d2ff1e4e870f74ec60d8a357b348c1 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sun, 27 Mar 2022 16:18:56 -0500 Subject: [PATCH 12/98] Remove move DecompIO files --- .../unix/variants/coverage/mpconfigvariant.mk | 2 - tests/circuitpython/zlib_decompio.py | 33 ---------- tests/circuitpython/zlib_decompio.py.exp | 12 ---- tests/circuitpython/zlib_decompio_gz.py | 60 ------------------- tests/circuitpython/zlib_decompio_gz.py.exp | 13 ---- 5 files changed, 120 deletions(-) delete mode 100644 tests/circuitpython/zlib_decompio.py delete mode 100644 tests/circuitpython/zlib_decompio.py.exp delete mode 100644 tests/circuitpython/zlib_decompio_gz.py delete mode 100644 tests/circuitpython/zlib_decompio_gz.py.exp diff --git a/ports/unix/variants/coverage/mpconfigvariant.mk b/ports/unix/variants/coverage/mpconfigvariant.mk index 681cc16e19..0f6cb11169 100644 --- a/ports/unix/variants/coverage/mpconfigvariant.mk +++ b/ports/unix/variants/coverage/mpconfigvariant.mk @@ -39,7 +39,6 @@ SRC_BITMAP := \ shared-bindings/traceback/__init__.c \ shared-bindings/util.c \ shared-bindings/zlib/__init__.c \ - shared-bindings/zlib/DecompIO.c \ shared-module/aesio/aes.c \ shared-module/aesio/__init__.c \ shared-module/bitmaptools/__init__.c \ @@ -50,7 +49,6 @@ SRC_BITMAP := \ shared-module/rainbowio/__init__.c \ shared-module/traceback/__init__.c \ shared-module/zlib/__init__.c \ - shared-module/zlib/DecompIO.c $(info $(SRC_BITMAP)) SRC_C += $(SRC_BITMAP) diff --git a/tests/circuitpython/zlib_decompio.py b/tests/circuitpython/zlib_decompio.py deleted file mode 100644 index 0ded0b6966..0000000000 --- a/tests/circuitpython/zlib_decompio.py +++ /dev/null @@ -1,33 +0,0 @@ -try: - import zlib - import uio as io -except ImportError: - print("SKIP") - raise SystemExit - - -# Raw DEFLATE bitstream -buf = io.BytesIO(b"\xcbH\xcd\xc9\xc9\x07\x00") -inp = zlib.DecompIO(buf, -8) -print(buf.seek(0, 1)) -print(inp.read(1)) -print(buf.seek(0, 1)) -print(inp.read(2)) -print(inp.read()) -print(buf.seek(0, 1)) -print(inp.read(1)) -print(inp.read()) -print(buf.seek(0, 1)) - - -# zlib bitstream -inp = zlib.DecompIO(io.BytesIO(b"x\x9c30\xa0=\x00\x00\xb3q\x12\xc1")) -print(inp.read(10)) -print(inp.read()) - -# zlib bitstream, wrong checksum -inp = zlib.DecompIO(io.BytesIO(b"x\x9c30\xa0=\x00\x00\xb3q\x12\xc0")) -try: - print(inp.read()) -except OSError as e: - print(repr(e)) diff --git a/tests/circuitpython/zlib_decompio.py.exp b/tests/circuitpython/zlib_decompio.py.exp deleted file mode 100644 index 3f5f360fa3..0000000000 --- a/tests/circuitpython/zlib_decompio.py.exp +++ /dev/null @@ -1,12 +0,0 @@ -0 -b'h' -2 -b'el' -b'lo' -7 -b'' -b'' -7 -b'0000000000' -b'000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' -OSError(22,) diff --git a/tests/circuitpython/zlib_decompio_gz.py b/tests/circuitpython/zlib_decompio_gz.py deleted file mode 100644 index e752d50a84..0000000000 --- a/tests/circuitpython/zlib_decompio_gz.py +++ /dev/null @@ -1,60 +0,0 @@ -try: - import zlib - import uio as io -except ImportError: - print("SKIP") - raise SystemExit - - -# gzip bitstream -buf = io.BytesIO( - b"\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00" -) -inp = zlib.DecompIO(buf, 16 + 8) -print(buf.seek(0, 1)) -print(inp.read(1)) -print(buf.seek(0, 1)) -print(inp.read(2)) -print(inp.read()) -print(buf.seek(0, 1)) -print(inp.read(1)) -print(inp.read()) -print(buf.seek(0, 1)) - -# Check FHCRC field -buf = io.BytesIO( - b"\x1f\x8b\x08\x02\x99\x0c\xe5W\x00\x03\x00\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00" -) -inp = zlib.DecompIO(buf, 16 + 8) -print(inp.read()) - -# Check FEXTRA field -buf = io.BytesIO( - b"\x1f\x8b\x08\x04\x99\x0c\xe5W\x00\x03\x01\x00X\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00" -) -inp = zlib.DecompIO(buf, 16 + 8) -print(inp.read()) - -# broken header -buf = io.BytesIO( - b"\x1f\x8c\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00" -) -try: - inp = zlib.DecompIO(buf, 16 + 8) -except ValueError: - print("ValueError") - -# broken crc32 -buf = io.BytesIO( - b"\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa7\x106\x05\x00\x00\x00" -) -inp = zlib.DecompIO(buf, 16 + 8) -try: - inp.read(6) -except OSError as e: - print(repr(e)) - -# broken uncompressed size - not checked so far -# buf = io.BytesIO(b'\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x06\x00\x00\x00') -# inp = zlib.DecompIO(buf, 16 + 8) -# inp.read(6) diff --git a/tests/circuitpython/zlib_decompio_gz.py.exp b/tests/circuitpython/zlib_decompio_gz.py.exp deleted file mode 100644 index 20a30c82a3..0000000000 --- a/tests/circuitpython/zlib_decompio_gz.py.exp +++ /dev/null @@ -1,13 +0,0 @@ -16 -b'h' -18 -b'el' -b'lo' -31 -b'' -b'' -31 -b'hello' -b'hello' -ValueError -OSError(22,) From 6d025a239e1c6d6ff786655c48e6927d923bb4f1 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Mon, 28 Mar 2022 08:55:04 +0100 Subject: [PATCH 13/98] Add espressif rotaryio divisor support. --- .../common-hal/rotaryio/IncrementalEncoder.c | 53 ++++++++++++++++--- .../common-hal/rotaryio/IncrementalEncoder.h | 1 + ports/espressif/peripherals/pcnt.c | 13 ++++- ports/espressif/peripherals/pcnt.h | 1 + shared-bindings/rotaryio/IncrementalEncoder.c | 2 +- 5 files changed, 60 insertions(+), 10 deletions(-) diff --git a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c index 676e99289d..db50e8db93 100644 --- a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c @@ -29,7 +29,6 @@ #include "common-hal/microcontroller/Pin.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" 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) { @@ -37,7 +36,7 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode claim_pin(pin_b); // Prepare configuration for the PCNT unit - const pcnt_config_t pcnt_config = { + pcnt_config_t pcnt_config = { // Set PCNT input signal and control GPIOs .pulse_gpio_num = pin_a->number, .ctrl_gpio_num = pin_b->number, @@ -51,11 +50,46 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode }; // Initialize PCNT unit - const int8_t unit = peripherals_pcnt_init(pcnt_config); + const int8_t unit = peripherals_pcnt_get_unit(pcnt_config); if (unit == -1) { mp_raise_RuntimeError(translate("All PCNT units in use")); } + pcnt_unit_config(&pcnt_config); + + if ((self->divisor == 2) || (self->divisor == 1)) { + // Setup channel 1 for divisor=2 or divisor=1 + pcnt_config.pulse_gpio_num = pin_b->number; // What was control is now signal + pcnt_config.ctrl_gpio_num = pin_a->number; // What was signal is now control + pcnt_config.channel = PCNT_CHANNEL_1; + // What to do on the positive / negative edge of pulse input? + pcnt_config.pos_mode = PCNT_COUNT_DEC; // Count up on the positive edge + pcnt_config.neg_mode = PCNT_COUNT_INC; // Keep the counter value on the negative edge + // What to do when control input is low or high? + pcnt_config.lctrl_mode = PCNT_MODE_KEEP; // Keep the primary counter mode if low + pcnt_config.hctrl_mode = PCNT_MODE_REVERSE; // Reverse counting direction if high + } else { + // Ensure channel 1 is disabled for divisor=4 + pcnt_config.pulse_gpio_num = pin_b->number; // What was control is now signal + pcnt_config.ctrl_gpio_num = pin_a->number; // What was signal is now control + pcnt_config.channel = PCNT_CHANNEL_1; + // What to do on the positive / negative edge of pulse input? + pcnt_config.pos_mode = PCNT_COUNT_DIS; // Disabled + pcnt_config.neg_mode = PCNT_COUNT_DIS; // Disabled + // What to do when control input is low or high? + pcnt_config.lctrl_mode = PCNT_MODE_DISABLE; // Disabled + pcnt_config.hctrl_mode = PCNT_MODE_DISABLE; // Disabled + } + + pcnt_unit_config(&pcnt_config); + + // Initialize PCNT's counter + pcnt_counter_pause(pcnt_config.unit); + pcnt_counter_clear(pcnt_config.unit); + + // Everything is set up, now go to counting + pcnt_counter_resume(pcnt_config.unit); + self->pin_a = pin_a->number; self->pin_b = pin_b->number; self->unit = (pcnt_unit_t)unit; @@ -77,7 +111,12 @@ void common_hal_rotaryio_incrementalencoder_deinit(rotaryio_incrementalencoder_o mp_int_t common_hal_rotaryio_incrementalencoder_get_position(rotaryio_incrementalencoder_obj_t *self) { int16_t count; pcnt_get_counter_value(self->unit, &count); - return (count / 2) + self->position; + + if ((self->divisor == 4) || (self->divisor == 2)) { + return (count / 2) + self->position; + } else { + return (count) + self->position; + } } void common_hal_rotaryio_incrementalencoder_set_position(rotaryio_incrementalencoder_obj_t *self, @@ -87,11 +126,9 @@ void common_hal_rotaryio_incrementalencoder_set_position(rotaryio_incrementalenc } mp_int_t common_hal_rotaryio_incrementalencoder_get_divisor(rotaryio_incrementalencoder_obj_t *self) { - return 4; + return self->divisor; } void common_hal_rotaryio_incrementalencoder_set_divisor(rotaryio_incrementalencoder_obj_t *self, mp_int_t divisor) { - if (divisor != 4) { - mp_raise_ValueError(translate("divisor must be 4")); - } + self->divisor = divisor; } diff --git a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.h b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.h index 4982c39103..c43cd62bf6 100644 --- a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.h +++ b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.h @@ -35,6 +35,7 @@ typedef struct { uint8_t pin_a, pin_b; mp_int_t position; pcnt_unit_t unit; + int8_t divisor; // Number of quadrature edges required per count } rotaryio_incrementalencoder_obj_t; #endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H diff --git a/ports/espressif/peripherals/pcnt.c b/ports/espressif/peripherals/pcnt.c index e4578a2791..d1b85fbb13 100644 --- a/ports/espressif/peripherals/pcnt.c +++ b/ports/espressif/peripherals/pcnt.c @@ -37,7 +37,7 @@ void peripherals_pcnt_reset(void) { } } -int peripherals_pcnt_init(pcnt_config_t pcnt_config) { +int peripherals_pcnt_get_unit(pcnt_config_t pcnt_config) { // Look for available pcnt unit for (uint8_t i = 0; i <= 3; i++) { if (pcnt_unit_state[i] == PCNT_UNIT_INACTIVE) { @@ -49,6 +49,17 @@ int peripherals_pcnt_init(pcnt_config_t pcnt_config) { } } + return pcnt_config.unit; +} + +int peripherals_pcnt_init(pcnt_config_t pcnt_config) { + // Look for available pcnt unit + + const int8_t unit = peripherals_pcnt_get_unit(pcnt_config); + if (unit == -1) { + return -1; + } + // Initialize PCNT unit pcnt_unit_config(&pcnt_config); diff --git a/ports/espressif/peripherals/pcnt.h b/ports/espressif/peripherals/pcnt.h index b2bae7b371..c73c41a232 100644 --- a/ports/espressif/peripherals/pcnt.h +++ b/ports/espressif/peripherals/pcnt.h @@ -31,6 +31,7 @@ #include "soc/pcnt_struct.h" extern int peripherals_pcnt_init(pcnt_config_t pcnt_config); +extern int peripherals_pcnt_get_unit(pcnt_config_t pcnt_config); extern void peripherals_pcnt_deinit(pcnt_unit_t *unit); extern void peripherals_pcnt_reset(void); diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index ef218ba024..12202a2649 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -77,9 +77,9 @@ STATIC mp_obj_t rotaryio_incrementalencoder_make_new(const mp_obj_type_t *type, rotaryio_incrementalencoder_obj_t *self = m_new_obj(rotaryio_incrementalencoder_obj_t); self->base.type = &rotaryio_incrementalencoder_type; + common_hal_rotaryio_incrementalencoder_set_divisor(self, args[ARG_divisor].u_int); common_hal_rotaryio_incrementalencoder_construct(self, pin_a, pin_b); - common_hal_rotaryio_incrementalencoder_set_divisor(self, args[ARG_divisor].u_int); return MP_OBJ_FROM_PTR(self); } From d5868b42ffa21659da4d8d3439497cb730d7aa9b Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 28 Mar 2022 19:45:42 -0400 Subject: [PATCH 14/98] Pin typer and click to have compatible versions --- requirements-dev.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index eb21bc208b..c3b011685b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,10 +4,12 @@ huffman # For nvm.toml cascadetoml jinja2 -typer +# Undo this pin when click and typer are again compatible. +typer==0.4.0 sh -click +# Undo this pin when click and typer are again compatible. +click==8.0.4 cpp-coveralls requests requests-cache From 29eed5c21f9908e9cae86b2725c371b5c3b87f56 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 28 Mar 2022 19:36:28 -0500 Subject: [PATCH 15/98] also pin typer for windows builds --- .github/workflows/ports_windows.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ports_windows.yml b/.github/workflows/ports_windows.yml index 777497485d..9d97ffbf6a 100644 --- a/.github/workflows/ports_windows.yml +++ b/.github/workflows/ports_windows.yml @@ -5,12 +5,14 @@ on: pull_request: paths: - '.github/workflows/*.yml' - - 'tools/**' - - 'py/**' - 'extmod/**' - 'lib/**' + - 'mpy-cross/**' - 'ports/unix/**' - 'ports/windows/**' + - 'py/**' + - 'requirements*.txt' + - 'tools/**' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -64,7 +66,8 @@ jobs: pip install wheel # requirements_dev.txt doesn't install on windows. (with msys2 python) # instead, pick a subset for what we want to do - pip install cascadetoml jinja2 typer intelhex + # Undo the pin of typer & click when undoing it in requirements-dev.txt + pip install cascadetoml jinja2 typer==0.4.0 click==8.0.4 intelhex # check that installed packages work....? which python; python --version; python -c "import cascadetoml" which python3; python3 --version; python3 -c "import cascadetoml" From 2563c509f71c50767f6dfd9b73d5798a8a040409 Mon Sep 17 00:00:00 2001 From: lady ada Date: Tue, 1 Mar 2022 18:15:37 -0500 Subject: [PATCH 16/98] fix automatic i2c enablement with rev C --- .../espressif/boards/adafruit_feather_esp32s2/board.c | 10 +++++++++- ports/espressif/boards/adafruit_feather_esp32s2/pins.c | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32s2/board.c b/ports/espressif/boards/adafruit_feather_esp32s2/board.c index 1be9000b3a..f9e88c097e 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2/board.c @@ -41,8 +41,16 @@ bool board_requests_safe_mode(void) { void reset_board(void) { // Turn on I2C power by default. + + // set pin to input to find 'rest state' + gpio_set_direction(7, GPIO_MODE_DEF_INPUT); + // wait 1 millis for pull to activate + mp_hal_delay_ms(1); + // read rest state (off) + bool restlevel = gpio_get_level(7); gpio_set_direction(7, GPIO_MODE_DEF_OUTPUT); - gpio_set_level(7, false); + // flip it! + gpio_set_level(7, !restlevel); } void board_deinit(void) { diff --git a/ports/espressif/boards/adafruit_feather_esp32s2/pins.c b/ports/espressif/boards/adafruit_feather_esp32s2/pins.c index c9f0e870ed..6cad56eb19 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2/pins.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2/pins.c @@ -17,6 +17,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_I2C_POWER_INVERTED), MP_ROM_PTR(&pin_GPIO7) }, + { 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) }, From b032d42a71fa46eddcd6fa52ccc82aa7851e9e3c Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 1 Mar 2022 19:56:23 -0500 Subject: [PATCH 17/98] Update ports/espressif/boards/adafruit_feather_esp32s2/pins.c --- ports/espressif/boards/adafruit_feather_esp32s2/pins.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32s2/pins.c b/ports/espressif/boards/adafruit_feather_esp32s2/pins.c index 6cad56eb19..cf4c915e7f 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2/pins.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2/pins.c @@ -16,7 +16,6 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { 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_INVERTED), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_I2C_POWER), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, From 319ca8560cfa62d1f28edef085bcfbd4d20e8d85 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Thu, 31 Mar 2022 20:00:34 +0100 Subject: [PATCH 18/98] Always configure the second PCNT channel. --- locale/circuitpython.pot | 4 -- .../common-hal/rotaryio/IncrementalEncoder.c | 38 +++++-------------- shared-bindings/rotaryio/IncrementalEncoder.c | 2 +- 3 files changed, 11 insertions(+), 33 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 0ce564f1f7..1df2209bba 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -3126,10 +3126,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c index db50e8db93..788050b6be 100644 --- a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c @@ -57,29 +57,15 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode pcnt_unit_config(&pcnt_config); - if ((self->divisor == 2) || (self->divisor == 1)) { - // Setup channel 1 for divisor=2 or divisor=1 - pcnt_config.pulse_gpio_num = pin_b->number; // What was control is now signal - pcnt_config.ctrl_gpio_num = pin_a->number; // What was signal is now control - pcnt_config.channel = PCNT_CHANNEL_1; - // What to do on the positive / negative edge of pulse input? - pcnt_config.pos_mode = PCNT_COUNT_DEC; // Count up on the positive edge - pcnt_config.neg_mode = PCNT_COUNT_INC; // Keep the counter value on the negative edge - // What to do when control input is low or high? - pcnt_config.lctrl_mode = PCNT_MODE_KEEP; // Keep the primary counter mode if low - pcnt_config.hctrl_mode = PCNT_MODE_REVERSE; // Reverse counting direction if high - } else { - // Ensure channel 1 is disabled for divisor=4 - pcnt_config.pulse_gpio_num = pin_b->number; // What was control is now signal - pcnt_config.ctrl_gpio_num = pin_a->number; // What was signal is now control - pcnt_config.channel = PCNT_CHANNEL_1; - // What to do on the positive / negative edge of pulse input? - pcnt_config.pos_mode = PCNT_COUNT_DIS; // Disabled - pcnt_config.neg_mode = PCNT_COUNT_DIS; // Disabled - // What to do when control input is low or high? - pcnt_config.lctrl_mode = PCNT_MODE_DISABLE; // Disabled - pcnt_config.hctrl_mode = PCNT_MODE_DISABLE; // Disabled - } + pcnt_config.pulse_gpio_num = pin_b->number; // What was control is now signal + pcnt_config.ctrl_gpio_num = pin_a->number; // What was signal is now control + pcnt_config.channel = PCNT_CHANNEL_1; + // What to do on the positive / negative edge of pulse input? + pcnt_config.pos_mode = PCNT_COUNT_DEC; // Count up on the positive edge + pcnt_config.neg_mode = PCNT_COUNT_INC; // Keep the counter value on the negative edge + // What to do when control input is low or high? + pcnt_config.lctrl_mode = PCNT_MODE_KEEP; // Keep the primary counter mode if low + pcnt_config.hctrl_mode = PCNT_MODE_REVERSE; // Reverse counting direction if high pcnt_unit_config(&pcnt_config); @@ -112,11 +98,7 @@ mp_int_t common_hal_rotaryio_incrementalencoder_get_position(rotaryio_incrementa int16_t count; pcnt_get_counter_value(self->unit, &count); - if ((self->divisor == 4) || (self->divisor == 2)) { - return (count / 2) + self->position; - } else { - return (count) + self->position; - } + return (count / self->divisor) + self->position; } void common_hal_rotaryio_incrementalencoder_set_position(rotaryio_incrementalencoder_obj_t *self, diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index 12202a2649..7793e12837 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -77,8 +77,8 @@ STATIC mp_obj_t rotaryio_incrementalencoder_make_new(const mp_obj_type_t *type, rotaryio_incrementalencoder_obj_t *self = m_new_obj(rotaryio_incrementalencoder_obj_t); self->base.type = &rotaryio_incrementalencoder_type; - common_hal_rotaryio_incrementalencoder_set_divisor(self, args[ARG_divisor].u_int); common_hal_rotaryio_incrementalencoder_construct(self, pin_a, pin_b); + common_hal_rotaryio_incrementalencoder_set_divisor(self, args[ARG_divisor].u_int); return MP_OBJ_FROM_PTR(self); } From d9bf79d82635d29537cdc16147ed3f312e7b4338 Mon Sep 17 00:00:00 2001 From: EmergReanimator Date: Sat, 2 Apr 2022 12:39:16 +0200 Subject: [PATCH 19/98] Fixed internal flash filesystem stub build issue Internal filesystem stubs is used when both INTERNAL_FLASH_FILESYSTEM, DISABLE_FILESYSTEM are set. --- supervisor/stub/filesystem.c | 5 +++++ supervisor/stub/internal_flash.c | 21 ++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/supervisor/stub/filesystem.c b/supervisor/stub/filesystem.c index 650f4d8346..77e9701065 100644 --- a/supervisor/stub/filesystem.c +++ b/supervisor/stub/filesystem.c @@ -31,6 +31,11 @@ void filesystem_background(void) { return; } +void filesystem_tick(void) +{ + return; +} + bool filesystem_init(bool create_allowed, bool force_create) { (void)create_allowed; (void)force_create; diff --git a/supervisor/stub/internal_flash.c b/supervisor/stub/internal_flash.c index 23e843c923..1501f4aeb6 100644 --- a/supervisor/stub/internal_flash.c +++ b/supervisor/stub/internal_flash.c @@ -23,7 +23,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "supervisor/internal_flash.h" +#include "supervisor/flash.h" #include #include @@ -46,21 +46,24 @@ uint32_t supervisor_flash_get_block_count(void) { return 0; } -void port_internal_flash_flush(void) { - return; -} - mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { return 0; // success } -bool supervisor_flash_write_block(const uint8_t *src, uint32_t block) { - return true; -} - mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t num_blocks) { return 0; // success } +#if (0) +void supervisor_flash_init_vfs(struct _fs_user_mount_t *vfs) +{ + return; +} +#endif + +void port_internal_flash_flush(void) { + return; +} + void supervisor_flash_release_cache(void) { } From 8162a5de4bcdc2989487196c61777f81e3303a02 Mon Sep 17 00:00:00 2001 From: EmergReanimator Date: Sat, 2 Apr 2022 12:47:43 +0200 Subject: [PATCH 20/98] Fixed code style formatting according to pre-commit rules. --- supervisor/stub/filesystem.c | 3 +-- supervisor/stub/internal_flash.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/supervisor/stub/filesystem.c b/supervisor/stub/filesystem.c index 77e9701065..920a7571f2 100644 --- a/supervisor/stub/filesystem.c +++ b/supervisor/stub/filesystem.c @@ -31,8 +31,7 @@ void filesystem_background(void) { return; } -void filesystem_tick(void) -{ +void filesystem_tick(void) { return; } diff --git a/supervisor/stub/internal_flash.c b/supervisor/stub/internal_flash.c index 1501f4aeb6..149c363c8b 100644 --- a/supervisor/stub/internal_flash.c +++ b/supervisor/stub/internal_flash.c @@ -55,8 +55,7 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, } #if (0) -void supervisor_flash_init_vfs(struct _fs_user_mount_t *vfs) -{ +void supervisor_flash_init_vfs(struct _fs_user_mount_t *vfs) { return; } #endif From 161c992fa0944bc9fb3f1ff738959ab7e8302e16 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 2 Apr 2022 09:19:30 -0500 Subject: [PATCH 21/98] Improve help text --- shared-bindings/zlib/__init__.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/shared-bindings/zlib/__init__.c b/shared-bindings/zlib/__init__.c index b75ef5e28f..65bec244e3 100644 --- a/shared-bindings/zlib/__init__.c +++ b/shared-bindings/zlib/__init__.c @@ -53,12 +53,20 @@ //| size used during compression (8-15, the dictionary size is power of 2 of //| that value). Additionally, if value is positive, *data* is assumed to be //| zlib stream (with zlib header). Otherwise, if it's negative, it's assumed -//| to be raw DEFLATE stream. *bufsize* parameter is for compatibility with -//| CPython and is ignored. +//| to be raw DEFLATE stream. //| -//| :param ~bytes data: data to be decompressed -//| :param ~int wbits: DEFLATE dictionary window size used during compression -//| :param ~int bufsize: ignored for compatibility with CPython only +//| The wbits parameter controls the size of the history buffer (or “window size”), and what header +//| and trailer format is expected. +//| +//| Common wbits values: +//| +//| * To decompress deflate format, use wbits = -15 +//| * To decompress zlib format, use wbits = 15 +//| * To decompress gzip format, use wbits = 31 +//| +//| :param bytes data: data to be decompressed +//| :param int wbits: DEFLATE dictionary window size used during compression. See above. +//| :param int bufsize: ignored for compatibility with CPython only //| """ //| ... //| From 7b586e077c61c14212ceac3ac106e733a873ff01 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 2 Apr 2022 12:22:14 -0500 Subject: [PATCH 22/98] Removed from small boards --- ports/stm/boards/meowbit_v121/mpconfigboard.mk | 1 + ports/stm/boards/thunderpack_v11/mpconfigboard.mk | 1 + 2 files changed, 2 insertions(+) diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index 15ae33c4c8..77b046ada7 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -26,5 +26,6 @@ CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_GIFIO = 0 CIRCUITPY_ULAB = 0 CIRCUITPY_STAGE = 1 +CIRCUITPY_ZLIB = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/meowbit diff --git a/ports/stm/boards/thunderpack_v11/mpconfigboard.mk b/ports/stm/boards/thunderpack_v11/mpconfigboard.mk index 5b5c098e16..0aa8ce6746 100644 --- a/ports/stm/boards/thunderpack_v11/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack_v11/mpconfigboard.mk @@ -21,3 +21,4 @@ CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_VECTORIO = 0 CIRCUITPY_ULAB = 0 +CIRCUITPY_ZLIB = 0 From 9d67e62f4d7cb754fbb17bedc90f24a2919502fe Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sun, 3 Apr 2022 11:47:19 -0500 Subject: [PATCH 23/98] Removed from small board --- ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk index 7a060a168b..a3f9306c7d 100644 --- a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk +++ b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk @@ -13,3 +13,4 @@ EXTERNAL_FLASH_DEVICES = AT25DF081A CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_ZLIB = 0 From 683ece76db5d952a46631f3b953872f9a9c749c6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 4 Apr 2022 09:16:27 -0500 Subject: [PATCH 24/98] MP3Decoder: Accurately inform when no more data Some audio implementations, notably samd, really don't like it when you return 0 samples of data. This was the case when reaching the end of an MP3 file. Now, we read forward in an MP3 file to the next sync word during "get_buffer", so that we can accurately return GET_BUFFER_DONE when the NEXT call WOULD HAVE resulted in 0 samples. Tested with @gamblor21's "laugh.mp3" file on a Trellis M4 Express. --- shared-module/audiomp3/MP3Decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/audiomp3/MP3Decoder.c b/shared-module/audiomp3/MP3Decoder.c index 2d45313814..d0aecc18bd 100644 --- a/shared-module/audiomp3/MP3Decoder.c +++ b/shared-module/audiomp3/MP3Decoder.c @@ -364,7 +364,7 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t * } self->samples_decoded += *buffer_length / sizeof(int16_t); - return GET_BUFFER_MORE_DATA; + return mp3file_find_sync_word(self) ? GET_BUFFER_MORE_DATA : GET_BUFFER_DONE; } void audiomp3_mp3file_get_buffer_structure(audiomp3_mp3file_obj_t *self, bool single_channel_output, From a43cfdd2747a94c815f585fa88769b6fdfdcbd1e Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 31 Mar 2022 10:57:34 +1100 Subject: [PATCH 25/98] py/vm: Prevent array bound warning when using -MP_OBJ_ITER_BUF_NSLOTS. This warning can happen on clang 13.0.1 building mpy-cross: ../py/vm.c:748:25: error: array index -3 refers past the last possible element for an array in 64-bit address space containing 64-bit (8-byte) elements (max possible 2305843009213693952 elements) [-Werror,-Warray-bounds] sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] = MP_OBJ_NULL; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Using pointer access instead of array access works around this warning. Fixes issue #8467. Signed-off-by: Damien George --- py/vm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py/vm.c b/py/vm.c index 9ad67bb2e0..efda4f9aa3 100644 --- a/py/vm.c +++ b/py/vm.c @@ -821,8 +821,8 @@ unwind_jump:; obj = mp_getiter(obj, iter_buf); if (obj != MP_OBJ_FROM_PTR(iter_buf)) { // Iterator didn't use the stack so indicate that with MP_OBJ_NULL. - sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] = MP_OBJ_NULL; - sp[-MP_OBJ_ITER_BUF_NSLOTS + 2] = obj; + *(sp - MP_OBJ_ITER_BUF_NSLOTS + 1) = MP_OBJ_NULL; + *(sp - MP_OBJ_ITER_BUF_NSLOTS + 2) = obj; } DISPATCH(); } @@ -833,8 +833,8 @@ unwind_jump:; DECODE_ULABEL; // the jump offset if iteration finishes; for labels are always forward code_state->sp = sp; mp_obj_t obj; - if (sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] == MP_OBJ_NULL) { - obj = sp[-MP_OBJ_ITER_BUF_NSLOTS + 2]; + if (*(sp - MP_OBJ_ITER_BUF_NSLOTS + 1) == MP_OBJ_NULL) { + obj = *(sp - MP_OBJ_ITER_BUF_NSLOTS + 2); } else { obj = MP_OBJ_FROM_PTR(&sp[-MP_OBJ_ITER_BUF_NSLOTS + 1]); } From fa4b4fa639a9fe315be8dd0534958d9274347cdb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 4 Apr 2022 10:07:14 -0500 Subject: [PATCH 26/98] nrf: Correctly mark PWM unused during reset --- ports/nrf/common-hal/pwmio/PWMOut.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/nrf/common-hal/pwmio/PWMOut.c b/ports/nrf/common-hal/pwmio/PWMOut.c index 76c8c4e6d4..27c0b79b5a 100644 --- a/ports/nrf/common-hal/pwmio/PWMOut.c +++ b/ports/nrf/common-hal/pwmio/PWMOut.c @@ -108,6 +108,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 } } From f7fd1683961359f43c6b689d975248797383f0f6 Mon Sep 17 00:00:00 2001 From: EmergReanimator Date: Mon, 4 Apr 2022 21:47:05 +0200 Subject: [PATCH 27/98] Incorporated feedback from PR. --- supervisor/stub/internal_flash.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/supervisor/stub/internal_flash.c b/supervisor/stub/internal_flash.c index 149c363c8b..3bb71493fd 100644 --- a/supervisor/stub/internal_flash.c +++ b/supervisor/stub/internal_flash.c @@ -55,14 +55,20 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, } #if (0) +// See definition in supervisor/flash.c void supervisor_flash_init_vfs(struct _fs_user_mount_t *vfs) { return; } + +// See definition in supervisor/flash.c +void supervisor_flash_flush(void) { + return; +} #endif +void supervisor_flash_release_cache(void) { +} + void port_internal_flash_flush(void) { return; } - -void supervisor_flash_release_cache(void) { -} From b29b7bfe32224b37637f02702dba818292b69884 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 4 Apr 2022 20:34:49 -0400 Subject: [PATCH 28/98] Free ringbuf buffer by relying on gc, not gc_free() --- py/ringbuf.c | 7 ++----- py/ringbuf.h | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/py/ringbuf.c b/py/ringbuf.c index 72e164946a..fe47b50068 100644 --- a/py/ringbuf.c +++ b/py/ringbuf.c @@ -28,7 +28,6 @@ #include "ringbuf.h" bool ringbuf_init(ringbuf_t *r, uint8_t *buf, size_t capacity) { - r->heap = false; r->buf = buf; r->size = capacity; r->iget = r->iput = 0; @@ -40,7 +39,6 @@ bool ringbuf_init(ringbuf_t *r, uint8_t *buf, size_t capacity) { // size of the buffer is one greater than that, due to how the buffer // handles empty and full statuses. bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived) { - r->heap = true; r->buf = gc_alloc(capacity + 1, false, long_lived); r->size = capacity + 1; r->iget = r->iput = 0; @@ -48,9 +46,8 @@ bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived) { } void ringbuf_free(ringbuf_t *r) { - if (r->heap) { - gc_free(r->buf); - } + // Free buf by letting gc take care of it. If the VM has finished already, + // this will be safe. r->buf = (uint8_t *)NULL; r->size = 0; ringbuf_clear(r); diff --git a/py/ringbuf.h b/py/ringbuf.h index 8f7e7b1760..d868eff1e4 100644 --- a/py/ringbuf.h +++ b/py/ringbuf.h @@ -37,7 +37,6 @@ typedef struct _ringbuf_t { uint32_t size; uint32_t iget; uint32_t iput; - bool heap; } ringbuf_t; // Note that the capacity of the buffer is N-1! From 4b0f80f08122cf62ae7028610a6550b089d24028 Mon Sep 17 00:00:00 2001 From: Reece Robinson Date: Tue, 5 Apr 2022 13:54:07 +1200 Subject: [PATCH 29/98] Enable support for extended HID usage page and usage. Related to Support HID Usage Pages and Usages >255 #5529 --- mpy-cross/mpy-cross.mk | 2 ++ shared-bindings/usb_hid/Device.c | 8 ++++---- shared-bindings/usb_hid/Device.h | 6 +++--- shared-module/usb_hid/Device.c | 6 +++--- shared-module/usb_hid/Device.h | 4 ++-- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/mpy-cross/mpy-cross.mk b/mpy-cross/mpy-cross.mk index 642fe9b5aa..c7bd91ad19 100644 --- a/mpy-cross/mpy-cross.mk +++ b/mpy-cross/mpy-cross.mk @@ -29,6 +29,8 @@ INC += -I$(BUILD) # compiler settings CWARN = -Wall -Werror CWARN += -Wpointer-arith -Wuninitialized +# Disable errors for array-bounds warnings on "sp[-MP_OBJ_ITER_BUF_NSLOTS + 2]" access +CWARN += -Wno-array-bounds CFLAGS = $(INC) $(CWARN) -std=gnu99 $(CFLAGS_MOD) $(COPT) $(CFLAGS_EXTRA) CFLAGS += -fdata-sections -ffunction-sections -fno-asynchronous-unwind-tables diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index 286623b0c3..50f67e90cb 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -103,12 +103,12 @@ STATIC mp_obj_t usb_hid_device_make_new(const mp_obj_type_t *type, size_t n_args mp_obj_t descriptor = mp_obj_new_bytearray(descriptor_bufinfo.len, descriptor_bufinfo.buf); const mp_int_t usage_page_arg = args[ARG_usage_page].u_int; - mp_arg_validate_int_range(usage_page_arg, 1, 255, MP_QSTR_usage_page); - const uint8_t usage_page = usage_page_arg; + mp_arg_validate_int_range(usage_page_arg, 1, 0xFFFF, MP_QSTR_usage_page); + const uint16_t usage_page = usage_page_arg; const mp_int_t usage_arg = args[ARG_usage].u_int; - mp_arg_validate_int_range(usage_arg, 1, 255, MP_QSTR_usage_page); - const uint8_t usage = usage_arg; + mp_arg_validate_int_range(usage_arg, 1, 0xFFFF, MP_QSTR_usage_page); + const uint16_t usage = usage_arg; mp_obj_t report_ids = args[ARG_report_ids].u_obj; mp_obj_t in_report_lengths = args[ARG_in_report_lengths].u_obj; diff --git a/shared-bindings/usb_hid/Device.h b/shared-bindings/usb_hid/Device.h index a5e94c4d52..dde66e2700 100644 --- a/shared-bindings/usb_hid/Device.h +++ b/shared-bindings/usb_hid/Device.h @@ -33,11 +33,11 @@ extern const mp_obj_type_t usb_hid_device_type; -void common_hal_usb_hid_device_construct(usb_hid_device_obj_t *self, mp_obj_t report_descriptor, uint8_t usage_page, uint8_t usage, size_t report_ids_count,uint8_t *report_ids, uint8_t *in_report_lengths, uint8_t *out_report_lengths); +void common_hal_usb_hid_device_construct(usb_hid_device_obj_t *self, mp_obj_t report_descriptor, uint16_t usage_page, uint16_t usage, size_t report_ids_count,uint8_t *report_ids, uint8_t *in_report_lengths, uint8_t *out_report_lengths); void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t *report, uint8_t len, uint8_t report_id); mp_obj_t common_hal_usb_hid_device_get_last_received_report(usb_hid_device_obj_t *self, uint8_t report_id); -uint8_t common_hal_usb_hid_device_get_usage_page(usb_hid_device_obj_t *self); -uint8_t common_hal_usb_hid_device_get_usage(usb_hid_device_obj_t *self); +uint16_t common_hal_usb_hid_device_get_usage_page(usb_hid_device_obj_t *self); +uint16_t common_hal_usb_hid_device_get_usage(usb_hid_device_obj_t *self); uint8_t common_hal_usb_hid_device_validate_report_id(usb_hid_device_obj_t *self, mp_int_t report_id); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_USB_HID_DEVICE_H diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index de34d60d0a..8a0c429f84 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -186,7 +186,7 @@ uint8_t common_hal_usb_hid_device_validate_report_id(usb_hid_device_obj_t *self, return (uint8_t)report_id_arg; } -void common_hal_usb_hid_device_construct(usb_hid_device_obj_t *self, mp_obj_t report_descriptor, uint8_t usage_page, uint8_t usage, size_t num_report_ids, uint8_t *report_ids, uint8_t *in_report_lengths, uint8_t *out_report_lengths) { +void common_hal_usb_hid_device_construct(usb_hid_device_obj_t *self, mp_obj_t report_descriptor, uint16_t usage_page, uint16_t usage, size_t num_report_ids, uint8_t *report_ids, uint8_t *in_report_lengths, uint8_t *out_report_lengths) { if (num_report_ids > CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR) { mp_raise_ValueError_varg(translate("More than %d report ids not supported"), CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR); @@ -211,11 +211,11 @@ void common_hal_usb_hid_device_construct(usb_hid_device_obj_t *self, mp_obj_t re memcpy(self->out_report_lengths, out_report_lengths, num_report_ids); } -uint8_t common_hal_usb_hid_device_get_usage_page(usb_hid_device_obj_t *self) { +uint16_t common_hal_usb_hid_device_get_usage_page(usb_hid_device_obj_t *self) { return self->usage_page; } -uint8_t common_hal_usb_hid_device_get_usage(usb_hid_device_obj_t *self) { +uint16_t common_hal_usb_hid_device_get_usage(usb_hid_device_obj_t *self) { return self->usage; } diff --git a/shared-module/usb_hid/Device.h b/shared-module/usb_hid/Device.h index 5a09d19526..f265712be4 100644 --- a/shared-module/usb_hid/Device.h +++ b/shared-module/usb_hid/Device.h @@ -42,8 +42,8 @@ typedef struct { uint8_t report_ids[CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR]; uint8_t in_report_lengths[CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR]; uint8_t out_report_lengths[CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR]; - uint8_t usage_page; - uint8_t usage; + uint16_t usage_page; + uint16_t usage; uint8_t num_report_ids; } usb_hid_device_obj_t; From 70add5277505cbd388729ba2ae8a055ebd21f717 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 4 Apr 2022 22:11:58 -0400 Subject: [PATCH 30/98] advance espressif CI cache key --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b95926871..6df3935555 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -400,7 +400,7 @@ jobs: id: idf-cache with: path: ${{ github.workspace }}/.idf_tools - key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20210923 + key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20220404 - name: Clone IDF submodules run: | (cd $IDF_PATH && git submodule update --init) From 0da10d802ced72486cd0b5098564133c955499cf Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 4 Apr 2022 22:36:58 -0400 Subject: [PATCH 31/98] advance espressif CI cache id --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b95926871..6df3935555 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -400,7 +400,7 @@ jobs: id: idf-cache with: path: ${{ github.workspace }}/.idf_tools - key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20210923 + key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20220404 - name: Clone IDF submodules run: | (cd $IDF_PATH && git submodule update --init) From 4cccc1a0364e9599729fd77f8df0766b4a581952 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 4 Apr 2022 23:39:00 -0400 Subject: [PATCH 32/98] handle clearing both RXIC and RTIC interrupts --- ports/raspberrypi/common-hal/busio/UART.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/common-hal/busio/UART.c b/ports/raspberrypi/common-hal/busio/UART.c index 0e25c57297..9fd5ad3168 100644 --- a/ports/raspberrypi/common-hal/busio/UART.c +++ b/ports/raspberrypi/common-hal/busio/UART.c @@ -85,7 +85,7 @@ static void shared_callback(busio_uart_obj_t *self) { _copy_into_ringbuf(&self->ringbuf, self->uart); // We always clear the interrupt so it doesn't continue to fire because we // may not have read everything available. - uart_get_hw(self->uart)->icr = UART_UARTICR_RXIC_BITS; + uart_get_hw(self->uart)->icr = UART_UARTICR_RXIC_BITS | UART_UARTICR_RTIC_BITS; } static void uart0_callback(void) { From 259e56062f30fccbeae525cfe26a835def353bd9 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 5 Apr 2022 09:10:25 -0400 Subject: [PATCH 33/98] Update mpy-cross/mpy-cross.mk --- mpy-cross/mpy-cross.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/mpy-cross/mpy-cross.mk b/mpy-cross/mpy-cross.mk index c7bd91ad19..642fe9b5aa 100644 --- a/mpy-cross/mpy-cross.mk +++ b/mpy-cross/mpy-cross.mk @@ -29,8 +29,6 @@ INC += -I$(BUILD) # compiler settings CWARN = -Wall -Werror CWARN += -Wpointer-arith -Wuninitialized -# Disable errors for array-bounds warnings on "sp[-MP_OBJ_ITER_BUF_NSLOTS + 2]" access -CWARN += -Wno-array-bounds CFLAGS = $(INC) $(CWARN) -std=gnu99 $(CFLAGS_MOD) $(COPT) $(CFLAGS_EXTRA) CFLAGS += -fdata-sections -ffunction-sections -fno-asynchronous-unwind-tables From c3539f0948f5c7e7a8a75378f1923cd4b08e8eee Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 5 Apr 2022 09:12:02 -0400 Subject: [PATCH 34/98] bump espressif CI cache id --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90ebde9062..6f260117ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -400,7 +400,7 @@ jobs: id: idf-cache with: path: ${{ github.workspace }}/.idf_tools - key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20210923 + key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20220404 - name: Clone IDF submodules run: | (cd $IDF_PATH && git submodule update --init) From d24f3b812d518301f2d4fc5593ca938fc8d15e9c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 5 Apr 2022 09:07:35 -0500 Subject: [PATCH 35/98] Document TileGrid limitation to tile values 0..255 Closes #6149 --- shared-bindings/displayio/TileGrid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index 4cecd0f0f1..2b2526cd84 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -53,6 +53,8 @@ //| convert the value and its location to a display native pixel color. This may be a simple color //| palette lookup, a gradient, a pattern or a color transformer. //| +//| To save RAM usage, tile values are only allowed in the range from 0 to 255 inclusive (single byte values). +//| //| tile_width and tile_height match the height of the bitmap by default. //| //| :param Bitmap,OnDiskBitmap,Shape bitmap: The bitmap storing one or more tiles. From c89af99f5942d3583f6c70d0be921519b9fd5e97 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 5 Apr 2022 09:17:55 -0500 Subject: [PATCH 36/98] Advise about ways to improve mp3 playback Closes: #6133 --- shared-bindings/audiomp3/MP3Decoder.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index 4761feacd8..a59d316072 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -44,6 +44,20 @@ //| :param typing.BinaryIO file: Already opened mp3 file //| :param ~circuitpython_typing.WriteableBuffer buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file. //| +//| Playback of mp3 audio is CPU intensive, and the +//| exact limit depends on many factors such as the particular +//| microcontroller, SD card or flash performance, and other +//| code in use such as displayio. If playback is garbled, +//| skips, or plays as static, first try using a "simpler" mp3: +//| +//| * Use constant bit rate (CBR) not VBR or ABR (variable or average bit rate) when encoding your mp3 file +//| * Use a lower sample rate (e.g., 11.025kHz instead of 48kHz) +//| * Use a lower bit rate (e.g., 32kbit/s instead of 256kbit/s) +//| +//| Reduce activity taking place at the same time as +//| mp3 playback. For instance, only update small portions of a +//| displayio screen if audio is playing. Disable auto-refresh +//| and explicitly call refresh. //| //| Playing a mp3 file from flash:: //| From b993313ac16b02e83b17e3434f1b5d36bdd92296 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 5 Apr 2022 11:30:12 -0500 Subject: [PATCH 37/98] Don't reset GPIO4 (used for voltage monitoring) --- ports/espressif/boards/adafruit_magtag_2.9_grayscale/board.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/board.c b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/board.c index 18dd280cea..3eee2f119b 100644 --- a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/board.c +++ b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/board.c @@ -188,6 +188,10 @@ bool espressif_board_reset_pin_number(gpio_num_t pin_number) { gpio_config(&cfg); return true; } + // Pin 4 is used for voltage monitoring, so don't reset + if (pin_number == 4) { + return true; + } return false; } From 203dad11bfc771bb9803dd452d62991147b4cd5b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 5 Apr 2022 09:48:29 -0500 Subject: [PATCH 38/98] keypad: scan immediately on construct, .reset() --- shared-module/keypad/KeyMatrix.c | 11 ++++++++--- shared-module/keypad/Keys.c | 10 ++++++++-- shared-module/keypad/ShiftRegisterKeys.c | 11 ++++++++--- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/shared-module/keypad/KeyMatrix.c b/shared-module/keypad/KeyMatrix.c index 49b87fc882..aa5e6378db 100644 --- a/shared-module/keypad/KeyMatrix.c +++ b/shared-module/keypad/KeyMatrix.c @@ -37,6 +37,8 @@ #include "supervisor/port.h" #include "supervisor/shared/tick.h" +static void keypad_keymatrix_scan_now(keypad_keymatrix_obj_t *self, uint64_t now); + static mp_uint_t row_column_to_key_number(keypad_keymatrix_obj_t *self, mp_uint_t row, mp_uint_t column) { return row * self->column_digitalinouts->len + column; } @@ -74,10 +76,10 @@ void common_hal_keypad_keymatrix_construct(keypad_keymatrix_obj_t *self, mp_uint self->events = events; self->interval_ticks = (mp_uint_t)(interval * 1024); // interval * 1000 * (1024/1000) - self->last_scan_ticks = port_get_raw_ticks(NULL); // Add self to the list of active keypad scanners. keypad_register_scanner((keypad_scanner_obj_t *)self); + keypad_keymatrix_scan_now(self, port_get_raw_ticks(NULL)); } void common_hal_keypad_keymatrix_deinit(keypad_keymatrix_obj_t *self) { @@ -132,10 +134,9 @@ mp_obj_t common_hal_keypad_keymatrix_get_events(keypad_keymatrix_obj_t *self) { void common_hal_keypad_keymatrix_reset(keypad_keymatrix_obj_t *self) { const size_t key_count = common_hal_keypad_keymatrix_get_key_count(self); - supervisor_acquire_lock(&keypad_scanners_linked_list_lock); memset(self->previously_pressed, false, key_count); memset(self->currently_pressed, false, key_count); - supervisor_release_lock(&keypad_scanners_linked_list_lock); + keypad_keymatrix_scan_now(self, port_get_raw_ticks(NULL)); } void keypad_keymatrix_scan(keypad_keymatrix_obj_t *self) { @@ -145,6 +146,10 @@ void keypad_keymatrix_scan(keypad_keymatrix_obj_t *self) { return; } + keypad_keymatrix_scan_now(self, now); +} + +static void keypad_keymatrix_scan_now(keypad_keymatrix_obj_t *self, uint64_t now) { self->last_scan_ticks = now; mp_obj_t timestamp = supervisor_ticks_ms(); diff --git a/shared-module/keypad/Keys.c b/shared-module/keypad/Keys.c index ce402e4dce..01ba275cc0 100644 --- a/shared-module/keypad/Keys.c +++ b/shared-module/keypad/Keys.c @@ -36,6 +36,8 @@ #include "supervisor/port.h" #include "supervisor/shared/tick.h" +static void keypad_keys_scan_now(keypad_keys_obj_t *self, uint64_t now); + void common_hal_keypad_keys_construct(keypad_keys_obj_t *self, mp_uint_t num_pins, const mcu_pin_obj_t *pins[], bool value_when_pressed, bool pull, mp_float_t interval, size_t max_events) { mp_obj_t dios[num_pins]; @@ -64,6 +66,7 @@ void common_hal_keypad_keys_construct(keypad_keys_obj_t *self, mp_uint_t num_pin // Add self to the list of active keypad scanners. keypad_register_scanner((keypad_scanner_obj_t *)self); + keypad_keys_scan_now(self, port_get_raw_ticks(NULL)); } void common_hal_keypad_keys_deinit(keypad_keys_obj_t *self) { @@ -96,10 +99,9 @@ mp_obj_t common_hal_keypad_keys_get_events(keypad_keys_obj_t *self) { void common_hal_keypad_keys_reset(keypad_keys_obj_t *self) { const size_t key_count = common_hal_keypad_keys_get_key_count(self); - supervisor_acquire_lock(&keypad_scanners_linked_list_lock); memset(self->previously_pressed, false, key_count); memset(self->currently_pressed, false, key_count); - supervisor_release_lock(&keypad_scanners_linked_list_lock); + keypad_keys_scan_now(self, port_get_raw_ticks(NULL)); } void keypad_keys_scan(keypad_keys_obj_t *self) { @@ -109,6 +111,10 @@ void keypad_keys_scan(keypad_keys_obj_t *self) { return; } + keypad_keys_scan_now(self, now); +} + +static void keypad_keys_scan_now(keypad_keys_obj_t *self, uint64_t now) { self->last_scan_ticks = now; const size_t key_count = common_hal_keypad_keys_get_key_count(self); diff --git a/shared-module/keypad/ShiftRegisterKeys.c b/shared-module/keypad/ShiftRegisterKeys.c index d185c6fca4..da9e09d7d8 100644 --- a/shared-module/keypad/ShiftRegisterKeys.c +++ b/shared-module/keypad/ShiftRegisterKeys.c @@ -36,6 +36,8 @@ #include "supervisor/port.h" #include "supervisor/shared/tick.h" +static void keypad_shiftregisterkeys_scan_now(keypad_shiftregisterkeys_obj_t *self, uint64_t now); + void common_hal_keypad_shiftregisterkeys_construct(keypad_shiftregisterkeys_obj_t *self, const mcu_pin_obj_t *clock_pin, const mcu_pin_obj_t *data_pin, const mcu_pin_obj_t *latch_pin, bool value_to_latch, size_t key_count, bool value_when_pressed, mp_float_t interval, size_t max_events) { digitalio_digitalinout_obj_t *clock = m_new_obj(digitalio_digitalinout_obj_t); @@ -63,7 +65,6 @@ void common_hal_keypad_shiftregisterkeys_construct(keypad_shiftregisterkeys_obj_ self->key_count = key_count; self->interval_ticks = (mp_uint_t)(interval * 1024); // interval * 1000 * (1024/1000) - self->last_scan_ticks = port_get_raw_ticks(NULL); keypad_eventqueue_obj_t *events = m_new_obj(keypad_eventqueue_obj_t); events->base.type = &keypad_eventqueue_type; @@ -72,6 +73,7 @@ void common_hal_keypad_shiftregisterkeys_construct(keypad_shiftregisterkeys_obj_ // Add self to the list of active keypad scanners. keypad_register_scanner((keypad_scanner_obj_t *)self); + keypad_shiftregisterkeys_scan_now(self, port_get_raw_ticks(NULL)); } void common_hal_keypad_shiftregisterkeys_deinit(keypad_shiftregisterkeys_obj_t *self) { @@ -108,10 +110,9 @@ mp_obj_t common_hal_keypad_shiftregisterkeys_get_events(keypad_shiftregisterkeys void common_hal_keypad_shiftregisterkeys_reset(keypad_shiftregisterkeys_obj_t *self) { const size_t key_count = common_hal_keypad_shiftregisterkeys_get_key_count(self); - supervisor_acquire_lock(&keypad_scanners_linked_list_lock); memset(self->previously_pressed, false, key_count); memset(self->currently_pressed, false, key_count); - supervisor_release_lock(&keypad_scanners_linked_list_lock); + keypad_shiftregisterkeys_scan_now(self, port_get_raw_ticks(NULL)); } void keypad_shiftregisterkeys_scan(keypad_shiftregisterkeys_obj_t *self) { @@ -121,6 +122,10 @@ void keypad_shiftregisterkeys_scan(keypad_shiftregisterkeys_obj_t *self) { return; } + keypad_shiftregisterkeys_scan_now(self, now); +} + +static void keypad_shiftregisterkeys_scan_now(keypad_shiftregisterkeys_obj_t *self, uint64_t now) { self->last_scan_ticks = now; mp_obj_t timestamp = supervisor_ticks_ms(); From d7c86c0e3e1df7964af9f999c3a6d9d374ba4998 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 5 Apr 2022 11:08:44 -0500 Subject: [PATCH 39/98] refactor keypad to share more code This saves 444 bytes on the pygamer build (both commits taken together) testing performed: * pygamer (samd51) with ShiftRegisterKeys * macropad (rp2040) with Keys * UM feather s2 (esp32-s2) with KeyMatrix Result: * all ports still worked nicely * keys held down at start always registered (>2 trials all boards, >100 trials esp32-s2) * keys held down are immediately registered after reset() (>100 trials esp32-s2) * double .reset() is OK, accessing .events throws (only tested esp32-s2) --- locale/circuitpython.pot | 59 +---------------- shared-bindings/keypad/KeyMatrix.c | 47 ++------------ shared-bindings/keypad/KeyMatrix.h | 5 -- shared-bindings/keypad/Keys.c | 49 ++------------ shared-bindings/keypad/Keys.h | 5 -- shared-bindings/keypad/ShiftRegisterKeys.c | 49 ++------------ shared-bindings/keypad/ShiftRegisterKeys.h | 5 -- shared-bindings/keypad/__init__.c | 47 ++++++++++++++ shared-bindings/keypad/__init__.h | 13 ++-- shared-module/keypad/EventQueue.h | 2 +- shared-module/keypad/KeyMatrix.c | 60 +++++------------- shared-module/keypad/KeyMatrix.h | 9 +-- shared-module/keypad/Keys.c | 63 +++++------------- shared-module/keypad/Keys.h | 9 +-- shared-module/keypad/ShiftRegisterKeys.c | 64 ++++++------------- shared-module/keypad/ShiftRegisterKeys.h | 9 +-- shared-module/keypad/__init__.c | 74 +++++++++++++++++++--- shared-module/keypad/__init__.h | 23 ++++++- 18 files changed, 212 insertions(+), 380 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 0ce564f1f7..83d96811cf 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -4067,63 +4067,8 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" diff --git a/shared-bindings/keypad/KeyMatrix.c b/shared-bindings/keypad/KeyMatrix.c index 486fa0b9b5..87836ac174 100644 --- a/shared-bindings/keypad/KeyMatrix.c +++ b/shared-bindings/keypad/KeyMatrix.c @@ -28,6 +28,7 @@ #include "py/binary.h" #include "py/objproperty.h" #include "py/runtime.h" +#include "shared-bindings/keypad/__init__.h" #include "shared-bindings/keypad/Event.h" #include "shared-bindings/keypad/KeyMatrix.h" #include "shared-bindings/microcontroller/Pin.h" @@ -138,7 +139,7 @@ STATIC mp_obj_t keypad_keymatrix___exit__(size_t n_args, const mp_obj_t *args) { STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(keypad_keymatrix___exit___obj, 4, 4, keypad_keymatrix___exit__); STATIC void check_for_deinit(keypad_keymatrix_obj_t *self) { - if (common_hal_keypad_keymatrix_deinited(self)) { + if (common_hal_keypad_deinited(self)) { raise_deinited_error(); } } @@ -150,33 +151,11 @@ STATIC void check_for_deinit(keypad_keymatrix_obj_t *self) { //| """ //| ... //| -STATIC mp_obj_t keypad_keymatrix_reset(mp_obj_t self_in) { - keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - common_hal_keypad_keymatrix_reset(self); - return MP_ROM_NONE; -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_keymatrix_reset_obj, keypad_keymatrix_reset); //| key_count: int //| """The number of keys that are being scanned. (read-only) //| """ //| -STATIC mp_obj_t keypad_keymatrix_get_key_count(mp_obj_t self_in) { - keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - return MP_OBJ_NEW_SMALL_INT(common_hal_keypad_keymatrix_get_key_count(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_keymatrix_get_key_count_obj, keypad_keymatrix_get_key_count); - -const mp_obj_property_t keypad_keymatrix_key_count_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_keymatrix_get_key_count_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; //| def key_number_to_row_column(self, row: int, column: int) -> Tuple[int]: //| """Return the row and column for the given key number. @@ -194,7 +173,7 @@ STATIC mp_obj_t keypad_keymatrix_key_number_to_row_column(mp_obj_t self_in, mp_o const mp_uint_t key_number = (mp_uint_t)mp_arg_validate_int_range( mp_obj_get_int(key_number_in), - 0, (mp_int_t)common_hal_keypad_keymatrix_get_key_count(self), + 0, (mp_int_t)common_hal_keypad_generic_get_key_count(self), MP_QSTR_key_number); mp_uint_t row; @@ -234,29 +213,15 @@ MP_DEFINE_CONST_FUN_OBJ_3(keypad_keymatrix_row_column_to_key_number_obj, keypad_ //| """The `EventQueue` associated with this `Keys` object. (read-only) //| """ //| -STATIC mp_obj_t keypad_keymatrix_get_events(mp_obj_t self_in) { - keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - return common_hal_keypad_keymatrix_get_events(self); -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_keymatrix_get_events_obj, keypad_keymatrix_get_events); - -const mp_obj_property_t keypad_keymatrix_events_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_keymatrix_get_events_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; STATIC const mp_rom_map_elem_t keypad_keymatrix_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&keypad_keymatrix_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&keypad_keymatrix___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_events), MP_ROM_PTR(&keypad_keymatrix_events_obj) }, - { MP_ROM_QSTR(MP_QSTR_key_count), MP_ROM_PTR(&keypad_keymatrix_key_count_obj) }, - { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&keypad_keymatrix_reset_obj) }, + { MP_ROM_QSTR(MP_QSTR_events), MP_ROM_PTR(&keypad_generic_events_obj) }, + { MP_ROM_QSTR(MP_QSTR_key_count), MP_ROM_PTR(&keypad_generic_key_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&keypad_generic_reset_obj) }, { MP_ROM_QSTR(MP_QSTR_key_number_to_row_column), MP_ROM_PTR(&keypad_keymatrix_key_number_to_row_column_obj) }, { MP_ROM_QSTR(MP_QSTR_row_column_to_key_number), MP_ROM_PTR(&keypad_keymatrix_row_column_to_key_number_obj) }, }; diff --git a/shared-bindings/keypad/KeyMatrix.h b/shared-bindings/keypad/KeyMatrix.h index 29a94fbf66..bdf77dd32a 100644 --- a/shared-bindings/keypad/KeyMatrix.h +++ b/shared-bindings/keypad/KeyMatrix.h @@ -35,16 +35,11 @@ extern const mp_obj_type_t keypad_keymatrix_type; void common_hal_keypad_keymatrix_construct(keypad_keymatrix_obj_t *self, mp_uint_t num_row_pins, const mcu_pin_obj_t *row_pins[], mp_uint_t num_column_pins, const mcu_pin_obj_t *column_pins[], bool columns_to_anodes, mp_float_t interval, size_t max_events); void common_hal_keypad_keymatrix_deinit(keypad_keymatrix_obj_t *self); -bool common_hal_keypad_keymatrix_deinited(keypad_keymatrix_obj_t *self); void common_hal_keypad_keymatrix_key_number_to_row_column(keypad_keymatrix_obj_t *self, mp_uint_t key_number, mp_uint_t *row, mp_uint_t *column); mp_uint_t common_hal_keypad_keymatrix_row_column_to_key_number(keypad_keymatrix_obj_t *self, mp_uint_t row, mp_uint_t column); -size_t common_hal_keypad_keymatrix_get_key_count(keypad_keymatrix_obj_t *self); size_t common_hal_keypad_keymatrix_get_column_count(keypad_keymatrix_obj_t *self); size_t common_hal_keypad_keymatrix_get_row_count(keypad_keymatrix_obj_t *self); -mp_obj_t common_hal_keypad_keymatrix_get_events(keypad_keymatrix_obj_t *self); -void common_hal_keypad_keymatrix_reset(keypad_keymatrix_obj_t *self); - #endif // MICROPY_INCLUDED_SHARED_BINDINGS_KEYPAD_KEYMATRIX_H diff --git a/shared-bindings/keypad/Keys.c b/shared-bindings/keypad/Keys.c index 2da55bccba..6ac705eba6 100644 --- a/shared-bindings/keypad/Keys.c +++ b/shared-bindings/keypad/Keys.c @@ -28,6 +28,7 @@ #include "py/binary.h" #include "py/objproperty.h" #include "py/runtime.h" +#include "shared-bindings/keypad/__init__.h" #include "shared-bindings/keypad/Event.h" #include "shared-bindings/keypad/Keys.h" #include "shared-bindings/microcontroller/Pin.h" @@ -129,11 +130,6 @@ STATIC mp_obj_t keypad_keys___exit__(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(keypad_keys___exit___obj, 4, 4, keypad_keys___exit__); -STATIC void check_for_deinit(keypad_keys_obj_t *self) { - if (common_hal_keypad_keys_deinited(self)) { - raise_deinited_error(); - } -} //| def reset(self) -> None: //| """Reset the internal state of the scanner to assume that all keys are now released. @@ -142,61 +138,24 @@ STATIC void check_for_deinit(keypad_keys_obj_t *self) { //| """ //| ... //| -STATIC mp_obj_t keypad_keys_reset(mp_obj_t self_in) { - keypad_keys_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - common_hal_keypad_keys_reset(self); - return MP_ROM_NONE; -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_keys_reset_obj, keypad_keys_reset); //| key_count: int //| """The number of keys that are being scanned. (read-only) //| """ //| -STATIC mp_obj_t keypad_keys_get_key_count(mp_obj_t self_in) { - keypad_keys_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - return MP_OBJ_NEW_SMALL_INT(common_hal_keypad_keys_get_key_count(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_keys_get_key_count_obj, keypad_keys_get_key_count); - -const mp_obj_property_t keypad_keys_key_count_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_keys_get_key_count_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; //| events: EventQueue //| """The `EventQueue` associated with this `Keys` object. (read-only) //| """ //| -STATIC mp_obj_t keypad_keys_get_events(mp_obj_t self_in) { - keypad_keys_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - return common_hal_keypad_keys_get_events(self); -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_keys_get_events_obj, keypad_keys_get_events); - -const mp_obj_property_t keypad_keys_events_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_keys_get_events_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; - STATIC const mp_rom_map_elem_t keypad_keys_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&keypad_keys_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&keypad_keys___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_events), MP_ROM_PTR(&keypad_keys_events_obj) }, - { MP_ROM_QSTR(MP_QSTR_key_count), MP_ROM_PTR(&keypad_keys_key_count_obj) }, - { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&keypad_keys_reset_obj) }, + { MP_ROM_QSTR(MP_QSTR_events), MP_ROM_PTR(&keypad_generic_events_obj) }, + { MP_ROM_QSTR(MP_QSTR_key_count), MP_ROM_PTR(&keypad_generic_key_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&keypad_generic_reset_obj) }, }; STATIC MP_DEFINE_CONST_DICT(keypad_keys_locals_dict, keypad_keys_locals_dict_table); diff --git a/shared-bindings/keypad/Keys.h b/shared-bindings/keypad/Keys.h index 89da18189a..eb833b97d6 100644 --- a/shared-bindings/keypad/Keys.h +++ b/shared-bindings/keypad/Keys.h @@ -35,10 +35,5 @@ extern const mp_obj_type_t keypad_keys_type; void common_hal_keypad_keys_construct(keypad_keys_obj_t *self, mp_uint_t num_pins, const mcu_pin_obj_t *pins[], bool value_when_pressed, bool pull, mp_float_t interval, size_t max_events); void common_hal_keypad_keys_deinit(keypad_keys_obj_t *self); -bool common_hal_keypad_keys_deinited(keypad_keys_obj_t *self); - -mp_obj_t common_hal_keypad_keys_get_events(keypad_keys_obj_t *self); -size_t common_hal_keypad_keys_get_key_count(keypad_keys_obj_t *self); -void common_hal_keypad_keys_reset(keypad_keys_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_KEYPAD_KEYS_H diff --git a/shared-bindings/keypad/ShiftRegisterKeys.c b/shared-bindings/keypad/ShiftRegisterKeys.c index 0032a45438..14ab87436b 100644 --- a/shared-bindings/keypad/ShiftRegisterKeys.c +++ b/shared-bindings/keypad/ShiftRegisterKeys.c @@ -28,6 +28,7 @@ #include "py/binary.h" #include "py/objproperty.h" #include "py/runtime.h" +#include "shared-bindings/keypad/__init__.h" #include "shared-bindings/keypad/Event.h" #include "shared-bindings/keypad/ShiftRegisterKeys.h" #include "shared-bindings/microcontroller/Pin.h" @@ -133,12 +134,6 @@ STATIC mp_obj_t keypad_shiftregisterkeys___exit__(size_t n_args, const mp_obj_t } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(keypad_shiftregisterkeys___exit___obj, 4, 4, keypad_shiftregisterkeys___exit__); -STATIC void check_for_deinit(keypad_shiftregisterkeys_obj_t *self) { - if (common_hal_keypad_shiftregisterkeys_deinited(self)) { - raise_deinited_error(); - } -} - //| def reset(self) -> None: //| """Reset the internal state of the scanner to assume that all keys are now released. //| Any key that is already pressed at the time of this call will therefore immediately cause @@ -146,61 +141,25 @@ STATIC void check_for_deinit(keypad_shiftregisterkeys_obj_t *self) { //| """ //| ... //| -STATIC mp_obj_t keypad_shiftregisterkeys_reset(mp_obj_t self_in) { - keypad_shiftregisterkeys_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - common_hal_keypad_shiftregisterkeys_reset(self); - return MP_ROM_NONE; -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_shiftregisterkeys_reset_obj, keypad_shiftregisterkeys_reset); //| key_count: int //| """The number of keys that are being scanned. (read-only) //| """ //| -STATIC mp_obj_t keypad_shiftregisterkeys_get_key_count(mp_obj_t self_in) { - keypad_shiftregisterkeys_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - return MP_OBJ_NEW_SMALL_INT(common_hal_keypad_shiftregisterkeys_get_key_count(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_shiftregisterkeys_get_key_count_obj, keypad_shiftregisterkeys_get_key_count); - -const mp_obj_property_t keypad_shiftregisterkeys_key_count_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_shiftregisterkeys_get_key_count_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; //| events: EventQueue //| """The `EventQueue` associated with this `Keys` object. (read-only) //| """ //| -STATIC mp_obj_t keypad_shiftregisterkeys_get_events(mp_obj_t self_in) { - keypad_shiftregisterkeys_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - return common_hal_keypad_shiftregisterkeys_get_events(self); -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_shiftregisterkeys_get_events_obj, keypad_shiftregisterkeys_get_events); - -const mp_obj_property_t keypad_shiftregisterkeys_events_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_shiftregisterkeys_get_events_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; STATIC const mp_rom_map_elem_t keypad_shiftregisterkeys_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&keypad_shiftregisterkeys_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&keypad_shiftregisterkeys___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_events), MP_ROM_PTR(&keypad_shiftregisterkeys_events_obj) }, - { MP_ROM_QSTR(MP_QSTR_key_count), MP_ROM_PTR(&keypad_shiftregisterkeys_key_count_obj) }, - { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&keypad_shiftregisterkeys_reset_obj) }, + { MP_ROM_QSTR(MP_QSTR_events), MP_ROM_PTR(&keypad_generic_events_obj) }, + { MP_ROM_QSTR(MP_QSTR_key_count), MP_ROM_PTR(&keypad_generic_key_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&keypad_generic_reset_obj) }, }; STATIC MP_DEFINE_CONST_DICT(keypad_shiftregisterkeys_locals_dict, keypad_shiftregisterkeys_locals_dict_table); diff --git a/shared-bindings/keypad/ShiftRegisterKeys.h b/shared-bindings/keypad/ShiftRegisterKeys.h index 62ab14d340..bc91c78ab0 100644 --- a/shared-bindings/keypad/ShiftRegisterKeys.h +++ b/shared-bindings/keypad/ShiftRegisterKeys.h @@ -35,10 +35,5 @@ extern const mp_obj_type_t keypad_shiftregisterkeys_type; void common_hal_keypad_shiftregisterkeys_construct(keypad_shiftregisterkeys_obj_t *self, const mcu_pin_obj_t *clock_pin, const mcu_pin_obj_t *data_pin, const mcu_pin_obj_t *latch_pin, bool value_to_latch, size_t key_count, bool value_when_pressed, mp_float_t interval, size_t max_events); void common_hal_keypad_shiftregisterkeys_deinit(keypad_shiftregisterkeys_obj_t *self); -bool common_hal_keypad_shiftregisterkeys_deinited(keypad_shiftregisterkeys_obj_t *self); - -mp_obj_t common_hal_keypad_shiftregisterkeys_get_events(keypad_shiftregisterkeys_obj_t *self); -size_t common_hal_keypad_shiftregisterkeys_get_key_count(keypad_shiftregisterkeys_obj_t *self); -void common_hal_keypad_shiftregisterkeys_reset(keypad_shiftregisterkeys_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_KEYPAD_SHIFTREGISTERKEYS_H diff --git a/shared-bindings/keypad/__init__.c b/shared-bindings/keypad/__init__.c index 4450e892ca..97db750af7 100644 --- a/shared-bindings/keypad/__init__.c +++ b/shared-bindings/keypad/__init__.c @@ -32,6 +32,53 @@ #include "shared-bindings/keypad/KeyMatrix.h" #include "shared-bindings/keypad/Keys.h" #include "shared-bindings/keypad/ShiftRegisterKeys.h" +#include "shared-bindings/util.h" + +STATIC void check_for_deinit(keypad_keymatrix_obj_t *self) { + if (common_hal_keypad_deinited(self)) { + raise_deinited_error(); + } +} + +STATIC mp_obj_t keypad_generic_reset(mp_obj_t self_in) { + keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + common_hal_keypad_generic_reset(self); + return MP_ROM_NONE; +} +MP_DEFINE_CONST_FUN_OBJ_1(keypad_generic_reset_obj, keypad_generic_reset); + +STATIC mp_obj_t keypad_generic_get_key_count(mp_obj_t self_in) { + keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + return MP_OBJ_NEW_SMALL_INT(common_hal_keypad_generic_get_key_count(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(keypad_generic_get_key_count_obj, keypad_generic_get_key_count); + +const mp_obj_property_t keypad_generic_key_count_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&keypad_generic_get_key_count_obj, + MP_ROM_NONE, + MP_ROM_NONE}, +}; + +STATIC mp_obj_t keypad_generic_get_events(mp_obj_t self_in) { + keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + return common_hal_keypad_generic_get_events(self); +} +MP_DEFINE_CONST_FUN_OBJ_1(keypad_generic_get_events_obj, keypad_generic_get_events); + +const mp_obj_property_t keypad_generic_events_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&keypad_generic_get_events_obj, + MP_ROM_NONE, + MP_ROM_NONE}, +}; + //| """Support for scanning keys and key matrices //| diff --git a/shared-bindings/keypad/__init__.h b/shared-bindings/keypad/__init__.h index 5e484dc5ed..eb3b16aa4b 100644 --- a/shared-bindings/keypad/__init__.h +++ b/shared-bindings/keypad/__init__.h @@ -28,14 +28,17 @@ #define SHARED_BINDINGS_KEYPAD_H #include "py/obj.h" -#include "py/objtuple.h" +#include "py/objproperty.h" #include "shared-module/keypad/__init__.h" -extern mp_obj_tuple_t common_hal_keypad_devices; +bool common_hal_keypad_deinited(void *self); +void common_hal_keypad_generic_reset(void *self); +size_t common_hal_keypad_generic_get_key_count(void *self); +mp_obj_t common_hal_keypad_generic_get_events(void *self); -void keypad_set_devices(mp_obj_t devices); +MP_DECLARE_CONST_FUN_OBJ_1(keypad_generic_reset_obj); -bool common_hal_keypad_disable(void); -bool common_hal_keypad_enable(const mp_obj_t devices_seq); +extern const mp_obj_property_t keypad_generic_events_obj; +extern const mp_obj_property_t keypad_generic_key_count_obj; #endif // SHARED_BINDINGS_KEYPAD_H diff --git a/shared-module/keypad/EventQueue.h b/shared-module/keypad/EventQueue.h index f686d45960..b523b16cac 100644 --- a/shared-module/keypad/EventQueue.h +++ b/shared-module/keypad/EventQueue.h @@ -30,7 +30,7 @@ #include "py/obj.h" #include "py/ringbuf.h" -typedef struct { +typedef struct _keypad_eventqueue_obj_t { mp_obj_base_t base; ringbuf_t encoded_events; bool overflowed; diff --git a/shared-module/keypad/KeyMatrix.c b/shared-module/keypad/KeyMatrix.c index aa5e6378db..b2520521cc 100644 --- a/shared-module/keypad/KeyMatrix.c +++ b/shared-module/keypad/KeyMatrix.c @@ -37,7 +37,13 @@ #include "supervisor/port.h" #include "supervisor/shared/tick.h" -static void keypad_keymatrix_scan_now(keypad_keymatrix_obj_t *self, uint64_t now); +static void keymatrix_scan_now(void *self_in, mp_obj_t timestamp); +static size_t keymatrix_get_key_count(void *self_in); + +static keypad_scanner_funcs_t keymatrix_funcs = { + .scan_now = keymatrix_scan_now, + .get_key_count = keymatrix_get_key_count, +}; static mp_uint_t row_column_to_key_number(keypad_keymatrix_obj_t *self, mp_uint_t row, mp_uint_t column) { return row * self->column_digitalinouts->len + column; @@ -69,21 +75,13 @@ void common_hal_keypad_keymatrix_construct(keypad_keymatrix_obj_t *self, mp_uint self->previously_pressed = (bool *)gc_alloc(sizeof(bool) * num_row_pins * num_column_pins, false, false); self->columns_to_anodes = columns_to_anodes; + self->funcs = &keymatrix_funcs; - keypad_eventqueue_obj_t *events = m_new_obj(keypad_eventqueue_obj_t); - events->base.type = &keypad_eventqueue_type; - common_hal_keypad_eventqueue_construct(events, max_events); - self->events = events; - - self->interval_ticks = (mp_uint_t)(interval * 1024); // interval * 1000 * (1024/1000) - - // Add self to the list of active keypad scanners. - keypad_register_scanner((keypad_scanner_obj_t *)self); - keypad_keymatrix_scan_now(self, port_get_raw_ticks(NULL)); + keypad_construct_common((keypad_scanner_obj_t *)self, interval, max_events); } void common_hal_keypad_keymatrix_deinit(keypad_keymatrix_obj_t *self) { - if (common_hal_keypad_keymatrix_deinited(self)) { + if (common_hal_keypad_deinited(self)) { return; } @@ -99,14 +97,7 @@ void common_hal_keypad_keymatrix_deinit(keypad_keymatrix_obj_t *self) { common_hal_digitalio_digitalinout_deinit(self->column_digitalinouts->items[column]); } self->column_digitalinouts = MP_ROM_NONE; -} - -bool common_hal_keypad_keymatrix_deinited(keypad_keymatrix_obj_t *self) { - return self->row_digitalinouts == MP_ROM_NONE; -} - -size_t common_hal_keypad_keymatrix_get_key_count(keypad_keymatrix_obj_t *self) { - return common_hal_keypad_keymatrix_get_row_count(self) * common_hal_keypad_keymatrix_get_column_count(self); + common_hal_keypad_deinit_core(self); } size_t common_hal_keypad_keymatrix_get_row_count(keypad_keymatrix_obj_t *self) { @@ -127,32 +118,13 @@ void common_hal_keypad_keymatrix_key_number_to_row_column(keypad_keymatrix_obj_t *column = key_number % num_columns; } -mp_obj_t common_hal_keypad_keymatrix_get_events(keypad_keymatrix_obj_t *self) { - return MP_OBJ_FROM_PTR(self->events); +static size_t keymatrix_get_key_count(void *self_in) { + keypad_keymatrix_obj_t *self = self_in; + return common_hal_keypad_keymatrix_get_column_count(self) * common_hal_keypad_keymatrix_get_row_count(self); } -void common_hal_keypad_keymatrix_reset(keypad_keymatrix_obj_t *self) { - const size_t key_count = common_hal_keypad_keymatrix_get_key_count(self); - - memset(self->previously_pressed, false, key_count); - memset(self->currently_pressed, false, key_count); - keypad_keymatrix_scan_now(self, port_get_raw_ticks(NULL)); -} - -void keypad_keymatrix_scan(keypad_keymatrix_obj_t *self) { - uint64_t now = port_get_raw_ticks(NULL); - if (now - self->last_scan_ticks < self->interval_ticks) { - // Too soon. Wait longer to debounce. - return; - } - - keypad_keymatrix_scan_now(self, now); -} - -static void keypad_keymatrix_scan_now(keypad_keymatrix_obj_t *self, uint64_t now) { - self->last_scan_ticks = now; - - mp_obj_t timestamp = supervisor_ticks_ms(); +static void keymatrix_scan_now(void *self_in, mp_obj_t timestamp) { + keypad_keymatrix_obj_t *self = self_in; // On entry, all pins are set to inputs with a pull-up or pull-down, // depending on the diode orientation. diff --git a/shared-module/keypad/KeyMatrix.h b/shared-module/keypad/KeyMatrix.h index bd7e2d23e2..8049fcbb90 100644 --- a/shared-module/keypad/KeyMatrix.h +++ b/shared-module/keypad/KeyMatrix.h @@ -35,16 +35,9 @@ #include "shared-module/keypad/EventQueue.h" typedef struct { - mp_obj_base_t base; - // All scanners have a next field here, to keep a linked list of active scanners. - keypad_scanner_obj_t *next; + KEYPAD_SCANNER_COMMON_FIELDS; mp_obj_tuple_t *row_digitalinouts; mp_obj_tuple_t *column_digitalinouts; - mp_uint_t interval_ticks; - uint64_t last_scan_ticks; - bool *previously_pressed; - bool *currently_pressed; - keypad_eventqueue_obj_t *events; bool columns_to_anodes; } keypad_keymatrix_obj_t; diff --git a/shared-module/keypad/Keys.c b/shared-module/keypad/Keys.c index 01ba275cc0..d74a3ab859 100644 --- a/shared-module/keypad/Keys.c +++ b/shared-module/keypad/Keys.c @@ -36,7 +36,13 @@ #include "supervisor/port.h" #include "supervisor/shared/tick.h" -static void keypad_keys_scan_now(keypad_keys_obj_t *self, uint64_t now); +static void keypad_keys_scan_now(void *self_in, mp_obj_t timestamp); +static size_t keys_get_key_count(void *self_in); + +static keypad_scanner_funcs_t keys_funcs = { + .scan_now = keypad_keys_scan_now, + .get_key_count = keys_get_key_count, +}; void common_hal_keypad_keys_construct(keypad_keys_obj_t *self, mp_uint_t num_pins, const mcu_pin_obj_t *pins[], bool value_when_pressed, bool pull, mp_float_t interval, size_t max_events) { mp_obj_t dios[num_pins]; @@ -55,71 +61,36 @@ void common_hal_keypad_keys_construct(keypad_keys_obj_t *self, mp_uint_t num_pin self->currently_pressed = (bool *)gc_alloc(sizeof(bool) * num_pins, false, false); self->previously_pressed = (bool *)gc_alloc(sizeof(bool) * num_pins, false, false); self->value_when_pressed = value_when_pressed; + self->funcs = &keys_funcs; - self->interval_ticks = (mp_uint_t)(interval * 1024); // interval * 1000 * (1024/1000) - self->last_scan_ticks = port_get_raw_ticks(NULL); + keypad_construct_common((keypad_scanner_obj_t *)self, interval, max_events); - keypad_eventqueue_obj_t *events = m_new_obj(keypad_eventqueue_obj_t); - events->base.type = &keypad_eventqueue_type; - common_hal_keypad_eventqueue_construct(events, max_events); - self->events = events; - - // Add self to the list of active keypad scanners. - keypad_register_scanner((keypad_scanner_obj_t *)self); - keypad_keys_scan_now(self, port_get_raw_ticks(NULL)); } void common_hal_keypad_keys_deinit(keypad_keys_obj_t *self) { - if (common_hal_keypad_keys_deinited(self)) { + if (common_hal_keypad_deinited(self)) { return; } // Remove self from the list of active keypad scanners first. keypad_deregister_scanner((keypad_scanner_obj_t *)self); - for (size_t key = 0; key < common_hal_keypad_keys_get_key_count(self); key++) { + for (size_t key = 0; key < keys_get_key_count(self); key++) { common_hal_digitalio_digitalinout_deinit(self->digitalinouts->items[key]); } self->digitalinouts = MP_ROM_NONE; + common_hal_keypad_deinit_core(self); } -bool common_hal_keypad_keys_deinited(keypad_keys_obj_t *self) { - return self->digitalinouts == MP_ROM_NONE; -} - -size_t common_hal_keypad_keys_get_key_count(keypad_keys_obj_t *self) { +size_t keys_get_key_count(void *self_in) { + keypad_keys_obj_t *self = self_in; return self->digitalinouts->len; } -mp_obj_t common_hal_keypad_keys_get_events(keypad_keys_obj_t *self) { - return MP_OBJ_FROM_PTR(self->events); -} - -void common_hal_keypad_keys_reset(keypad_keys_obj_t *self) { - const size_t key_count = common_hal_keypad_keys_get_key_count(self); - - memset(self->previously_pressed, false, key_count); - memset(self->currently_pressed, false, key_count); - keypad_keys_scan_now(self, port_get_raw_ticks(NULL)); -} - -void keypad_keys_scan(keypad_keys_obj_t *self) { - uint64_t now = port_get_raw_ticks(NULL); - if (now - self->last_scan_ticks < self->interval_ticks) { - // Too soon. Wait longer to debounce. - return; - } - - keypad_keys_scan_now(self, now); -} - -static void keypad_keys_scan_now(keypad_keys_obj_t *self, uint64_t now) { - self->last_scan_ticks = now; - - const size_t key_count = common_hal_keypad_keys_get_key_count(self); - - mp_obj_t timestamp = supervisor_ticks_ms(); +static void keypad_keys_scan_now(void *self_in, mp_obj_t timestamp) { + keypad_keys_obj_t *self = self_in; + size_t key_count = keys_get_key_count(self); for (mp_uint_t key_number = 0; key_number < key_count; key_number++) { // Remember the previous up/down state. diff --git a/shared-module/keypad/Keys.h b/shared-module/keypad/Keys.h index 3edae32439..6bd7d7ac31 100644 --- a/shared-module/keypad/Keys.h +++ b/shared-module/keypad/Keys.h @@ -35,15 +35,8 @@ #include "shared-module/keypad/EventQueue.h" typedef struct { - mp_obj_base_t base; - // All scanners have a next field here, to keep a linked list of active scanners. - keypad_scanner_obj_t *next; + KEYPAD_SCANNER_COMMON_FIELDS; mp_obj_tuple_t *digitalinouts; - mp_uint_t interval_ticks; - uint64_t last_scan_ticks; - bool *previously_pressed; - bool *currently_pressed; - keypad_eventqueue_obj_t *events; bool value_when_pressed; } keypad_keys_obj_t; diff --git a/shared-module/keypad/ShiftRegisterKeys.c b/shared-module/keypad/ShiftRegisterKeys.c index da9e09d7d8..b2b10c65a2 100644 --- a/shared-module/keypad/ShiftRegisterKeys.c +++ b/shared-module/keypad/ShiftRegisterKeys.c @@ -36,7 +36,13 @@ #include "supervisor/port.h" #include "supervisor/shared/tick.h" -static void keypad_shiftregisterkeys_scan_now(keypad_shiftregisterkeys_obj_t *self, uint64_t now); +static void shiftregisterkeys_scan_now(void *self, mp_obj_t timestamp); +static size_t shiftregisterkeys_get_key_count(void *self); + +static keypad_scanner_funcs_t shiftregisterkeys_funcs = { + .scan_now = shiftregisterkeys_scan_now, + .get_key_count = shiftregisterkeys_get_key_count, +}; void common_hal_keypad_shiftregisterkeys_construct(keypad_shiftregisterkeys_obj_t *self, const mcu_pin_obj_t *clock_pin, const mcu_pin_obj_t *data_pin, const mcu_pin_obj_t *latch_pin, bool value_to_latch, size_t key_count, bool value_when_pressed, mp_float_t interval, size_t max_events) { @@ -54,30 +60,21 @@ void common_hal_keypad_shiftregisterkeys_construct(keypad_shiftregisterkeys_obj_ digitalio_digitalinout_obj_t *latch = m_new_obj(digitalio_digitalinout_obj_t); latch->base.type = &digitalio_digitalinout_type; + common_hal_digitalio_digitalinout_construct(latch, latch_pin); common_hal_digitalio_digitalinout_switch_to_output(latch, true, DRIVE_MODE_PUSH_PULL); self->latch = latch; self->value_to_latch = value_to_latch; - self->currently_pressed = (bool *)gc_alloc(sizeof(bool) * key_count, false, false); - self->previously_pressed = (bool *)gc_alloc(sizeof(bool) * key_count, false, false); self->value_when_pressed = value_when_pressed; self->key_count = key_count; + self->funcs = &shiftregisterkeys_funcs; - self->interval_ticks = (mp_uint_t)(interval * 1024); // interval * 1000 * (1024/1000) - - keypad_eventqueue_obj_t *events = m_new_obj(keypad_eventqueue_obj_t); - events->base.type = &keypad_eventqueue_type; - common_hal_keypad_eventqueue_construct(events, max_events); - self->events = events; - - // Add self to the list of active keypad scanners. - keypad_register_scanner((keypad_scanner_obj_t *)self); - keypad_shiftregisterkeys_scan_now(self, port_get_raw_ticks(NULL)); + keypad_construct_common((keypad_scanner_obj_t *)self, interval, max_events); } void common_hal_keypad_shiftregisterkeys_deinit(keypad_shiftregisterkeys_obj_t *self) { - if (common_hal_keypad_shiftregisterkeys_deinited(self)) { + if (common_hal_keypad_deinited(self)) { return; } @@ -93,47 +90,22 @@ void common_hal_keypad_shiftregisterkeys_deinit(keypad_shiftregisterkeys_obj_t * common_hal_digitalio_digitalinout_deinit(self->latch); self->latch = MP_ROM_NONE; + + common_hal_keypad_deinit_core(self); } -bool common_hal_keypad_shiftregisterkeys_deinited(keypad_shiftregisterkeys_obj_t *self) { - return self->clock == MP_ROM_NONE; -} - -size_t common_hal_keypad_shiftregisterkeys_get_key_count(keypad_shiftregisterkeys_obj_t *self) { +size_t shiftregisterkeys_get_key_count(void *self_in) { + keypad_shiftregisterkeys_obj_t *self = self_in; return self->key_count; } -mp_obj_t common_hal_keypad_shiftregisterkeys_get_events(keypad_shiftregisterkeys_obj_t *self) { - return MP_OBJ_FROM_PTR(self->events); -} - -void common_hal_keypad_shiftregisterkeys_reset(keypad_shiftregisterkeys_obj_t *self) { - const size_t key_count = common_hal_keypad_shiftregisterkeys_get_key_count(self); - - memset(self->previously_pressed, false, key_count); - memset(self->currently_pressed, false, key_count); - keypad_shiftregisterkeys_scan_now(self, port_get_raw_ticks(NULL)); -} - -void keypad_shiftregisterkeys_scan(keypad_shiftregisterkeys_obj_t *self) { - uint64_t now = port_get_raw_ticks(NULL); - if (now - self->last_scan_ticks < self->interval_ticks) { - // Too soon. Wait longer to debounce. - return; - } - - keypad_shiftregisterkeys_scan_now(self, now); -} - -static void keypad_shiftregisterkeys_scan_now(keypad_shiftregisterkeys_obj_t *self, uint64_t now) { - self->last_scan_ticks = now; - - mp_obj_t timestamp = supervisor_ticks_ms(); +static void shiftregisterkeys_scan_now(void *self_in, mp_obj_t timestamp) { + keypad_shiftregisterkeys_obj_t *self = self_in; // Latch (freeze) the current state of the input pins. common_hal_digitalio_digitalinout_set_value(self->latch, self->value_to_latch); - const size_t key_count = common_hal_keypad_shiftregisterkeys_get_key_count(self); + const size_t key_count = shiftregisterkeys_get_key_count(self); for (mp_uint_t key_number = 0; key_number < key_count; key_number++) { // Zero-th data appears on on the data pin immediately, without shifting. diff --git a/shared-module/keypad/ShiftRegisterKeys.h b/shared-module/keypad/ShiftRegisterKeys.h index b04c622679..84c66ef627 100644 --- a/shared-module/keypad/ShiftRegisterKeys.h +++ b/shared-module/keypad/ShiftRegisterKeys.h @@ -35,18 +35,11 @@ #include "shared-module/keypad/EventQueue.h" typedef struct { - mp_obj_base_t base; - // All scanners have a next field here, to keep a linked list of active scanners. - keypad_scanner_obj_t *next; + KEYPAD_SCANNER_COMMON_FIELDS; digitalio_digitalinout_obj_t *clock; digitalio_digitalinout_obj_t *data; digitalio_digitalinout_obj_t *latch; size_t key_count; - mp_uint_t interval_ticks; - uint64_t last_scan_ticks; - bool *previously_pressed; - bool *currently_pressed; - keypad_eventqueue_obj_t *events; bool value_when_pressed; bool value_to_latch; } keypad_shiftregisterkeys_obj_t; diff --git a/shared-module/keypad/__init__.c b/shared-module/keypad/__init__.c index e239c56b61..d2f5521a25 100644 --- a/shared-module/keypad/__init__.c +++ b/shared-module/keypad/__init__.c @@ -24,13 +24,20 @@ * THE SOFTWARE. */ +#include +#include "shared-bindings/keypad/__init__.h" +#include "shared-bindings/keypad/EventQueue.h" #include "shared-bindings/keypad/Keys.h" #include "shared-bindings/keypad/KeyMatrix.h" #include "shared-bindings/keypad/ShiftRegisterKeys.h" +#include "shared-bindings/supervisor/__init__.h" +#include "supervisor/port.h" #include "supervisor/shared/lock.h" #include "supervisor/shared/tick.h" supervisor_lock_t keypad_scanners_linked_list_lock; +static void keypad_scan_now(keypad_scanner_obj_t *self, uint64_t now); +static void keypad_scan_maybe(keypad_scanner_obj_t *self, uint64_t now); void keypad_tick(void) { // Fast path. Return immediately there are no scanners. @@ -40,16 +47,10 @@ void keypad_tick(void) { // Skip scanning if someone else has the lock. Don't wait for the lock. if (supervisor_try_lock(&keypad_scanners_linked_list_lock)) { + uint64_t now = port_get_raw_ticks(NULL); mp_obj_t scanner = MP_STATE_VM(keypad_scanners_linked_list); while (scanner) { - if (mp_obj_is_type(scanner, &keypad_keys_type)) { - keypad_keys_scan((keypad_keys_obj_t *)scanner); - } else if (mp_obj_is_type(scanner, &keypad_keymatrix_type)) { - keypad_keymatrix_scan((keypad_keymatrix_obj_t *)scanner); - } else if (mp_obj_is_type(scanner, &keypad_shiftregisterkeys_type)) { - keypad_shiftregisterkeys_scan((keypad_shiftregisterkeys_obj_t *)scanner); - } - + keypad_scan_maybe(scanner, now); scanner = ((keypad_scanner_obj_t *)scanner)->next; } supervisor_release_lock(&keypad_scanners_linked_list_lock); @@ -97,3 +98,60 @@ void keypad_deregister_scanner(keypad_scanner_obj_t *scanner) { } supervisor_release_lock(&keypad_scanners_linked_list_lock); } + +void keypad_construct_common(keypad_scanner_obj_t *self, mp_float_t interval, size_t max_events) { + size_t key_count = common_hal_keypad_generic_get_key_count(self); + self->currently_pressed = (bool *)gc_alloc(sizeof(bool) * key_count, false, false); + self->previously_pressed = (bool *)gc_alloc(sizeof(bool) * key_count, false, false); + + self->interval_ticks = (mp_uint_t)(interval * 1024); // interval * 1000 * (1024/1000) + + keypad_eventqueue_obj_t *events = m_new_obj(keypad_eventqueue_obj_t); + events->base.type = &keypad_eventqueue_type; + common_hal_keypad_eventqueue_construct(events, max_events); + self->events = events; + + // Add self to the list of active keypad scanners. + keypad_register_scanner(self); + keypad_scan_now(self, port_get_raw_ticks(NULL)); +} + +static void keypad_scan_now(keypad_scanner_obj_t *self, uint64_t now) { + self->next_scan_ticks = now + self->interval_ticks; + self->funcs->scan_now(self, supervisor_ticks_ms()); +} + +static void keypad_scan_maybe(keypad_scanner_obj_t *self, uint64_t now) { + if (now < self->next_scan_ticks) { + return; + } + keypad_scan_now(self, now); +} + +void common_hal_keypad_generic_reset(void *self_in) { + keypad_scanner_obj_t *self = self_in; + size_t key_count = common_hal_keypad_generic_get_key_count(self); + memset(self->previously_pressed, false, key_count); + memset(self->currently_pressed, false, key_count); + keypad_scan_now(self, port_get_raw_ticks(NULL)); +} + +void common_hal_keypad_deinit_core(void *self_in) { + keypad_scanner_obj_t *self = self_in; + self->events = NULL; +} + +bool common_hal_keypad_deinited(void *self_in) { + keypad_scanner_obj_t *self = self_in; + return !self->events; +} + +size_t common_hal_keypad_generic_get_key_count(void *self_in) { + keypad_scanner_obj_t *self = self_in; + return self->funcs->get_key_count(self); +} + +mp_obj_t common_hal_keypad_generic_get_events(void *self_in) { + keypad_scanner_obj_t *self = self_in; + return self->events; +} diff --git a/shared-module/keypad/__init__.h b/shared-module/keypad/__init__.h index c5b8fe3a0a..cc792ff791 100644 --- a/shared-module/keypad/__init__.h +++ b/shared-module/keypad/__init__.h @@ -30,12 +30,26 @@ #include "py/obj.h" #include "supervisor/shared/lock.h" -// All scanners must have a next field immediately following base. +typedef struct _keypad_scanner_funcs_t { + void (*scan_now)(void *self_in, mp_obj_t timestamp); + size_t (*get_key_count)(void *self_in); +} keypad_scanner_funcs_t; + +// All scanners must begin with these common fields. // This is an ad hoc "superclass" struct for scanners, though they do // not actually have a superclass relationship. +#define KEYPAD_SCANNER_COMMON_FIELDS \ + mp_obj_base_t base; \ + struct _keypad_scanner_obj_t *next; \ + keypad_scanner_funcs_t *funcs; \ + uint64_t next_scan_ticks; \ + bool *previously_pressed; \ + bool *currently_pressed; \ + struct _keypad_eventqueue_obj_t *events; \ + mp_uint_t interval_ticks + typedef struct _keypad_scanner_obj_t { - mp_obj_base_t base; - struct _keypad_scanner_obj_t *next; + KEYPAD_SCANNER_COMMON_FIELDS; } keypad_scanner_obj_t; extern supervisor_lock_t keypad_scanners_linked_list_lock; @@ -45,6 +59,9 @@ void keypad_reset(void); void keypad_register_scanner(keypad_scanner_obj_t *scanner); void keypad_deregister_scanner(keypad_scanner_obj_t *scanner); +void keypad_construct_common(keypad_scanner_obj_t *scanner, mp_float_t interval, size_t max_events); +size_t common_hal_keypad_generic_get_key_count(void *scanner); +void common_hal_keypad_deinit_core(void *scanner); #endif // SHARED_MODULE_KEYPAD_H From 286e26edf09154c22c5407675bfbb2992e095df9 Mon Sep 17 00:00:00 2001 From: Pontus Oldberg Date: Wed, 6 Apr 2022 11:08:22 +0200 Subject: [PATCH 40/98] Added support for 4MB flash. --- ports/nrf/boards/challenger_840/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/boards/challenger_840/mpconfigboard.mk b/ports/nrf/boards/challenger_840/mpconfigboard.mk index a72bd34857..61af9ac029 100644 --- a/ports/nrf/boards/challenger_840/mpconfigboard.mk +++ b/ports/nrf/boards/challenger_840/mpconfigboard.mk @@ -6,4 +6,4 @@ USB_MANUFACTURER = "Invector Labs AB" MCU_CHIP = nrf52840 SPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ,W25Q32FV" From b7acdee2265c16695b3f09bdd378659ba07af866 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 6 Apr 2022 13:18:40 +0000 Subject: [PATCH 41/98] Translated using Weblate (Russian) Currently translated at 37.7% (398 of 1053 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ru/ --- locale/ru.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/ru.po b/locale/ru.po index cc26975101..19c282ce87 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2022-02-14 18:08+0000\n" -"Last-Translator: Clay \n" +"PO-Revision-Date: 2022-04-06 13:37+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: none\n" "Language: ru\n" "MIME-Version: 1.0\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.11-dev\n" +"X-Generator: Weblate 4.12-dev\n" #: main.c msgid "" @@ -212,7 +212,7 @@ msgstr "Объект '%q' не является вызываемым" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "Объект '%q'не является итерируемым" +msgstr "Объект '%q' не является итерируемым" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format From 0c97ac041b1bb5e7a7df4db4c1a50b349ec59551 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 6 Apr 2022 15:37:52 +0200 Subject: [PATCH 42/98] 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 | 59 ++-------------------------------------- locale/cs.po | 59 ++-------------------------------------- locale/de_DE.po | 59 ++-------------------------------------- locale/el.po | 59 ++-------------------------------------- locale/en_GB.po | 59 ++-------------------------------------- locale/es.po | 59 ++-------------------------------------- locale/fil.po | 59 ++-------------------------------------- locale/fr.po | 59 ++-------------------------------------- locale/hi.po | 59 ++-------------------------------------- locale/it_IT.po | 59 ++-------------------------------------- locale/ja.po | 59 ++-------------------------------------- locale/ko.po | 59 ++-------------------------------------- locale/nl.po | 59 ++-------------------------------------- locale/pl.po | 59 ++-------------------------------------- locale/pt_BR.po | 59 ++-------------------------------------- locale/ru.po | 59 ++-------------------------------------- locale/sv.po | 59 ++-------------------------------------- locale/tr.po | 59 ++-------------------------------------- locale/zh_Latn_pinyin.po | 59 ++-------------------------------------- 19 files changed, 38 insertions(+), 1083 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 448a289a24..d6fcba07fb 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -4103,63 +4103,8 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index b9fa742cc1..96e507a9a1 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -4076,63 +4076,8 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 0b2269c461..b7d80e4d39 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -4160,63 +4160,8 @@ msgstr "pow() drittes Argument darf nicht 0 sein" msgid "pow() with 3 arguments requires integers" msgstr "pow() mit 3 Argumenten erfordert Integer" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "Drücken der Boot-Taste beim Start.\n" diff --git a/locale/el.po b/locale/el.po index 7d43824e4e..793547be79 100644 --- a/locale/el.po +++ b/locale/el.po @@ -4067,63 +4067,8 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index cd600837c1..1175ac7c9b 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -4102,63 +4102,8 @@ msgstr "pow() 3rd argument cannot be 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() with 3 arguments requires integers" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "pressing boot button at start up.\n" diff --git a/locale/es.po b/locale/es.po index 995919bc8a..4ad541a5c0 100644 --- a/locale/es.po +++ b/locale/es.po @@ -4148,63 +4148,8 @@ msgstr "el 3er argumento de pow() no puede ser 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argumentos requiere enteros" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "presionando botón de arranque al inicio.\n" diff --git a/locale/fil.po b/locale/fil.po index 193bc0c88e..3f5f65d5e6 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -4108,63 +4108,8 @@ msgstr "pow() 3rd argument ay hindi maaring 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() na may 3 argumento kailangan ng integers" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 05ec1209de..fb957730b7 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -4179,63 +4179,8 @@ msgstr "le 3e argument de pow() ne peut être 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() avec 3 arguments nécessite des entiers" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "bouton boot appuyé lors du démarrage.\n" diff --git a/locale/hi.po b/locale/hi.po index 12671ffb38..e182fb733c 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -4067,63 +4067,8 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 29415e59f9..9449d514c8 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -4128,63 +4128,8 @@ msgstr "il terzo argomento di pow() non può essere 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argomenti richiede interi" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 20f41e546d..ef0ff78707 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -4089,63 +4089,8 @@ msgstr "pow()の3つ目の引数は0にできません" msgid "pow() with 3 arguments requires integers" msgstr "pow()の第3引数には整数が必要" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 9ebbf36eb1..a132a0536a 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -4071,63 +4071,8 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 098bb276ba..c86ecf5158 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -4108,63 +4108,8 @@ msgstr "derde argument van pow() mag geen 0 zijn" msgid "pow() with 3 arguments requires integers" msgstr "pow() met 3 argumenten vereist integers" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "druk bootknop in bij opstarten.\n" diff --git a/locale/pl.po b/locale/pl.po index 054e175527..a8024b17e2 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -4080,63 +4080,8 @@ msgstr "trzeci argument pow() nie może być 0" msgid "pow() with 3 arguments requires integers" msgstr "trzyargumentowe pow() wymaga liczb całkowitych" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index ea3ffae29f..cc18c0b3e0 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -4171,63 +4171,8 @@ msgstr "O terceiro argumento pow() não pode ser 0" msgid "pow() with 3 arguments requires integers" msgstr "o pow() com 3 argumentos requer números inteiros" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "pressionando o botão de boot na inicialização.\n" diff --git a/locale/ru.po b/locale/ru.po index 19c282ce87..353dac4aa8 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -4116,63 +4116,8 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 9a2925f6f6..19476d94be 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -4128,63 +4128,8 @@ msgstr "pow() 3: e argument kan inte vara 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() med 3 argument kräver heltal" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "trycka på startknappen vid start.\n" diff --git a/locale/tr.po b/locale/tr.po index 6966ee8ae9..ec84406e68 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -4083,63 +4083,8 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 0ad1a11f80..a574528889 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -4136,63 +4136,8 @@ msgstr "pow() 3 cān shǔ bùnéng wéi 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "Zài qǐdòng shí àn qǐdòng ànniǔ.\n" From 99dc4029dcadc5a4dc88930223cdba4951863eb8 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 6 Apr 2022 11:33:56 -0400 Subject: [PATCH 43/98] Espressif: disable pull-up on AnalogIn creation --- ports/espressif/common-hal/analogio/AnalogIn.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/espressif/common-hal/analogio/AnalogIn.c b/ports/espressif/common-hal/analogio/AnalogIn.c index ba85d42735..adb8b15065 100644 --- a/ports/espressif/common-hal/analogio/AnalogIn.c +++ b/ports/espressif/common-hal/analogio/AnalogIn.c @@ -55,6 +55,10 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, } common_hal_mcu_pin_claim(pin); self->pin = pin; + // Pull-ups are enabled by default for power-saving reasons on quiescent pins. + // Turn off the pull-up as soon as we know the pin will be used for analog reads, + // since it may take a while for the voltage to stabilize if the input is high-impedance. + gpio_pullup_dis(pin->number); } bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { From 4a2b68000e83e332666d5424371db20a7446aeef Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 6 Apr 2022 18:06:54 +0200 Subject: [PATCH 44/98] 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 | 2 +- locale/cs.po | 2 +- locale/de_DE.po | 2 +- locale/el.po | 2 +- locale/en_GB.po | 2 +- locale/es.po | 2 +- locale/fil.po | 2 +- locale/fr.po | 2 +- locale/hi.po | 2 +- locale/it_IT.po | 2 +- locale/ja.po | 2 +- locale/ko.po | 2 +- locale/nl.po | 2 +- locale/pl.po | 2 +- locale/pt_BR.po | 2 +- locale/ru.po | 2 +- locale/sv.po | 2 +- locale/tr.po | 2 +- locale/zh_Latn_pinyin.po | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index d6fcba07fb..e6fd03c807 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -3054,7 +3054,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "kompresi header" diff --git a/locale/cs.po b/locale/cs.po index 96e507a9a1..eff642e9d3 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -3028,7 +3028,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index b7d80e4d39..9548e7d792 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -3097,7 +3097,7 @@ msgstr "Komplexe Division durch null" msgid "complex values not supported" msgstr "Komplexe Zahlen nicht unterstützt" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "kompression header" diff --git a/locale/el.po b/locale/el.po index 793547be79..952e0c505e 100644 --- a/locale/el.po +++ b/locale/el.po @@ -3019,7 +3019,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 1175ac7c9b..0a15c0d5ae 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -3053,7 +3053,7 @@ msgstr "complex division by zero" msgid "complex values not supported" msgstr "complex values not supported" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "compression header" diff --git a/locale/es.po b/locale/es.po index 4ad541a5c0..56193b521c 100644 --- a/locale/es.po +++ b/locale/es.po @@ -3091,7 +3091,7 @@ msgstr "división compleja por cero" msgid "complex values not supported" msgstr "valores complejos no soportados" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "encabezado de compresión" diff --git a/locale/fil.po b/locale/fil.po index 3f5f65d5e6..41ed0ca6a6 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -3048,7 +3048,7 @@ msgstr "kumplikadong dibisyon sa pamamagitan ng zero" msgid "complex values not supported" msgstr "kumplikadong values hindi sinusuportahan" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "compression header" diff --git a/locale/fr.po b/locale/fr.po index fb957730b7..43fdfddf34 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -3117,7 +3117,7 @@ msgstr "division complexe par zéro" msgid "complex values not supported" msgstr "valeurs complexes non supportées" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "entête de compression" diff --git a/locale/hi.po b/locale/hi.po index e182fb733c..69bd716ef5 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -3019,7 +3019,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 9449d514c8..1ff5e6a76b 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -3064,7 +3064,7 @@ msgstr "complex divisione per zero" msgid "complex values not supported" msgstr "valori complessi non supportai" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "compressione dell'header" diff --git a/locale/ja.po b/locale/ja.po index ef0ff78707..472e616b6d 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -3036,7 +3036,7 @@ msgstr "複素数ゼロ除算" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "圧縮ヘッダー" diff --git a/locale/ko.po b/locale/ko.po index a132a0536a..d0c5b38243 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -3023,7 +3023,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index c86ecf5158..7304d09917 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -3053,7 +3053,7 @@ msgstr "complexe deling door 0" msgid "complex values not supported" msgstr "complexe waardes niet ondersteund" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "compressie header" diff --git a/locale/pl.po b/locale/pl.po index a8024b17e2..c351948799 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -3030,7 +3030,7 @@ msgstr "zespolone dzielenie przez zero" msgid "complex values not supported" msgstr "wartości zespolone nieobsługiwane" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "nagłówek kompresji" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index cc18c0b3e0..791e123a53 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -3109,7 +3109,7 @@ msgstr "divisão complexa por zero" msgid "complex values not supported" msgstr "os valores complexos não compatíveis" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "compressão do cabeçalho" diff --git a/locale/ru.po b/locale/ru.po index 353dac4aa8..b5433c167a 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -3068,7 +3068,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 19476d94be..31aa3850cf 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -3073,7 +3073,7 @@ msgstr "komplex division med noll" msgid "complex values not supported" msgstr "komplexa värden stöds inte" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "komprimeringsheader" diff --git a/locale/tr.po b/locale/tr.po index ec84406e68..368b078b4c 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -3035,7 +3035,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index a574528889..7de9e163a4 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -3085,7 +3085,7 @@ msgstr "fùzá de fēngé wèi 0" msgid "complex values not supported" msgstr "bù zhīchí fùzá de zhí" -#: extmod/moduzlib.c +#: extmod/moduzlib.c shared-module/zlib/DecompIO.c msgid "compression header" msgstr "yāsuō tóu bù" From f297e872d6f27064803abd793f4c0eedc50c3f4b Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Wed, 6 Apr 2022 18:13:59 +0100 Subject: [PATCH 45/98] Account for divisor when overriding position. --- ports/espressif/common-hal/rotaryio/IncrementalEncoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c index 788050b6be..15e7fc4b8f 100644 --- a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c @@ -98,12 +98,12 @@ mp_int_t common_hal_rotaryio_incrementalencoder_get_position(rotaryio_incrementa int16_t count; pcnt_get_counter_value(self->unit, &count); - return (count / self->divisor) + self->position; + return (count + self->position) / self->divisor; } void common_hal_rotaryio_incrementalencoder_set_position(rotaryio_incrementalencoder_obj_t *self, mp_int_t new_position) { - self->position = new_position; + self->position = new_position * self->divisor; pcnt_counter_clear(self->unit); } From a69738c59263985cf4d8aa1ee048dfc9edfde881 Mon Sep 17 00:00:00 2001 From: KurtE Date: Wed, 6 Apr 2022 14:19:38 -0700 Subject: [PATCH 46/98] Start setting up a Teensy MicroMod port --- ports/mimxrt10xx/boards/teensyMM/board.c | 64 ++++++ ports/mimxrt10xx/boards/teensyMM/board.ld | 1 + .../mimxrt10xx/boards/teensyMM/flash_config.c | 170 +++++++++++++++ .../boards/teensyMM/mpconfigboard.h | 21 ++ .../boards/teensyMM/mpconfigboard.mk | 10 + ports/mimxrt10xx/boards/teensyMM/pins.c | 204 ++++++++++++++++++ 6 files changed, 470 insertions(+) create mode 100644 ports/mimxrt10xx/boards/teensyMM/board.c create mode 100644 ports/mimxrt10xx/boards/teensyMM/board.ld create mode 100644 ports/mimxrt10xx/boards/teensyMM/flash_config.c create mode 100644 ports/mimxrt10xx/boards/teensyMM/mpconfigboard.h create mode 100644 ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk create mode 100644 ports/mimxrt10xx/boards/teensyMM/pins.c diff --git a/ports/mimxrt10xx/boards/teensyMM/board.c b/ports/mimxrt10xx/boards/teensyMM/board.c new file mode 100644 index 0000000000..1a1dc7e5ec --- /dev/null +++ b/ports/mimxrt10xx/boards/teensyMM/board.c @@ -0,0 +1,64 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Artur Pacholec + * + * 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 "boards/flash_config.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // FLEX flash + common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); + + // FLEX flash 2 + common_hal_never_reset_pin(&pin_GPIO_AD_B0_04); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_06); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_07); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_08); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_09); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_10); + common_hal_never_reset_pin(&pin_GPIO_EMC_01); + common_hal_never_reset_pin(&pin_GPIO_B0_13); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_11); + // Data strobe needs protection despite being grounded + common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/mimxrt10xx/boards/teensyMM/board.ld b/ports/mimxrt10xx/boards/teensyMM/board.ld new file mode 100644 index 0000000000..8f19810a35 --- /dev/null +++ b/ports/mimxrt10xx/boards/teensyMM/board.ld @@ -0,0 +1 @@ +_ld_reserved_flash_size = 4K; diff --git a/ports/mimxrt10xx/boards/teensyMM/flash_config.c b/ports/mimxrt10xx/boards/teensyMM/flash_config.c new file mode 100644 index 0000000000..09886dece6 --- /dev/null +++ b/ports/mimxrt10xx/boards/teensyMM/flash_config.c @@ -0,0 +1,170 @@ +/* + * Copyright 2017 NXP + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "boards/flash_config.h" + +#include "fsl_flexspi_nor_boot.h" + + +__attribute__((section(".boot_hdr.ivt"))) +/************************************* + * IVT Data + *************************************/ +const ivt image_vector_table = { + IVT_HEADER, /* IVT Header */ + IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ + IVT_RSVD, /* Reserved = 0 */ + (uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */ + (uint32_t)BOOT_DATA_ADDRESS, /* Address where BOOT Data Structure is stored */ + (uint32_t)&image_vector_table, /* Pointer to IVT Self (absolute address */ + (uint32_t)CSF_ADDRESS, /* Address where CSF file is stored */ + IVT_RSVD /* Reserved = 0 */ +}; + +__attribute__((section(".boot_hdr.boot_data"))) +/************************************* + * Boot Data + *************************************/ +const BOOT_DATA_T boot_data = { + FLASH_BASE, /* boot start location */ + FLASH_SIZE, /* size */ + PLUGIN_FLAG, /* Plugin flag*/ + 0xFFFFFFFF /* empty - extra data word */ +}; + +// Config for W25Q64JV with QSPI routed. +__attribute__((section(".boot_hdr.conf"))) +const flexspi_nor_config_t qspiflash_config = { + .pageSize = 256u, + .sectorSize = 4u * 1024u, + .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, + .blockSize = 0x00010000, + .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x02, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x31 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, +}; diff --git a/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.h b/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.h new file mode 100644 index 0000000000..ac9fa5ae14 --- /dev/null +++ b/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.h @@ -0,0 +1,21 @@ +#define MICROPY_HW_BOARD_NAME "Teensy MM" +#define MICROPY_HW_MCU_NAME "IMXRT1062DVL6A" + +// If you change this, then make sure to update the linker scripts as well to +// make sure you don't overwrite code +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 + +#define BOARD_FLASH_SIZE (16 * 1024 * 1024) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO_AD_B1_00) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO_AD_B1_01) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO_B0_03) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO_B0_02) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO_B0_01) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO_AD_B0_03) +#define DEFAULT_UART_BUS_TX (&pin_GPIO_AD_B0_02) + +#define CIRCUITPY_USB_DEVICE_INSTANCE 0 +#define CIRCUITPY_USB_HOST_INSTANCE 1 diff --git a/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk b/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk new file mode 100644 index 0000000000..9f214a22a2 --- /dev/null +++ b/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk @@ -0,0 +1,10 @@ +USB_VID = 0x239A +USB_PID = 0x80AE +USB_PRODUCT = "Teensy 4.1" +USB_MANUFACTURER = "PJRC" + +CHIP_VARIANT = MIMXRT1062DVJ6A +CHIP_FAMILY = MIMXRT1062 +FLASH = W25Q64JV +CIRCUITPY__EVE = 1 +CIRCUITPY_USB_HOST = 1 diff --git a/ports/mimxrt10xx/boards/teensyMM/pins.c b/ports/mimxrt10xx/boards/teensyMM/pins.c new file mode 100644 index 0000000000..1b48485087 --- /dev/null +++ b/ports/mimxrt10xx/boards/teensyMM/pins.c @@ -0,0 +1,204 @@ +#include "shared-bindings/board/__init__.h" + +#include "supervisor/board.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // Micromod pins mapped to logical Teensy pins + {MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_UART_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_UART_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO_EMC_04)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO_EMC_05)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_D0), MP_ROM_PTR(&pin_GPIO_EMC_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_D1), MP_ROM_PTR(&pin_GPIO_EMC_08)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G6), MP_ROM_PTR(&pin_GPIO_B0_10)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX4), MP_ROM_PTR(&pin_GPIO_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_OUT), MP_ROM_PTR(&pin_GPIO_B1_01)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX4), MP_ROM_PTR(&pin_GPIO_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_IN), MP_ROM_PTR(&pin_GPIO_B1_00)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G7), MP_ROM_PTR(&pin_GPIO_B0_11)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO_B0_00)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SPI_COPI), MP_ROM_PTR(&pin_GPIO_B0_02)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SPI_CIPO), MP_ROM_PTR(&pin_GPIO_B0_01)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SPI_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX3), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX3), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX5), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_LRCLK), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX5), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_BCLK), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BATT_VIN3), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_MCLK), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX6), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_SCL1), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX6), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_SDA1), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G8), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G11), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX7), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX7), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_INT), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_GPIO_EMC_37)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_GPIO_EMC_36)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G9), MP_ROM_PTR(&pin_GPIO_B0_12)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G10), MP_ROM_PTR(&pin_GPIO_EMC_07)}, + + // SD Card slot + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + + // new + + {MP_OBJ_NEW_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G0), MP_ROM_PTR(&pin_GPIO_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS0), MP_ROM_PTR(&pin_GPIO_B0_04)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G1), MP_ROM_PTR(&pin_GPIO_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS1), MP_ROM_PTR(&pin_GPIO_B0_05)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO_B0_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G2), MP_ROM_PTR(&pin_GPIO_B0_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS2), MP_ROM_PTR(&pin_GPIO_B0_06)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_GPIO_B0_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G3), MP_ROM_PTR(&pin_GPIO_B0_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS3), MP_ROM_PTR(&pin_GPIO_B0_07)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO_B0_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G4), MP_ROM_PTR(&pin_GPIO_B0_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS4), MP_ROM_PTR(&pin_GPIO_B0_08)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_GPIO_B0_09)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G5), MP_ROM_PTR(&pin_GPIO_B0_09)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS5), MP_ROM_PTR(&pin_GPIO_B0_09)}, + + // USB Host + {MP_ROM_QSTR(MP_QSTR_USB_HOST_POWER), MP_ROM_PTR(&pin_GPIO_EMC_40)}, + {MP_ROM_QSTR(MP_QSTR_USB_HOST_DP), MP_ROM_PTR(&pin_USB_OTG2_DP)}, + {MP_ROM_QSTR(MP_QSTR_USB_HOST_DM), MP_ROM_PTR(&pin_USB_OTG2_DN)}, + + {MP_ROM_QSTR(MP_QSTR_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 ef9f9c8bf0fe3feb5a8f8d72a91c6943697001b2 Mon Sep 17 00:00:00 2001 From: KurtE Date: Wed, 6 Apr 2022 15:22:24 -0700 Subject: [PATCH 47/98] Update PID/VID and Flash --- ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk b/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk index 9f214a22a2..1aa9220e00 100644 --- a/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk +++ b/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk @@ -1,10 +1,10 @@ -USB_VID = 0x239A -USB_PID = 0x80AE -USB_PRODUCT = "Teensy 4.1" +USB_VID = 0x1B4F +USB_PID = 0x002E +USB_PRODUCT = "Teensy MicroMod" USB_MANUFACTURER = "PJRC" CHIP_VARIANT = MIMXRT1062DVJ6A CHIP_FAMILY = MIMXRT1062 -FLASH = W25Q64JV +FLASH = W25Q128JV CIRCUITPY__EVE = 1 CIRCUITPY_USB_HOST = 1 From 219ef5e407742bedf1326929a5cd70a86516a65b Mon Sep 17 00:00:00 2001 From: KurtE Date: Wed, 6 Apr 2022 15:58:27 -0700 Subject: [PATCH 48/98] disable on mimxrt10xx (Teensy40 41) Serial port Hooks As mentioned in issue #6241 the commit to setup port hooks is now causing all input/output that are to go to the Mu window to also go to the LpUart that is defined the port serial.c and in this case it goes to lpuart4, which on Teensy 4, 4.1 is used on Arduino Serial2. With this new code this port no longer works properly. This is one way to solve it, in that there is a #if defined() that if not set, all of the code in this file is ignored and the higher level supervisor stub versions of these functions will be used, which don't interfere with Serial2 and my test sketch works again. Note: the PR for Switch to Port Serial Hooks, also changed code in other ports. I have not tried to see how. There are other more global fixes for this, in which maybe a higer level #if that disables the code within the top level supervisor. Or could be software controlled Again this may not be the final solution, but at least it gets Serial2 up and running agin. --- ports/mimxrt10xx/supervisor/serial.c | 58 ++++++++++++++-------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/ports/mimxrt10xx/supervisor/serial.c b/ports/mimxrt10xx/supervisor/serial.c index b3c37b077d..9d4971e089 100644 --- a/ports/mimxrt10xx/supervisor/serial.c +++ b/ports/mimxrt10xx/supervisor/serial.c @@ -26,65 +26,65 @@ * THE SOFTWARE. */ +#include "supervisor/serial.h" #include "py/mphal.h" #include -#include "supervisor/serial.h" #include "fsl_clock.h" #include "fsl_lpuart.h" // TODO: Switch this to using DEBUG_UART. - +#if defined(USE_DEBUG_PORT_CODE) // static LPUART_Type *uart_instance = LPUART1; // evk static LPUART_Type *uart_instance = LPUART4; // feather 1011 // static LPUART_Type *uart_instance = LPUART2; // feather 1062 static uint32_t UartSrcFreq(void) { - uint32_t freq; + uint32_t freq; - /* To make it simple, we assume default PLL and divider settings, and the only variable - from application is use PLL3 source or OSC source */ - /* PLL3 div6 80M */ - if (CLOCK_GetMux(kCLOCK_UartMux) == 0) { - freq = (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U); - } else { - freq = CLOCK_GetOscFreq() / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U); - } + /* To make it simple, we assume default PLL and divider settings, and the only + variable from application is use PLL3 source or OSC source */ + /* PLL3 div6 80M */ + if (CLOCK_GetMux(kCLOCK_UartMux) == 0) { + freq = (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / + (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U); + } else { + freq = CLOCK_GetOscFreq() / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U); + } - return freq; + return freq; } void port_serial_init(void) { - lpuart_config_t config; + lpuart_config_t config; - LPUART_GetDefaultConfig(&config); - config.baudRate_Bps = 115200; - config.enableTx = true; - config.enableRx = true; + LPUART_GetDefaultConfig(&config); + config.baudRate_Bps = 115200; + config.enableTx = true; + config.enableRx = true; - LPUART_Init(uart_instance, &config, UartSrcFreq()); + LPUART_Init(uart_instance, &config, UartSrcFreq()); } -bool port_serial_connected(void) { - return true; -} +bool port_serial_connected(void) { return true; } char port_serial_read(void) { - uint8_t data; + uint8_t data; - LPUART_ReadBlocking(uart_instance, &data, sizeof(data)); + LPUART_ReadBlocking(uart_instance, &data, sizeof(data)); - return data; + return data; } bool port_serial_bytes_available(void) { - return LPUART_GetStatusFlags(uart_instance) & kLPUART_RxDataRegFullFlag; + return LPUART_GetStatusFlags(uart_instance) & kLPUART_RxDataRegFullFlag; } void port_serial_write_substring(const char *text, uint32_t len) { - if (len == 0) { - return; - } + if (len == 0) { + return; + } - LPUART_WriteBlocking(uart_instance, (uint8_t *)text, len); + LPUART_WriteBlocking(uart_instance, (uint8_t *)text, len); } +#endif // USE_DEBUG_PORT_CODE From a74ec22aa4b6c723c14bd7d523f4b81fea5fda66 Mon Sep 17 00:00:00 2001 From: KurtE Date: Wed, 6 Apr 2022 14:19:38 -0700 Subject: [PATCH 49/98] Start setting up a Teensy MicroMod port I have done a first pass through the files this also includes a new VID/PID from sparkfun --- ports/mimxrt10xx/boards/teensyMM/board.c | 64 ++++++ ports/mimxrt10xx/boards/teensyMM/board.ld | 1 + .../mimxrt10xx/boards/teensyMM/flash_config.c | 170 +++++++++++++++ .../boards/teensyMM/mpconfigboard.h | 21 ++ .../boards/teensyMM/mpconfigboard.mk | 10 + ports/mimxrt10xx/boards/teensyMM/pins.c | 204 ++++++++++++++++++ 6 files changed, 470 insertions(+) create mode 100644 ports/mimxrt10xx/boards/teensyMM/board.c create mode 100644 ports/mimxrt10xx/boards/teensyMM/board.ld create mode 100644 ports/mimxrt10xx/boards/teensyMM/flash_config.c create mode 100644 ports/mimxrt10xx/boards/teensyMM/mpconfigboard.h create mode 100644 ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk create mode 100644 ports/mimxrt10xx/boards/teensyMM/pins.c diff --git a/ports/mimxrt10xx/boards/teensyMM/board.c b/ports/mimxrt10xx/boards/teensyMM/board.c new file mode 100644 index 0000000000..1a1dc7e5ec --- /dev/null +++ b/ports/mimxrt10xx/boards/teensyMM/board.c @@ -0,0 +1,64 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Artur Pacholec + * + * 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 "boards/flash_config.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // FLEX flash + common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); + + // FLEX flash 2 + common_hal_never_reset_pin(&pin_GPIO_AD_B0_04); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_06); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_07); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_08); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_09); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_10); + common_hal_never_reset_pin(&pin_GPIO_EMC_01); + common_hal_never_reset_pin(&pin_GPIO_B0_13); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_11); + // Data strobe needs protection despite being grounded + common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/mimxrt10xx/boards/teensyMM/board.ld b/ports/mimxrt10xx/boards/teensyMM/board.ld new file mode 100644 index 0000000000..8f19810a35 --- /dev/null +++ b/ports/mimxrt10xx/boards/teensyMM/board.ld @@ -0,0 +1 @@ +_ld_reserved_flash_size = 4K; diff --git a/ports/mimxrt10xx/boards/teensyMM/flash_config.c b/ports/mimxrt10xx/boards/teensyMM/flash_config.c new file mode 100644 index 0000000000..09886dece6 --- /dev/null +++ b/ports/mimxrt10xx/boards/teensyMM/flash_config.c @@ -0,0 +1,170 @@ +/* + * Copyright 2017 NXP + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "boards/flash_config.h" + +#include "fsl_flexspi_nor_boot.h" + + +__attribute__((section(".boot_hdr.ivt"))) +/************************************* + * IVT Data + *************************************/ +const ivt image_vector_table = { + IVT_HEADER, /* IVT Header */ + IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ + IVT_RSVD, /* Reserved = 0 */ + (uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */ + (uint32_t)BOOT_DATA_ADDRESS, /* Address where BOOT Data Structure is stored */ + (uint32_t)&image_vector_table, /* Pointer to IVT Self (absolute address */ + (uint32_t)CSF_ADDRESS, /* Address where CSF file is stored */ + IVT_RSVD /* Reserved = 0 */ +}; + +__attribute__((section(".boot_hdr.boot_data"))) +/************************************* + * Boot Data + *************************************/ +const BOOT_DATA_T boot_data = { + FLASH_BASE, /* boot start location */ + FLASH_SIZE, /* size */ + PLUGIN_FLAG, /* Plugin flag*/ + 0xFFFFFFFF /* empty - extra data word */ +}; + +// Config for W25Q64JV with QSPI routed. +__attribute__((section(".boot_hdr.conf"))) +const flexspi_nor_config_t qspiflash_config = { + .pageSize = 256u, + .sectorSize = 4u * 1024u, + .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, + .blockSize = 0x00010000, + .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x02, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x31 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, +}; diff --git a/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.h b/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.h new file mode 100644 index 0000000000..ac9fa5ae14 --- /dev/null +++ b/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.h @@ -0,0 +1,21 @@ +#define MICROPY_HW_BOARD_NAME "Teensy MM" +#define MICROPY_HW_MCU_NAME "IMXRT1062DVL6A" + +// If you change this, then make sure to update the linker scripts as well to +// make sure you don't overwrite code +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 + +#define BOARD_FLASH_SIZE (16 * 1024 * 1024) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO_AD_B1_00) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO_AD_B1_01) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO_B0_03) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO_B0_02) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO_B0_01) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO_AD_B0_03) +#define DEFAULT_UART_BUS_TX (&pin_GPIO_AD_B0_02) + +#define CIRCUITPY_USB_DEVICE_INSTANCE 0 +#define CIRCUITPY_USB_HOST_INSTANCE 1 diff --git a/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk b/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk new file mode 100644 index 0000000000..1aa9220e00 --- /dev/null +++ b/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk @@ -0,0 +1,10 @@ +USB_VID = 0x1B4F +USB_PID = 0x002E +USB_PRODUCT = "Teensy MicroMod" +USB_MANUFACTURER = "PJRC" + +CHIP_VARIANT = MIMXRT1062DVJ6A +CHIP_FAMILY = MIMXRT1062 +FLASH = W25Q128JV +CIRCUITPY__EVE = 1 +CIRCUITPY_USB_HOST = 1 diff --git a/ports/mimxrt10xx/boards/teensyMM/pins.c b/ports/mimxrt10xx/boards/teensyMM/pins.c new file mode 100644 index 0000000000..1b48485087 --- /dev/null +++ b/ports/mimxrt10xx/boards/teensyMM/pins.c @@ -0,0 +1,204 @@ +#include "shared-bindings/board/__init__.h" + +#include "supervisor/board.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // Micromod pins mapped to logical Teensy pins + {MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_UART_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_UART_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO_EMC_04)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO_EMC_05)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_D0), MP_ROM_PTR(&pin_GPIO_EMC_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_D1), MP_ROM_PTR(&pin_GPIO_EMC_08)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G6), MP_ROM_PTR(&pin_GPIO_B0_10)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX4), MP_ROM_PTR(&pin_GPIO_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_OUT), MP_ROM_PTR(&pin_GPIO_B1_01)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX4), MP_ROM_PTR(&pin_GPIO_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_IN), MP_ROM_PTR(&pin_GPIO_B1_00)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G7), MP_ROM_PTR(&pin_GPIO_B0_11)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO_B0_00)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SPI_COPI), MP_ROM_PTR(&pin_GPIO_B0_02)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SPI_CIPO), MP_ROM_PTR(&pin_GPIO_B0_01)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SPI_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX3), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX3), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX5), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_LRCLK), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX5), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_BCLK), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BATT_VIN3), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_MCLK), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX6), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_SCL1), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX6), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_SDA1), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G8), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G11), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX7), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX7), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_INT), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_GPIO_EMC_37)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_GPIO_EMC_36)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G9), MP_ROM_PTR(&pin_GPIO_B0_12)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G10), MP_ROM_PTR(&pin_GPIO_EMC_07)}, + + // SD Card slot + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + + // new + + {MP_OBJ_NEW_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G0), MP_ROM_PTR(&pin_GPIO_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS0), MP_ROM_PTR(&pin_GPIO_B0_04)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G1), MP_ROM_PTR(&pin_GPIO_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS1), MP_ROM_PTR(&pin_GPIO_B0_05)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO_B0_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G2), MP_ROM_PTR(&pin_GPIO_B0_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS2), MP_ROM_PTR(&pin_GPIO_B0_06)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_GPIO_B0_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G3), MP_ROM_PTR(&pin_GPIO_B0_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS3), MP_ROM_PTR(&pin_GPIO_B0_07)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO_B0_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G4), MP_ROM_PTR(&pin_GPIO_B0_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS4), MP_ROM_PTR(&pin_GPIO_B0_08)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_GPIO_B0_09)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_G5), MP_ROM_PTR(&pin_GPIO_B0_09)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS5), MP_ROM_PTR(&pin_GPIO_B0_09)}, + + // USB Host + {MP_ROM_QSTR(MP_QSTR_USB_HOST_POWER), MP_ROM_PTR(&pin_GPIO_EMC_40)}, + {MP_ROM_QSTR(MP_QSTR_USB_HOST_DP), MP_ROM_PTR(&pin_USB_OTG2_DP)}, + {MP_ROM_QSTR(MP_QSTR_USB_HOST_DM), MP_ROM_PTR(&pin_USB_OTG2_DN)}, + + {MP_ROM_QSTR(MP_QSTR_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 9ec589ef0f9347f062c001745217db83361ec985 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 7 Apr 2022 03:35:12 +0200 Subject: [PATCH 50/98] 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 | 4 ---- locale/cs.po | 4 ---- locale/de_DE.po | 7 +++---- locale/el.po | 4 ---- locale/en_GB.po | 4 ---- locale/es.po | 4 ---- locale/fil.po | 4 ---- locale/fr.po | 7 +++---- locale/hi.po | 4 ---- locale/it_IT.po | 4 ---- locale/ja.po | 4 ---- locale/ko.po | 4 ---- locale/nl.po | 4 ---- locale/pl.po | 4 ---- locale/pt_BR.po | 7 +++---- locale/ru.po | 4 ---- locale/sv.po | 7 +++---- locale/tr.po | 4 ---- locale/zh_Latn_pinyin.po | 7 +++---- 19 files changed, 15 insertions(+), 76 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index e6fd03c807..875c6c46a1 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -3161,10 +3161,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index eff642e9d3..69227eefe9 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -3135,10 +3135,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 9548e7d792..25bef643bd 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -3206,10 +3206,6 @@ msgstr "durch Null dividieren" msgid "division by zero" msgstr "Division durch Null" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "Teiler muss 4 sein" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "dtype muss Float oder komplex sein" @@ -4720,6 +4716,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 "divisor must be 4" +#~ msgstr "Teiler muss 4 sein" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/el.po b/locale/el.po index 952e0c505e..bad0723a70 100644 --- a/locale/el.po +++ b/locale/el.po @@ -3126,10 +3126,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 0a15c0d5ae..cc1801abba 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -3161,10 +3161,6 @@ msgstr "divide by zero" msgid "division by zero" msgstr "division by zero" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/locale/es.po b/locale/es.po index 56193b521c..c8dc2b9845 100644 --- a/locale/es.po +++ b/locale/es.po @@ -3200,10 +3200,6 @@ msgstr "divide por cero" msgid "division by zero" msgstr "división por cero" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 41ed0ca6a6..79dd7c1bdc 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -3159,10 +3159,6 @@ msgstr "" msgid "division by zero" msgstr "dibisyon ng zero" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 43fdfddf34..7f41ca2ced 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -3227,10 +3227,6 @@ msgstr "division par zéro" msgid "division by zero" msgstr "division par zéro" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "le diviseur doit être 4" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -4737,6 +4733,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 "divisor must be 4" +#~ msgstr "le diviseur doit être 4" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/hi.po b/locale/hi.po index 69bd716ef5..59aa535b3f 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -3126,10 +3126,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 1ff5e6a76b..ee8522f360 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -3174,10 +3174,6 @@ msgstr "" msgid "division by zero" msgstr "divisione per zero" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 472e616b6d..5c483cfcd5 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -3145,10 +3145,6 @@ msgstr "" msgid "division by zero" msgstr "ゼロ除算 (division by zero)" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index d0c5b38243..3fc04dcdc8 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -3130,10 +3130,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 7304d09917..5c584c1cf6 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -3162,10 +3162,6 @@ msgstr "" msgid "division by zero" msgstr "deling door nul" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index c351948799..d8c98ba4e6 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -3138,10 +3138,6 @@ msgstr "" msgid "division by zero" msgstr "dzielenie przez zero" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 791e123a53..adfdb1ce4c 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -3219,10 +3219,6 @@ msgstr "divido por zero" msgid "division by zero" msgstr "divisão por zero" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "o divisor deve ser 4" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "dtype deve ser flutuante ou complexo" @@ -4728,6 +4724,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 "divisor must be 4" +#~ msgstr "o divisor deve ser 4" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/ru.po b/locale/ru.po index b5433c167a..3d78a492c1 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -3175,10 +3175,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 31aa3850cf..4f8d39879b 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -3183,10 +3183,6 @@ msgstr "division med noll" msgid "division by zero" msgstr "division med noll" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "divisor måste vara 4" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "dtype måste vara float eller complex" @@ -4685,6 +4681,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 "divisor must be 4" +#~ msgstr "divisor måste vara 4" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/tr.po b/locale/tr.po index 368b078b4c..91f0253cb4 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -3142,10 +3142,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 7de9e163a4..e8bf961f6b 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -3194,10 +3194,6 @@ msgstr "chú yǐ líng" msgid "division by zero" msgstr "bèi líng chú" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "èr chóng zòu bì xū shì 4" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "dtype bì xū shì fú diǎn xíng huò fù shù" @@ -4696,6 +4692,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 "divisor must be 4" +#~ msgstr "èr chóng zòu bì xū shì 4" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" From 2cb422fb192384dfe3df82e778fd2d58eed98139 Mon Sep 17 00:00:00 2001 From: KurtE Date: Thu, 7 Apr 2022 12:09:56 -0700 Subject: [PATCH 51/98] Create W25Q128JV.ld Add flash file needed for Teensy MicroMod, --- ports/mimxrt10xx/linking/flash/W25Q128JV.ld | 1 + 1 file changed, 1 insertion(+) create mode 100644 ports/mimxrt10xx/linking/flash/W25Q128JV.ld diff --git a/ports/mimxrt10xx/linking/flash/W25Q128JV.ld b/ports/mimxrt10xx/linking/flash/W25Q128JV.ld new file mode 100644 index 0000000000..4c055f4ba4 --- /dev/null +++ b/ports/mimxrt10xx/linking/flash/W25Q128JV.ld @@ -0,0 +1 @@ +_ld_flash_size = 16M; \ No newline at end of file From 03e0acde943f9c943e6e598ebd4fa0bce5723a40 Mon Sep 17 00:00:00 2001 From: KurtE Date: Thu, 7 Apr 2022 14:11:22 -0700 Subject: [PATCH 52/98] Trying to cleanup the pre build messages --- ports/mimxrt10xx/boards/teensyMM/pins.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/mimxrt10xx/boards/teensyMM/pins.c b/ports/mimxrt10xx/boards/teensyMM/pins.c index 1b48485087..157ca00560 100644 --- a/ports/mimxrt10xx/boards/teensyMM/pins.c +++ b/ports/mimxrt10xx/boards/teensyMM/pins.c @@ -6,6 +6,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS // Micromod pins mapped to logical Teensy pins + // Plus pins mapping some of the names on micromod breakout boards {MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, {MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, {MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, From 93e9e3ad9035fdd1086ad0b3b9881712c179a1e6 Mon Sep 17 00:00:00 2001 From: KurtE Date: Thu, 7 Apr 2022 15:52:01 -0700 Subject: [PATCH 53/98] Fix end of line --- ports/mimxrt10xx/linking/flash/W25Q128JV.ld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mimxrt10xx/linking/flash/W25Q128JV.ld b/ports/mimxrt10xx/linking/flash/W25Q128JV.ld index 4c055f4ba4..205d9dd839 100644 --- a/ports/mimxrt10xx/linking/flash/W25Q128JV.ld +++ b/ports/mimxrt10xx/linking/flash/W25Q128JV.ld @@ -1 +1 @@ -_ld_flash_size = 16M; \ No newline at end of file +_ld_flash_size = 16M; From 2a3eb49da74c4f50b47d52e5ba26a29f8be0bee8 Mon Sep 17 00:00:00 2001 From: KurtE Date: Fri, 8 Apr 2022 07:41:51 -0700 Subject: [PATCH 54/98] Update the pins.c I fixed a couple issues in the pin name definitions. The pin names are sort of Teensy centric in that the priority is given to the pin names you would use in Arduino like D0, D1, ... But also added names for the MicroMod names in particular the names on the front of the ATP carrier board Also updated manufacturer to be both PJRC and Sparkfun --- .../boards/teensyMM/mpconfigboard.mk | 2 +- ports/mimxrt10xx/boards/teensyMM/pins.c | 115 +++++++++--------- 2 files changed, 60 insertions(+), 57 deletions(-) diff --git a/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk b/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk index 1aa9220e00..2eefba15f0 100644 --- a/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk +++ b/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk @@ -1,7 +1,7 @@ USB_VID = 0x1B4F USB_PID = 0x002E USB_PRODUCT = "Teensy MicroMod" -USB_MANUFACTURER = "PJRC" +USB_MANUFACTURER = "PJRC/Sparkfun" CHIP_VARIANT = MIMXRT1062DVJ6A CHIP_FAMILY = MIMXRT1062 diff --git a/ports/mimxrt10xx/boards/teensyMM/pins.c b/ports/mimxrt10xx/boards/teensyMM/pins.c index 157ca00560..a81414aed2 100644 --- a/ports/mimxrt10xx/boards/teensyMM/pins.c +++ b/ports/mimxrt10xx/boards/teensyMM/pins.c @@ -10,53 +10,35 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { {MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, {MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, {MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_UART_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, {MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, {MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_UART_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO_EMC_04)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO_EMC_05)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_MM_D0), MP_ROM_PTR(&pin_GPIO_EMC_06)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_MM_D1), MP_ROM_PTR(&pin_GPIO_EMC_08)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_G6), MP_ROM_PTR(&pin_GPIO_B0_10)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01)}, {MP_OBJ_NEW_QSTR(MP_QSTR_RX4), MP_ROM_PTR(&pin_GPIO_B1_01)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_OUT), MP_ROM_PTR(&pin_GPIO_B1_01)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00)}, {MP_OBJ_NEW_QSTR(MP_QSTR_TX4), MP_ROM_PTR(&pin_GPIO_B1_00)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_IN), MP_ROM_PTR(&pin_GPIO_B1_00)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_G7), MP_ROM_PTR(&pin_GPIO_B0_11)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO_B0_00)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02)}, {MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_SPI_COPI), MP_ROM_PTR(&pin_GPIO_B0_02)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01)}, {MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_SPI_CIPO), MP_ROM_PTR(&pin_GPIO_B0_01)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03)}, {MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_B0_03)}, {MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_SPI_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, {MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, @@ -78,118 +60,88 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { {MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, {MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, {MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, {MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, {MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, {MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, {MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, {MP_OBJ_NEW_QSTR(MP_QSTR_TX5), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_LRCLK), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, {MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, {MP_OBJ_NEW_QSTR(MP_QSTR_RX5), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_BCLK), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, {MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_BATT_VIN3), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, {MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_AUD_MCLK), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, {MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, {MP_OBJ_NEW_QSTR(MP_QSTR_TX6), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_SCL1), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, {MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, {MP_OBJ_NEW_QSTR(MP_QSTR_RX6), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_SDA1), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, {MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_G8), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, {MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_G11), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32)}, {MP_OBJ_NEW_QSTR(MP_QSTR_RX7), MP_ROM_PTR(&pin_GPIO_EMC_32)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_TX7), MP_ROM_PTR(&pin_GPIO_EMC_32)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_I2C_INT), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX7), MP_ROM_PTR(&pin_GPIO_EMC_31)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_GPIO_EMC_37)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_GPIO_EMC_36)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_G9), MP_ROM_PTR(&pin_GPIO_B0_12)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_G10), MP_ROM_PTR(&pin_GPIO_EMC_07)}, // SD Card slot - {MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, - // new + // new pins (not on T4 or T4.1) {MP_OBJ_NEW_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO_B0_04)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_G0), MP_ROM_PTR(&pin_GPIO_B0_04)}, {MP_OBJ_NEW_QSTR(MP_QSTR_BUS0), MP_ROM_PTR(&pin_GPIO_B0_04)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO_B0_05)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_G1), MP_ROM_PTR(&pin_GPIO_B0_05)}, {MP_OBJ_NEW_QSTR(MP_QSTR_BUS1), MP_ROM_PTR(&pin_GPIO_B0_05)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO_B0_06)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_G2), MP_ROM_PTR(&pin_GPIO_B0_06)}, {MP_OBJ_NEW_QSTR(MP_QSTR_BUS2), MP_ROM_PTR(&pin_GPIO_B0_06)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_GPIO_B0_07)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_G3), MP_ROM_PTR(&pin_GPIO_B0_07)}, {MP_OBJ_NEW_QSTR(MP_QSTR_BUS3), MP_ROM_PTR(&pin_GPIO_B0_07)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO_B0_08)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_G4), MP_ROM_PTR(&pin_GPIO_B0_08)}, {MP_OBJ_NEW_QSTR(MP_QSTR_BUS4), MP_ROM_PTR(&pin_GPIO_B0_08)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_GPIO_B0_09)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_G5), MP_ROM_PTR(&pin_GPIO_B0_09)}, {MP_OBJ_NEW_QSTR(MP_QSTR_BUS5), MP_ROM_PTR(&pin_GPIO_B0_09)}, // USB Host @@ -201,5 +153,56 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj)}, {MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj)}, + // Micromod Names on different carrier boards + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, // D0 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, // D1 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_PWM1), MP_ROM_PTR(&pin_GPIO_EMC_04)}, // D2 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_PWM0), MP_ROM_PTR(&pin_GPIO_EMC_05)}, // D3 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_D0), MP_ROM_PTR(&pin_GPIO_EMC_06)}, // D4 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_D1), MP_ROM_PTR(&pin_GPIO_EMC_08)}, // D5 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G6), MP_ROM_PTR(&pin_GPIO_B0_10)}, // D6 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2S_SDO), MP_ROM_PTR(&pin_GPIO_B1_01)}, // D7 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2S_SDI), MP_ROM_PTR(&pin_GPIO_B1_00)}, // D8 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G7), MP_ROM_PTR(&pin_GPIO_B0_11)}, // D9 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_CS), MP_ROM_PTR(&pin_GPIO_B0_00)}, // D10 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_COPI), MP_ROM_PTR(&pin_GPIO_B0_02)}, // D11 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_CIPO), MP_ROM_PTR(&pin_GPIO_B0_01)}, // D12 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)}, // D13 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, // D14 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, // D15 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_RX2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, // D16 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_TX2), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, // D17 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, // D18 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, // D19 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2S_FS), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, // D20 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2S_CLK), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, // D21 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_BATT_VIN3), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, // D22 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_MCLK), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, // D23 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_SCL1), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, // D24 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_SDA1), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, // D25 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G8), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, // D26 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G11), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, // D27 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_33V_EN), MP_ROM_PTR(&pin_GPIO_EMC_32)}, // D28 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2C_INT), MP_ROM_PTR(&pin_GPIO_EMC_31)}, // D29 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_CAN_RX), MP_ROM_PTR(&pin_GPIO_EMC_37)}, // D30 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_CAN_TX), MP_ROM_PTR(&pin_GPIO_EMC_36)}, // D31 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G9), MP_ROM_PTR(&pin_GPIO_B0_12)}, // D32 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G10), MP_ROM_PTR(&pin_GPIO_EMC_07)}, // D33 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, // D34 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, // 35 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_CIPO1), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, // 35 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_SCK1), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, // D36 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_COPI1), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, // D37 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_CS1), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, // D38 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, // D38 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G0), MP_ROM_PTR(&pin_GPIO_B0_04)}, // D40 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G1), MP_ROM_PTR(&pin_GPIO_B0_05)}, // D41 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G2), MP_ROM_PTR(&pin_GPIO_B0_06)}, // D42 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G3), MP_ROM_PTR(&pin_GPIO_B0_07)}, // D43 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G4), MP_ROM_PTR(&pin_GPIO_B0_08)}, // D44 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G5), MP_ROM_PTR(&pin_GPIO_B0_09)}, // D45 + }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From ea3dfa444ac7bf7b687065e609988c96dc376bae Mon Sep 17 00:00:00 2001 From: lady ada Date: Fri, 8 Apr 2022 16:39:47 -0400 Subject: [PATCH 55/98] msys at least breaks elsewhere now --- py/makeversionhdr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py/makeversionhdr.py b/py/makeversionhdr.py index da6f7c9f59..84bba402d9 100644 --- a/py/makeversionhdr.py +++ b/py/makeversionhdr.py @@ -22,13 +22,14 @@ def get_version_info_from_git(): [tools_describe], stderr=subprocess.STDOUT, universal_newlines=True, + shell=True ).strip() except subprocess.CalledProcessError as er: if er.returncode == 128: # git exit code of 128 means no repository found return None git_tag = "" - except OSError: + except OSError as e: return None try: git_hash = subprocess.check_output( From 1f3dadcbb9a135c4d4348cc85da8af140ac79d43 Mon Sep 17 00:00:00 2001 From: lady ada Date: Fri, 8 Apr 2022 16:43:15 -0400 Subject: [PATCH 56/98] ok other waythen --- py/makeversionhdr.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/py/makeversionhdr.py b/py/makeversionhdr.py index 84bba402d9..e4ddf9fa1e 100644 --- a/py/makeversionhdr.py +++ b/py/makeversionhdr.py @@ -19,10 +19,7 @@ def get_version_info_from_git(): # Note: git describe doesn't work if no tag is available try: git_tag = subprocess.check_output( - [tools_describe], - stderr=subprocess.STDOUT, - universal_newlines=True, - shell=True + [tools_describe], stderr=subprocess.STDOUT, universal_newlines=True, shell=True ).strip() except subprocess.CalledProcessError as er: if er.returncode == 128: From d3a989f27479bf148eae17221254c0557d090fb6 Mon Sep 17 00:00:00 2001 From: lady ada Date: Fri, 8 Apr 2022 16:55:49 -0400 Subject: [PATCH 57/98] not sure why this changed...but it changed in mingw64? --- mpy-cross/mpy-cross.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpy-cross/mpy-cross.mk b/mpy-cross/mpy-cross.mk index 642fe9b5aa..a975f8253b 100644 --- a/mpy-cross/mpy-cross.mk +++ b/mpy-cross/mpy-cross.mk @@ -8,7 +8,7 @@ include ../py/mkenv.mk ifeq ($(OS),Windows_NT) # Detect a MINGW32 build, and change the name of the final executable. -PROG ?= mpy-cross.exe +PROG ?= mpy-cross else PROG ?= mpy-cross endif From f7b3247deb4196f809f3d8f9a7cdaf214074bb0f Mon Sep 17 00:00:00 2001 From: lady ada Date: Fri, 8 Apr 2022 17:44:28 -0400 Subject: [PATCH 58/98] fix paths with ('s or spaces --- ports/espressif/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index 96360d06bd..214b9251e7 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -310,7 +310,7 @@ $(BUILD)/lib/protomatter/src/core.o: CFLAGS += -DESP32 SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_MOD) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) # IDF build commands -IDF_PATH = $(realpath ./esp-idf) +IDF_PATH = "$(realpath ./esp-idf)" # create the directory $(BUILD)/esp-idf: $(Q)$(MKDIR) -p $@ From 7ff0036a2674461784f1ce63d76b529744ebe1a6 Mon Sep 17 00:00:00 2001 From: KurtE Date: Fri, 8 Apr 2022 15:59:27 -0700 Subject: [PATCH 59/98] Fix the pre-check stuff --- ports/mimxrt10xx/supervisor/serial.c | 55 +++++++++++++++------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/ports/mimxrt10xx/supervisor/serial.c b/ports/mimxrt10xx/supervisor/serial.c index 9d4971e089..4223ab4f5b 100644 --- a/ports/mimxrt10xx/supervisor/serial.c +++ b/ports/mimxrt10xx/supervisor/serial.c @@ -34,57 +34,60 @@ #include "fsl_lpuart.h" // TODO: Switch this to using DEBUG_UART. +// Need official way to turn off the port serial code when it is not needed #if defined(USE_DEBUG_PORT_CODE) // static LPUART_Type *uart_instance = LPUART1; // evk static LPUART_Type *uart_instance = LPUART4; // feather 1011 // static LPUART_Type *uart_instance = LPUART2; // feather 1062 static uint32_t UartSrcFreq(void) { - uint32_t freq; + uint32_t freq; - /* To make it simple, we assume default PLL and divider settings, and the only - variable from application is use PLL3 source or OSC source */ - /* PLL3 div6 80M */ - if (CLOCK_GetMux(kCLOCK_UartMux) == 0) { - freq = (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / - (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U); - } else { - freq = CLOCK_GetOscFreq() / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U); - } + /* To make it simple, we assume default PLL and divider settings, and the only + variable from application is use PLL3 source or OSC source */ + /* PLL3 div6 80M */ + if (CLOCK_GetMux(kCLOCK_UartMux) == 0) { + freq = (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / + (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U); + } else { + freq = CLOCK_GetOscFreq() / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U); + } - return freq; + return freq; } void port_serial_init(void) { - lpuart_config_t config; + lpuart_config_t config; - LPUART_GetDefaultConfig(&config); - config.baudRate_Bps = 115200; - config.enableTx = true; - config.enableRx = true; + LPUART_GetDefaultConfig(&config); + config.baudRate_Bps = 115200; + config.enableTx = true; + config.enableRx = true; - LPUART_Init(uart_instance, &config, UartSrcFreq()); + LPUART_Init(uart_instance, &config, UartSrcFreq()); } -bool port_serial_connected(void) { return true; } +bool port_serial_connected(void) { + return true; +} char port_serial_read(void) { - uint8_t data; + uint8_t data; - LPUART_ReadBlocking(uart_instance, &data, sizeof(data)); + LPUART_ReadBlocking(uart_instance, &data, sizeof(data)); - return data; + return data; } bool port_serial_bytes_available(void) { - return LPUART_GetStatusFlags(uart_instance) & kLPUART_RxDataRegFullFlag; + return LPUART_GetStatusFlags(uart_instance) & kLPUART_RxDataRegFullFlag; } void port_serial_write_substring(const char *text, uint32_t len) { - if (len == 0) { - return; - } + if (len == 0) { + return; + } - LPUART_WriteBlocking(uart_instance, (uint8_t *)text, len); + LPUART_WriteBlocking(uart_instance, (uint8_t *)text, len); } #endif // USE_DEBUG_PORT_CODE From 3c70aa8845707cca98112d70f36c18f42ced8ceb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 9 Apr 2022 08:49:26 -0500 Subject: [PATCH 60/98] Revert "fix paths with ('s or spaces" This reverts commit f7b3247deb4196f809f3d8f9a7cdaf214074bb0f. --- ports/espressif/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index 214b9251e7..96360d06bd 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -310,7 +310,7 @@ $(BUILD)/lib/protomatter/src/core.o: CFLAGS += -DESP32 SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_MOD) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) # IDF build commands -IDF_PATH = "$(realpath ./esp-idf)" +IDF_PATH = $(realpath ./esp-idf) # create the directory $(BUILD)/esp-idf: $(Q)$(MKDIR) -p $@ From b5ab73b111ab790c7c7382317a881c0c9cbb1bd7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 9 Apr 2022 09:55:10 -0500 Subject: [PATCH 61/98] whole conditional block no longer needed --- mpy-cross/mpy-cross.mk | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mpy-cross/mpy-cross.mk b/mpy-cross/mpy-cross.mk index a975f8253b..825566efec 100644 --- a/mpy-cross/mpy-cross.mk +++ b/mpy-cross/mpy-cross.mk @@ -6,12 +6,7 @@ include ../py/mkenv.mk # define main target -ifeq ($(OS),Windows_NT) -# Detect a MINGW32 build, and change the name of the final executable. PROG ?= mpy-cross -else -PROG ?= mpy-cross -endif # qstr definitions (must come before including py.mk) QSTR_DEFS = qstrdefsport.h From a9713b773f9d832dce918a3107aa7a5deee39715 Mon Sep 17 00:00:00 2001 From: lady ada Date: Sat, 9 Apr 2022 11:34:04 -0400 Subject: [PATCH 62/98] try reducing freq --- ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c b/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c index 74187899ef..d4debd6287 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c @@ -81,7 +81,7 @@ void board_init(void) { &pin_GPIO39, // DC &pin_GPIO7, // CS &pin_GPIO40, // RST - 40000000, // baudrate + 10000000, // baudrate 0, // polarity 0 // phase ); From e5a613ba136e3cee198ac22d916c659d51daa395 Mon Sep 17 00:00:00 2001 From: lady ada Date: Sat, 9 Apr 2022 11:39:09 -0400 Subject: [PATCH 63/98] Revert "try reducing freq" This reverts commit a9713b773f9d832dce918a3107aa7a5deee39715. --- ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c b/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c index d4debd6287..74187899ef 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c @@ -81,7 +81,7 @@ void board_init(void) { &pin_GPIO39, // DC &pin_GPIO7, // CS &pin_GPIO40, // RST - 10000000, // baudrate + 40000000, // baudrate 0, // polarity 0 // phase ); From c3cfbc12596f5a916323e36d9a514e2716dafe53 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 9 Apr 2022 22:03:16 -0400 Subject: [PATCH 64/98] Force pin 21 high; patch; need to diagnose further --- ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c b/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c index 74187899ef..46f1fbd31c 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c @@ -71,6 +71,12 @@ uint8_t display_init_sequence[] = { void board_init(void) { + // THIS SHOULD BE HANDLED BY espressif_board_reset_pin_number(), but it is not working. + // TEMPORARY FIX UNTIL IT'S DIAGNOSED. + common_hal_never_reset_pin(&pin_GPIO21); + gpio_set_direction(21, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(21, true); + busio_spi_obj_t *spi = common_hal_board_create_spi(0); displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus; bus->base.type = &displayio_fourwire_type; From ecf2f1c80c3df5c28b110dffa5203212041998b4 Mon Sep 17 00:00:00 2001 From: KurtE Date: Sun, 10 Apr 2022 05:39:43 -0700 Subject: [PATCH 65/98] Add to board object other Serial and I2c pin names While testing out this and the new MicroMod Teensy port, @mjs513 and myself found it desirable to have logical pin names for the different Serial UART objects. It is a lot easier and clearer to use and maintain to do something like: uart4 = busio.UART(board.TX4, board.RX4) than have to go look up the pin numbers for each board. --- ports/mimxrt10xx/boards/teensy40/pins.c | 172 ++++++++++-------- ports/mimxrt10xx/boards/teensy41/pins.c | 222 +++++++++++++----------- 2 files changed, 219 insertions(+), 175 deletions(-) diff --git a/ports/mimxrt10xx/boards/teensy40/pins.c b/ports/mimxrt10xx/boards/teensy40/pins.c index 2188c6c0e2..263603dcf3 100644 --- a/ports/mimxrt10xx/boards/teensy40/pins.c +++ b/ports/mimxrt10xx/boards/teensy40/pins.c @@ -6,111 +6,133 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS // With USB on left. Bottom edge. - { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01)}, // Top edge - { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_AD_B1_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO_AD_B1_07) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_B1_07) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO_AD_B1_06) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_B1_06) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, // Back side - { MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_SD_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_SD_B0_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_SD_B0_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_SD_B0_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_SD_B0_04) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_04) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_SD_B0_05) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_05) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, - { MP_ROM_QSTR(MP_QSTR_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_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)}, + + // other i2c ports defined + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + + // Serial Pins + {MP_OBJ_NEW_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX3), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX3), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX4), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX4), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX5), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX5), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX6), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX6), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX7), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX7), MP_ROM_PTR(&pin_GPIO_EMC_31)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX8), MP_ROM_PTR(&pin_GPIO_B1_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX8), MP_ROM_PTR(&pin_GPIO_B1_12)}, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/boards/teensy41/pins.c b/ports/mimxrt10xx/boards/teensy41/pins.c index 46604a933d..716772e27c 100644 --- a/ports/mimxrt10xx/boards/teensy41/pins.c +++ b/ports/mimxrt10xx/boards/teensy41/pins.c @@ -6,149 +6,171 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS // With USB on left. Bottom edge. - { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01)}, // Bottom Edge extended for 4.1 - { MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12)}, // Top edge - { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_AD_B1_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO_AD_B1_07) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_B1_07) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO_AD_B1_06) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_B1_06) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, // Top edge extended for Teensy 4.1 - { MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_B1_13) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_B1_12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_B1_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_B1_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_AD_B1_12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_AD_B1_13) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO_AD_B1_04) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO_AD_B1_05) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_B1_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_B1_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_AD_B1_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_AD_B1_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO_AD_B1_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO_AD_B1_05)}, // SD Card slot - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO_SD_B0_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_GPIO_SD_B0_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO_SD_B0_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_GPIO_SD_B0_00) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D46), MP_ROM_PTR(&pin_GPIO_SD_B0_05) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D46), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D47), MP_ROM_PTR(&pin_GPIO_SD_B0_04) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D47), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, // Flash expansion spot and PSRAM expansion spot on a shared QSPI BUS - { MP_OBJ_NEW_QSTR(MP_QSTR_D48), MP_ROM_PTR(&pin_GPIO_EMC_24) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_PSRAM_CS), MP_ROM_PTR(&pin_GPIO_EMC_24) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D48), MP_ROM_PTR(&pin_GPIO_EMC_24)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_PSRAM_CS), MP_ROM_PTR(&pin_GPIO_EMC_24)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D49), MP_ROM_PTR(&pin_GPIO_EMC_27) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO1), MP_ROM_PTR(&pin_GPIO_EMC_27) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D49), MP_ROM_PTR(&pin_GPIO_EMC_27)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO1), MP_ROM_PTR(&pin_GPIO_EMC_27)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D50), MP_ROM_PTR(&pin_GPIO_EMC_28) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO2), MP_ROM_PTR(&pin_GPIO_EMC_28) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D50), MP_ROM_PTR(&pin_GPIO_EMC_28)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO2), MP_ROM_PTR(&pin_GPIO_EMC_28)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D51), MP_ROM_PTR(&pin_GPIO_EMC_22) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_FLASH_CS), MP_ROM_PTR(&pin_GPIO_EMC_22) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D51), MP_ROM_PTR(&pin_GPIO_EMC_22)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_FLASH_CS), MP_ROM_PTR(&pin_GPIO_EMC_22)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D52), MP_ROM_PTR(&pin_GPIO_EMC_26) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO0), MP_ROM_PTR(&pin_GPIO_EMC_26) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D52), MP_ROM_PTR(&pin_GPIO_EMC_26)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO0), MP_ROM_PTR(&pin_GPIO_EMC_26)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D53), MP_ROM_PTR(&pin_GPIO_EMC_25) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_CLK), MP_ROM_PTR(&pin_GPIO_EMC_25) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D53), MP_ROM_PTR(&pin_GPIO_EMC_25)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_CLK), MP_ROM_PTR(&pin_GPIO_EMC_25)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D54), MP_ROM_PTR(&pin_GPIO_EMC_29) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO3), MP_ROM_PTR(&pin_GPIO_EMC_29) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D54), MP_ROM_PTR(&pin_GPIO_EMC_29)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO3), MP_ROM_PTR(&pin_GPIO_EMC_29)}, // USB Host - { MP_ROM_QSTR(MP_QSTR_USB_HOST_POWER), MP_ROM_PTR(&pin_GPIO_EMC_40) }, - { MP_ROM_QSTR(MP_QSTR_USB_HOST_DP), MP_ROM_PTR(&pin_USB_OTG2_DP) }, - { MP_ROM_QSTR(MP_QSTR_USB_HOST_DM), MP_ROM_PTR(&pin_USB_OTG2_DN) }, + {MP_ROM_QSTR(MP_QSTR_USB_HOST_POWER), MP_ROM_PTR(&pin_GPIO_EMC_40)}, + {MP_ROM_QSTR(MP_QSTR_USB_HOST_DP), MP_ROM_PTR(&pin_USB_OTG2_DP)}, + {MP_ROM_QSTR(MP_QSTR_USB_HOST_DM), MP_ROM_PTR(&pin_USB_OTG2_DN)}, - { MP_ROM_QSTR(MP_QSTR_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_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)}, + + // other i2c ports defined + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + + // Serial Pins + {MP_OBJ_NEW_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX3), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX3), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX4), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX4), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX5), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX5), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX6), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX6), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX7), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX7), MP_ROM_PTR(&pin_GPIO_EMC_31)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX8), MP_ROM_PTR(&pin_GPIO_B1_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX8), MP_ROM_PTR(&pin_GPIO_B1_12)}, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From f95a68a37c1c969df8eb2d30e69bf9d09eca014d Mon Sep 17 00:00:00 2001 From: KurtE Date: Sun, 10 Apr 2022 16:56:51 -0700 Subject: [PATCH 66/98] Rename the board name Renamed the board both name of directory within boards, but also the name reported board name: board_id -- sparkfun_teensy_micromod Adafruit CircuitPython 7.3.0-beta.0-10-g2a3eb49da-dirty on 2022-04-10; SparkFun Teensy MicroMod Processor with IMXRT1062DVL6A --- .../boards/{teensyMM => sparkfun_teensy_micromod}/board.c | 0 .../boards/{teensyMM => sparkfun_teensy_micromod}/board.ld | 0 .../{teensyMM => sparkfun_teensy_micromod}/flash_config.c | 0 .../{teensyMM => sparkfun_teensy_micromod}/mpconfigboard.h | 2 +- .../{teensyMM => sparkfun_teensy_micromod}/mpconfigboard.mk | 0 .../boards/{teensyMM => sparkfun_teensy_micromod}/pins.c | 0 6 files changed, 1 insertion(+), 1 deletion(-) rename ports/mimxrt10xx/boards/{teensyMM => sparkfun_teensy_micromod}/board.c (100%) rename ports/mimxrt10xx/boards/{teensyMM => sparkfun_teensy_micromod}/board.ld (100%) rename ports/mimxrt10xx/boards/{teensyMM => sparkfun_teensy_micromod}/flash_config.c (100%) rename ports/mimxrt10xx/boards/{teensyMM => sparkfun_teensy_micromod}/mpconfigboard.h (90%) rename ports/mimxrt10xx/boards/{teensyMM => sparkfun_teensy_micromod}/mpconfigboard.mk (100%) rename ports/mimxrt10xx/boards/{teensyMM => sparkfun_teensy_micromod}/pins.c (100%) diff --git a/ports/mimxrt10xx/boards/teensyMM/board.c b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.c similarity index 100% rename from ports/mimxrt10xx/boards/teensyMM/board.c rename to ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.c diff --git a/ports/mimxrt10xx/boards/teensyMM/board.ld b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.ld similarity index 100% rename from ports/mimxrt10xx/boards/teensyMM/board.ld rename to ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.ld diff --git a/ports/mimxrt10xx/boards/teensyMM/flash_config.c b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/flash_config.c similarity index 100% rename from ports/mimxrt10xx/boards/teensyMM/flash_config.c rename to ports/mimxrt10xx/boards/sparkfun_teensy_micromod/flash_config.c diff --git a/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.h b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h similarity index 90% rename from ports/mimxrt10xx/boards/teensyMM/mpconfigboard.h rename to ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h index ac9fa5ae14..e768578b03 100644 --- a/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.h +++ b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h @@ -1,4 +1,4 @@ -#define MICROPY_HW_BOARD_NAME "Teensy MM" +#define MICROPY_HW_BOARD_NAME "SparkFun Teensy MicroMod Processor" #define MICROPY_HW_MCU_NAME "IMXRT1062DVL6A" // If you change this, then make sure to update the linker scripts as well to diff --git a/ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.mk similarity index 100% rename from ports/mimxrt10xx/boards/teensyMM/mpconfigboard.mk rename to ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.mk diff --git a/ports/mimxrt10xx/boards/teensyMM/pins.c b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/pins.c similarity index 100% rename from ports/mimxrt10xx/boards/teensyMM/pins.c rename to ports/mimxrt10xx/boards/sparkfun_teensy_micromod/pins.c From 71a7ec6f76aecdf92b11770cc4ca2214dc873597 Mon Sep 17 00:00:00 2001 From: Xu Hao Date: Tue, 12 Apr 2022 16:10:02 +0800 Subject: [PATCH 67/98] Add ELECFREAKS Pico:ed board. --- .../boards/elecfreaks_picoed/board.c | 40 +++++++++++++ .../boards/elecfreaks_picoed/mpconfigboard.h | 2 + .../boards/elecfreaks_picoed/mpconfigboard.mk | 11 ++++ .../elecfreaks_picoed/pico-sdk-configboard.h | 1 + .../boards/elecfreaks_picoed/pins.c | 56 +++++++++++++++++++ 5 files changed, 110 insertions(+) create mode 100644 ports/raspberrypi/boards/elecfreaks_picoed/board.c create mode 100644 ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/elecfreaks_picoed/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/elecfreaks_picoed/pins.c diff --git a/ports/raspberrypi/boards/elecfreaks_picoed/board.c b/ports/raspberrypi/boards/elecfreaks_picoed/board.c new file mode 100644 index 0000000000..de6e424ed9 --- /dev/null +++ b/ports/raspberrypi/boards/elecfreaks_picoed/board.c @@ -0,0 +1,40 @@ +/* + * 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" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.h b/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.h new file mode 100644 index 0000000000..0a73b3d73b --- /dev/null +++ b/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.h @@ -0,0 +1,2 @@ +#define MICROPY_HW_BOARD_NAME "ELECFREAKS PICO:ED" +#define MICROPY_HW_MCU_NAME "rp2040" diff --git a/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.mk b/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.mk new file mode 100644 index 0000000000..e7da543143 --- /dev/null +++ b/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x239A +USB_PID = 0x80F6 +USB_PRODUCT = "Pico:ed" +USB_MANUFACTURER = "ELECFREAKS" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/elecfreaks_picoed/pico-sdk-configboard.h b/ports/raspberrypi/boards/elecfreaks_picoed/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/elecfreaks_picoed/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/elecfreaks_picoed/pins.c b/ports/raspberrypi/boards/elecfreaks_picoed/pins.c new file mode 100644 index 0000000000..4542b58672 --- /dev/null +++ b/ports/raspberrypi/boards/elecfreaks_picoed/pins.c @@ -0,0 +1,56 @@ +#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_BUZZER_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_I2C0_SDA), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_I2C0_SCL), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_BUZZER_GP3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_P8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_P9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_P10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_P11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_P12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_P13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_P14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_P15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_P16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_P20), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_P19), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_B), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SMPS_MODE), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_P0_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_P0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_P1_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_P2_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + + { MP_ROM_QSTR(MP_QSTR_P3_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 60e330fb0ddcb24fccf505e6ffb4645587fa0dbd Mon Sep 17 00:00:00 2001 From: root Date: Wed, 13 Apr 2022 09:47:55 -0400 Subject: [PATCH 68/98] Added Settable Clock for MIMXRT BOARDS --- .../sparkfun_teensy_micromod/mpconfigboard.h | 2 + .../boards/teensy40/mpconfigboard.h | 2 + .../boards/teensy41/mpconfigboard.h | 2 + .../common-hal/microcontroller/Processor.c | 11 +- .../common-hal/microcontroller/Processor.h | 2 + .../mimxrt10xx/MIMXRT1062/clocks.c | 245 ++++++++++++++++++ .../peripherals/mimxrt10xx/clocks.h | 1 + shared-bindings/microcontroller/Processor.c | 35 ++- shared-bindings/microcontroller/Processor.h | 3 +- 9 files changed, 300 insertions(+), 3 deletions(-) diff --git a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h index e768578b03..93de3bc81d 100644 --- a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h +++ b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h @@ -19,3 +19,5 @@ #define CIRCUITPY_USB_DEVICE_INSTANCE 0 #define CIRCUITPY_USB_HOST_INSTANCE 1 + +#define HAS_SETTABLE_CLOCK 1 \ No newline at end of file diff --git a/ports/mimxrt10xx/boards/teensy40/mpconfigboard.h b/ports/mimxrt10xx/boards/teensy40/mpconfigboard.h index 718d9b9673..ca00f880f5 100644 --- a/ports/mimxrt10xx/boards/teensy40/mpconfigboard.h +++ b/ports/mimxrt10xx/boards/teensy40/mpconfigboard.h @@ -16,3 +16,5 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO_AD_B0_03) #define DEFAULT_UART_BUS_TX (&pin_GPIO_AD_B0_02) + +#define HAS_SETTABLE_CLOCK 1 \ No newline at end of file diff --git a/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h index 4ba34692c6..ef35d2d026 100644 --- a/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h +++ b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h @@ -19,3 +19,5 @@ #define CIRCUITPY_USB_DEVICE_INSTANCE 0 #define CIRCUITPY_USB_HOST_INSTANCE 1 + +#define HAS_SETTABLE_CLOCK 1 \ No newline at end of file diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c index 697d97ca43..4df9a1f702 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c @@ -25,6 +25,8 @@ * THE SOFTWARE. */ +//https://raw.githubusercontent.com/adafruit/circuitpython/main/ports/mimxrt10xx/common-hal/microcontroller/Processor.c + #include #include "common-hal/microcontroller/Processor.h" @@ -50,6 +52,13 @@ float common_hal_mcu_processor_get_temperature(void) { return temp; } +uint32_t common_hal_mcu_processor_set_sys_clock(mcu_processor_obj_t *self, + uint32_t frequency) { + SystemCoreClock = setarmclock(frequency); + return SystemCoreClock; +} + + float common_hal_mcu_processor_get_voltage(void) { return NAN; } @@ -75,4 +84,4 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void) { return RESET_REASON_UNKNOWN; -} +} \ No newline at end of file diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Processor.h b/ports/mimxrt10xx/common-hal/microcontroller/Processor.h index 43b0ec878c..46f34ea566 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Processor.h +++ b/ports/mimxrt10xx/common-hal/microcontroller/Processor.h @@ -31,10 +31,12 @@ #define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 16 #include "py/obj.h" +#include "clocks.h" typedef struct { mp_obj_base_t base; // Stores no state currently. + uint32_t frequency; } mcu_processor_obj_t; #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c index 46d1eccb20..cae074e774 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c @@ -34,6 +34,7 @@ #include "fsl_clock.h" #include "fsl_iomuxc.h" +#include "fsl_device_registers.h" #include "clocks.h" @@ -335,3 +336,247 @@ void clocks_init(void) { CLOCK_EnableClock(kCLOCK_Iomuxc); } + +/* clockspeed.c + * http://www.pjrc.com/teensy/ + * Copyright (c) 2017 PJRC.COM, LLC + * + * 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. + */ +//Note setarmclock is a port from Teensyduino for the Teensy 4.x written by Paul Stroffgren, +// A brief explanation of F_CPU_ACTUAL vs F_CPU +// https://forum.pjrc.com/threads/57236?p=212642&viewfull=1#post212642 +volatile uint32_t F_CPU_ACTUAL = 396000000; +volatile uint32_t F_BUS_ACTUAL = 132000000; + +// Define these to increase the voltage when attempting overclocking +// The frequency step is how quickly to increase voltage per frequency +// The datasheet says 1600 is the absolute maximum voltage. The hardware +// can actually create up to 1575. But 1300 is the recommended limit. +// (earlier versions of the datasheet said 1300 was the absolute max) +#define OVERCLOCK_STEPSIZE 28000000 +#define OVERCLOCK_MAX_VOLT 1575 + +#define DCDC_REG3 0x40080012 +#define DCDC_REG0 0x40080000 +#define DCDC_REG0_STS_DC_OK_L ((uint32_t)(1<<31)) +#define CCM_ANALOG_PLL_USB1_ENABLE_L ((uint32_t)(1<<13)) +#define CCM_ANALOG_PLL_USB1_POWER_L ((uint32_t)(1<<12)) +#define CCM_ANALOG_PLL_USB1_EN_USB_CLKS_L ((uint32_t)(1<<6)) +#define CCM_ANALOG_PLL_USB1_LOCK_L ((uint32_t)(1<<31)) +#define CCM_CCGR6_DCDC(n) ((uint32_t)(((n) & 0x03) << 6)) +#define CCM_ANALOG_PLL_ARM_LOCK_L ((uint32_t)(1<<31)) +#define CCM_ANALOG_PLL_ARM_BYPASS_L ((uint32_t)(1<<16)) +#define CCM_ANALOG_PLL_ARM_ENABLE_L ((uint32_t)(1<<13)) +#define CCM_ANALOG_PLL_ARM_POWERDOWN_L ((uint32_t)(1<<12)) +#define CCM_CDHIPR_ARM_PODF_BUSY_L ((uint32_t)(1<<16)) +#define CCM_CDHIPR_AHB_PODF_BUSY_L ((uint32_t)(1<<1)) +#define CCM_CDHIPR_PERIPH_CLK_SEL_BUSY_L ((uint32_t)(1<<5)) +#define CCM_CBCDR_PERIPH_CLK_SEL_L ((uint32_t)(1<<25)) +#define CCM_CCGR_OFF 0 +#define CCM_CCGR_ON_RUNONLY 1 +#define CCM_CCGR_ON 3 + +/* Teensyduino Core Library - clockspeed.c + * http://www.pjrc.com/teensy/ + * Copyright (c) 2017 PJRC.COM, LLC. + * + * 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: + * + * 1. The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 2. If the Software is incorporated into a build system that allows + * selection among a list of target devices, then similar target + * devices manufactured by PJRC.COM must be included in the list of + * target devices and selectable in the same manner. + * + * 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. + */ + +//uint32_t set_arm_clock(uint32_t frequency); + +// stuff needing wait handshake: +// CCM_CACRR ARM_PODF +// CCM_CBCDR PERIPH_CLK_SEL +// CCM_CBCMR PERIPH2_CLK_SEL +// CCM_CBCDR AHB_PODF +// CCM_CBCDR SEMC_PODF + +uint32_t setarmclock(uint32_t frequency) +{ + uint32_t cbcdr = CCM->CBCDR; // pg 1021 + uint32_t cbcmr = CCM->CBCMR; // pg 1023 + uint32_t dcdc = DCDC->REG3; + + // compute required voltage + uint32_t voltage = 1150; // default = 1.15V + if (frequency > 528000000) { + voltage = 1250; // 1.25V +#if defined(OVERCLOCK_STEPSIZE) && defined(OVERCLOCK_MAX_VOLT) + if (frequency > 600000000) { + voltage += ((frequency - 600000000) / OVERCLOCK_STEPSIZE) * 25; + if (voltage > OVERCLOCK_MAX_VOLT) voltage = OVERCLOCK_MAX_VOLT; + } +#endif + } else if (frequency <= 24000000) { + voltage = 950; // 0.95 + } + + // if voltage needs to increase, do it before switch clock speed + CCM->CCGR6 |= CCM_CCGR6_DCDC(CCM_CCGR_ON); + if ((dcdc & ((uint32_t)(0x1F << 0))) < ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0)) { + //printf("Increasing voltage to %u mV\n", voltage); + dcdc &= ~((uint32_t)(0x1F << 0)); + dcdc |= ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0); + DCDC->REG3 = dcdc; + while (!(DCDC->REG0 & DCDC_REG0_STS_DC_OK_L)) ; // wait voltage settling + } + + if (!(cbcdr & CCM_CBCDR_PERIPH_CLK_SEL_L)) { + //printf("need to switch to alternate clock during reconfigure of ARM PLL\n"); + const uint32_t need1s = CCM_ANALOG_PLL_USB1_ENABLE_L | CCM_ANALOG_PLL_USB1_POWER_L | + CCM_ANALOG_PLL_USB1_LOCK_L | CCM_ANALOG_PLL_USB1_EN_USB_CLKS_L; + uint32_t sel, div; + if ((CCM_ANALOG->PLL_USB1 & need1s) == need1s) { + //printf("USB PLL is running, so we can use 120 MHz\n"); + sel = 0; + div = 3; // divide down to 120 MHz, so IPG is ok even if IPG_PODF=0 + } else { + //printf("USB PLL is off, use 24 MHz crystal\n"); + sel = 1; + div = 0; + } + if ((cbcdr & ((uint32_t)(0x07 << 27))) != CCM_CBCDR_PERIPH_CLK2_PODF(div)) { + // PERIPH_CLK2 divider needs to be changed + cbcdr &= ~((uint32_t)(0x07 << 27)); + cbcdr |= CCM_CBCDR_PERIPH_CLK2_PODF(div); + CCM->CBCDR = cbcdr; + } + if ((cbcmr & ((uint32_t)(0x03 << 12))) != CCM_CBCMR_PERIPH_CLK2_SEL(sel)) { + // PERIPH_CLK2 source select needs to be changed + cbcmr &= ~((uint32_t)(0x03 << 12)); + cbcmr |= CCM_CBCMR_PERIPH_CLK2_SEL(sel); + CCM->CBCMR = cbcmr; + while (CCM->CDHIPR & ((uint32_t)(1<<3))) ; // wait + } + // switch over to PERIPH_CLK2 + cbcdr |= ((uint32_t)(1<<25)); + CCM->CBCDR = cbcdr; + while (CCM->CDHIPR & ((uint32_t)(1<<5))) ; // wait + } else { + //printf("already running from PERIPH_CLK2, safe to mess with ARM PLL\n"); + } + + // TODO: check if PLL2 running, can 352, 396 or 528 can work? (no need for ARM PLL) + + // DIV_SELECT: 54-108 = official range 648 to 1296 in 12 MHz steps + uint32_t div_arm = 1; + uint32_t div_ahb = 1; + while (frequency * div_arm * div_ahb < 648000000) { + if (div_arm < 8) { + div_arm = div_arm + 1; + } else { + if (div_ahb < 5) { + div_ahb = div_ahb + 1; + div_arm = 1; + } else { + break; + } + } + } + uint32_t mult = (frequency * div_arm * div_ahb + 6000000) / 12000000; + if (mult > 108) mult = 108; + if (mult < 54) mult = 54; + //printf("Freq: 12 MHz * %u / %u / %u\n", mult, div_arm, div_ahb); + frequency = mult * 12000000 / div_arm / div_ahb; + + //printf("ARM PLL=%x\n", CCM_ANALOG->PLL_ARM); + const uint32_t arm_pll_mask = CCM_ANALOG_PLL_ARM_LOCK_L | CCM_ANALOG_PLL_ARM_BYPASS_L | + CCM_ANALOG_PLL_ARM_ENABLE_L | CCM_ANALOG_PLL_ARM_POWERDOWN_L | + CCM_ANALOG_PLL_ARM_DIV_SELECT_MASK; + if ((CCM_ANALOG->PLL_ARM & arm_pll_mask) != (CCM_ANALOG_PLL_ARM_LOCK_L + | CCM_ANALOG_PLL_ARM_ENABLE_L | CCM_ANALOG_PLL_ARM_DIV_SELECT(mult))) { + //printf("ARM PLL needs reconfigure\n"); + CCM_ANALOG->PLL_ARM = CCM_ANALOG_PLL_ARM_POWERDOWN_L; + // TODO: delay needed? + CCM_ANALOG->PLL_ARM = CCM_ANALOG_PLL_ARM_ENABLE_L + | CCM_ANALOG_PLL_ARM_DIV_SELECT(mult); + while (!(CCM_ANALOG->PLL_ARM & CCM_ANALOG_PLL_ARM_LOCK_L)) ; // wait for lock + //printf("ARM PLL=%x\n", CCM_ANALOG->PLL_ARM); + } else { + //printf("ARM PLL already running at required frequency\n"); + } + + if ((CCM->CACRR & ((uint32_t)(0x07 << 0))) != (div_arm - 1)) { + CCM->CACRR = CCM_CACRR_ARM_PODF(div_arm - 1); + while (CCM->CDHIPR & CCM_CDHIPR_ARM_PODF_BUSY_L) ; // wait + } + + if ((cbcdr & ((uint32_t)(0x07 << 10))) != CCM_CBCDR_AHB_PODF(div_ahb - 1)) { + cbcdr &= ~((uint32_t)(0x07 << 10)); + cbcdr |= CCM_CBCDR_AHB_PODF(div_ahb - 1); + CCM->CBCDR = cbcdr; + while (CCM->CDHIPR & CCM_CDHIPR_AHB_PODF_BUSY_L); // wait + } + + uint32_t div_ipg = (frequency + 149999999) / 150000000; + if (div_ipg > 4) div_ipg = 4; + if ((cbcdr & ((uint32_t)(0x03 << 8))) != (CCM_CBCDR_IPG_PODF(div_ipg - 1))) { + cbcdr &= ~((uint32_t)(0x03 << 8)); + cbcdr |= CCM_CBCDR_IPG_PODF(div_ipg - 1); + // TODO: how to safely change IPG_PODF ?? + CCM->CBCDR = cbcdr; + } + + //cbcdr &= ~CCM_CBCDR_PERIPH_CLK_SEL; + //CCM_CBCDR = cbcdr; // why does this not work at 24 MHz? + CCM->CBCDR &= ~((uint32_t)(1<<25)); + while (CCM->CDHIPR & CCM_CDHIPR_PERIPH_CLK_SEL_BUSY_L) ; // wait + + F_CPU_ACTUAL = frequency; + F_BUS_ACTUAL = frequency / div_ipg; + //scale_cpu_cycles_to_microseconds = 0xFFFFFFFFu / (uint32_t)(frequency / 1000000u); + + //printf("New Frequency: ARM=%u, IPG=%u\n", frequency, frequency / div_ipg); + + // if voltage needs to decrease, do it after switch clock speed + if ((dcdc & ((uint32_t)(0x1F << 0))) > ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0)) { + //printf("Decreasing voltage to %u mV\n", voltage); + dcdc &= ~((uint32_t)(0x1F << 0)); + dcdc |= ((uint32_t)(0x1F << 0)); + DCDC->REG3 = dcdc; + while (!(DCDC->REG0 & DCDC_REG0_STS_DC_OK_L)) ; // wait voltage settling + } + + return frequency; +} \ No newline at end of file diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/clocks.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/clocks.h index ccbba2edd4..6551fcd043 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/clocks.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/clocks.h @@ -27,3 +27,4 @@ extern uint32_t SystemCoreClock; void clocks_init(void); +uint32_t setarmclock(uint32_t frequency); \ No newline at end of file diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index dfcafcd324..6015a45935 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -30,9 +30,20 @@ #include #include -#include "py/objproperty.h" +//#include "py/objproperty.h" +//#include "py/runtime.h" + +#include "shared-bindings/util.h" + +#include "shared/runtime/buffer_helper.h" +#include "shared/runtime/context_manager_helpers.h" +#include "py/mperrno.h" +#include "py/objtype.h" +#include "py/objproperty.h" #include "py/runtime.h" +#include "supervisor/shared/translate.h" + //| class Processor: //| """Microcontroller CPU information and control @@ -61,6 +72,27 @@ //| frequency: int //| """The CPU operating frequency in Hertz. (read-only)""" //| + +STATIC mp_obj_t mcu_processor_set_sys_clock(mp_obj_t self_in, mp_obj_t freq) { + mcu_processor_obj_t *self = MP_OBJ_TO_PTR(self_in); + #if defined(HAS_SETTABLE_CLOCK) + uint32_t value_of_freq = MP_OBJ_SMALL_INT_VALUE(freq); + common_hal_mcu_processor_set_sys_clock(self, value_of_freq); + #else + mp_raise_msg(&mp_type_NotImplementedError,translate("Settable Clock Not Implemented for Your Board")); + #endif + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_2(mcu_processor_set_sys_clock_obj, mcu_processor_set_sys_clock); + +const mp_obj_property_t mcu_processor_freq_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&mcu_processor_set_sys_clock_obj, + MP_ROM_NONE, + MP_ROM_NONE}, +}; + STATIC mp_obj_t mcu_processor_get_frequency(mp_obj_t self) { return mp_obj_new_int_from_uint(common_hal_mcu_processor_get_frequency()); } @@ -157,6 +189,7 @@ STATIC const mp_rom_map_elem_t mcu_processor_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_temperature), MP_ROM_PTR(&mcu_processor_temperature_obj) }, { MP_ROM_QSTR(MP_QSTR_uid), MP_ROM_PTR(&mcu_processor_uid_obj) }, { MP_ROM_QSTR(MP_QSTR_voltage), MP_ROM_PTR(&mcu_processor_voltage_obj) }, + { MP_ROM_QSTR(MP_QSTR_setfrequency), MP_ROM_PTR(&mcu_processor_set_sys_clock_obj) }, }; STATIC MP_DEFINE_CONST_DICT(mcu_processor_locals_dict, mcu_processor_locals_dict_table); diff --git a/shared-bindings/microcontroller/Processor.h b/shared-bindings/microcontroller/Processor.h index 98d4790876..86b6ce4624 100644 --- a/shared-bindings/microcontroller/Processor.h +++ b/shared-bindings/microcontroller/Processor.h @@ -38,6 +38,7 @@ uint32_t common_hal_mcu_processor_get_frequency(void); mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void); float common_hal_mcu_processor_get_temperature(void); void common_hal_mcu_processor_get_uid(uint8_t raw_id[]); -float common_hal_mcu_processor_get_voltage(void); +float common_hal_mcu_processor_get_voltage(void); +uint32_t common_hal_mcu_processor_set_sys_clock(mcu_processor_obj_t *self, uint32_t frequency); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_MICROCONTROLLER_PROCESSOR_H From 716497c132efcff55c064ae088746e53f98c14ff Mon Sep 17 00:00:00 2001 From: root Date: Wed, 13 Apr 2022 12:04:28 -0400 Subject: [PATCH 69/98] corrected pre-commit errors --- locale/circuitpython.pot | 6 +- .../sparkfun_teensy_micromod/mpconfigboard.h | 2 +- .../boards/teensy40/mpconfigboard.h | 2 +- .../boards/teensy41/mpconfigboard.h | 2 +- .../common-hal/microcontroller/Processor.c | 6 +- .../common-hal/microcontroller/Processor.h | 2 +- .../mimxrt10xx/MIMXRT1062/clocks.c | 335 ++++++++++-------- .../peripherals/mimxrt10xx/clocks.h | 2 +- shared-bindings/microcontroller/Processor.c | 20 +- shared-bindings/microcontroller/Processor.h | 2 +- 10 files changed, 203 insertions(+), 176 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index d7e14eabe5..6c5cc6737e 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -2149,6 +2149,10 @@ msgstr "" msgid "Set pin count must be between 1 and 5" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "Settable Clock Not Implemented for Your Board" +msgstr "" + #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Side set pin count must be between 1 and 5" msgstr "" @@ -3019,7 +3023,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "" diff --git a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h index 93de3bc81d..816b148e5f 100644 --- a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h +++ b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h @@ -20,4 +20,4 @@ #define CIRCUITPY_USB_DEVICE_INSTANCE 0 #define CIRCUITPY_USB_HOST_INSTANCE 1 -#define HAS_SETTABLE_CLOCK 1 \ No newline at end of file +#define HAS_SETTABLE_CLOCK 1 diff --git a/ports/mimxrt10xx/boards/teensy40/mpconfigboard.h b/ports/mimxrt10xx/boards/teensy40/mpconfigboard.h index ca00f880f5..c7fa1f2650 100644 --- a/ports/mimxrt10xx/boards/teensy40/mpconfigboard.h +++ b/ports/mimxrt10xx/boards/teensy40/mpconfigboard.h @@ -17,4 +17,4 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO_AD_B0_03) #define DEFAULT_UART_BUS_TX (&pin_GPIO_AD_B0_02) -#define HAS_SETTABLE_CLOCK 1 \ No newline at end of file +#define HAS_SETTABLE_CLOCK 1 diff --git a/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h index ef35d2d026..63c3e8e032 100644 --- a/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h +++ b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h @@ -20,4 +20,4 @@ #define CIRCUITPY_USB_DEVICE_INSTANCE 0 #define CIRCUITPY_USB_HOST_INSTANCE 1 -#define HAS_SETTABLE_CLOCK 1 \ No newline at end of file +#define HAS_SETTABLE_CLOCK 1 diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c index 4df9a1f702..eee5559e09 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c @@ -25,7 +25,7 @@ * THE SOFTWARE. */ -//https://raw.githubusercontent.com/adafruit/circuitpython/main/ports/mimxrt10xx/common-hal/microcontroller/Processor.c +// https://raw.githubusercontent.com/adafruit/circuitpython/main/ports/mimxrt10xx/common-hal/microcontroller/Processor.c #include @@ -54,7 +54,7 @@ float common_hal_mcu_processor_get_temperature(void) { uint32_t common_hal_mcu_processor_set_sys_clock(mcu_processor_obj_t *self, uint32_t frequency) { - SystemCoreClock = setarmclock(frequency); + SystemCoreClock = setarmclock(frequency); return SystemCoreClock; } @@ -84,4 +84,4 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void) { return RESET_REASON_UNKNOWN; -} \ No newline at end of file +} diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Processor.h b/ports/mimxrt10xx/common-hal/microcontroller/Processor.h index 46f34ea566..2e18aacfde 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Processor.h +++ b/ports/mimxrt10xx/common-hal/microcontroller/Processor.h @@ -36,7 +36,7 @@ typedef struct { mp_obj_base_t base; // Stores no state currently. - uint32_t frequency; + uint32_t frequency; } mcu_processor_obj_t; #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c index cae074e774..72d8990071 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c @@ -359,7 +359,7 @@ void clocks_init(void) { * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -//Note setarmclock is a port from Teensyduino for the Teensy 4.x written by Paul Stroffgren, +// Note setarmclock is a port from Teensyduino for the Teensy 4.x written by Paul Stroffgren, // A brief explanation of F_CPU_ACTUAL vs F_CPU // https://forum.pjrc.com/threads/57236?p=212642&viewfull=1#post212642 volatile uint32_t F_CPU_ACTUAL = 396000000; @@ -373,25 +373,25 @@ volatile uint32_t F_BUS_ACTUAL = 132000000; #define OVERCLOCK_STEPSIZE 28000000 #define OVERCLOCK_MAX_VOLT 1575 -#define DCDC_REG3 0x40080012 -#define DCDC_REG0 0x40080000 -#define DCDC_REG0_STS_DC_OK_L ((uint32_t)(1<<31)) -#define CCM_ANALOG_PLL_USB1_ENABLE_L ((uint32_t)(1<<13)) -#define CCM_ANALOG_PLL_USB1_POWER_L ((uint32_t)(1<<12)) -#define CCM_ANALOG_PLL_USB1_EN_USB_CLKS_L ((uint32_t)(1<<6)) -#define CCM_ANALOG_PLL_USB1_LOCK_L ((uint32_t)(1<<31)) -#define CCM_CCGR6_DCDC(n) ((uint32_t)(((n) & 0x03) << 6)) -#define CCM_ANALOG_PLL_ARM_LOCK_L ((uint32_t)(1<<31)) -#define CCM_ANALOG_PLL_ARM_BYPASS_L ((uint32_t)(1<<16)) -#define CCM_ANALOG_PLL_ARM_ENABLE_L ((uint32_t)(1<<13)) -#define CCM_ANALOG_PLL_ARM_POWERDOWN_L ((uint32_t)(1<<12)) -#define CCM_CDHIPR_ARM_PODF_BUSY_L ((uint32_t)(1<<16)) -#define CCM_CDHIPR_AHB_PODF_BUSY_L ((uint32_t)(1<<1)) -#define CCM_CDHIPR_PERIPH_CLK_SEL_BUSY_L ((uint32_t)(1<<5)) -#define CCM_CBCDR_PERIPH_CLK_SEL_L ((uint32_t)(1<<25)) -#define CCM_CCGR_OFF 0 -#define CCM_CCGR_ON_RUNONLY 1 -#define CCM_CCGR_ON 3 +#define DCDC_REG3 0x40080012 +#define DCDC_REG0 0x40080000 +#define DCDC_REG0_STS_DC_OK_L ((uint32_t)(1 << 31)) +#define CCM_ANALOG_PLL_USB1_ENABLE_L ((uint32_t)(1 << 13)) +#define CCM_ANALOG_PLL_USB1_POWER_L ((uint32_t)(1 << 12)) +#define CCM_ANALOG_PLL_USB1_EN_USB_CLKS_L ((uint32_t)(1 << 6)) +#define CCM_ANALOG_PLL_USB1_LOCK_L ((uint32_t)(1 << 31)) +#define CCM_CCGR6_DCDC(n) ((uint32_t)(((n) & 0x03) << 6)) +#define CCM_ANALOG_PLL_ARM_LOCK_L ((uint32_t)(1 << 31)) +#define CCM_ANALOG_PLL_ARM_BYPASS_L ((uint32_t)(1 << 16)) +#define CCM_ANALOG_PLL_ARM_ENABLE_L ((uint32_t)(1 << 13)) +#define CCM_ANALOG_PLL_ARM_POWERDOWN_L ((uint32_t)(1 << 12)) +#define CCM_CDHIPR_ARM_PODF_BUSY_L ((uint32_t)(1 << 16)) +#define CCM_CDHIPR_AHB_PODF_BUSY_L ((uint32_t)(1 << 1)) +#define CCM_CDHIPR_PERIPH_CLK_SEL_BUSY_L ((uint32_t)(1 << 5)) +#define CCM_CBCDR_PERIPH_CLK_SEL_L ((uint32_t)(1 << 25)) +#define CCM_CCGR_OFF 0 +#define CCM_CCGR_ON_RUNONLY 1 +#define CCM_CCGR_ON 3 /* Teensyduino Core Library - clockspeed.c * http://www.pjrc.com/teensy/ @@ -423,7 +423,7 @@ volatile uint32_t F_BUS_ACTUAL = 132000000; * SOFTWARE. */ -//uint32_t set_arm_clock(uint32_t frequency); +// uint32_t set_arm_clock(uint32_t frequency); // stuff needing wait handshake: // CCM_CACRR ARM_PODF @@ -432,151 +432,174 @@ volatile uint32_t F_BUS_ACTUAL = 132000000; // CCM_CBCDR AHB_PODF // CCM_CBCDR SEMC_PODF -uint32_t setarmclock(uint32_t frequency) -{ - uint32_t cbcdr = CCM->CBCDR; // pg 1021 - uint32_t cbcmr = CCM->CBCMR; // pg 1023 - uint32_t dcdc = DCDC->REG3; +uint32_t setarmclock(uint32_t frequency) { + uint32_t cbcdr = CCM->CBCDR; // pg 1021 + uint32_t cbcmr = CCM->CBCMR; // pg 1023 + uint32_t dcdc = DCDC->REG3; - // compute required voltage - uint32_t voltage = 1150; // default = 1.15V - if (frequency > 528000000) { - voltage = 1250; // 1.25V -#if defined(OVERCLOCK_STEPSIZE) && defined(OVERCLOCK_MAX_VOLT) - if (frequency > 600000000) { - voltage += ((frequency - 600000000) / OVERCLOCK_STEPSIZE) * 25; - if (voltage > OVERCLOCK_MAX_VOLT) voltage = OVERCLOCK_MAX_VOLT; - } -#endif - } else if (frequency <= 24000000) { - voltage = 950; // 0.95 - } + // compute required voltage + uint32_t voltage = 1150; // default = 1.15V + if (frequency > 528000000) { + voltage = 1250; // 1.25V + #if defined(OVERCLOCK_STEPSIZE) && defined(OVERCLOCK_MAX_VOLT) + if (frequency > 600000000) { + voltage += ((frequency - 600000000) / OVERCLOCK_STEPSIZE) * 25; + if (voltage > OVERCLOCK_MAX_VOLT) { + voltage = OVERCLOCK_MAX_VOLT; + } + } + #endif + } else if (frequency <= 24000000) { + voltage = 950; // 0.95 + } - // if voltage needs to increase, do it before switch clock speed - CCM->CCGR6 |= CCM_CCGR6_DCDC(CCM_CCGR_ON); - if ((dcdc & ((uint32_t)(0x1F << 0))) < ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0)) { - //printf("Increasing voltage to %u mV\n", voltage); - dcdc &= ~((uint32_t)(0x1F << 0)); - dcdc |= ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0); - DCDC->REG3 = dcdc; - while (!(DCDC->REG0 & DCDC_REG0_STS_DC_OK_L)) ; // wait voltage settling - } + // if voltage needs to increase, do it before switch clock speed + CCM->CCGR6 |= CCM_CCGR6_DCDC(CCM_CCGR_ON); + if ((dcdc & ((uint32_t)(0x1F << 0))) < ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0)) { + // printf("Increasing voltage to %u mV\n", voltage); + dcdc &= ~((uint32_t)(0x1F << 0)); + dcdc |= ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0); + DCDC->REG3 = dcdc; + while (!(DCDC->REG0 & DCDC_REG0_STS_DC_OK_L)) { + ; // wait voltage settling + } + } - if (!(cbcdr & CCM_CBCDR_PERIPH_CLK_SEL_L)) { - //printf("need to switch to alternate clock during reconfigure of ARM PLL\n"); - const uint32_t need1s = CCM_ANALOG_PLL_USB1_ENABLE_L | CCM_ANALOG_PLL_USB1_POWER_L | - CCM_ANALOG_PLL_USB1_LOCK_L | CCM_ANALOG_PLL_USB1_EN_USB_CLKS_L; - uint32_t sel, div; - if ((CCM_ANALOG->PLL_USB1 & need1s) == need1s) { - //printf("USB PLL is running, so we can use 120 MHz\n"); - sel = 0; - div = 3; // divide down to 120 MHz, so IPG is ok even if IPG_PODF=0 - } else { - //printf("USB PLL is off, use 24 MHz crystal\n"); - sel = 1; - div = 0; - } - if ((cbcdr & ((uint32_t)(0x07 << 27))) != CCM_CBCDR_PERIPH_CLK2_PODF(div)) { - // PERIPH_CLK2 divider needs to be changed - cbcdr &= ~((uint32_t)(0x07 << 27)); - cbcdr |= CCM_CBCDR_PERIPH_CLK2_PODF(div); - CCM->CBCDR = cbcdr; - } - if ((cbcmr & ((uint32_t)(0x03 << 12))) != CCM_CBCMR_PERIPH_CLK2_SEL(sel)) { - // PERIPH_CLK2 source select needs to be changed - cbcmr &= ~((uint32_t)(0x03 << 12)); - cbcmr |= CCM_CBCMR_PERIPH_CLK2_SEL(sel); - CCM->CBCMR = cbcmr; - while (CCM->CDHIPR & ((uint32_t)(1<<3))) ; // wait - } - // switch over to PERIPH_CLK2 - cbcdr |= ((uint32_t)(1<<25)); - CCM->CBCDR = cbcdr; - while (CCM->CDHIPR & ((uint32_t)(1<<5))) ; // wait - } else { - //printf("already running from PERIPH_CLK2, safe to mess with ARM PLL\n"); - } + if (!(cbcdr & CCM_CBCDR_PERIPH_CLK_SEL_L)) { + // printf("need to switch to alternate clock during reconfigure of ARM PLL\n"); + const uint32_t need1s = CCM_ANALOG_PLL_USB1_ENABLE_L | CCM_ANALOG_PLL_USB1_POWER_L | + CCM_ANALOG_PLL_USB1_LOCK_L | CCM_ANALOG_PLL_USB1_EN_USB_CLKS_L; + uint32_t sel, div; + if ((CCM_ANALOG->PLL_USB1 & need1s) == need1s) { + // printf("USB PLL is running, so we can use 120 MHz\n"); + sel = 0; + div = 3; // divide down to 120 MHz, so IPG is ok even if IPG_PODF=0 + } else { + // printf("USB PLL is off, use 24 MHz crystal\n"); + sel = 1; + div = 0; + } + if ((cbcdr & ((uint32_t)(0x07 << 27))) != CCM_CBCDR_PERIPH_CLK2_PODF(div)) { + // PERIPH_CLK2 divider needs to be changed + cbcdr &= ~((uint32_t)(0x07 << 27)); + cbcdr |= CCM_CBCDR_PERIPH_CLK2_PODF(div); + CCM->CBCDR = cbcdr; + } + if ((cbcmr & ((uint32_t)(0x03 << 12))) != CCM_CBCMR_PERIPH_CLK2_SEL(sel)) { + // PERIPH_CLK2 source select needs to be changed + cbcmr &= ~((uint32_t)(0x03 << 12)); + cbcmr |= CCM_CBCMR_PERIPH_CLK2_SEL(sel); + CCM->CBCMR = cbcmr; + while (CCM->CDHIPR & ((uint32_t)(1 << 3))) { + ; // wait + } + } + // switch over to PERIPH_CLK2 + cbcdr |= ((uint32_t)(1 << 25)); + CCM->CBCDR = cbcdr; + while (CCM->CDHIPR & ((uint32_t)(1 << 5))) { + ; // wait + } + } else { + // printf("already running from PERIPH_CLK2, safe to mess with ARM PLL\n"); + } - // TODO: check if PLL2 running, can 352, 396 or 528 can work? (no need for ARM PLL) + // TODO: check if PLL2 running, can 352, 396 or 528 can work? (no need for ARM PLL) - // DIV_SELECT: 54-108 = official range 648 to 1296 in 12 MHz steps - uint32_t div_arm = 1; - uint32_t div_ahb = 1; - while (frequency * div_arm * div_ahb < 648000000) { - if (div_arm < 8) { - div_arm = div_arm + 1; - } else { - if (div_ahb < 5) { - div_ahb = div_ahb + 1; - div_arm = 1; - } else { - break; - } - } - } - uint32_t mult = (frequency * div_arm * div_ahb + 6000000) / 12000000; - if (mult > 108) mult = 108; - if (mult < 54) mult = 54; - //printf("Freq: 12 MHz * %u / %u / %u\n", mult, div_arm, div_ahb); - frequency = mult * 12000000 / div_arm / div_ahb; + // DIV_SELECT: 54-108 = official range 648 to 1296 in 12 MHz steps + uint32_t div_arm = 1; + uint32_t div_ahb = 1; + while (frequency * div_arm * div_ahb < 648000000) { + if (div_arm < 8) { + div_arm = div_arm + 1; + } else { + if (div_ahb < 5) { + div_ahb = div_ahb + 1; + div_arm = 1; + } else { + break; + } + } + } + uint32_t mult = (frequency * div_arm * div_ahb + 6000000) / 12000000; + if (mult > 108) { + mult = 108; + } + if (mult < 54) { + mult = 54; + } + // printf("Freq: 12 MHz * %u / %u / %u\n", mult, div_arm, div_ahb); + frequency = mult * 12000000 / div_arm / div_ahb; - //printf("ARM PLL=%x\n", CCM_ANALOG->PLL_ARM); - const uint32_t arm_pll_mask = CCM_ANALOG_PLL_ARM_LOCK_L | CCM_ANALOG_PLL_ARM_BYPASS_L | - CCM_ANALOG_PLL_ARM_ENABLE_L | CCM_ANALOG_PLL_ARM_POWERDOWN_L | - CCM_ANALOG_PLL_ARM_DIV_SELECT_MASK; - if ((CCM_ANALOG->PLL_ARM & arm_pll_mask) != (CCM_ANALOG_PLL_ARM_LOCK_L - | CCM_ANALOG_PLL_ARM_ENABLE_L | CCM_ANALOG_PLL_ARM_DIV_SELECT(mult))) { - //printf("ARM PLL needs reconfigure\n"); - CCM_ANALOG->PLL_ARM = CCM_ANALOG_PLL_ARM_POWERDOWN_L; - // TODO: delay needed? - CCM_ANALOG->PLL_ARM = CCM_ANALOG_PLL_ARM_ENABLE_L - | CCM_ANALOG_PLL_ARM_DIV_SELECT(mult); - while (!(CCM_ANALOG->PLL_ARM & CCM_ANALOG_PLL_ARM_LOCK_L)) ; // wait for lock - //printf("ARM PLL=%x\n", CCM_ANALOG->PLL_ARM); - } else { - //printf("ARM PLL already running at required frequency\n"); - } + // printf("ARM PLL=%x\n", CCM_ANALOG->PLL_ARM); + const uint32_t arm_pll_mask = CCM_ANALOG_PLL_ARM_LOCK_L | CCM_ANALOG_PLL_ARM_BYPASS_L | + CCM_ANALOG_PLL_ARM_ENABLE_L | CCM_ANALOG_PLL_ARM_POWERDOWN_L | + CCM_ANALOG_PLL_ARM_DIV_SELECT_MASK; + if ((CCM_ANALOG->PLL_ARM & arm_pll_mask) != (CCM_ANALOG_PLL_ARM_LOCK_L + | CCM_ANALOG_PLL_ARM_ENABLE_L | CCM_ANALOG_PLL_ARM_DIV_SELECT(mult))) { + // printf("ARM PLL needs reconfigure\n"); + CCM_ANALOG->PLL_ARM = CCM_ANALOG_PLL_ARM_POWERDOWN_L; + // TODO: delay needed? + CCM_ANALOG->PLL_ARM = CCM_ANALOG_PLL_ARM_ENABLE_L + | CCM_ANALOG_PLL_ARM_DIV_SELECT(mult); + while (!(CCM_ANALOG->PLL_ARM & CCM_ANALOG_PLL_ARM_LOCK_L)) { + ; // wait for lock + } + // printf("ARM PLL=%x\n", CCM_ANALOG->PLL_ARM); + } else { + // printf("ARM PLL already running at required frequency\n"); + } - if ((CCM->CACRR & ((uint32_t)(0x07 << 0))) != (div_arm - 1)) { - CCM->CACRR = CCM_CACRR_ARM_PODF(div_arm - 1); - while (CCM->CDHIPR & CCM_CDHIPR_ARM_PODF_BUSY_L) ; // wait - } + if ((CCM->CACRR & ((uint32_t)(0x07 << 0))) != (div_arm - 1)) { + CCM->CACRR = CCM_CACRR_ARM_PODF(div_arm - 1); + while (CCM->CDHIPR & CCM_CDHIPR_ARM_PODF_BUSY_L) { + ; // wait + } + } - if ((cbcdr & ((uint32_t)(0x07 << 10))) != CCM_CBCDR_AHB_PODF(div_ahb - 1)) { - cbcdr &= ~((uint32_t)(0x07 << 10)); - cbcdr |= CCM_CBCDR_AHB_PODF(div_ahb - 1); - CCM->CBCDR = cbcdr; - while (CCM->CDHIPR & CCM_CDHIPR_AHB_PODF_BUSY_L); // wait - } + if ((cbcdr & ((uint32_t)(0x07 << 10))) != CCM_CBCDR_AHB_PODF(div_ahb - 1)) { + cbcdr &= ~((uint32_t)(0x07 << 10)); + cbcdr |= CCM_CBCDR_AHB_PODF(div_ahb - 1); + CCM->CBCDR = cbcdr; + while (CCM->CDHIPR & CCM_CDHIPR_AHB_PODF_BUSY_L) { + ; // wait + } + } - uint32_t div_ipg = (frequency + 149999999) / 150000000; - if (div_ipg > 4) div_ipg = 4; - if ((cbcdr & ((uint32_t)(0x03 << 8))) != (CCM_CBCDR_IPG_PODF(div_ipg - 1))) { - cbcdr &= ~((uint32_t)(0x03 << 8)); - cbcdr |= CCM_CBCDR_IPG_PODF(div_ipg - 1); - // TODO: how to safely change IPG_PODF ?? - CCM->CBCDR = cbcdr; - } + uint32_t div_ipg = (frequency + 149999999) / 150000000; + if (div_ipg > 4) { + div_ipg = 4; + } + if ((cbcdr & ((uint32_t)(0x03 << 8))) != (CCM_CBCDR_IPG_PODF(div_ipg - 1))) { + cbcdr &= ~((uint32_t)(0x03 << 8)); + cbcdr |= CCM_CBCDR_IPG_PODF(div_ipg - 1); + // TODO: how to safely change IPG_PODF ?? + CCM->CBCDR = cbcdr; + } - //cbcdr &= ~CCM_CBCDR_PERIPH_CLK_SEL; - //CCM_CBCDR = cbcdr; // why does this not work at 24 MHz? - CCM->CBCDR &= ~((uint32_t)(1<<25)); - while (CCM->CDHIPR & CCM_CDHIPR_PERIPH_CLK_SEL_BUSY_L) ; // wait + // cbcdr &= ~CCM_CBCDR_PERIPH_CLK_SEL; + // CCM_CBCDR = cbcdr; // why does this not work at 24 MHz? + CCM->CBCDR &= ~((uint32_t)(1 << 25)); + while (CCM->CDHIPR & CCM_CDHIPR_PERIPH_CLK_SEL_BUSY_L) { + ; // wait - F_CPU_ACTUAL = frequency; - F_BUS_ACTUAL = frequency / div_ipg; - //scale_cpu_cycles_to_microseconds = 0xFFFFFFFFu / (uint32_t)(frequency / 1000000u); + } + F_CPU_ACTUAL = frequency; + F_BUS_ACTUAL = frequency / div_ipg; + // scale_cpu_cycles_to_microseconds = 0xFFFFFFFFu / (uint32_t)(frequency / 1000000u); - //printf("New Frequency: ARM=%u, IPG=%u\n", frequency, frequency / div_ipg); + // printf("New Frequency: ARM=%u, IPG=%u\n", frequency, frequency / div_ipg); - // if voltage needs to decrease, do it after switch clock speed - if ((dcdc & ((uint32_t)(0x1F << 0))) > ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0)) { - //printf("Decreasing voltage to %u mV\n", voltage); - dcdc &= ~((uint32_t)(0x1F << 0)); - dcdc |= ((uint32_t)(0x1F << 0)); - DCDC->REG3 = dcdc; - while (!(DCDC->REG0 & DCDC_REG0_STS_DC_OK_L)) ; // wait voltage settling - } - - return frequency; -} \ No newline at end of file + // if voltage needs to decrease, do it after switch clock speed + if ((dcdc & ((uint32_t)(0x1F << 0))) > ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0)) { + // printf("Decreasing voltage to %u mV\n", voltage); + dcdc &= ~((uint32_t)(0x1F << 0)); + dcdc |= ((uint32_t)(0x1F << 0)); + DCDC->REG3 = dcdc; + while (!(DCDC->REG0 & DCDC_REG0_STS_DC_OK_L)) { + ; // wait voltage settling + } + } + + return frequency; +} diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/clocks.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/clocks.h index 6551fcd043..54f0e37b8f 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/clocks.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/clocks.h @@ -27,4 +27,4 @@ extern uint32_t SystemCoreClock; void clocks_init(void); -uint32_t setarmclock(uint32_t frequency); \ No newline at end of file +uint32_t setarmclock(uint32_t frequency); diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index 6015a45935..11708d64f9 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -30,9 +30,9 @@ #include #include -//#include "py/objproperty.h" +// #include "py/objproperty.h" -//#include "py/runtime.h" +// #include "py/runtime.h" #include "shared-bindings/util.h" @@ -75,12 +75,12 @@ STATIC mp_obj_t mcu_processor_set_sys_clock(mp_obj_t self_in, mp_obj_t freq) { mcu_processor_obj_t *self = MP_OBJ_TO_PTR(self_in); - #if defined(HAS_SETTABLE_CLOCK) - uint32_t value_of_freq = MP_OBJ_SMALL_INT_VALUE(freq); - common_hal_mcu_processor_set_sys_clock(self, value_of_freq); - #else - mp_raise_msg(&mp_type_NotImplementedError,translate("Settable Clock Not Implemented for Your Board")); - #endif + #if defined(HAS_SETTABLE_CLOCK) + uint32_t value_of_freq = MP_OBJ_SMALL_INT_VALUE(freq); + common_hal_mcu_processor_set_sys_clock(self, value_of_freq); + #else + mp_raise_msg(&mp_type_NotImplementedError,translate("Settable Clock Not Implemented for Your Board")); + #endif return mp_const_none; } @@ -89,7 +89,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(mcu_processor_set_sys_clock_obj, mcu_processor_set_sys const mp_obj_property_t mcu_processor_freq_obj = { .base.type = &mp_type_property, .proxy = {(mp_obj_t)&mcu_processor_set_sys_clock_obj, - MP_ROM_NONE, + MP_ROM_NONE, MP_ROM_NONE}, }; @@ -189,7 +189,7 @@ STATIC const mp_rom_map_elem_t mcu_processor_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_temperature), MP_ROM_PTR(&mcu_processor_temperature_obj) }, { MP_ROM_QSTR(MP_QSTR_uid), MP_ROM_PTR(&mcu_processor_uid_obj) }, { MP_ROM_QSTR(MP_QSTR_voltage), MP_ROM_PTR(&mcu_processor_voltage_obj) }, - { MP_ROM_QSTR(MP_QSTR_setfrequency), MP_ROM_PTR(&mcu_processor_set_sys_clock_obj) }, + { MP_ROM_QSTR(MP_QSTR_setfrequency), MP_ROM_PTR(&mcu_processor_set_sys_clock_obj) }, }; STATIC MP_DEFINE_CONST_DICT(mcu_processor_locals_dict, mcu_processor_locals_dict_table); diff --git a/shared-bindings/microcontroller/Processor.h b/shared-bindings/microcontroller/Processor.h index 86b6ce4624..07b1759c06 100644 --- a/shared-bindings/microcontroller/Processor.h +++ b/shared-bindings/microcontroller/Processor.h @@ -38,7 +38,7 @@ uint32_t common_hal_mcu_processor_get_frequency(void); mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void); float common_hal_mcu_processor_get_temperature(void); void common_hal_mcu_processor_get_uid(uint8_t raw_id[]); -float common_hal_mcu_processor_get_voltage(void); +float common_hal_mcu_processor_get_voltage(void); uint32_t common_hal_mcu_processor_set_sys_clock(mcu_processor_obj_t *self, uint32_t frequency); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_MICROCONTROLLER_PROCESSOR_H From 7a30176b4982865358d9d240afabec4cf8414b8f Mon Sep 17 00:00:00 2001 From: mjs513 Date: Wed, 13 Apr 2022 13:44:22 -0400 Subject: [PATCH 70/98] Fix Build Errors for Other Boards --- shared-bindings/microcontroller/Processor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index 11708d64f9..c89ecfb790 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -73,8 +73,7 @@ //| """The CPU operating frequency in Hertz. (read-only)""" //| -STATIC mp_obj_t mcu_processor_set_sys_clock(mp_obj_t self_in, mp_obj_t freq) { - mcu_processor_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t mcu_processor_set_sys_clock(mp_obj_t self, mp_obj_t freq) { #if defined(HAS_SETTABLE_CLOCK) uint32_t value_of_freq = MP_OBJ_SMALL_INT_VALUE(freq); common_hal_mcu_processor_set_sys_clock(self, value_of_freq); From 9c1b44a03050fb61641ee082868e74d2ee2cdf2b Mon Sep 17 00:00:00 2001 From: Xu Hao Date: Thu, 14 Apr 2022 17:42:04 +0800 Subject: [PATCH 71/98] Modify USB VID and PID of the Pico:ed --- ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.mk b/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.mk index e7da543143..42200ac8c7 100644 --- a/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.mk +++ b/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.mk @@ -1,5 +1,5 @@ -USB_VID = 0x239A -USB_PID = 0x80F6 +USB_VID = 0x2E8A +USB_PID = 0x1026 USB_PRODUCT = "Pico:ed" USB_MANUFACTURER = "ELECFREAKS" From fd41c1ac5b4b6f53a2f5f3bf02afb8cad4bb68cc Mon Sep 17 00:00:00 2001 From: mjs513 Date: Thu, 14 Apr 2022 06:45:16 -0400 Subject: [PATCH 72/98] Update based on PR Comments --- locale/circuitpython.pot | 4 ++++ .../sparkfun_teensy_micromod/mpconfigboard.h | 2 -- .../sparkfun_teensy_micromod/mpconfigboard.mk | 1 + .../boards/teensy40/mpconfigboard.h | 2 -- .../boards/teensy40/mpconfigboard.mk | 1 + .../boards/teensy41/mpconfigboard.h | 2 -- .../boards/teensy41/mpconfigboard.mk | 1 + .../common-hal/microcontroller/Processor.c | 9 ++++++--- .../common-hal/microcontroller/Processor.h | 1 - .../mimxrt10xx/MIMXRT1062/clocks.c | 15 +-------------- py/circuitpy_mpconfig.mk | 3 +++ shared-bindings/microcontroller/Processor.c | 19 ++++++------------- shared-bindings/microcontroller/Processor.h | 2 +- 13 files changed, 24 insertions(+), 38 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 6c5cc6737e..d0bb7a4067 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1107,6 +1107,10 @@ msgstr "" msgid "Framebuffer requires %d bytes" msgstr "" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "Frequency Out of Range Must be between 24Mhz and 1.008Ghz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" diff --git a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h index 816b148e5f..e768578b03 100644 --- a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h +++ b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h @@ -19,5 +19,3 @@ #define CIRCUITPY_USB_DEVICE_INSTANCE 0 #define CIRCUITPY_USB_HOST_INSTANCE 1 - -#define HAS_SETTABLE_CLOCK 1 diff --git a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.mk b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.mk index 2eefba15f0..3705bc6fb6 100644 --- a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.mk +++ b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.mk @@ -8,3 +8,4 @@ CHIP_FAMILY = MIMXRT1062 FLASH = W25Q128JV CIRCUITPY__EVE = 1 CIRCUITPY_USB_HOST = 1 +CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY = 1 diff --git a/ports/mimxrt10xx/boards/teensy40/mpconfigboard.h b/ports/mimxrt10xx/boards/teensy40/mpconfigboard.h index c7fa1f2650..718d9b9673 100644 --- a/ports/mimxrt10xx/boards/teensy40/mpconfigboard.h +++ b/ports/mimxrt10xx/boards/teensy40/mpconfigboard.h @@ -16,5 +16,3 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO_AD_B0_03) #define DEFAULT_UART_BUS_TX (&pin_GPIO_AD_B0_02) - -#define HAS_SETTABLE_CLOCK 1 diff --git a/ports/mimxrt10xx/boards/teensy40/mpconfigboard.mk b/ports/mimxrt10xx/boards/teensy40/mpconfigboard.mk index 3a73245403..9cb1e636b6 100644 --- a/ports/mimxrt10xx/boards/teensy40/mpconfigboard.mk +++ b/ports/mimxrt10xx/boards/teensy40/mpconfigboard.mk @@ -7,3 +7,4 @@ CHIP_VARIANT = MIMXRT1062DVJ6A CHIP_FAMILY = MIMXRT1062 FLASH = W25Q16JV CIRCUITPY__EVE = 1 +CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY = 1 diff --git a/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h index 63c3e8e032..4ba34692c6 100644 --- a/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h +++ b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h @@ -19,5 +19,3 @@ #define CIRCUITPY_USB_DEVICE_INSTANCE 0 #define CIRCUITPY_USB_HOST_INSTANCE 1 - -#define HAS_SETTABLE_CLOCK 1 diff --git a/ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk index 9f214a22a2..7d16b797c5 100644 --- a/ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk +++ b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk @@ -8,3 +8,4 @@ CHIP_FAMILY = MIMXRT1062 FLASH = W25Q64JV CIRCUITPY__EVE = 1 CIRCUITPY_USB_HOST = 1 +CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY = 1 diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c index eee5559e09..ac76c88330 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c @@ -25,10 +25,10 @@ * THE SOFTWARE. */ -// https://raw.githubusercontent.com/adafruit/circuitpython/main/ports/mimxrt10xx/common-hal/microcontroller/Processor.c - #include +#include "py/runtime.h" + #include "common-hal/microcontroller/Processor.h" #include "shared-bindings/microcontroller/Processor.h" #include "shared-bindings/microcontroller/ResetReason.h" @@ -52,8 +52,11 @@ float common_hal_mcu_processor_get_temperature(void) { return temp; } -uint32_t common_hal_mcu_processor_set_sys_clock(mcu_processor_obj_t *self, +uint32_t common_hal_mcu_processor_set_frequency(mcu_processor_obj_t *self, uint32_t frequency) { + if (frequency < 24000000 || frequency > 1008000000) { + mp_raise_ValueError(translate("Frequency Out of Range Must be between 24Mhz and 1.008Ghz")); + } SystemCoreClock = setarmclock(frequency); return SystemCoreClock; } diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Processor.h b/ports/mimxrt10xx/common-hal/microcontroller/Processor.h index 2e18aacfde..2f7ff88697 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Processor.h +++ b/ports/mimxrt10xx/common-hal/microcontroller/Processor.h @@ -35,7 +35,6 @@ typedef struct { mp_obj_base_t base; - // Stores no state currently. uint32_t frequency; } mcu_processor_obj_t; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c index 72d8990071..0eb879053b 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c @@ -456,7 +456,6 @@ uint32_t setarmclock(uint32_t frequency) { // if voltage needs to increase, do it before switch clock speed CCM->CCGR6 |= CCM_CCGR6_DCDC(CCM_CCGR_ON); if ((dcdc & ((uint32_t)(0x1F << 0))) < ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0)) { - // printf("Increasing voltage to %u mV\n", voltage); dcdc &= ~((uint32_t)(0x1F << 0)); dcdc |= ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0); DCDC->REG3 = dcdc; @@ -466,16 +465,13 @@ uint32_t setarmclock(uint32_t frequency) { } if (!(cbcdr & CCM_CBCDR_PERIPH_CLK_SEL_L)) { - // printf("need to switch to alternate clock during reconfigure of ARM PLL\n"); const uint32_t need1s = CCM_ANALOG_PLL_USB1_ENABLE_L | CCM_ANALOG_PLL_USB1_POWER_L | CCM_ANALOG_PLL_USB1_LOCK_L | CCM_ANALOG_PLL_USB1_EN_USB_CLKS_L; uint32_t sel, div; if ((CCM_ANALOG->PLL_USB1 & need1s) == need1s) { - // printf("USB PLL is running, so we can use 120 MHz\n"); sel = 0; div = 3; // divide down to 120 MHz, so IPG is ok even if IPG_PODF=0 } else { - // printf("USB PLL is off, use 24 MHz crystal\n"); sel = 1; div = 0; } @@ -500,8 +496,6 @@ uint32_t setarmclock(uint32_t frequency) { while (CCM->CDHIPR & ((uint32_t)(1 << 5))) { ; // wait } - } else { - // printf("already running from PERIPH_CLK2, safe to mess with ARM PLL\n"); } // TODO: check if PLL2 running, can 352, 396 or 528 can work? (no need for ARM PLL) @@ -528,10 +522,9 @@ uint32_t setarmclock(uint32_t frequency) { if (mult < 54) { mult = 54; } - // printf("Freq: 12 MHz * %u / %u / %u\n", mult, div_arm, div_ahb); + frequency = mult * 12000000 / div_arm / div_ahb; - // printf("ARM PLL=%x\n", CCM_ANALOG->PLL_ARM); const uint32_t arm_pll_mask = CCM_ANALOG_PLL_ARM_LOCK_L | CCM_ANALOG_PLL_ARM_BYPASS_L | CCM_ANALOG_PLL_ARM_ENABLE_L | CCM_ANALOG_PLL_ARM_POWERDOWN_L | CCM_ANALOG_PLL_ARM_DIV_SELECT_MASK; @@ -545,9 +538,6 @@ uint32_t setarmclock(uint32_t frequency) { while (!(CCM_ANALOG->PLL_ARM & CCM_ANALOG_PLL_ARM_LOCK_L)) { ; // wait for lock } - // printf("ARM PLL=%x\n", CCM_ANALOG->PLL_ARM); - } else { - // printf("ARM PLL already running at required frequency\n"); } if ((CCM->CACRR & ((uint32_t)(0x07 << 0))) != (div_arm - 1)) { @@ -588,11 +578,8 @@ uint32_t setarmclock(uint32_t frequency) { F_BUS_ACTUAL = frequency / div_ipg; // scale_cpu_cycles_to_microseconds = 0xFFFFFFFFu / (uint32_t)(frequency / 1000000u); - // printf("New Frequency: ARM=%u, IPG=%u\n", frequency, frequency / div_ipg); - // if voltage needs to decrease, do it after switch clock speed if ((dcdc & ((uint32_t)(0x1F << 0))) > ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0)) { - // printf("Decreasing voltage to %u mV\n", voltage); dcdc &= ~((uint32_t)(0x1F << 0)); dcdc |= ((uint32_t)(0x1F << 0)); DCDC->REG3 = dcdc; diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 081048181e..cc228956bc 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -347,6 +347,9 @@ CFLAGS += -DCIRCUITPY_SDIOIO=$(CIRCUITPY_SDIOIO) CIRCUITPY_SERIAL_BLE ?= 0 CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE) +CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY?= 0 +CFLAGS += -DCIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY=$(CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY) + CIRCUITPY_SHARPDISPLAY ?= $(CIRCUITPY_FRAMEBUFFERIO) CFLAGS += -DCIRCUITPY_SHARPDISPLAY=$(CIRCUITPY_SHARPDISPLAY) diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index c89ecfb790..df9d5a9df9 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -73,24 +73,18 @@ //| """The CPU operating frequency in Hertz. (read-only)""" //| -STATIC mp_obj_t mcu_processor_set_sys_clock(mp_obj_t self, mp_obj_t freq) { - #if defined(HAS_SETTABLE_CLOCK) - uint32_t value_of_freq = MP_OBJ_SMALL_INT_VALUE(freq); - common_hal_mcu_processor_set_sys_clock(self, value_of_freq); +STATIC mp_obj_t mcu_processor_set_frequency(mp_obj_t self, mp_obj_t freq) { + #if CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY + uint32_t value_of_freq = (uint32_t)mp_arg_validate_int_min(mp_obj_get_int(freq), 0, MP_QSTR_frequency); + common_hal_mcu_processor_set_frequency(self, value_of_freq); #else mp_raise_msg(&mp_type_NotImplementedError,translate("Settable Clock Not Implemented for Your Board")); #endif return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(mcu_processor_set_sys_clock_obj, mcu_processor_set_sys_clock); +MP_DEFINE_CONST_FUN_OBJ_2(mcu_processor_set_frequency_obj, mcu_processor_set_frequency); -const mp_obj_property_t mcu_processor_freq_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&mcu_processor_set_sys_clock_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; STATIC mp_obj_t mcu_processor_get_frequency(mp_obj_t self) { return mp_obj_new_int_from_uint(common_hal_mcu_processor_get_frequency()); @@ -101,7 +95,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(mcu_processor_get_frequency_obj, mcu_processor_get_fre const mp_obj_property_t mcu_processor_frequency_obj = { .base.type = &mp_type_property, .proxy = {(mp_obj_t)&mcu_processor_get_frequency_obj, // getter - MP_ROM_NONE, // no setter + (mp_obj_t)&mcu_processor_set_frequency_obj, // setter MP_ROM_NONE, // no deleter }, }; @@ -188,7 +182,6 @@ STATIC const mp_rom_map_elem_t mcu_processor_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_temperature), MP_ROM_PTR(&mcu_processor_temperature_obj) }, { MP_ROM_QSTR(MP_QSTR_uid), MP_ROM_PTR(&mcu_processor_uid_obj) }, { MP_ROM_QSTR(MP_QSTR_voltage), MP_ROM_PTR(&mcu_processor_voltage_obj) }, - { MP_ROM_QSTR(MP_QSTR_setfrequency), MP_ROM_PTR(&mcu_processor_set_sys_clock_obj) }, }; STATIC MP_DEFINE_CONST_DICT(mcu_processor_locals_dict, mcu_processor_locals_dict_table); diff --git a/shared-bindings/microcontroller/Processor.h b/shared-bindings/microcontroller/Processor.h index 07b1759c06..9a2f22b245 100644 --- a/shared-bindings/microcontroller/Processor.h +++ b/shared-bindings/microcontroller/Processor.h @@ -39,6 +39,6 @@ mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void); float common_hal_mcu_processor_get_temperature(void); void common_hal_mcu_processor_get_uid(uint8_t raw_id[]); float common_hal_mcu_processor_get_voltage(void); -uint32_t common_hal_mcu_processor_set_sys_clock(mcu_processor_obj_t *self, uint32_t frequency); +uint32_t common_hal_mcu_processor_set_frequency(mcu_processor_obj_t *self, uint32_t frequency); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_MICROCONTROLLER_PROCESSOR_H From 3c111ba338f82fff557742c38ba9932c6764318b Mon Sep 17 00:00:00 2001 From: Neradoc Date: Fri, 8 Apr 2022 00:28:59 +0200 Subject: [PATCH 73/98] fix the keypad doc --- shared-bindings/keypad/Event.c | 4 ++-- shared-bindings/keypad/EventQueue.c | 2 +- shared-bindings/keypad/KeyMatrix.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/keypad/Event.c b/shared-bindings/keypad/Event.c index fda44d3521..591a330bba 100644 --- a/shared-bindings/keypad/Event.c +++ b/shared-bindings/keypad/Event.c @@ -36,7 +36,7 @@ //| def __init__(self, key_number: int=0, pressed: bool=True, timestamp:Optional[int]=None) -> None: //| """Create a key transition event, which reports a key-pressed or key-released transition. //| -//| :param int key_number: the key number +//| :param int key_number: The key number. //| :param bool pressed: ``True`` if the key was pressed; ``False`` if it was released. //| :param int timestamp: The time in milliseconds that the keypress occurred in the `supervisor.ticks_ms` time system. If specified as None, the current value of `supervisor.ticks_ms` is used. //| """ @@ -120,7 +120,7 @@ const mp_obj_property_t keypad_event_released_obj = { }; //| timestamp: int -//| """The timestamp""" +//| """The timestamp.""" //| STATIC mp_obj_t keypad_event_get_timestamp(mp_obj_t self_in) { keypad_event_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/keypad/EventQueue.c b/shared-bindings/keypad/EventQueue.c index 2cb449551b..41dc292ba6 100644 --- a/shared-bindings/keypad/EventQueue.c +++ b/shared-bindings/keypad/EventQueue.c @@ -45,7 +45,7 @@ //| If a new event arrives when the queue is full, the event is discarded, and //| `overflowed` is set to ``True``. //| -//| :return: the next queued key transition `Event` +//| :return: The next queued key transition `Event`. //| :rtype: Optional[Event] //| """ //| ... diff --git a/shared-bindings/keypad/KeyMatrix.c b/shared-bindings/keypad/KeyMatrix.c index 87836ac174..9e65471a2b 100644 --- a/shared-bindings/keypad/KeyMatrix.c +++ b/shared-bindings/keypad/KeyMatrix.c @@ -157,7 +157,7 @@ STATIC void check_for_deinit(keypad_keymatrix_obj_t *self) { //| """ //| -//| def key_number_to_row_column(self, row: int, column: int) -> Tuple[int]: +//| def key_number_to_row_column(self, key_number: int) -> Tuple[int]: //| """Return the row and column for the given key number. //| The row is ``key_number // len(column_pins)``. //| The column is ``key_number % len(column_pins)``. From 0b6c451fdf8eb59fecb4f6f51c24371b6a684ef5 Mon Sep 17 00:00:00 2001 From: mjs513 Date: Sat, 16 Apr 2022 11:01:50 -0400 Subject: [PATCH 74/98] Add Overclocking Warnings to Processor.c --- ports/mimxrt10xx/common-hal/microcontroller/Processor.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c index ac76c88330..96f1185b3b 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c @@ -57,6 +57,15 @@ uint32_t common_hal_mcu_processor_set_frequency(mcu_processor_obj_t *self, if (frequency < 24000000 || frequency > 1008000000) { mp_raise_ValueError(translate("Frequency Out of Range Must be between 24Mhz and 1.008Ghz")); } + if (frequency <= 600000000) { + mp_printf(&mp_plat_print, "System Clock is set to %d hz\n", frequency); + } + if (frequency > 600000000) { + mp_printf(&mp_plat_print, "System Clock is set to %d hz and is Overclocked\n", frequency); + } + if (frequency > 816000000) { + mp_printf(&mp_plat_print, "System Clock is set to %d hz and is Overclocked, Cooling Required!\n", frequency); + } SystemCoreClock = setarmclock(frequency); return SystemCoreClock; } From 208bfb33aa96f3b27c525000625b02f0cb351a1d Mon Sep 17 00:00:00 2001 From: mjs513 Date: Sun, 17 Apr 2022 15:04:16 -0400 Subject: [PATCH 75/98] Deleted Warnings Chanaged ValueError Method --- locale/circuitpython.pot | 3 ++- .../common-hal/microcontroller/Processor.c | 15 ++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index d0bb7a4067..eabace6931 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1108,7 +1108,8 @@ msgid "Framebuffer requires %d bytes" msgstr "" #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c -msgid "Frequency Out of Range Must be between 24Mhz and 1.008Ghz" +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" #: shared-bindings/pwmio/PWMOut.c diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c index 96f1185b3b..17ced78910 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c @@ -54,17 +54,10 @@ float common_hal_mcu_processor_get_temperature(void) { uint32_t common_hal_mcu_processor_set_frequency(mcu_processor_obj_t *self, uint32_t frequency) { - if (frequency < 24000000 || frequency > 1008000000) { - mp_raise_ValueError(translate("Frequency Out of Range Must be between 24Mhz and 1.008Ghz")); - } - if (frequency <= 600000000) { - mp_printf(&mp_plat_print, "System Clock is set to %d hz\n", frequency); - } - if (frequency > 600000000) { - mp_printf(&mp_plat_print, "System Clock is set to %d hz and is Overclocked\n", frequency); - } - if (frequency > 816000000) { - mp_printf(&mp_plat_print, "System Clock is set to %d hz and is Overclocked, Cooling Required!\n", frequency); + uint32_t freq = frequency / 1000000; + if (freq != 24 && freq != 150 && freq != 396 && freq != 450 && freq != 528 && freq != 600 && + freq != 720 && freq != 816 && freq != 912 && freq != 960 && freq != 1008) { + mp_raise_ValueError(translate("Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz")); } SystemCoreClock = setarmclock(frequency); return SystemCoreClock; From 92f2c6e53e334037c62359ce3cf677e2555bb44b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Siyabend=20=C3=9Cr=C3=BCn?= Date: Mon, 18 Apr 2022 07:04:39 +0300 Subject: [PATCH 76/98] New Turkish translations --- locale/tr.po | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/locale/tr.po b/locale/tr.po index 91f0253cb4..f90b408411 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -30,6 +30,8 @@ msgid "" "\n" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +"\n" +"Program otomatik yeniden yükleme tarafından durduruldu. Birazdan tekrar yüklenecek.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -595,12 +597,12 @@ msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "Parlaklık 0-1.0 aralığında olmalı" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" -msgstr "" +msgstr "Parlaklık ayarlanabilir değil" #: shared-bindings/_bleio/UUID.c #, c-format @@ -614,27 +616,27 @@ msgstr "" #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" +msgstr "Geçersiz arabellek boyutu. %d kadar olmalı" #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "" +msgstr "Arabellek bayt dizisi değil" #: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "Arabellek çok küçük" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "Mevcut arabellek boyutu %d çok büyük. En fazla %d kadar olmalı" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "Arabellek boyutu 512'nin katı olmalı" #: ports/stm/common-hal/sdioio/SDCard.c msgid "Buffer must be a multiple of 512 bytes" @@ -642,7 +644,7 @@ msgstr "" #: shared-bindings/bitbangio/I2C.c msgid "Buffer must be at least length 1" -msgstr "" +msgstr "Arabellek boyutu en az 1 olmalı" #: shared-bindings/_bleio/PacketBuffer.c #, c-format @@ -651,7 +653,7 @@ msgstr "" #: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c msgid "Buffers must be same size" -msgstr "" +msgstr "Arabellek boyutları aynı olmalı" #: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c @@ -659,7 +661,7 @@ msgstr "" #: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" -msgstr "" +msgstr "Veriyolu pini %d kullanımda" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." @@ -667,15 +669,15 @@ msgstr "" #: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." -msgstr "" +msgstr "Baytlar 0-255 aralığında olmalı" #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "CBC blokları 16 baytın katları şeklinde olmalı" #: supervisor/shared/safe_mode.c msgid "CIRCUITPY drive could not be found or created." -msgstr "" +msgstr "CIRCUITPY sürücüsü bulunamadı veya oluşturulamadı" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" @@ -705,17 +707,17 @@ msgstr "" #: shared-bindings/storage/__init__.c shared-bindings/usb_cdc/__init__.c #: shared-bindings/usb_hid/__init__.c shared-bindings/usb_midi/__init__.c msgid "Cannot change USB devices now" -msgstr "" +msgstr "USB aygıtları şu an değiştirilemez" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" -msgstr "" +msgstr "Yeni Adapter oluşturulamaz, _bleio.adapter; kullanın" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" -msgstr "" +msgstr "Değerler silinemez" #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c #: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c From f502703e5237dfd9b14fd30eb06e3f99b3c2d825 Mon Sep 17 00:00:00 2001 From: George White Date: Sun, 17 Apr 2022 17:14:39 +0000 Subject: [PATCH 77/98] Add hook to do some flash setup before filesystem init --- main.c | 6 ++++++ py/circuitpy_mpconfig.mk | 3 +++ supervisor/board.h | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/main.c b/main.c index ba6950e34c..4cdc39bf21 100644 --- a/main.c +++ b/main.c @@ -836,6 +836,12 @@ int __attribute__((used)) main(void) { // Start the debug serial serial_early_init(); + #if CIRCUITPY_EXTERNAL_FLASH_SETUP + // Set up anything that might need to get done before we try to use SPI flash + // This is needed for some boards where flash relies on GPIO setup to work + external_flash_setup(); + #endif + // Create a new filesystem only if we're not in a safe mode. // A power brownout here could make it appear as if there's // no SPI flash filesystem, and we might erase the existing one. diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 081048181e..80625a2cae 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -49,6 +49,9 @@ CFLAGS += -DMICROPY_PY_USELECT=$(MICROPY_PY_USELECT) MICROPY_PY_USELECT_SELECT ?= $(MICROPY_PY_USELECT) CFLAGS += -DMICROPY_PY_USELECT_SELECT=$(MICROPY_PY_USELECT_SELECT) +# enable pre-flash GPIO setup +CIRCUITPY_EXTERNAL_FLASH_SETUP ?= 0 +CFLAGS += -DCIRCUITPY_EXTERNAL_FLASH_SETUP=$(CIRCUITPY_EXTERNAL_FLASH_SETUP) CIRCUITPY_AESIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_AESIO=$(CIRCUITPY_AESIO) diff --git a/supervisor/board.h b/supervisor/board.h index 605c16f5dc..d9aee837f7 100644 --- a/supervisor/board.h +++ b/supervisor/board.h @@ -47,5 +47,9 @@ void reset_board(void); // disabling USB, BLE or flash) because CircuitPython may continue to run. void board_deinit(void); +// Configure anything that needs to get set up before the external flash +// is init'ed. For example, if GPIO needs to be configured to enable the +// flash chip, as is the case on some boards. +void external_flash_setup(void); #endif // MICROPY_INCLUDED_SUPERVISOR_BOARD_H From 0ba93b20e5e823d256f0a3fa8ff910c9cd9ec2ac Mon Sep 17 00:00:00 2001 From: George White Date: Sun, 17 Apr 2022 17:18:45 +0000 Subject: [PATCH 78/98] Setup flash pins on Sparkfun SAMD51 Micromod --- .../boards/sparkfun_samd51_micromod/board.c | 23 +++++++++++++++++++ .../sparkfun_samd51_micromod/mpconfigboard.h | 4 ++++ .../sparkfun_samd51_micromod/mpconfigboard.mk | 1 + 3 files changed, 28 insertions(+) diff --git a/ports/atmel-samd/boards/sparkfun_samd51_micromod/board.c b/ports/atmel-samd/boards/sparkfun_samd51_micromod/board.c index 289d68af29..5960bff666 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_micromod/board.c +++ b/ports/atmel-samd/boards/sparkfun_samd51_micromod/board.c @@ -26,6 +26,9 @@ #include "supervisor/board.h" #include "mpconfigboard.h" +#include "common-hal/microcontroller/Pin.h" +#include "hal/include/hal_gpio.h" +#include "py/mphal.h" void board_init(void) { } @@ -39,3 +42,23 @@ void reset_board(void) { void board_deinit(void) { } + +void external_flash_setup(void) { + // Do not reset the external flash write-protect and hold pins high + never_reset_pin_number(PIN_PB22); + never_reset_pin_number(PIN_PB23); + + // note: using output instead of input+pullups because the pullups are a little weak + // Set the WP pin high + gpio_set_pin_function(PIN_PB22, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_direction(PIN_PB22, GPIO_DIRECTION_OUT); + gpio_set_pin_level(PIN_PB22, true); + + // Set the HOLD pin high + gpio_set_pin_function(PIN_PB23, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_direction(PIN_PB23, GPIO_DIRECTION_OUT); + gpio_set_pin_level(PIN_PB23, true); + + // Add some delay to give the pins time to get set + // mp_hal_delay_ms(3000); +} diff --git a/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.h index 3c4ef44b88..15fbcc45de 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.h @@ -27,3 +27,7 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 + +// The external flash chip has WP (write-protect) and hold pins we should ignore +#define IGNORE_PIN_PB22 +#define IGNORE_PIN_PB23 diff --git a/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.mk index 026a1978c3..6903219184 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.mk @@ -13,3 +13,4 @@ EXTERNAL_FLASH_DEVICES = W25Q128JVxM LONGINT_IMPL = MPZ CIRCUITPY_PS2IO = 1 +CIRCUITPY_EXTERNAL_FLASH_SETUP = 1 From 32fc084b39d990d73b73f893c79d6c7d54ae730a Mon Sep 17 00:00:00 2001 From: George White Date: Mon, 18 Apr 2022 03:18:25 +0000 Subject: [PATCH 79/98] Removed compiler flag in favor of MP_WEAK implementation --- main.c | 5 +++-- .../boards/sparkfun_samd51_micromod/mpconfigboard.mk | 1 - py/circuitpy_mpconfig.mk | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/main.c b/main.c index 4cdc39bf21..0521170545 100644 --- a/main.c +++ b/main.c @@ -836,11 +836,9 @@ int __attribute__((used)) main(void) { // Start the debug serial serial_early_init(); - #if CIRCUITPY_EXTERNAL_FLASH_SETUP // Set up anything that might need to get done before we try to use SPI flash // This is needed for some boards where flash relies on GPIO setup to work external_flash_setup(); - #endif // Create a new filesystem only if we're not in a safe mode. // A power brownout here could make it appear as if there's @@ -984,3 +982,6 @@ void MP_WEAK __assert_func(const char *file, int line, const char *func, const c __fatal_error("Assertion failed"); } #endif + +void MP_WEAK external_flash_setup(void) { +} diff --git a/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.mk index 6903219184..026a1978c3 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.mk @@ -13,4 +13,3 @@ EXTERNAL_FLASH_DEVICES = W25Q128JVxM LONGINT_IMPL = MPZ CIRCUITPY_PS2IO = 1 -CIRCUITPY_EXTERNAL_FLASH_SETUP = 1 diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 80625a2cae..535bd2f698 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -49,10 +49,6 @@ CFLAGS += -DMICROPY_PY_USELECT=$(MICROPY_PY_USELECT) MICROPY_PY_USELECT_SELECT ?= $(MICROPY_PY_USELECT) CFLAGS += -DMICROPY_PY_USELECT_SELECT=$(MICROPY_PY_USELECT_SELECT) -# enable pre-flash GPIO setup -CIRCUITPY_EXTERNAL_FLASH_SETUP ?= 0 -CFLAGS += -DCIRCUITPY_EXTERNAL_FLASH_SETUP=$(CIRCUITPY_EXTERNAL_FLASH_SETUP) - CIRCUITPY_AESIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_AESIO=$(CIRCUITPY_AESIO) From 3b5171c4ffe9225bb1ac675987639f441b87e87d Mon Sep 17 00:00:00 2001 From: George White Date: Mon, 18 Apr 2022 14:09:36 +0000 Subject: [PATCH 80/98] Move hook implementation to supervisor --- main.c | 4 +--- ports/atmel-samd/boards/sparkfun_samd51_micromod/board.c | 5 +---- supervisor/board.h | 5 ----- supervisor/shared/external_flash/external_flash.c | 3 +++ supervisor/shared/external_flash/external_flash.h | 5 +++++ 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/main.c b/main.c index 0521170545..810348b6c9 100644 --- a/main.c +++ b/main.c @@ -62,6 +62,7 @@ #include "supervisor/shared/workflow.h" #include "supervisor/usb.h" #include "supervisor/workflow.h" +#include "supervisor/shared/external_flash/external_flash.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Processor.h" @@ -982,6 +983,3 @@ void MP_WEAK __assert_func(const char *file, int line, const char *func, const c __fatal_error("Assertion failed"); } #endif - -void MP_WEAK external_flash_setup(void) { -} diff --git a/ports/atmel-samd/boards/sparkfun_samd51_micromod/board.c b/ports/atmel-samd/boards/sparkfun_samd51_micromod/board.c index 5960bff666..9e862b3c01 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_micromod/board.c +++ b/ports/atmel-samd/boards/sparkfun_samd51_micromod/board.c @@ -28,7 +28,7 @@ #include "mpconfigboard.h" #include "common-hal/microcontroller/Pin.h" #include "hal/include/hal_gpio.h" -#include "py/mphal.h" +#include "supervisor/shared/external_flash/external_flash.h" void board_init(void) { } @@ -58,7 +58,4 @@ void external_flash_setup(void) { gpio_set_pin_function(PIN_PB23, GPIO_PIN_FUNCTION_OFF); gpio_set_pin_direction(PIN_PB23, GPIO_DIRECTION_OUT); gpio_set_pin_level(PIN_PB23, true); - - // Add some delay to give the pins time to get set - // mp_hal_delay_ms(3000); } diff --git a/supervisor/board.h b/supervisor/board.h index d9aee837f7..e3f0af79a3 100644 --- a/supervisor/board.h +++ b/supervisor/board.h @@ -47,9 +47,4 @@ void reset_board(void); // disabling USB, BLE or flash) because CircuitPython may continue to run. void board_deinit(void); -// Configure anything that needs to get set up before the external flash -// is init'ed. For example, if GPIO needs to be configured to enable the -// flash chip, as is the case on some boards. -void external_flash_setup(void); - #endif // MICROPY_INCLUDED_SUPERVISOR_BOARD_H diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 33d618276c..7da45fdc99 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -588,3 +588,6 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, } return 0; // success } + +void MP_WEAK external_flash_setup(void) { +} diff --git a/supervisor/shared/external_flash/external_flash.h b/supervisor/shared/external_flash/external_flash.h index db5c677eb0..7966b64674 100644 --- a/supervisor/shared/external_flash/external_flash.h +++ b/supervisor/shared/external_flash/external_flash.h @@ -47,4 +47,9 @@ void supervisor_external_flash_flush(void); +// Configure anything that needs to get set up before the external flash +// is init'ed. For example, if GPIO needs to be configured to enable the +// flash chip, as is the case on some boards. +void external_flash_setup(void); + #endif // MICROPY_INCLUDED_SUPERVISOR_SHARED_EXTERNAL_FLASH_EXTERNAL_FLASH_H From a068b6ba27414dd0eb9149be8342a26ad033c70a Mon Sep 17 00:00:00 2001 From: George White Date: Mon, 18 Apr 2022 14:59:30 +0000 Subject: [PATCH 81/98] guard external flash setup hook --- main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.c b/main.c index 810348b6c9..a3cc01d165 100644 --- a/main.c +++ b/main.c @@ -837,9 +837,11 @@ int __attribute__((used)) main(void) { // Start the debug serial serial_early_init(); + #if !INTERNAL_FLASH_FILESYSTEM // Set up anything that might need to get done before we try to use SPI flash // This is needed for some boards where flash relies on GPIO setup to work external_flash_setup(); + #endif // Create a new filesystem only if we're not in a safe mode. // A power brownout here could make it appear as if there's From d94f6b8f07f7bd6bbfbfd131e77b1f3e39dc47ef Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 18 Apr 2022 12:07:07 -0500 Subject: [PATCH 82/98] update frozen requests --- frozen/Adafruit_CircuitPython_Requests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen/Adafruit_CircuitPython_Requests b/frozen/Adafruit_CircuitPython_Requests index 270565665a..2e6b3f9fee 160000 --- a/frozen/Adafruit_CircuitPython_Requests +++ b/frozen/Adafruit_CircuitPython_Requests @@ -1 +1 @@ -Subproject commit 270565665ada26fe8d7a99a3cb5941b452444471 +Subproject commit 2e6b3f9feeacc678402454f7d3416b04a9a93e17 From 17bba7b17dc23628d7f5903bc10df29d68c86024 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Tue, 19 Apr 2022 06:49:11 +0200 Subject: [PATCH 83/98] remove Adafruit_CircuitPython_BusDevice from frozen modules, it's built in now --- .../adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk | 1 - .../boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk | 1 - ports/nrf/boards/TG-Watch/mpconfigboard.mk | 1 - .../raspberrypi/boards/solderparty_rp2040_stamp/mpconfigboard.mk | 1 - 4 files changed, 4 deletions(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk index 01657b7ffd..e1a9793289 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk @@ -20,5 +20,4 @@ CIRCUITPY_MODULE=wroom FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk index 1156b1b915..657855cad8 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk @@ -19,5 +19,4 @@ CIRCUITPY_ESP_FLASH_SIZE=8MB FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register diff --git a/ports/nrf/boards/TG-Watch/mpconfigboard.mk b/ports/nrf/boards/TG-Watch/mpconfigboard.mk index 8a191c1534..212ab7edc2 100644 --- a/ports/nrf/boards/TG-Watch/mpconfigboard.mk +++ b/ports/nrf/boards/TG-Watch/mpconfigboard.mk @@ -8,7 +8,6 @@ MCU_CHIP = nrf52840 QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q128JVxQ" -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ST7789 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Display_Shapes diff --git a/ports/raspberrypi/boards/solderparty_rp2040_stamp/mpconfigboard.mk b/ports/raspberrypi/boards/solderparty_rp2040_stamp/mpconfigboard.mk index e2b4118761..1954b12415 100644 --- a/ports/raspberrypi/boards/solderparty_rp2040_stamp/mpconfigboard.mk +++ b/ports/raspberrypi/boards/solderparty_rp2040_stamp/mpconfigboard.mk @@ -11,7 +11,6 @@ EXTERNAL_FLASH_DEVICES = "GD25Q64C" CIRCUITPY__EVE = 1 FROZEN_MPY_DIRS += $(TOP)/ports/raspberrypi/boards/solderparty_rp2040_stamp -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register From e73c5c768bff365b8a659a0184694ec6f9e7c98c Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Tue, 19 Apr 2022 11:23:39 -0400 Subject: [PATCH 84/98] Update documentation for end param in SPI.readinto() --- shared-bindings/busio/SPI.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index df364fcbb9..92fff7e571 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -299,7 +299,9 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 1, busio_spi_write); //| //| :param WriteableBuffer buffer: read bytes into this buffer //| :param int start: beginning of buffer slice -//| :param int end: end of buffer slice; if not specified, use ``len(buffer)`` +//| :param int end: end of buffer slice; if not specified, it will be the equivalent value +//| of ``len(buffer)`` and for any value provided it will take the value of +//| ``min(end, len(buffer))`` //| :param int write_value: value to write while reading //| """ //| ... From 2e2e3ad612ca35ed9103a7671443ab0511e18ae4 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Tue, 19 Apr 2022 11:46:39 -0400 Subject: [PATCH 85/98] Add documentation for math.log() --- shared-bindings/math/__init__.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index d41097ad8e..f25c261ef5 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -157,6 +157,11 @@ STATIC NORETURN void math_error(void) { //| """Return ``x * (2**exp)``.""" //| ... //| +//| def log(x: float, base: float = math.e) -> float: +//| """Return the logarithm of x to the given base. If base is not specified, +//| returns the natural logarithm (base e) of x"" +//| ... +//| //| def modf(x: float) -> Tuple[float, float]: //| """Return a tuple of two floats, being the fractional and integral parts of //| ``x``. Both return values have the same sign as ``x``.""" From af59f4938af194ef7739010282431d6a5da7970d Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 19 Apr 2022 12:57:22 -0400 Subject: [PATCH 86/98] Missing double-quote --- shared-bindings/math/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index f25c261ef5..c6ecbad2b6 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -159,7 +159,7 @@ STATIC NORETURN void math_error(void) { //| //| def log(x: float, base: float = math.e) -> float: //| """Return the logarithm of x to the given base. If base is not specified, -//| returns the natural logarithm (base e) of x"" +//| returns the natural logarithm (base e) of x""" //| ... //| //| def modf(x: float) -> Tuple[float, float]: From 63c18ce748c7e1efaffe43a1fb38ca19981b457b Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Tue, 19 Apr 2022 12:57:42 -0400 Subject: [PATCH 87/98] Change signature of math.log() to use value for base --- shared-bindings/math/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index f25c261ef5..f0698164a7 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -157,7 +157,7 @@ STATIC NORETURN void math_error(void) { //| """Return ``x * (2**exp)``.""" //| ... //| -//| def log(x: float, base: float = math.e) -> float: +//| def log(x: float, base: float = 2.71828) -> float: //| """Return the logarithm of x to the given base. If base is not specified, //| returns the natural logarithm (base e) of x"" //| ... From 59ccbc6316d94c63772ba69ceec99d49937f777e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Siyabend=20=C3=9Cr=C3=BCn?= Date: Mon, 18 Apr 2022 16:47:05 +0000 Subject: [PATCH 88/98] Translated using Weblate (Turkish) Currently translated at 12.6% (133 of 1052 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/tr/ --- locale/tr.po | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/locale/tr.po b/locale/tr.po index f90b408411..a7d6c46b76 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -7,15 +7,15 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2022-01-16 13:56+0000\n" -"Last-Translator: Gökhan Koçmarlı \n" +"PO-Revision-Date: 2022-04-19 17:07+0000\n" +"Last-Translator: Siyabend Ürün \n" "Language-Team: none\n" "Language: tr\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.10.1\n" +"X-Generator: Weblate 4.12-dev\n" #: main.c msgid "" @@ -515,7 +515,7 @@ msgstr "Dizi değerleri tekil bytelar olmalıdır." #: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "En az %d %q belirtilmeli (%d değil)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format @@ -570,23 +570,24 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" +msgstr "Bit derinliği 1-6 aralığında olmalı, %d değil" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." -msgstr "" +msgstr "Bit derinliği 8'in katı olacak şekilde olmalı." #: shared-bindings/bitmaptools/__init__.c +#, fuzzy msgid "Bitmap size and bits per value must match" -msgstr "" +msgstr "Bitmap boyutu ve bit başına değer uyuşmalı" #: supervisor/shared/safe_mode.c msgid "Boot device must be first device (interface #0)." -msgstr "" +msgstr "Önyükleme cihazı ilk cihaz olmalı (arayüz #0)." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "Hem RX hem de TX akış kontrolü için gerekli" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" From 36e7b49ddd15fa18ac1a24cb8c9d050a2d0d5aad Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 19 Apr 2022 13:26:10 -0400 Subject: [PATCH 89/98] update all frozen libraries --- frozen/Adafruit_CircuitPython_APDS9960 | 2 +- frozen/Adafruit_CircuitPython_BLE | 2 +- frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center | 2 +- frozen/Adafruit_CircuitPython_BusDevice | 2 +- frozen/Adafruit_CircuitPython_CircuitPlayground | 2 +- frozen/Adafruit_CircuitPython_Display_Shapes | 2 +- frozen/Adafruit_CircuitPython_Display_Text | 2 +- frozen/Adafruit_CircuitPython_DotStar | 2 +- frozen/Adafruit_CircuitPython_ESP32SPI | 2 +- frozen/Adafruit_CircuitPython_FocalTouch | 2 +- frozen/Adafruit_CircuitPython_IRRemote | 2 +- frozen/Adafruit_CircuitPython_LC709203F | 2 +- frozen/Adafruit_CircuitPython_LSM6DS | 2 +- frozen/Adafruit_CircuitPython_MIDI | 2 +- frozen/Adafruit_CircuitPython_NeoPixel | 2 +- frozen/Adafruit_CircuitPython_PortalBase | 2 +- frozen/Adafruit_CircuitPython_SD | 2 +- frozen/Adafruit_CircuitPython_ST7789 | 2 +- frozen/Adafruit_CircuitPython_seesaw | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/frozen/Adafruit_CircuitPython_APDS9960 b/frozen/Adafruit_CircuitPython_APDS9960 index baab505fd4..9bd4882092 160000 --- a/frozen/Adafruit_CircuitPython_APDS9960 +++ b/frozen/Adafruit_CircuitPython_APDS9960 @@ -1 +1 @@ -Subproject commit baab505fd4dcc54d8e9d45e6463c68bdc6d100eb +Subproject commit 9bd48820928afad549832fe9b4ae497b224007f0 diff --git a/frozen/Adafruit_CircuitPython_BLE b/frozen/Adafruit_CircuitPython_BLE index beec030657..de7cacfbb4 160000 --- a/frozen/Adafruit_CircuitPython_BLE +++ b/frozen/Adafruit_CircuitPython_BLE @@ -1 +1 @@ -Subproject commit beec03065712cd62f79e839d5cf8f7c9847fc3b1 +Subproject commit de7cacfbb4bddf74f5188f23b56f075c884f98c4 diff --git a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center index 859a7d403e..258bb62c58 160000 --- a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center +++ b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center @@ -1 +1 @@ -Subproject commit 859a7d403e4e79ec1c8915c81ba581dbaab8a4ac +Subproject commit 258bb62c58e545c38749b8a66f5872035b2384cb diff --git a/frozen/Adafruit_CircuitPython_BusDevice b/frozen/Adafruit_CircuitPython_BusDevice index a8abc3aa8d..b96f0d2794 160000 --- a/frozen/Adafruit_CircuitPython_BusDevice +++ b/frozen/Adafruit_CircuitPython_BusDevice @@ -1 +1 @@ -Subproject commit a8abc3aa8dece6c4d0152b001dfca7d2c279f899 +Subproject commit b96f0d279481446017ca1cc1ff4abf1f5a10346f diff --git a/frozen/Adafruit_CircuitPython_CircuitPlayground b/frozen/Adafruit_CircuitPython_CircuitPlayground index b04042addd..f82d3ef195 160000 --- a/frozen/Adafruit_CircuitPython_CircuitPlayground +++ b/frozen/Adafruit_CircuitPython_CircuitPlayground @@ -1 +1 @@ -Subproject commit b04042addd47c2645e139032b02a3b9ddeeb3425 +Subproject commit f82d3ef195256aa71d274a34ea25f760d7e651d1 diff --git a/frozen/Adafruit_CircuitPython_Display_Shapes b/frozen/Adafruit_CircuitPython_Display_Shapes index 708bb0c82c..2fad6f2f98 160000 --- a/frozen/Adafruit_CircuitPython_Display_Shapes +++ b/frozen/Adafruit_CircuitPython_Display_Shapes @@ -1 +1 @@ -Subproject commit 708bb0c82c7b075bd6912c97231aea880b1a1cb8 +Subproject commit 2fad6f2f98c0df135e2306d32af18bb2796b852c diff --git a/frozen/Adafruit_CircuitPython_Display_Text b/frozen/Adafruit_CircuitPython_Display_Text index 0bd04a2355..de3276cc08 160000 --- a/frozen/Adafruit_CircuitPython_Display_Text +++ b/frozen/Adafruit_CircuitPython_Display_Text @@ -1 +1 @@ -Subproject commit 0bd04a235556979bd13a373821a6602445fe132b +Subproject commit de3276cc08ba13901d1f69060ff7501c1699bc4d diff --git a/frozen/Adafruit_CircuitPython_DotStar b/frozen/Adafruit_CircuitPython_DotStar index eb6124fdff..a90579e1e1 160000 --- a/frozen/Adafruit_CircuitPython_DotStar +++ b/frozen/Adafruit_CircuitPython_DotStar @@ -1 +1 @@ -Subproject commit eb6124fdff59b98d7d49dd86072df99c0e97167b +Subproject commit a90579e1e1e1c973e6ba8f6cf8e914d77fc8f0f2 diff --git a/frozen/Adafruit_CircuitPython_ESP32SPI b/frozen/Adafruit_CircuitPython_ESP32SPI index 13775b0584..ddd26eb4ab 160000 --- a/frozen/Adafruit_CircuitPython_ESP32SPI +++ b/frozen/Adafruit_CircuitPython_ESP32SPI @@ -1 +1 @@ -Subproject commit 13775b058422085762874fde8e587f2e9f066855 +Subproject commit ddd26eb4abcd3c10ae5dd33b1345d10d58707995 diff --git a/frozen/Adafruit_CircuitPython_FocalTouch b/frozen/Adafruit_CircuitPython_FocalTouch index bccbe3da75..a77f0f9c2e 160000 --- a/frozen/Adafruit_CircuitPython_FocalTouch +++ b/frozen/Adafruit_CircuitPython_FocalTouch @@ -1 +1 @@ -Subproject commit bccbe3da75f42b540b3faebb9d5a2d1ccf5e7147 +Subproject commit a77f0f9c2e8f64568bbb68254d0134fbc7b5a8af diff --git a/frozen/Adafruit_CircuitPython_IRRemote b/frozen/Adafruit_CircuitPython_IRRemote index 9771c9369c..1e478b1530 160000 --- a/frozen/Adafruit_CircuitPython_IRRemote +++ b/frozen/Adafruit_CircuitPython_IRRemote @@ -1 +1 @@ -Subproject commit 9771c9369c7e251f514eb26abcfcea1e891e6f27 +Subproject commit 1e478b1530b3be81bd84f13620d0a23502d377f1 diff --git a/frozen/Adafruit_CircuitPython_LC709203F b/frozen/Adafruit_CircuitPython_LC709203F index 29816fbe98..a9cf0cde77 160000 --- a/frozen/Adafruit_CircuitPython_LC709203F +++ b/frozen/Adafruit_CircuitPython_LC709203F @@ -1 +1 @@ -Subproject commit 29816fbe98c012ea0a1b5cae7f07aeae7ebf8b52 +Subproject commit a9cf0cde77c185c6bbc79a3b6d77dd024a9683d2 diff --git a/frozen/Adafruit_CircuitPython_LSM6DS b/frozen/Adafruit_CircuitPython_LSM6DS index 75e9ec62e4..2dfd61a0d5 160000 --- a/frozen/Adafruit_CircuitPython_LSM6DS +++ b/frozen/Adafruit_CircuitPython_LSM6DS @@ -1 +1 @@ -Subproject commit 75e9ec62e4fe47a7212a69fb84aa1cfa7848e2b3 +Subproject commit 2dfd61a0d5ffc8048e72d24e5ecdac9a74bb2bc3 diff --git a/frozen/Adafruit_CircuitPython_MIDI b/frozen/Adafruit_CircuitPython_MIDI index 6641509ef4..3d871907f0 160000 --- a/frozen/Adafruit_CircuitPython_MIDI +++ b/frozen/Adafruit_CircuitPython_MIDI @@ -1 +1 @@ -Subproject commit 6641509ef43b672a82addf41f02b6466d6c67f01 +Subproject commit 3d871907f0187c627277382f184209f5520703a6 diff --git a/frozen/Adafruit_CircuitPython_NeoPixel b/frozen/Adafruit_CircuitPython_NeoPixel index a115fc30df..36d4a31010 160000 --- a/frozen/Adafruit_CircuitPython_NeoPixel +++ b/frozen/Adafruit_CircuitPython_NeoPixel @@ -1 +1 @@ -Subproject commit a115fc30df1c230c09c8a533ca77f3a4afd9f6c3 +Subproject commit 36d4a31010461e47f265553ebd764c69d38a254c diff --git a/frozen/Adafruit_CircuitPython_PortalBase b/frozen/Adafruit_CircuitPython_PortalBase index 77ba8eedf8..2bc1b86ef2 160000 --- a/frozen/Adafruit_CircuitPython_PortalBase +++ b/frozen/Adafruit_CircuitPython_PortalBase @@ -1 +1 @@ -Subproject commit 77ba8eedf89b96c85a6194e5da2061c9d5c20242 +Subproject commit 2bc1b86ef2e709f31aea65469964b777f1da6d5b diff --git a/frozen/Adafruit_CircuitPython_SD b/frozen/Adafruit_CircuitPython_SD index 9dd51fecfc..22cb706e5f 160000 --- a/frozen/Adafruit_CircuitPython_SD +++ b/frozen/Adafruit_CircuitPython_SD @@ -1 +1 @@ -Subproject commit 9dd51fecfcbb15cb2a00eeadbd66b36ce0c09ee2 +Subproject commit 22cb706e5f718988d5442246120defd21c5937c9 diff --git a/frozen/Adafruit_CircuitPython_ST7789 b/frozen/Adafruit_CircuitPython_ST7789 index 79c70a4928..5fdd62ab69 160000 --- a/frozen/Adafruit_CircuitPython_ST7789 +++ b/frozen/Adafruit_CircuitPython_ST7789 @@ -1 +1 @@ -Subproject commit 79c70a49285be8b6548de3f5ca20aa5ac1fafa22 +Subproject commit 5fdd62ab69fda70407644acc6f9b45681da9ef68 diff --git a/frozen/Adafruit_CircuitPython_seesaw b/frozen/Adafruit_CircuitPython_seesaw index c89c868916..3aaf72165b 160000 --- a/frozen/Adafruit_CircuitPython_seesaw +++ b/frozen/Adafruit_CircuitPython_seesaw @@ -1 +1 @@ -Subproject commit c89c8689161e5b35bfe4fa8355615696e03f0648 +Subproject commit 3aaf72165bc6ba10bf5219716c8654651649f87b From 211d42f58d9f1585a7291ad0058b1cc346bc63ec Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Tue, 19 Apr 2022 13:27:46 -0400 Subject: [PATCH 90/98] Change value of base in math.log to e --- shared-bindings/math/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index 2d76341b25..4146112d20 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -157,7 +157,7 @@ STATIC NORETURN void math_error(void) { //| """Return ``x * (2**exp)``.""" //| ... //| -//| def log(x: float, base: float = 2.71828) -> float: +//| def log(x: float, base: float = e) -> float: //| """Return the logarithm of x to the given base. If base is not specified, //| returns the natural logarithm (base e) of x""" //| ... From 9274e6a681937cdbead3e12f6969bc2656c97ad5 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Tue, 19 Apr 2022 14:13:38 -0400 Subject: [PATCH 91/98] Fix signature of random.randrange() to show multiple signatures in stub --- shared-bindings/random/__init__.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/shared-bindings/random/__init__.c b/shared-bindings/random/__init__.c index d6aecbf322..f90d9a6e90 100644 --- a/shared-bindings/random/__init__.c +++ b/shared-bindings/random/__init__.c @@ -75,8 +75,13 @@ STATIC mp_obj_t random_getrandbits(mp_obj_t num_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(random_getrandbits_obj, random_getrandbits); -//| def randrange(stop: Tuple[int, int, int]) -> int: -//| """Returns a randomly selected integer from ``range(start, stop, step)``.""" +//| @overload +//| def randrange(stop: int) -> int: ... +//| @overload +//| def randrange(start: int, stop: int) -> int: ... +//| @overload +//| def randrange(start: int, stop: int, step: int): +//| """Returns a randomly selected integer from ``range(start[, stop[, step]])``.""" //| ... //| STATIC mp_obj_t random_randrange(size_t n_args, const mp_obj_t *args) { From 3a5973084f6c972eac30171d6471b4d72b374670 Mon Sep 17 00:00:00 2001 From: Alec Delaney <89490472+tekktrik@users.noreply.github.com> Date: Tue, 19 Apr 2022 16:14:01 -0400 Subject: [PATCH 92/98] Add return type for 3-argument random.randrange() --- shared-bindings/random/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/random/__init__.c b/shared-bindings/random/__init__.c index f90d9a6e90..838e1e72ca 100644 --- a/shared-bindings/random/__init__.c +++ b/shared-bindings/random/__init__.c @@ -80,7 +80,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(random_getrandbits_obj, random_getrandbits); //| @overload //| def randrange(start: int, stop: int) -> int: ... //| @overload -//| def randrange(start: int, stop: int, step: int): +//| def randrange(start: int, stop: int, step: int) -> int: //| """Returns a randomly selected integer from ``range(start[, stop[, step]])``.""" //| ... //| From 49769cfea408aa212d7310acefa8c91f1a2eaa92 Mon Sep 17 00:00:00 2001 From: KurtE Date: Tue, 19 Apr 2022 14:02:16 -0700 Subject: [PATCH 93/98] Convert to use debug rx/tx pins to trigger adding this code As per review request --- ports/mimxrt10xx/supervisor/serial.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ports/mimxrt10xx/supervisor/serial.c b/ports/mimxrt10xx/supervisor/serial.c index 4223ab4f5b..63f468beaf 100644 --- a/ports/mimxrt10xx/supervisor/serial.c +++ b/ports/mimxrt10xx/supervisor/serial.c @@ -34,12 +34,11 @@ #include "fsl_lpuart.h" // TODO: Switch this to using DEBUG_UART. -// Need official way to turn off the port serial code when it is not needed -#if defined(USE_DEBUG_PORT_CODE) +// If the board defined a debug uart tx or rx pin then we enable this code +#if defined(CIRCUITPY_DEBUG_UART_TX) || defined(CIRCUITPY_DEBUG_UART_RX) // static LPUART_Type *uart_instance = LPUART1; // evk static LPUART_Type *uart_instance = LPUART4; // feather 1011 // static LPUART_Type *uart_instance = LPUART2; // feather 1062 - static uint32_t UartSrcFreq(void) { uint32_t freq; From 2e9e29bf1b1758a171e36aac10e8e978778cc906 Mon Sep 17 00:00:00 2001 From: mjs513 Date: Wed, 20 Apr 2022 04:10:16 -0400 Subject: [PATCH 95/98] Delete Left Over Comments --- locale/circuitpython.pot | 8 ++++---- shared-bindings/microcontroller/Processor.c | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index eabace6931..da413022ba 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -2154,10 +2154,6 @@ msgstr "" msgid "Set pin count must be between 1 and 5" msgstr "" -#: shared-bindings/microcontroller/Processor.c -msgid "Settable Clock Not Implemented for Your Board" -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Side set pin count must be between 1 and 5" msgstr "" @@ -3282,6 +3278,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index df9d5a9df9..423480435e 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -30,10 +30,6 @@ #include #include -// #include "py/objproperty.h" - -// #include "py/runtime.h" - #include "shared-bindings/util.h" #include "shared/runtime/buffer_helper.h" @@ -78,7 +74,7 @@ STATIC mp_obj_t mcu_processor_set_frequency(mp_obj_t self, mp_obj_t freq) { uint32_t value_of_freq = (uint32_t)mp_arg_validate_int_min(mp_obj_get_int(freq), 0, MP_QSTR_frequency); common_hal_mcu_processor_set_frequency(self, value_of_freq); #else - mp_raise_msg(&mp_type_NotImplementedError,translate("Settable Clock Not Implemented for Your Board")); + mp_raise_msg(&mp_type_NotImplementedError,translate("frequency is read-only for this board")); #endif return mp_const_none; } From e4944fc98dbd2722ca2712af38893b4aa1345515 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 20 Apr 2022 14:31:52 +0200 Subject: [PATCH 96/98] 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 | 11 ++++++++++- locale/cs.po | 11 ++++++++++- locale/de_DE.po | 11 ++++++++++- locale/el.po | 11 ++++++++++- locale/en_GB.po | 11 ++++++++++- locale/es.po | 11 ++++++++++- locale/fil.po | 11 ++++++++++- locale/fr.po | 11 ++++++++++- locale/hi.po | 11 ++++++++++- locale/it_IT.po | 11 ++++++++++- locale/ja.po | 11 ++++++++++- locale/ko.po | 11 ++++++++++- locale/nl.po | 11 ++++++++++- locale/pl.po | 11 ++++++++++- locale/pt_BR.po | 11 ++++++++++- locale/ru.po | 11 ++++++++++- locale/sv.po | 11 ++++++++++- locale/tr.po | 14 ++++++++++++-- locale/zh_Latn_pinyin.po | 11 ++++++++++- 19 files changed, 192 insertions(+), 20 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 875c6c46a1..2a230e14e4 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -1124,6 +1124,11 @@ msgstr "" msgid "Framebuffer requires %d bytes" msgstr "" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "Frekuensi harus cocok dengan PWMOut yang ada menggunakan timer ini" @@ -3054,7 +3059,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "kompresi header" @@ -3308,6 +3313,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 69227eefe9..7c2ac387d4 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -1114,6 +1114,11 @@ msgstr "" msgid "Framebuffer requires %d bytes" msgstr "" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -3028,7 +3033,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "" @@ -3282,6 +3287,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 25bef643bd..7547691254 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1125,6 +1125,11 @@ msgstr "Format nicht unterstützt" msgid "Framebuffer requires %d bytes" msgstr "Framepuffer benötigt %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -3097,7 +3102,7 @@ msgstr "Komplexe Division durch null" msgid "complex values not supported" msgstr "Komplexe Zahlen nicht unterstützt" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "kompression header" @@ -3353,6 +3358,10 @@ msgstr "Die Schriftart (font) muss 2048 Byte lang sein" msgid "format requires a dict" msgstr "Format erfordert ein Wörterbuch (dict)" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "voll" diff --git a/locale/el.po b/locale/el.po index bad0723a70..6f0c064921 100644 --- a/locale/el.po +++ b/locale/el.po @@ -1107,6 +1107,11 @@ msgstr "" msgid "Framebuffer requires %d bytes" msgstr "" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -3019,7 +3024,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "" @@ -3273,6 +3278,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index cc1801abba..590a62eab0 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -1118,6 +1118,11 @@ msgstr "Format not supported" msgid "Framebuffer requires %d bytes" msgstr "Framebuffer requires %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "Frequency must match existing PWMOut using this timer" @@ -3053,7 +3058,7 @@ msgstr "complex division by zero" msgid "complex values not supported" msgstr "complex values not supported" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "compression header" @@ -3308,6 +3313,10 @@ msgstr "font must be 2048 bytes long" msgid "format requires a dict" msgstr "format requires a dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "full" diff --git a/locale/es.po b/locale/es.po index c8dc2b9845..54c5450c9d 100644 --- a/locale/es.po +++ b/locale/es.po @@ -1128,6 +1128,11 @@ msgstr "Sin capacidades para el formato" msgid "Framebuffer requires %d bytes" msgstr "Framebuffer requiere %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -3091,7 +3096,7 @@ msgstr "división compleja por cero" msgid "complex values not supported" msgstr "valores complejos no soportados" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "encabezado de compresión" @@ -3347,6 +3352,10 @@ msgstr "font debe ser 2048 bytes de largo" msgid "format requires a dict" msgstr "format requiere un dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "lleno" diff --git a/locale/fil.po b/locale/fil.po index 79dd7c1bdc..76483d726b 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -1120,6 +1120,11 @@ msgstr "" msgid "Framebuffer requires %d bytes" msgstr "" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -3048,7 +3053,7 @@ msgstr "kumplikadong dibisyon sa pamamagitan ng zero" msgid "complex values not supported" msgstr "kumplikadong values hindi sinusuportahan" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "compression header" @@ -3307,6 +3312,10 @@ msgstr "font ay dapat 2048 bytes ang haba" msgid "format requires a dict" msgstr "kailangan ng format ng dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "puno" diff --git a/locale/fr.po b/locale/fr.po index 7f41ca2ced..86a6c33ea7 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -1138,6 +1138,11 @@ msgstr "Format non supporté" msgid "Framebuffer requires %d bytes" msgstr "FrameBuffer nécessite %d octets" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -3117,7 +3122,7 @@ msgstr "division complexe par zéro" msgid "complex values not supported" msgstr "valeurs complexes non supportées" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "entête de compression" @@ -3374,6 +3379,10 @@ msgstr "la police doit être longue de 2048 octets" msgid "format requires a dict" msgstr "le format nécessite un dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "plein" diff --git a/locale/hi.po b/locale/hi.po index 59aa535b3f..631a9ccb5f 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -1107,6 +1107,11 @@ msgstr "" msgid "Framebuffer requires %d bytes" msgstr "" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -3019,7 +3024,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "" @@ -3273,6 +3278,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index ee8522f360..bbd745060d 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -1125,6 +1125,11 @@ msgstr "" msgid "Framebuffer requires %d bytes" msgstr "" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -3064,7 +3069,7 @@ msgstr "complex divisione per zero" msgid "complex values not supported" msgstr "valori complessi non supportai" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "compressione dell'header" @@ -3322,6 +3327,10 @@ msgstr "il font deve essere lungo 2048 byte" msgid "format requires a dict" msgstr "la formattazione richiede un dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "pieno" diff --git a/locale/ja.po b/locale/ja.po index 5c483cfcd5..b2fa07d980 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -1116,6 +1116,11 @@ msgstr "非対応の形式" msgid "Framebuffer requires %d bytes" msgstr "" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "このタイマーを使う既存のPWMOutと周波数を一致させる必要があります" @@ -3036,7 +3041,7 @@ msgstr "複素数ゼロ除算" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "圧縮ヘッダー" @@ -3292,6 +3297,10 @@ msgstr "fontは2048バイト長でなければなりません" msgid "format requires a dict" msgstr "formatにはdictが必要" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 3fc04dcdc8..e522e69235 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -1110,6 +1110,11 @@ msgstr "" msgid "Framebuffer requires %d bytes" msgstr "" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -3023,7 +3028,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "" @@ -3277,6 +3282,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "완전한(full)" diff --git a/locale/nl.po b/locale/nl.po index 5c584c1cf6..8594e0534f 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -1116,6 +1116,11 @@ msgstr "Formaat wordt niet ondersteund" msgid "Framebuffer requires %d bytes" msgstr "Framebuffer benodigd %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -3053,7 +3058,7 @@ msgstr "complexe deling door 0" msgid "complex values not supported" msgstr "complexe waardes niet ondersteund" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "compressie header" @@ -3309,6 +3314,10 @@ msgstr "lettertype moet 2048 bytes lang zijn" msgid "format requires a dict" msgstr "format vereist een dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "vol" diff --git a/locale/pl.po b/locale/pl.po index d8c98ba4e6..1f69744808 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -1116,6 +1116,11 @@ msgstr "Nie wspierany format" msgid "Framebuffer requires %d bytes" msgstr "Bufor ramki wymaga %d bajtów" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -3030,7 +3035,7 @@ msgstr "zespolone dzielenie przez zero" msgid "complex values not supported" msgstr "wartości zespolone nieobsługiwane" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "nagłówek kompresji" @@ -3285,6 +3290,10 @@ msgstr "font musi mieć 2048 bajtów długości" msgid "format requires a dict" msgstr "format wymaga słownika" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "pełny" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index adfdb1ce4c..2b403f27ca 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -1135,6 +1135,11 @@ msgstr "O formato não é suportado" msgid "Framebuffer requires %d bytes" msgstr "O Framebuffer requer %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -3109,7 +3114,7 @@ msgstr "divisão complexa por zero" msgid "complex values not supported" msgstr "os valores complexos não compatíveis" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "compressão do cabeçalho" @@ -3366,6 +3371,10 @@ msgstr "a fonte deve ter 2048 bytes de comprimento" msgid "format requires a dict" msgstr "formato requer um dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "cheio" diff --git a/locale/ru.po b/locale/ru.po index 3d78a492c1..0cded6267a 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -1134,6 +1134,11 @@ msgstr "Формат не поддерживается" msgid "Framebuffer requires %d bytes" msgstr "Фреймбуфер требует %d байт" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -3068,7 +3073,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "" @@ -3322,6 +3327,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 4f8d39879b..319bc0d3b6 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -1122,6 +1122,11 @@ msgstr "Formatet stöds inte" msgid "Framebuffer requires %d bytes" msgstr "Framebuffer kräver %d byte" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "Frekvensen måste matcha befintlig PWMOut med denna timer" @@ -3073,7 +3078,7 @@ msgstr "komplex division med noll" msgid "complex values not supported" msgstr "komplexa värden stöds inte" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "komprimeringsheader" @@ -3330,6 +3335,10 @@ msgstr "typsnitt måste vara 2048 bytes långt" msgid "format requires a dict" msgstr "formatet kräver en dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "full" diff --git a/locale/tr.po b/locale/tr.po index a7d6c46b76..890ac7f60a 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -31,7 +31,8 @@ msgid "" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" "\n" -"Program otomatik yeniden yükleme tarafından durduruldu. Birazdan tekrar yüklenecek.\n" +"Program otomatik yeniden yükleme tarafından durduruldu. Birazdan tekrar " +"yüklenecek.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1123,6 +1124,11 @@ msgstr "" msgid "Framebuffer requires %d bytes" msgstr "" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -3038,7 +3044,7 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "" @@ -3292,6 +3298,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index e8bf961f6b..4836ab293e 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -1131,6 +1131,11 @@ msgstr "Bù zhīyuán géshì" msgid "Framebuffer requires %d bytes" msgstr "zhēn huǎn chōng qū xū yào %d zì jié" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" + #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "Pínlǜ bìxū yǔ shǐyòng cǐ jìshí qì de xiàn yǒu PWMOut xiāng pǐpèi" @@ -3085,7 +3090,7 @@ msgstr "fùzá de fēngé wèi 0" msgid "complex values not supported" msgstr "bù zhīchí fùzá de zhí" -#: extmod/moduzlib.c shared-module/zlib/DecompIO.c +#: extmod/moduzlib.c msgid "compression header" msgstr "yāsuō tóu bù" @@ -3341,6 +3346,10 @@ msgstr "zìtǐ bìxū wèi 2048 zì jié" msgid "format requires a dict" msgstr "géshì yāoqiú yīgè yǔjù" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "chōngfèn" From e007e9a003d3f5dbb66eaf578c1b0d90f11aee4c Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Wed, 20 Apr 2022 12:44:16 +0000 Subject: [PATCH 97/98] Translated using Weblate (Swedish) Currently translated at 100.0% (1054 of 1054 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 319bc0d3b6..ebe0eb0496 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: 2022-03-23 08:58+0000\n" +"PO-Revision-Date: 2022-04-21 13:12+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -1126,19 +1126,21 @@ msgstr "Framebuffer kräver %d byte" msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" +"Frekvens måste vara en av 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 " +"eller 1008 Mhz" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" -msgstr "Frekvensen måste matcha befintlig PWMOut med denna timer" +msgstr "Frekvensen måste matcha befintlig PWMOut med den här timern" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" -msgstr "Funktion kräver lås" +msgstr "Funktionen kräver lås" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" -msgstr "Generiskt fel" +msgstr "Allmänt fel" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c @@ -3337,7 +3339,7 @@ msgstr "formatet kräver en dict" #: shared-bindings/microcontroller/Processor.c msgid "frequency is read-only for this board" -msgstr "" +msgstr "frekvens är skrivskyddad för detta kort" #: py/objdeque.c msgid "full" From 76d54ca8add7b72e3feaf547f78e6e659d00c52b Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 21 Apr 2022 12:58:46 -0400 Subject: [PATCH 98/98] shrink sparkfun_redboard_turbo --- .../atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk index 70ece9b9fc..7b97822bda 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk @@ -9,3 +9,5 @@ CHIP_FAMILY = samd21 SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = "W25Q32FV" LONGINT_IMPL = MPZ + +CIRCUITPY_ONEWIREIO = 0