From 47849a9e58d5f6d06bb92e00b3de567da1a356dd Mon Sep 17 00:00:00 2001 From: sommersoft Date: Mon, 29 Jun 2020 18:18:25 -0500 Subject: [PATCH 01/64] add custom css for 'viewing-old-docs' message --- docs/static/customstyle.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/static/customstyle.css b/docs/static/customstyle.css index 6c964b762c..1136edcd31 100644 --- a/docs/static/customstyle.css +++ b/docs/static/customstyle.css @@ -10,6 +10,19 @@ } +/* custom CSS to sticky the ' viewing outdated version' + warning +*/ +.document > .admonition { + position: sticky; + top: 0px; + background-color: salmon; + z-index: 2; +} + +body { + overflow-x: unset!important; +} /* override table width restrictions */ @media screen and (min-width: 767px) { From 35ef6c687fdd27a01e4e3a31731eeb622becc2fb Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 11 Nov 2020 23:11:12 +0530 Subject: [PATCH 02/64] nvm implementation for esp32s2 --- locale/circuitpython.pot | 10 ++- ports/esp32s2/Makefile | 2 + .../common-hal/microcontroller/__init__.c | 12 +++ ports/esp32s2/common-hal/nvm/ByteArray.c | 80 +++++++++++++++++++ ports/esp32s2/common-hal/nvm/ByteArray.h | 38 +++++++++ ports/esp32s2/common-hal/nvm/__init__.c | 1 + ports/esp32s2/mpconfigport.h | 7 +- ports/esp32s2/mpconfigport.mk | 2 +- 8 files changed, 147 insertions(+), 5 deletions(-) create mode 100644 ports/esp32s2/common-hal/nvm/ByteArray.c create mode 100644 ports/esp32s2/common-hal/nvm/ByteArray.h create mode 100644 ports/esp32s2/common-hal/nvm/__init__.c diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index b4445abfbf..2bb02b2c9d 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -296,7 +296,8 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "" -#: ports/esp32s2/peripherals/pcnt_handler.c +#: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "" @@ -1248,6 +1249,10 @@ msgstr "" msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" +#: ports/esp32s2/common-hal/nvm/ByteArray.c +msgid "NVS Error" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -3201,6 +3206,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h #: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 55d6e91d44..ec389e9feb 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -104,6 +104,8 @@ INC += -isystem esp-idf/components/soc/soc/include INC += -isystem esp-idf/components/soc/soc/esp32s2/include INC += -isystem esp-idf/components/heap/include INC += -isystem esp-idf/components/esp_system/include +INC += -isystem esp-idf/components/spi_flash/include +INC += -isystem esp-idf/components/nvs_flash/include INC += -I$(BUILD)/esp-idf/config CFLAGS += -DHAVE_CONFIG_H \ diff --git a/ports/esp32s2/common-hal/microcontroller/__init__.c b/ports/esp32s2/common-hal/microcontroller/__init__.c index 6b2e18673d..dc4d2c095e 100644 --- a/ports/esp32s2/common-hal/microcontroller/__init__.c +++ b/ports/esp32s2/common-hal/microcontroller/__init__.c @@ -35,6 +35,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Processor.h" +#include "shared-bindings/nvm/ByteArray.h" #include "supervisor/filesystem.h" #include "supervisor/shared/safe_mode.h" @@ -85,6 +86,17 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }, }; +#if CIRCUITPY_INTERNAL_NVM_SIZE > 0 +// The singleton nvm.ByteArray object. +const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { + .base = { + .type = &nvm_bytearray_type, + }, + .start_address = (uint8_t*) CIRCUITPY_INTERNAL_NVM_START_ADDR, + .len = CIRCUITPY_INTERNAL_NVM_SIZE, +}; +#endif + // This maps MCU pin names to pin objects. STATIC const mp_rom_map_elem_t mcu_pin_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_GPIO0), MP_ROM_PTR(&pin_GPIO0) }, diff --git a/ports/esp32s2/common-hal/nvm/ByteArray.c b/ports/esp32s2/common-hal/nvm/ByteArray.c new file mode 100644 index 0000000000..30051df1ef --- /dev/null +++ b/ports/esp32s2/common-hal/nvm/ByteArray.c @@ -0,0 +1,80 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "common-hal/nvm/ByteArray.h" + +#include "py/runtime.h" + +#include "nvs_flash.h" + +uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { + return self->len; +} + +static nvs_handle get_nvs_handle(void) { + // Initialize NVS + esp_err_t err = nvs_flash_init(); + if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) { + // NVS partition was truncated and needs to be erased + // Retry nvs_flash_init + ESP_ERROR_CHECK(nvs_flash_erase()); + err = nvs_flash_init(); + } + ESP_ERROR_CHECK(err); + + // Open NVS handle + nvs_handle nvs_handle; + if (nvs_open("CPY", NVS_READWRITE, &nvs_handle) != ESP_OK) { + mp_raise_RuntimeError(translate("NVS Error")); + } + return nvs_handle; +} + +bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, + uint32_t start_index, uint8_t* values, uint32_t len) { + char index[9]; + sprintf(index, "%i", start_index); + // start nvs + nvs_handle handle = get_nvs_handle(); + bool status = ((nvs_set_u8(handle, (const char *)index, *values) == ESP_OK) && (nvs_commit(handle) == ESP_OK)); + // close nvs + nvs_close(handle); + return status; +} + +// NVM memory is memory mapped so reading it is easy. +void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, + uint32_t start_index, uint32_t len, uint8_t* values) { + char index[9]; + sprintf(index, "%i", start_index); + // start nvs + nvs_handle handle = get_nvs_handle(); + if (nvs_get_u8(handle, (const char *)index, values) != ESP_OK) { + mp_raise_RuntimeError(translate("NVS Error")); + } + // close nvs + nvs_close(handle); +} diff --git a/ports/esp32s2/common-hal/nvm/ByteArray.h b/ports/esp32s2/common-hal/nvm/ByteArray.h new file mode 100644 index 0000000000..44b63d7241 --- /dev/null +++ b/ports/esp32s2/common-hal/nvm/ByteArray.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_NVM_BYTEARRAY_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_NVM_BYTEARRAY_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + uint8_t* start_address; + uint32_t len; +} nvm_bytearray_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_NVM_BYTEARRAY_H diff --git a/ports/esp32s2/common-hal/nvm/__init__.c b/ports/esp32s2/common-hal/nvm/__init__.c new file mode 100644 index 0000000000..1b702a1584 --- /dev/null +++ b/ports/esp32s2/common-hal/nvm/__init__.c @@ -0,0 +1 @@ +// No nvm module functions. diff --git a/ports/esp32s2/mpconfigport.h b/ports/esp32s2/mpconfigport.h index cec8dd35df..11ea5f6382 100644 --- a/ports/esp32s2/mpconfigport.h +++ b/ports/esp32s2/mpconfigport.h @@ -28,7 +28,6 @@ #ifndef ESP32S2_MPCONFIGPORT_H__ #define ESP32S2_MPCONFIGPORT_H__ -#define CIRCUITPY_INTERNAL_NVM_SIZE (0) #define MICROPY_NLR_THUMB (0) #define MICROPY_PY_UJSON (1) @@ -36,11 +35,15 @@ #include "py/circuitpy_mpconfig.h" - #define MICROPY_PORT_ROOT_POINTERS \ CIRCUITPY_COMMON_ROOT_POINTERS #define MICROPY_NLR_SETJMP (1) #define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x9000) + +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (20000) +#endif #endif // __INCLUDED_ESP32S2_MPCONFIGPORT_H diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 4579b95ab6..7f3b4241a0 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -21,7 +21,7 @@ CIRCUITPY_COUNTIO = 1 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_ROTARYIO = 1 -CIRCUITPY_NVM = 0 +CIRCUITPY_NVM = 1 # We don't have enough endpoints to include MIDI. CIRCUITPY_USB_MIDI = 0 CIRCUITPY_WIFI = 1 From c4917cdabd97c016a46b6193e93b274573d94193 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Mon, 16 Nov 2020 00:11:00 +0530 Subject: [PATCH 03/64] frequencyio implementation for esp32s2 --- .../common-hal/frequencyio/FrequencyIn.c | 158 ++++++++++++++++++ .../common-hal/frequencyio/FrequencyIn.h | 43 +++++ .../esp32s2/common-hal/frequencyio/__init__.c | 1 + ports/esp32s2/mpconfigport.mk | 2 +- 4 files changed, 203 insertions(+), 1 deletion(-) create mode 100644 ports/esp32s2/common-hal/frequencyio/FrequencyIn.c create mode 100644 ports/esp32s2/common-hal/frequencyio/FrequencyIn.h create mode 100644 ports/esp32s2/common-hal/frequencyio/__init__.c diff --git a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c new file mode 100644 index 0000000000..fce1d34d87 --- /dev/null +++ b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c @@ -0,0 +1,158 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/frequencyio/FrequencyIn.h" + +#include + +#include "py/runtime.h" + +#include "supervisor/shared/tick.h" +#include "shared-bindings/time/__init__.h" + +#include "common-hal/microcontroller/Pin.h" + +static void frequencyin_interrupt_handler(void *self_in) { + frequencyio_frequencyin_obj_t* self = self_in; + // get counter value + int16_t count; + pcnt_get_counter_value(self->unit, &count); + self->frequency = count / 2.0 / self->capture_period; + + // reset counter + pcnt_counter_clear(self->unit); +} + +static void init_timer(frequencyio_frequencyin_obj_t* self, uint16_t capture_period) { + // Prepare configuration for the timer module + timer_config_t config = { + .alarm_en = true, + .counter_en = false, + .intr_type = TIMER_INTR_LEVEL, + .counter_dir = TIMER_COUNT_UP, + .auto_reload = true, + .divider = 80 // 1 us per tick + }; + + // Initialize timer module + timer_init(TIMER_GROUP_0, TIMER_0, &config); + timer_set_counter_value(TIMER_GROUP_0, TIMER_0, 0); + timer_set_alarm_value(TIMER_GROUP_0, TIMER_0, capture_period * 1000000); + timer_enable_intr(TIMER_GROUP_0, TIMER_0); + timer_isr_register(TIMER_GROUP_0, TIMER_0, &frequencyin_interrupt_handler, (void *)self, 0, &self->handle); + + // Start timer + timer_start(TIMER_GROUP_0, TIMER_0); +} + +void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* self, + const mcu_pin_obj_t* pin, const uint16_t capture_period) { + if ((capture_period == 0) || (capture_period > 500)) { + mp_raise_ValueError(translate("Invalid capture period. Valid range: 1 - 500")); + } + + // Prepare configuration for the PCNT unit + const pcnt_config_t pcnt_config = { + // Set PCNT input signal and control GPIOs + .pulse_gpio_num = pin->number, + .ctrl_gpio_num = PCNT_PIN_NOT_USED, + .channel = PCNT_CHANNEL_0, + .lctrl_mode = PCNT_MODE_DISABLE, + .hctrl_mode = PCNT_MODE_KEEP, + .pos_mode = PCNT_COUNT_INC, // count both rising and falling edges + .neg_mode = PCNT_COUNT_INC, + .counter_h_lim = 0, + .counter_l_lim = 0, + }; + + // Initialize PCNT unit + const int8_t unit = peripherals_pcnt_init(pcnt_config); + if (unit == -1) { + mp_raise_RuntimeError(translate("All PCNT units in use")); + } + + // set the GPIO back to high-impedance, as pcnt_unit_config sets it as pull-up + gpio_set_pull_mode(pin->number, GPIO_FLOATING); + + // initialize timer + init_timer(self, capture_period); + + self->pin = pin->number; + self->unit = (pcnt_unit_t)unit; + self->capture_period = capture_period; + + claim_pin(pin); +} + +bool common_hal_frequencyio_frequencyin_deinited(frequencyio_frequencyin_obj_t* self) { + return self->unit == PCNT_UNIT_MAX; +} + +void common_hal_frequencyio_frequencyin_deinit(frequencyio_frequencyin_obj_t* self) { + if (common_hal_frequencyio_frequencyin_deinited(self)) { + return; + } + reset_pin_number(self->pin); + peripherals_pcnt_deinit(&self->unit); + if (self->handle) { + timer_deinit(TIMER_GROUP_0, TIMER_0); + esp_intr_free(self->handle); + self->handle = NULL; + } +} + +uint32_t common_hal_frequencyio_frequencyin_get_item(frequencyio_frequencyin_obj_t* self) { + return (1000 / (self->capture_period / self->frequency)); +} + +void common_hal_frequencyio_frequencyin_pause(frequencyio_frequencyin_obj_t* self) { + pcnt_counter_pause(self->unit); + timer_pause(TIMER_GROUP_0, TIMER_0); +} + +void common_hal_frequencyio_frequencyin_resume(frequencyio_frequencyin_obj_t* self) { + pcnt_counter_resume(self->unit); + timer_start(TIMER_GROUP_0, TIMER_0); +} + +void common_hal_frequencyio_frequencyin_clear(frequencyio_frequencyin_obj_t* self) { + self->frequency = 0; + pcnt_counter_clear(self->unit); + timer_set_counter_value(TIMER_GROUP_0, TIMER_0, 0); +} + +uint16_t common_hal_frequencyio_frequencyin_get_capture_period(frequencyio_frequencyin_obj_t *self) { + return self->capture_period; +} + +void common_hal_frequencyio_frequencyin_set_capture_period(frequencyio_frequencyin_obj_t *self, uint16_t capture_period) { + if ((capture_period == 0) || (capture_period > 500)) { + mp_raise_ValueError(translate("Invalid capture period. Valid range: 1 - 500")); + } + self->capture_period = capture_period; + common_hal_frequencyio_frequencyin_clear(self); + timer_set_alarm_value(TIMER_GROUP_0, TIMER_0, capture_period * 1000000); +} diff --git a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.h b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.h new file mode 100644 index 0000000000..01e617d13a --- /dev/null +++ b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_FREQUENCYIO_FREQUENCYIN_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_FREQUENCYIO_FREQUENCYIN_H + +#include "py/obj.h" +#include "driver/timer.h" +#include "peripherals/pcnt.h" + +typedef struct { + mp_obj_base_t base; + pcnt_unit_t unit; + intr_handle_t handle; + uint8_t pin; + uint32_t frequency; + uint16_t capture_period; +} frequencyio_frequencyin_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_FREQUENCYIO_FREQUENCYIN_H diff --git a/ports/esp32s2/common-hal/frequencyio/__init__.c b/ports/esp32s2/common-hal/frequencyio/__init__.c new file mode 100644 index 0000000000..487814bd07 --- /dev/null +++ b/ports/esp32s2/common-hal/frequencyio/__init__.c @@ -0,0 +1 @@ +// No ferquencyio module functions. diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 4579b95ab6..a84965a6a1 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -18,7 +18,7 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_CANIO = 1 CIRCUITPY_COUNTIO = 1 -CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_FREQUENCYIO = 1 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_ROTARYIO = 1 CIRCUITPY_NVM = 0 From 2bec02738fb7eacaaea710bd448b98a418eb2693 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Mon, 16 Nov 2020 11:44:11 +0530 Subject: [PATCH 04/64] move interrupt handler to iram --- ports/esp32s2/common-hal/frequencyio/FrequencyIn.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c index fce1d34d87..ec7ebb21ac 100644 --- a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c +++ b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c @@ -35,7 +35,7 @@ #include "common-hal/microcontroller/Pin.h" -static void frequencyin_interrupt_handler(void *self_in) { +static void IRAM_ATTR frequencyin_interrupt_handler(void *self_in) { frequencyio_frequencyin_obj_t* self = self_in; // get counter value int16_t count; @@ -44,6 +44,10 @@ static void frequencyin_interrupt_handler(void *self_in) { // reset counter pcnt_counter_clear(self->unit); + + // reset interrupt + TIMERG0.int_clr.t0 = 1; + TIMERG0.hw_timer[0].config.alarm_en = 1; } static void init_timer(frequencyio_frequencyin_obj_t* self, uint16_t capture_period) { @@ -62,7 +66,7 @@ static void init_timer(frequencyio_frequencyin_obj_t* self, uint16_t capture_per timer_set_counter_value(TIMER_GROUP_0, TIMER_0, 0); timer_set_alarm_value(TIMER_GROUP_0, TIMER_0, capture_period * 1000000); timer_enable_intr(TIMER_GROUP_0, TIMER_0); - timer_isr_register(TIMER_GROUP_0, TIMER_0, &frequencyin_interrupt_handler, (void *)self, 0, &self->handle); + timer_isr_register(TIMER_GROUP_0, TIMER_0, frequencyin_interrupt_handler, (void *)self, ESP_INTR_FLAG_IRAM, &self->handle); // Start timer timer_start(TIMER_GROUP_0, TIMER_0); From f2824f6a68b3d326e0f4a137880e08147a0074d2 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Mon, 16 Nov 2020 12:55:55 +0530 Subject: [PATCH 05/64] update frequency measurement --- ports/esp32s2/common-hal/frequencyio/FrequencyIn.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c index ec7ebb21ac..bdbe782add 100644 --- a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c +++ b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c @@ -84,12 +84,9 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* .pulse_gpio_num = pin->number, .ctrl_gpio_num = PCNT_PIN_NOT_USED, .channel = PCNT_CHANNEL_0, - .lctrl_mode = PCNT_MODE_DISABLE, - .hctrl_mode = PCNT_MODE_KEEP, + // What to do on the positive / negative edge of pulse input? .pos_mode = PCNT_COUNT_INC, // count both rising and falling edges .neg_mode = PCNT_COUNT_INC, - .counter_h_lim = 0, - .counter_l_lim = 0, }; // Initialize PCNT unit @@ -129,7 +126,7 @@ void common_hal_frequencyio_frequencyin_deinit(frequencyio_frequencyin_obj_t* se } uint32_t common_hal_frequencyio_frequencyin_get_item(frequencyio_frequencyin_obj_t* self) { - return (1000 / (self->capture_period / self->frequency)); + return self->frequency; } void common_hal_frequencyio_frequencyin_pause(frequencyio_frequencyin_obj_t* self) { From 18e463cca538ed80f03ce9eda0e2ff757f1ba8f4 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Mon, 16 Nov 2020 23:32:22 +0530 Subject: [PATCH 06/64] add pcnt overflow handler & clean-up --- .../common-hal/frequencyio/FrequencyIn.c | 91 +++++++++++-------- .../common-hal/frequencyio/FrequencyIn.h | 3 +- 2 files changed, 57 insertions(+), 37 deletions(-) diff --git a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c index bdbe782add..20d744139d 100644 --- a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c +++ b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c @@ -26,16 +26,21 @@ #include "shared-bindings/frequencyio/FrequencyIn.h" -#include - #include "py/runtime.h" -#include "supervisor/shared/tick.h" -#include "shared-bindings/time/__init__.h" +static void IRAM_ATTR pcnt_overflow_handler(void *self_in) { + frequencyio_frequencyin_obj_t* self = self_in; + // reset counter + pcnt_counter_clear(self->unit); -#include "common-hal/microcontroller/Pin.h" + // increase multiplier + self->multiplier++; -static void IRAM_ATTR frequencyin_interrupt_handler(void *self_in) { + // reset interrupt + PCNT.int_clr.val = BIT(self->unit); +} + +static void IRAM_ATTR timer_interrupt_handler(void *self_in) { frequencyio_frequencyin_obj_t* self = self_in; // get counter value int16_t count; @@ -50,9 +55,41 @@ static void IRAM_ATTR frequencyin_interrupt_handler(void *self_in) { TIMERG0.hw_timer[0].config.alarm_en = 1; } -static void init_timer(frequencyio_frequencyin_obj_t* self, uint16_t capture_period) { +static void init_pcnt(frequencyio_frequencyin_obj_t* self) { + // Prepare configuration for the PCNT unit + const pcnt_config_t pcnt_config = { + // Set PCNT input signal and control GPIOs + .pulse_gpio_num = self->pin, + .ctrl_gpio_num = PCNT_PIN_NOT_USED, + .channel = PCNT_CHANNEL_0, + // What to do on the positive / negative edge of pulse input? + .pos_mode = PCNT_COUNT_INC, // count both rising and falling edges + .neg_mode = PCNT_COUNT_INC, + // Set counter limit + .counter_h_lim = INT16_MAX, + .counter_l_lim = 0, + }; + + // Initialize PCNT unit + const int8_t unit = peripherals_pcnt_init(pcnt_config); + if (unit == -1) { + mp_raise_RuntimeError(translate("All PCNT units in use")); + } + + // set the GPIO back to high-impedance, as pcnt_unit_config sets it as pull-up + gpio_set_pull_mode(self->pin, GPIO_FLOATING); + + self->unit = (pcnt_unit_t)unit; + + // enable pcnt interrupt + pcnt_event_enable(self->unit, PCNT_EVT_H_LIM); + pcnt_isr_register(pcnt_overflow_handler, (void *)self, ESP_INTR_FLAG_IRAM, &self->handle); + pcnt_intr_enable(self->unit); +} + +static void init_timer(frequencyio_frequencyin_obj_t* self) { // Prepare configuration for the timer module - timer_config_t config = { + const timer_config_t config = { .alarm_en = true, .counter_en = false, .intr_type = TIMER_INTR_LEVEL, @@ -64,9 +101,9 @@ static void init_timer(frequencyio_frequencyin_obj_t* self, uint16_t capture_per // Initialize timer module timer_init(TIMER_GROUP_0, TIMER_0, &config); timer_set_counter_value(TIMER_GROUP_0, TIMER_0, 0); - timer_set_alarm_value(TIMER_GROUP_0, TIMER_0, capture_period * 1000000); + timer_set_alarm_value(TIMER_GROUP_0, TIMER_0, self->capture_period * 1000000); + timer_isr_register(TIMER_GROUP_0, TIMER_0, timer_interrupt_handler, (void *)self, ESP_INTR_FLAG_IRAM, &self->handle); timer_enable_intr(TIMER_GROUP_0, TIMER_0); - timer_isr_register(TIMER_GROUP_0, TIMER_0, frequencyin_interrupt_handler, (void *)self, ESP_INTR_FLAG_IRAM, &self->handle); // Start timer timer_start(TIMER_GROUP_0, TIMER_0); @@ -78,33 +115,15 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* mp_raise_ValueError(translate("Invalid capture period. Valid range: 1 - 500")); } - // Prepare configuration for the PCNT unit - const pcnt_config_t pcnt_config = { - // Set PCNT input signal and control GPIOs - .pulse_gpio_num = pin->number, - .ctrl_gpio_num = PCNT_PIN_NOT_USED, - .channel = PCNT_CHANNEL_0, - // What to do on the positive / negative edge of pulse input? - .pos_mode = PCNT_COUNT_INC, // count both rising and falling edges - .neg_mode = PCNT_COUNT_INC, - }; - - // Initialize PCNT unit - const int8_t unit = peripherals_pcnt_init(pcnt_config); - if (unit == -1) { - mp_raise_RuntimeError(translate("All PCNT units in use")); - } - - // set the GPIO back to high-impedance, as pcnt_unit_config sets it as pull-up - gpio_set_pull_mode(pin->number, GPIO_FLOATING); - - // initialize timer - init_timer(self, capture_period); - self->pin = pin->number; - self->unit = (pcnt_unit_t)unit; + self->handle = NULL; + self->multiplier = 0; self->capture_period = capture_period; + // initialize pcnt and timer + init_pcnt(self); + init_timer(self); + claim_pin(pin); } @@ -118,15 +137,15 @@ void common_hal_frequencyio_frequencyin_deinit(frequencyio_frequencyin_obj_t* se } reset_pin_number(self->pin); peripherals_pcnt_deinit(&self->unit); + timer_deinit(TIMER_GROUP_0, TIMER_0); if (self->handle) { - timer_deinit(TIMER_GROUP_0, TIMER_0); esp_intr_free(self->handle); self->handle = NULL; } } uint32_t common_hal_frequencyio_frequencyin_get_item(frequencyio_frequencyin_obj_t* self) { - return self->frequency; + return (self->frequency + (self->multiplier * INT16_MAX)); } void common_hal_frequencyio_frequencyin_pause(frequencyio_frequencyin_obj_t* self) { diff --git a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.h b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.h index 01e617d13a..ce3bf8f2f9 100644 --- a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.h +++ b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.h @@ -36,7 +36,8 @@ typedef struct { pcnt_unit_t unit; intr_handle_t handle; uint8_t pin; - uint32_t frequency; + uint8_t multiplier; + uint16_t frequency; uint16_t capture_period; } frequencyio_frequencyin_obj_t; From 0686cde2263a50e2074f741417d169a1c1ea752e Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Tue, 17 Nov 2020 01:19:12 +0530 Subject: [PATCH 07/64] update internal nvm size --- ports/esp32s2/common-hal/nvm/ByteArray.c | 4 ++-- ports/esp32s2/mpconfigport.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/esp32s2/common-hal/nvm/ByteArray.c b/ports/esp32s2/common-hal/nvm/ByteArray.c index 30051df1ef..d90f7fbdc2 100644 --- a/ports/esp32s2/common-hal/nvm/ByteArray.c +++ b/ports/esp32s2/common-hal/nvm/ByteArray.c @@ -56,7 +56,7 @@ static nvs_handle get_nvs_handle(void) { bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint8_t* values, uint32_t len) { char index[9]; - sprintf(index, "%i", start_index); + sprintf(index, "%i", start_index - CIRCUITPY_INTERNAL_NVM_START_ADDR); // start nvs nvs_handle handle = get_nvs_handle(); bool status = ((nvs_set_u8(handle, (const char *)index, *values) == ESP_OK) && (nvs_commit(handle) == ESP_OK)); @@ -69,7 +69,7 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint32_t len, uint8_t* values) { char index[9]; - sprintf(index, "%i", start_index); + sprintf(index, "%i", start_index - CIRCUITPY_INTERNAL_NVM_START_ADDR); // start nvs nvs_handle handle = get_nvs_handle(); if (nvs_get_u8(handle, (const char *)index, values) != ESP_OK) { diff --git a/ports/esp32s2/mpconfigport.h b/ports/esp32s2/mpconfigport.h index 11ea5f6382..db7393d8ef 100644 --- a/ports/esp32s2/mpconfigport.h +++ b/ports/esp32s2/mpconfigport.h @@ -43,7 +43,7 @@ #define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x9000) #ifndef CIRCUITPY_INTERNAL_NVM_SIZE -#define CIRCUITPY_INTERNAL_NVM_SIZE (20000) +#define CIRCUITPY_INTERNAL_NVM_SIZE (20 * 1024) #endif #endif // __INCLUDED_ESP32S2_MPCONFIGPORT_H From 119e9d38202cb26f7f04d1050263e27e1083865a Mon Sep 17 00:00:00 2001 From: jgillick Date: Mon, 16 Nov 2020 23:50:00 -0800 Subject: [PATCH 08/64] Add Thunderpack 1.2 --- ports/stm/boards/thunderpack_v12/board.c | 38 ++ .../boards/thunderpack_v12/mpconfigboard.h | 61 +++ .../boards/thunderpack_v12/mpconfigboard.mk | 20 + ports/stm/boards/thunderpack_v12/pins.c | 39 ++ .../thunderpack_v12/stm32f4xx_hal_conf.h | 440 ++++++++++++++++++ ports/stm/common-hal/microcontroller/Pin.c | 33 ++ 6 files changed, 631 insertions(+) create mode 100644 ports/stm/boards/thunderpack_v12/board.c create mode 100644 ports/stm/boards/thunderpack_v12/mpconfigboard.h create mode 100644 ports/stm/boards/thunderpack_v12/mpconfigboard.mk create mode 100644 ports/stm/boards/thunderpack_v12/pins.c create mode 100644 ports/stm/boards/thunderpack_v12/stm32f4xx_hal_conf.h diff --git a/ports/stm/boards/thunderpack_v12/board.c b/ports/stm/boards/thunderpack_v12/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/stm/boards/thunderpack_v12/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 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 "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.h b/ports/stm/boards/thunderpack_v12/mpconfigboard.h new file mode 100644 index 0000000000..4c71b8aeb2 --- /dev/null +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.h @@ -0,0 +1,61 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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. + */ +#define MICROPY_HW_BOARD_NAME "THUNDERPACK_v12" +#define MICROPY_HW_MCU_NAME "STM32F411CE" + +// Non-volatile memory config +#define CIRCUITPY_INTERNAL_NVM_SIZE (0x4000) +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x08010000) +#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_4 + +// Putting the entire flash sector in the NVM byte array buffer +// would take up too much RAM. This limits how much of the sector we use. +#define NVM_BYTEARRAY_BUFFER_SIZE 512 + +// Flash config +#define FLASH_SIZE (0x80000) +#define FLASH_PAGE_SIZE (0x4000) +#define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000) + +// On-board flash +#define SPI_FLASH_MOSI_PIN (&pin_PB15) +#define SPI_FLASH_MISO_PIN (&pin_PB14) +#define SPI_FLASH_SCK_PIN (&pin_PB13) +#define SPI_FLASH_CS_PIN (&pin_PB12) + +// Status LEDs +#define MICROPY_HW_LED_STATUS (&pin_PA02) +#define MICROPY_HW_APA102_MOSI (&pin_PB08) +#define MICROPY_HW_APA102_SCK (&pin_PB00) + +// I2C +#define DEFAULT_I2C_BUS_SCL (&pin_PB06) +#define DEFAULT_I2C_BUS_SDA (&pin_PB07) + +// General config +#define BOARD_OSC_DIV (24) +#define BOARD_OVERWRITE_SWD (1) +#define BOARD_NO_VBUS_SENSE (1) \ No newline at end of file diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk new file mode 100644 index 0000000000..d11cfb7505 --- /dev/null +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk @@ -0,0 +1,20 @@ +USB_VID = 0x239A +USB_PID = 0x806A +USB_PRODUCT = "Thunderpack STM32F411" +USB_MANUFACTURER = "Jeremy Gillick" +USB_DEVICES = "CDC,MSC" + +LONGINT_IMPL = NONE + +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = GD25Q16C + +CIRCUITPY_NVM = 1 + +MCU_SERIES = F4 +MCU_VARIANT = STM32F411xE +MCU_PACKAGE = UFQFPN48 + +LD_COMMON = boards/common_nvm.ld +LD_FILE = boards/STM32F411_nvm.ld diff --git a/ports/stm/boards/thunderpack_v12/pins.c b/ports/stm/boards/thunderpack_v12/pins.c new file mode 100644 index 0000000000..1e07621eaa --- /dev/null +++ b/ports/stm/boards/thunderpack_v12/pins.c @@ -0,0 +1,39 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_PA0), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_PA1), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_PA2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_PA3), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_PA4), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_PA5), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PA6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_PA7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_PA8), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_PA9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, + + { MP_ROM_QSTR(MP_QSTR_PB0), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_PB5), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_PB6), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_PB7), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_PB8), MP_ROM_PTR(&pin_PB08) }, + + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PA03) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_PB04) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, + + { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_PB00) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/thunderpack_v12/stm32f4xx_hal_conf.h b/ports/stm/boards/thunderpack_v12/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..5cb5634223 --- /dev/null +++ b/ports/stm/boards/thunderpack_v12/stm32f4xx_hal_conf.h @@ -0,0 +1,440 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_RNG_MODULE_ENABLED */ +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +/* #define HAL_PCD_MODULE_ENABLED */ +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)24000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)40000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 2c513f4aad..cf5cd754f4 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -35,6 +35,10 @@ #ifdef MICROPY_HW_NEOPIXEL bool neopixel_in_use; #endif +#ifdef MICROPY_HW_APA102_MOSI +bool apa102_sck_in_use; +bool apa102_mosi_in_use; +#endif #if defined(LQFP144) #define GPIO_PORT_COUNT 7 @@ -66,6 +70,10 @@ void reset_all_pins(void) { #ifdef MICROPY_HW_NEOPIXEL neopixel_in_use = false; #endif + #ifdef MICROPY_HW_APA102_MOSI + apa102_sck_in_use = false; + apa102_mosi_in_use = false; + #endif } // Mark pin as free and return it to a quiescent state. @@ -85,6 +93,15 @@ void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { return; } #endif + #ifdef MICROPY_HW_APA102_MOSI + if ((pin_port == MICROPY_HW_APA102_MOSI->port && pin_number == MICROPY_HW_APA102_MOSI->number) + || (pin_port == MICROPY_HW_APA102_SCK->port && pin_number == MICROPY_HW_APA102_MOSI->number)) { + apa102_mosi_in_use = false; + apa102_sck_in_use = false; + rgb_led_status_init(); + return; + } + #endif } void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number) { @@ -108,6 +125,14 @@ void claim_pin(const mcu_pin_obj_t* pin) { neopixel_in_use = true; } #endif + #ifdef MICROPY_HW_APA102_MOSI + if (pin == MICROPY_HW_APA102_MOSI) { + apa102_mosi_in_use = true; + } + if (pin == MICROPY_HW_APA102_SCK) { + apa102_sck_in_use = true; + } + #endif } bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number) { @@ -120,6 +145,14 @@ bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) { return !neopixel_in_use; } #endif + #ifdef MICROPY_HW_APA102_MOSI + if (pin == MICROPY_HW_APA102_MOSI) { + return !apa102_mosi_in_use; + } + if (pin == MICROPY_HW_APA102_SCK) { + return !apa102_sck_in_use; + } + #endif return pin_number_is_free(pin->port, pin->number); } From ff987e7496152c3175608570d90f36753b4c4670 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 18 Nov 2020 12:16:14 +0530 Subject: [PATCH 09/64] add timer peripheral --- ports/esp32s2/Makefile | 1 + ports/esp32s2/peripherals/timer.c | 73 +++++++++++++++++++++++++++++++ ports/esp32s2/peripherals/timer.h | 41 +++++++++++++++++ ports/esp32s2/supervisor/port.c | 23 ++++++---- 4 files changed, 129 insertions(+), 9 deletions(-) create mode 100644 ports/esp32s2/peripherals/timer.c create mode 100644 ports/esp32s2/peripherals/timer.h diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 55d6e91d44..931e4d0639 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -188,6 +188,7 @@ SRC_C += \ lib/utils/pyexec.c \ lib/utils/stdout_helpers.c \ lib/utils/sys_stdio_mphal.c \ + peripherals/timer.c \ peripherals/pcnt.c \ peripherals/pins.c \ peripherals/rmt.c \ diff --git a/ports/esp32s2/peripherals/timer.c b/ports/esp32s2/peripherals/timer.c new file mode 100644 index 0000000000..3aee33dc50 --- /dev/null +++ b/ports/esp32s2/peripherals/timer.c @@ -0,0 +1,73 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "peripherals/timer.h" + +#define TIMER_FREE 1 +#define TIMER_BUSY 0 + +static uint8_t timer_state[2][2]; + +void peripherals_timer_reset(void) { + timer_index_t timer; + for (uint8_t i = 0; i < 2; i++) { + for (uint8_t j = 0; j < 2; j++) { + if (timer_state[i][j] == TIMER_BUSY) { + timer.idx = (timer_idx_t)j; + timer.group = (timer_group_t)i; + timer_state[i][j] = TIMER_FREE; + peripherals_timer_deinit(&timer); + } + } + } +} + +void peripherals_timer_init(const timer_config_t * config, timer_index_t * timer) { + // get free timer + for (uint8_t i = 0; i < 2; i++) { + for (uint8_t j = 0; j < 2; j++) { + if (timer_state[i][j] == TIMER_FREE) { + timer->idx = (timer_idx_t)j; + timer->group = (timer_group_t)i; + timer_state[i][j] = TIMER_BUSY; + goto init_timer; + } else if (i == 1 && j == 1) { + timer->idx = TIMER_MAX; + timer->group = TIMER_GROUP_MAX; + return; + } + } + } + +init_timer: + // initialize timer module + timer_init(timer->group, timer->idx, config); + timer_set_counter_value(timer->group, timer->idx, 0); +} + +void peripherals_timer_deinit(timer_index_t * timer) { + timer_deinit(timer->group, timer->idx); +} diff --git a/ports/esp32s2/peripherals/timer.h b/ports/esp32s2/peripherals/timer.h new file mode 100644 index 0000000000..8c9ebd91c9 --- /dev/null +++ b/ports/esp32s2/peripherals/timer.h @@ -0,0 +1,41 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_PERIPHERALS_TIMER_HANDLER_H +#define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_TIMER_HANDLER_H + +#include "driver/timer.h" + +typedef struct { + timer_idx_t idx; + timer_group_t group; +} timer_index_t; + +extern void peripherals_timer_init(const timer_config_t * config, timer_index_t * timer); +extern void peripherals_timer_deinit(timer_index_t * timer); +extern void peripherals_timer_reset(void); + +#endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_TIMER_HANDLER_H diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index ef032c4a76..4bf792516d 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -50,6 +50,7 @@ #include "peripherals/rmt.h" #include "peripherals/pcnt.h" +#include "peripherals/timer.h" #include "components/heap/include/esp_heap_caps.h" #include "components/soc/soc/esp32s2/include/soc/cache_memory.h" @@ -103,15 +104,6 @@ void reset_port(void) { analogout_reset(); #endif -#if CIRCUITPY_PULSEIO - esp32s2_peripherals_rmt_reset(); - pulsein_reset(); -#endif - -#if CIRCUITPY_PWMIO - pwmout_reset(); -#endif - #if CIRCUITPY_BUSIO i2c_reset(); spi_reset(); @@ -122,6 +114,19 @@ void reset_port(void) { peripherals_pcnt_reset(); #endif +#if CIRCUITPY_FREQUENCYIO + peripherals_timer_reset(); +#endif + +#if CIRCUITPY_PULSEIO + esp32s2_peripherals_rmt_reset(); + pulsein_reset(); +#endif + +#if CIRCUITPY_PWMIO + pwmout_reset(); +#endif + #if CIRCUITPY_RTC rtc_reset(); #endif From c457d373e18a5bcadec44e0815bea8b9beb30a97 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 18 Nov 2020 12:24:48 +0530 Subject: [PATCH 10/64] update init_timer & frequency calculation --- .../common-hal/frequencyio/FrequencyIn.c | 55 ++++++++++++------- .../common-hal/frequencyio/FrequencyIn.h | 5 +- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c index 20d744139d..12d612abb0 100644 --- a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c +++ b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c @@ -29,7 +29,7 @@ #include "py/runtime.h" static void IRAM_ATTR pcnt_overflow_handler(void *self_in) { - frequencyio_frequencyin_obj_t* self = self_in; + frequencyio_frequencyin_obj_t * self = self_in; // reset counter pcnt_counter_clear(self->unit); @@ -41,18 +41,26 @@ static void IRAM_ATTR pcnt_overflow_handler(void *self_in) { } static void IRAM_ATTR timer_interrupt_handler(void *self_in) { - frequencyio_frequencyin_obj_t* self = self_in; + frequencyio_frequencyin_obj_t * self = self_in; // get counter value int16_t count; pcnt_get_counter_value(self->unit, &count); - self->frequency = count / 2.0 / self->capture_period; + self->frequency = ((count / 2.0) + (self->multiplier * INT16_MAX / 4.0)) / (self->capture_period); + + // reset multiplier + self->multiplier = 0; // reset counter pcnt_counter_clear(self->unit); // reset interrupt - TIMERG0.int_clr.t0 = 1; - TIMERG0.hw_timer[0].config.alarm_en = 1; + timg_dev_t *device = self->timer.group ? &(TIMERG1) : &(TIMERG0); + if (self->timer.idx) { + device->int_clr.t1 = 1; + } else { + device->int_clr.t0 = 1; + } + device->hw_timer[self->timer.idx].config.alarm_en = 1; } static void init_pcnt(frequencyio_frequencyin_obj_t* self) { @@ -70,7 +78,7 @@ static void init_pcnt(frequencyio_frequencyin_obj_t* self) { .counter_l_lim = 0, }; - // Initialize PCNT unit + // initialize PCNT const int8_t unit = peripherals_pcnt_init(pcnt_config); if (unit == -1) { mp_raise_RuntimeError(translate("All PCNT units in use")); @@ -98,15 +106,22 @@ static void init_timer(frequencyio_frequencyin_obj_t* self) { .divider = 80 // 1 us per tick }; - // Initialize timer module - timer_init(TIMER_GROUP_0, TIMER_0, &config); - timer_set_counter_value(TIMER_GROUP_0, TIMER_0, 0); - timer_set_alarm_value(TIMER_GROUP_0, TIMER_0, self->capture_period * 1000000); - timer_isr_register(TIMER_GROUP_0, TIMER_0, timer_interrupt_handler, (void *)self, ESP_INTR_FLAG_IRAM, &self->handle); - timer_enable_intr(TIMER_GROUP_0, TIMER_0); + // initialize Timer + peripherals_timer_init(&config, &self->timer); + if (self->timer.idx == TIMER_MAX || self->timer.group == TIMER_GROUP_MAX) { + mp_raise_RuntimeError(translate("All timers in use")); + } - // Start timer - timer_start(TIMER_GROUP_0, TIMER_0); + timer_idx_t idx = self->timer.idx; + timer_group_t group = self->timer.group; + + // enable timer interrupt + timer_set_alarm_value(group, idx, self->capture_period * 1000000); + timer_isr_register(group, idx, timer_interrupt_handler, (void *)self, ESP_INTR_FLAG_IRAM, &self->handle); + timer_enable_intr(group, idx); + + // start timer + timer_start(self->timer.group, self->timer.idx); } void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* self, @@ -137,7 +152,7 @@ void common_hal_frequencyio_frequencyin_deinit(frequencyio_frequencyin_obj_t* se } reset_pin_number(self->pin); peripherals_pcnt_deinit(&self->unit); - timer_deinit(TIMER_GROUP_0, TIMER_0); + peripherals_timer_deinit(&self->timer); if (self->handle) { esp_intr_free(self->handle); self->handle = NULL; @@ -145,23 +160,23 @@ void common_hal_frequencyio_frequencyin_deinit(frequencyio_frequencyin_obj_t* se } uint32_t common_hal_frequencyio_frequencyin_get_item(frequencyio_frequencyin_obj_t* self) { - return (self->frequency + (self->multiplier * INT16_MAX)); + return self->frequency; } void common_hal_frequencyio_frequencyin_pause(frequencyio_frequencyin_obj_t* self) { pcnt_counter_pause(self->unit); - timer_pause(TIMER_GROUP_0, TIMER_0); + timer_pause(self->timer.group, self->timer.idx); } void common_hal_frequencyio_frequencyin_resume(frequencyio_frequencyin_obj_t* self) { pcnt_counter_resume(self->unit); - timer_start(TIMER_GROUP_0, TIMER_0); + timer_start(self->timer.group, self->timer.idx); } void common_hal_frequencyio_frequencyin_clear(frequencyio_frequencyin_obj_t* self) { self->frequency = 0; pcnt_counter_clear(self->unit); - timer_set_counter_value(TIMER_GROUP_0, TIMER_0, 0); + timer_set_counter_value(self->timer.group, self->timer.idx, 0); } uint16_t common_hal_frequencyio_frequencyin_get_capture_period(frequencyio_frequencyin_obj_t *self) { @@ -174,5 +189,5 @@ void common_hal_frequencyio_frequencyin_set_capture_period(frequencyio_frequency } self->capture_period = capture_period; common_hal_frequencyio_frequencyin_clear(self); - timer_set_alarm_value(TIMER_GROUP_0, TIMER_0, capture_period * 1000000); + timer_set_alarm_value(self->timer.group, self->timer.idx, capture_period * 1000000); } diff --git a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.h b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.h index ce3bf8f2f9..cf9d2ae538 100644 --- a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.h +++ b/ports/esp32s2/common-hal/frequencyio/FrequencyIn.h @@ -28,16 +28,17 @@ #define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_FREQUENCYIO_FREQUENCYIN_H #include "py/obj.h" -#include "driver/timer.h" #include "peripherals/pcnt.h" +#include "peripherals/timer.h" typedef struct { mp_obj_base_t base; pcnt_unit_t unit; + timer_index_t timer; intr_handle_t handle; uint8_t pin; uint8_t multiplier; - uint16_t frequency; + uint32_t frequency; uint16_t capture_period; } frequencyio_frequencyin_obj_t; From bab41afce759916af15ab57645691336ea2bdd06 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 18 Nov 2020 12:34:56 +0530 Subject: [PATCH 11/64] ps2io implementation for esp32s2 --- ports/esp32s2/common-hal/ps2io/Ps2.c | 393 ++++++++++++++++++++++ ports/esp32s2/common-hal/ps2io/Ps2.h | 60 ++++ ports/esp32s2/common-hal/ps2io/__init__.c | 1 + ports/esp32s2/mpconfigport.mk | 4 + 4 files changed, 458 insertions(+) create mode 100644 ports/esp32s2/common-hal/ps2io/Ps2.c create mode 100644 ports/esp32s2/common-hal/ps2io/Ps2.h create mode 100644 ports/esp32s2/common-hal/ps2io/__init__.c diff --git a/ports/esp32s2/common-hal/ps2io/Ps2.c b/ports/esp32s2/common-hal/ps2io/Ps2.c new file mode 100644 index 0000000000..2156a42479 --- /dev/null +++ b/ports/esp32s2/common-hal/ps2io/Ps2.c @@ -0,0 +1,393 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "common-hal/ps2io/Ps2.h" + +#include "py/runtime.h" +#include "supervisor/port.h" +#include "shared-bindings/ps2io/Ps2.h" +#include "shared-bindings/microcontroller/__init__.h" + +#define STATE_IDLE 0 +#define STATE_RECV 1 +#define STATE_RECV_PARITY 2 +#define STATE_RECV_STOP 3 +#define STATE_RECV_ERR 10 + +#define ERROR_STARTBIT 0x01 +#define ERROR_TIMEOUT 0x02 +#define ERROR_PARITY 0x04 +#define ERROR_STOPBIT 0x08 +#define ERROR_BUFFER 0x10 + +#define ERROR_TX_CLKLO 0x100 +#define ERROR_TX_CLKHI 0x200 +#define ERROR_TX_ACKDATA 0x400 +#define ERROR_TX_ACKCLK 0x800 +#define ERROR_TX_RTS 0x1000 +#define ERROR_TX_NORESP 0x2000 + +static void IRAM_ATTR ps2_interrupt_handler(void *self_in); + +static void ps2_set_config(ps2io_ps2_obj_t* self) { + // turn on falling edge interrupt + gpio_set_intr_type(self->clk_pin, GPIO_INTR_NEGEDGE); + gpio_isr_register(ps2_interrupt_handler, (void *)self, ESP_INTR_FLAG_IRAM, &self->handle); + gpio_intr_enable(self->clk_pin); +} + +static void disable_interrupt(ps2io_ps2_obj_t* self) { + // turn off fallling edge interrupt + gpio_intr_disable(self->clk_pin); +} + +static void resume_interrupt(ps2io_ps2_obj_t* self) { + self->state = STATE_IDLE; + gpio_intr_enable(self->clk_pin); +} + +static void clk_hi(ps2io_ps2_obj_t* self) { + // external pull-up + gpio_set_direction(self->clk_pin, GPIO_MODE_INPUT); + gpio_pullup_dis(self->clk_pin); +} + +static bool wait_clk_lo(ps2io_ps2_obj_t* self, uint32_t us) { + clk_hi(self); + common_hal_mcu_delay_us(1); + while (gpio_get_level(self->clk_pin) && us) { + --us; + common_hal_mcu_delay_us(1); + } + return us; +} + +static bool wait_clk_hi(ps2io_ps2_obj_t* self, uint32_t us) { + clk_hi(self); + common_hal_mcu_delay_us(1); + while (!gpio_get_level(self->clk_pin) && us) { + --us; + common_hal_mcu_delay_us(1); + } + return us; +} + +static void clk_lo(ps2io_ps2_obj_t* self) { + gpio_pullup_dis(self->clk_pin); + gpio_set_direction(self->clk_pin, GPIO_MODE_OUTPUT); + gpio_set_level(self->clk_pin, 0); +} + +static void data_hi(ps2io_ps2_obj_t* self) { + // external pull-up + gpio_set_direction(self->data_pin, GPIO_MODE_INPUT); + gpio_pullup_dis(self->data_pin); +} + +static bool wait_data_lo(ps2io_ps2_obj_t* self, uint32_t us) { + data_hi(self); + common_hal_mcu_delay_us(1); + while (gpio_get_level(self->data_pin) && us) { + --us; + common_hal_mcu_delay_us(1); + } + return us; +} + +static bool wait_data_hi(ps2io_ps2_obj_t* self, uint32_t us) { + data_hi(self); + common_hal_mcu_delay_us(1); + while (!gpio_get_level(self->data_pin) && us) { + --us; + common_hal_mcu_delay_us(1); + } + return us; +} + +static void data_lo(ps2io_ps2_obj_t* self) { + gpio_pullup_dis(self->data_pin); + gpio_set_direction(self->data_pin, GPIO_MODE_OUTPUT); + gpio_set_level(self->data_pin, 0); +} + +static void idle(ps2io_ps2_obj_t* self) { + clk_hi(self); + data_hi(self); +} + +static void inhibit(ps2io_ps2_obj_t* self) { + clk_lo(self); + data_hi(self); +} + +static void delay_us(uint32_t t) { + common_hal_mcu_delay_us(t); +} + +static void IRAM_ATTR ps2_interrupt_handler(void *self_in) { + // Grab the current time first. + uint64_t current_tick = port_get_raw_ticks(NULL); + + ps2io_ps2_obj_t * self = self_in; + int data_bit = gpio_get_level(self->data_pin) ? 1 : 0; + + // test for timeout + if (self->state != STATE_IDLE) { + int64_t diff_ms = current_tick - self->last_raw_ticks; + if (diff_ms > 1) { // a.k.a. > 1.001ms + self->last_errors |= ERROR_TIMEOUT; + self->state = STATE_IDLE; + } + } + + self->last_raw_ticks = current_tick; + + if (self->state == STATE_IDLE) { + self->bits = 0; + self->parity = false; + self->bitcount = 0; + self->state = STATE_RECV; + if (data_bit) { + // start bit should be 0 + self->last_errors |= ERROR_STARTBIT; + self->state = STATE_RECV_ERR; + } else { + self->state = STATE_RECV; + } + + } else if (self->state == STATE_RECV) { + if (data_bit) { + self->bits |= data_bit << self->bitcount; + self->parity = !self->parity; + } + ++self->bitcount; + if (self->bitcount >= 8) { + self->state = STATE_RECV_PARITY; + } + + } else if (self->state == STATE_RECV_PARITY) { + ++self->bitcount; + if (data_bit) { + self->parity = !self->parity; + } + if (!self->parity) { + self->last_errors |= ERROR_PARITY; + self->state = STATE_RECV_ERR; + } else { + self->state = STATE_RECV_STOP; + } + + } else if (self->state == STATE_RECV_STOP) { + ++self->bitcount; + if (! data_bit) { + self->last_errors |= ERROR_STOPBIT; + } else if (self->waiting_cmd_response) { + self->cmd_response = self->bits; + self->waiting_cmd_response = false; + } else if (self->bufcount >= sizeof(self->buffer)) { + self->last_errors |= ERROR_BUFFER; + } else { + self->buffer[self->bufposw] = self->bits; + self->bufposw = (self->bufposw + 1) % sizeof(self->buffer); + self->bufcount++; + } + self->state = STATE_IDLE; + + } else if (self->state == STATE_RECV_ERR) { + // just count the bits until idle + if (++self->bitcount >= 10) { + self->state = STATE_IDLE; + } + } +} + +void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t* self, + const mcu_pin_obj_t* data_pin, const mcu_pin_obj_t* clk_pin) { + clk_hi(self); + data_hi(self); + + self->clk_pin = (gpio_num_t)clk_pin->number; + self->data_pin = (gpio_num_t)data_pin->number; + self->state = STATE_IDLE; + self->bufcount = 0; + self->bufposr = 0; + self->bufposw = 0; + self->waiting_cmd_response = false; + + claim_pin(clk_pin); + claim_pin(data_pin); + + // set config will enable the interrupt. + ps2_set_config(self); +} + +bool common_hal_ps2io_ps2_deinited(ps2io_ps2_obj_t* self) { + return self->clk_pin == GPIO_NUM_MAX; +} + +void common_hal_ps2io_ps2_deinit(ps2io_ps2_obj_t* self) { + if (common_hal_ps2io_ps2_deinited(self)) { + return; + } + if (self->handle) { + esp_intr_free(self->handle); + self->handle = NULL; + } + reset_pin_number(self->clk_pin); + reset_pin_number(self->data_pin); + self->clk_pin = GPIO_NUM_MAX; + self->data_pin = GPIO_NUM_MAX; +} + +uint16_t common_hal_ps2io_ps2_get_len(ps2io_ps2_obj_t* self) { + return self->bufcount; +} + +int16_t common_hal_ps2io_ps2_popleft(ps2io_ps2_obj_t* self) { + common_hal_mcu_disable_interrupts(); + if (self->bufcount <= 0) { + common_hal_mcu_enable_interrupts(); + return -1; + } + uint8_t b = self->buffer[self->bufposr]; + self->bufposr = (self->bufposr + 1) % sizeof(self->buffer); + self->bufcount -= 1; + common_hal_mcu_enable_interrupts(); + return b; +} + +uint16_t common_hal_ps2io_ps2_clear_errors(ps2io_ps2_obj_t* self) { + common_hal_mcu_disable_interrupts(); + uint16_t errors = self->last_errors; + self->last_errors = 0; + common_hal_mcu_enable_interrupts(); + return errors; +} + +// Based upon TMK implementation of PS/2 protocol +// https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/protocol/ps2_interrupt.c + +int16_t common_hal_ps2io_ps2_sendcmd(ps2io_ps2_obj_t* self, uint8_t b) { + disable_interrupt(self); + inhibit(self); + delay_us(100); + + /* RTS and start bit */ + data_lo(self); + clk_hi(self); + if (!wait_clk_lo(self, 10000)) { + self->last_errors |= ERROR_TX_RTS; + goto ERROR; + } + + bool parity = true; + for (uint8_t i = 0; i < 8; i++) { + delay_us(15); + if (b & (1 << i)) { + parity = !parity; + data_hi(self); + } else { + data_lo(self); + } + if (!wait_clk_hi(self, 50)) { + self->last_errors |= ERROR_TX_CLKHI; + goto ERROR; + } + if (!wait_clk_lo(self, 50)) { + self->last_errors |= ERROR_TX_CLKLO; + goto ERROR; + } + } + + delay_us(15); + if (parity) { + data_hi(self); + } else { + data_lo(self); + } + if (!wait_clk_hi(self, 50)) { + self->last_errors |= ERROR_TX_CLKHI; + goto ERROR; + } + if (!wait_clk_lo(self, 50)) { + self->last_errors |= ERROR_TX_CLKLO; + goto ERROR; + } + + /* Stop bit */ + delay_us(15); + data_hi(self); + + /* Ack */ + if (!wait_data_lo(self, 50)) { + self->last_errors |= ERROR_TX_ACKDATA; + goto ERROR; + } + if (!wait_clk_lo(self, 50)) { + self->last_errors |= ERROR_TX_ACKCLK; + goto ERROR; + } + + /* wait for idle state */ + if (!wait_clk_hi(self, 50)) { + self->last_errors |= ERROR_TX_ACKCLK; + goto ERROR; + } + if (!wait_data_hi(self, 50)) { + self->last_errors |= ERROR_TX_ACKDATA; + goto ERROR; + } + + /* Wait for response byte */ + self->waiting_cmd_response = true; + idle(self); + resume_interrupt(self); + + for (int i = 0; i < 25; ++i) { + delay_us(1000); + common_hal_mcu_disable_interrupts(); + bool has_response = !self->waiting_cmd_response; + uint8_t response = self->cmd_response; + common_hal_mcu_enable_interrupts(); + + if (has_response) { + return response; + } + } + + /* No response */ + common_hal_mcu_disable_interrupts(); + self->waiting_cmd_response = false; + self->last_errors |= ERROR_TX_NORESP; + common_hal_mcu_enable_interrupts(); + return -1; + + /* Other errors */ +ERROR: + idle(self); + resume_interrupt(self); + return -1; +} diff --git a/ports/esp32s2/common-hal/ps2io/Ps2.h b/ports/esp32s2/common-hal/ps2io/Ps2.h new file mode 100644 index 0000000000..51ebde4487 --- /dev/null +++ b/ports/esp32s2/common-hal/ps2io/Ps2.h @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PS2IO_PS2_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PS2IO_PS2_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" +#include "driver/gpio.h" + +typedef struct { + mp_obj_base_t base; + gpio_num_t clk_pin; + gpio_num_t data_pin; + + uint8_t state; + uint64_t last_raw_ticks; + + uint16_t bits; + bool parity; + uint8_t bitcount; + + uint8_t buffer[16]; + uint8_t bufcount; + uint8_t bufposr; + uint8_t bufposw; + + uint16_t last_errors; + + bool waiting_cmd_response; + uint8_t cmd_response; + + intr_handle_t handle; +} ps2io_ps2_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PS2IO_PS2_H diff --git a/ports/esp32s2/common-hal/ps2io/__init__.c b/ports/esp32s2/common-hal/ps2io/__init__.c new file mode 100644 index 0000000000..ba4b4249f7 --- /dev/null +++ b/ports/esp32s2/common-hal/ps2io/__init__.c @@ -0,0 +1 @@ +// No ps2io module functions. diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 335d2caf72..26bb516114 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -28,6 +28,10 @@ CIRCUITPY_WIFI = 1 CIRCUITPY_WATCHDOG ?= 1 CIRCUITPY_ESPIDF = 1 +ifndef CIRCUITPY_PS2IO +CIRCUITPY_PS2IO = 1 +endif + ifndef CIRCUITPY_TOUCHIO_USE_NATIVE CIRCUITPY_TOUCHIO_USE_NATIVE = 1 endif From 0d3e81f969adc6d8744e8e720ec4b01848a8fa6c Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 18 Nov 2020 22:22:42 +0530 Subject: [PATCH 12/64] update interrupt handling --- ports/esp32s2/common-hal/ps2io/Ps2.c | 13 +++++-------- ports/esp32s2/common-hal/ps2io/Ps2.h | 2 -- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ports/esp32s2/common-hal/ps2io/Ps2.c b/ports/esp32s2/common-hal/ps2io/Ps2.c index 2156a42479..9c19ea950e 100644 --- a/ports/esp32s2/common-hal/ps2io/Ps2.c +++ b/ports/esp32s2/common-hal/ps2io/Ps2.c @@ -55,18 +55,18 @@ static void IRAM_ATTR ps2_interrupt_handler(void *self_in); static void ps2_set_config(ps2io_ps2_obj_t* self) { // turn on falling edge interrupt gpio_set_intr_type(self->clk_pin, GPIO_INTR_NEGEDGE); - gpio_isr_register(ps2_interrupt_handler, (void *)self, ESP_INTR_FLAG_IRAM, &self->handle); - gpio_intr_enable(self->clk_pin); + gpio_install_isr_service(ESP_INTR_FLAG_IRAM); + gpio_isr_handler_add(self->clk_pin, ps2_interrupt_handler, (void*)self); } static void disable_interrupt(ps2io_ps2_obj_t* self) { // turn off fallling edge interrupt - gpio_intr_disable(self->clk_pin); + gpio_isr_handler_remove(self->clk_pin); } static void resume_interrupt(ps2io_ps2_obj_t* self) { self->state = STATE_IDLE; - gpio_intr_enable(self->clk_pin); + gpio_isr_handler_add(self->clk_pin, ps2_interrupt_handler, (void*)self); } static void clk_hi(ps2io_ps2_obj_t* self) { @@ -252,10 +252,7 @@ void common_hal_ps2io_ps2_deinit(ps2io_ps2_obj_t* self) { if (common_hal_ps2io_ps2_deinited(self)) { return; } - if (self->handle) { - esp_intr_free(self->handle); - self->handle = NULL; - } + gpio_uninstall_isr_service(); reset_pin_number(self->clk_pin); reset_pin_number(self->data_pin); self->clk_pin = GPIO_NUM_MAX; diff --git a/ports/esp32s2/common-hal/ps2io/Ps2.h b/ports/esp32s2/common-hal/ps2io/Ps2.h index 51ebde4487..eb93829b46 100644 --- a/ports/esp32s2/common-hal/ps2io/Ps2.h +++ b/ports/esp32s2/common-hal/ps2io/Ps2.h @@ -53,8 +53,6 @@ typedef struct { bool waiting_cmd_response; uint8_t cmd_response; - - intr_handle_t handle; } ps2io_ps2_obj_t; #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PS2IO_PS2_H From f61f8f999b5eeb8a545f5cea13b30ac5b3aeb04a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 18 Nov 2020 18:06:31 -0600 Subject: [PATCH 13/64] EPaperDisplay: add rotation property untested, because I don't want to mess my magtag demo up :) but it builds --- shared-bindings/displayio/EPaperDisplay.c | 24 +++++++++++++++++++++++ shared-bindings/displayio/EPaperDisplay.h | 2 ++ shared-module/displayio/EPaperDisplay.c | 23 ++++++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index ebff640085..4f5c47acab 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -294,6 +294,29 @@ const mp_obj_property_t displayio_epaperdisplay_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; +//| rotation: int +//| """The rotation of the display as an int in degrees.""" +//| +STATIC mp_obj_t displayio_epaperdisplay_obj_get_rotation(mp_obj_t self_in) { + displayio_epaperdisplay_obj_t *self = native_display(self_in); + return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_epaperdisplay_get_rotation(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_rotation_obj, displayio_epaperdisplay_obj_get_rotation); +STATIC mp_obj_t displayio_epaperdisplay_obj_set_rotation(mp_obj_t self_in, mp_obj_t value) { + displayio_epaperdisplay_obj_t *self = native_display(self_in); + common_hal_displayio_epaperdisplay_set_rotation(self, mp_obj_get_int(value)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(displayio_epaperdisplay_set_rotation_obj, displayio_epaperdisplay_obj_set_rotation); + + +const mp_obj_property_t displayio_epaperdisplay_rotation_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&displayio_epaperdisplay_get_rotation_obj, + (mp_obj_t)&displayio_epaperdisplay_set_rotation_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + //| bus: _DisplayBus //| """The bus being used by the display""" //| @@ -317,6 +340,7 @@ STATIC const mp_rom_map_elem_t displayio_epaperdisplay_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&displayio_epaperdisplay_width_obj) }, { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&displayio_epaperdisplay_height_obj) }, + { MP_ROM_QSTR(MP_QSTR_rotation), MP_ROM_PTR(&displayio_epaperdisplay_rotation_obj) }, { MP_ROM_QSTR(MP_QSTR_bus), MP_ROM_PTR(&displayio_epaperdisplay_bus_obj) }, { MP_ROM_QSTR(MP_QSTR_busy), MP_ROM_PTR(&displayio_epaperdisplay_busy_obj) }, { MP_ROM_QSTR(MP_QSTR_time_to_refresh), MP_ROM_PTR(&displayio_epaperdisplay_time_to_refresh_obj) }, diff --git a/shared-bindings/displayio/EPaperDisplay.h b/shared-bindings/displayio/EPaperDisplay.h index f785203a41..14d4f6aa9a 100644 --- a/shared-bindings/displayio/EPaperDisplay.h +++ b/shared-bindings/displayio/EPaperDisplay.h @@ -56,6 +56,8 @@ bool common_hal_displayio_epaperdisplay_get_busy(displayio_epaperdisplay_obj_t* uint16_t common_hal_displayio_epaperdisplay_get_width(displayio_epaperdisplay_obj_t* self); uint16_t common_hal_displayio_epaperdisplay_get_height(displayio_epaperdisplay_obj_t* self); +uint16_t common_hal_displayio_epaperdisplay_get_rotation(displayio_epaperdisplay_obj_t* self); +void common_hal_displayio_epaperdisplay_set_rotation(displayio_epaperdisplay_obj_t* self, int rotation); mp_obj_t common_hal_displayio_epaperdisplay_get_bus(displayio_epaperdisplay_obj_t* self); diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 1b285b4b1d..3fb37ff219 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -198,6 +198,29 @@ mp_obj_t common_hal_displayio_epaperdisplay_get_bus(displayio_epaperdisplay_obj_ return self->core.bus; } +void common_hal_displayio_epaperdisplay_set_rotation(displayio_epaperdisplay_obj_t* self, int rotation){ + bool transposed = (self->core.rotation == 90 || self->core.rotation == 270); + bool will_transposed = (rotation == 90 || rotation == 270); + if(transposed != will_transposed) { + int tmp = self->core.width; + self->core.width = self->core.height; + self->core.height = tmp; + } + displayio_display_core_set_rotation(&self->core, rotation); + if (self == &displays[0].epaper_display) { + supervisor_stop_terminal(); + supervisor_start_terminal(self->core.width, self->core.height); + } + if (self->core.current_group != NULL) { + displayio_group_update_transform(self->core.current_group, &self->core.transform); + } +} + +uint16_t common_hal_displayio_epaperdisplay_get_rotation(displayio_epaperdisplay_obj_t* self){ + return self->core.rotation; +} + + bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, const displayio_area_t* area) { uint16_t buffer_size = 128; // In uint32_ts From 081aec44290cdacc2a28cf8b5c01d34c3d681d93 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 18 Nov 2020 16:39:34 -0800 Subject: [PATCH 14/64] Retry connection when getting NOT_AUTHED I saw it once with a correct password. Retrying may still fail but at least it'll try first. --- ports/esp32s2/common-hal/wifi/__init__.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index 2eb3719b4d..70f1d98cba 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -59,6 +59,7 @@ static void event_handler(void* arg, esp_event_base_t event_base, ESP_EARLY_LOGW(TAG, "reason %d 0x%02x", reason, reason); if (radio->retries_left > 0 && (reason == WIFI_REASON_AUTH_EXPIRE || + reason == WIFI_REASON_NOT_AUTHED || reason == WIFI_REASON_ASSOC_EXPIRE || reason == WIFI_REASON_CONNECTION_FAIL || reason == WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT)) { From 9a642fc0490c22b60460bcca8dec3b0b93344d81 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 18 Nov 2020 20:37:26 -0600 Subject: [PATCH 15/64] samd21: Enable terse error reporting on resource constrained chip family This reclaims over 1kB of flash space by simplifying certain exception messages. e.g., it will no longer display the requested/actual length when a fixed list/tuple of N items is needed: if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { mp_raise_ValueError(translate("tuple/list has wrong length")); } else { mp_raise_ValueError_varg(translate("requested length %d but object has length %d"), (int)len, (int)seq_len); Other chip families including samd51 keep their current error reporting capabilities. --- ports/atmel-samd/mpconfigport.h | 1 + py/circuitpy_mpconfig.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index ed10da9b9d..3069def33b 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -42,6 +42,7 @@ #define CIRCUITPY_MCU_FAMILY samd21 #define MICROPY_PY_SYS_PLATFORM "Atmel SAMD21" #define SPI_FLASH_MAX_BAUDRATE 8000000 +#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE) #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0) #define MICROPY_PY_FUNCTION_ATTRS (0) // MICROPY_PY_UJSON depends on MICROPY_PY_IO diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 85e152670a..4c2e33be01 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -64,7 +64,9 @@ #define MICROPY_ENABLE_FINALISER (1) #define MICROPY_ENABLE_GC (1) #define MICROPY_ENABLE_SOURCE_LINE (1) +#ifndef MICROPY_ERROR_REPORTING #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL) +#endif #define MICROPY_FLOAT_HIGH_QUALITY_HASH (0) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) #define MICROPY_GC_ALLOC_THRESHOLD (0) From b56645808c88cca22a42cb66ed7b3ddc8383436a Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 19 Nov 2020 11:44:22 +0530 Subject: [PATCH 16/64] fix crash on user code exit --- ports/esp32s2/common-hal/ps2io/Ps2.c | 6 ++++-- ports/esp32s2/common-hal/ps2io/Ps2.h | 2 ++ ports/esp32s2/supervisor/port.c | 5 +++++ shared-bindings/ps2io/Ps2.c | 5 +++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ports/esp32s2/common-hal/ps2io/Ps2.c b/ports/esp32s2/common-hal/ps2io/Ps2.c index 9c19ea950e..56199f4cbf 100644 --- a/ports/esp32s2/common-hal/ps2io/Ps2.c +++ b/ports/esp32s2/common-hal/ps2io/Ps2.c @@ -26,9 +26,7 @@ #include "common-hal/ps2io/Ps2.h" -#include "py/runtime.h" #include "supervisor/port.h" -#include "shared-bindings/ps2io/Ps2.h" #include "shared-bindings/microcontroller/__init__.h" #define STATE_IDLE 0 @@ -259,6 +257,10 @@ void common_hal_ps2io_ps2_deinit(ps2io_ps2_obj_t* self) { self->data_pin = GPIO_NUM_MAX; } +void ps2_reset(void) { + gpio_uninstall_isr_service(); +} + uint16_t common_hal_ps2io_ps2_get_len(ps2io_ps2_obj_t* self) { return self->bufcount; } diff --git a/ports/esp32s2/common-hal/ps2io/Ps2.h b/ports/esp32s2/common-hal/ps2io/Ps2.h index eb93829b46..497952b250 100644 --- a/ports/esp32s2/common-hal/ps2io/Ps2.h +++ b/ports/esp32s2/common-hal/ps2io/Ps2.h @@ -55,4 +55,6 @@ typedef struct { uint8_t cmd_response; } ps2io_ps2_obj_t; +void ps2_reset(void); + #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PS2IO_PS2_H diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 47d0c7f463..f66a8511ad 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -41,6 +41,7 @@ #include "common-hal/busio/I2C.h" #include "common-hal/busio/SPI.h" #include "common-hal/busio/UART.h" +#include "common-hal/ps2io/Ps2.h" #include "common-hal/pulseio/PulseIn.h" #include "common-hal/pwmio/PWMOut.h" #include "common-hal/watchdog/WatchDogTimer.h" @@ -104,6 +105,10 @@ void reset_port(void) { analogout_reset(); #endif +#if CIRCUITPY_PS2IO + ps2_reset(); +#endif + #if CIRCUITPY_PULSEIO esp32s2_peripherals_rmt_reset(); pulsein_reset(); diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index 0977e08ff7..07fa5cebb9 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -116,8 +116,9 @@ STATIC void check_for_deinit(ps2io_ps2_obj_t *self) { //| ... //| STATIC mp_obj_t ps2io_ps2_obj___exit__(size_t n_args, const mp_obj_t *args) { - (void)n_args; - common_hal_ps2io_ps2_deinit(args[0]); + mp_check_self(MP_OBJ_IS_TYPE(args[0], &ps2io_ps2_type)); + ps2io_ps2_obj_t *self = MP_OBJ_TO_PTR(args[0]); + common_hal_ps2io_ps2_deinit(self); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ps2io_ps2___exit___obj, 4, 4, ps2io_ps2_obj___exit__); From 040eaa044344562ec1f9905d67b612ea2ec12949 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 19 Nov 2020 15:30:15 +0530 Subject: [PATCH 17/64] re-organize and clean-up --- ports/esp32s2/common-hal/ps2io/Ps2.c | 200 +++++++++++++-------------- 1 file changed, 100 insertions(+), 100 deletions(-) diff --git a/ports/esp32s2/common-hal/ps2io/Ps2.c b/ports/esp32s2/common-hal/ps2io/Ps2.c index 56199f4cbf..003f0d827e 100644 --- a/ports/esp32s2/common-hal/ps2io/Ps2.c +++ b/ports/esp32s2/common-hal/ps2io/Ps2.c @@ -48,103 +48,16 @@ #define ERROR_TX_RTS 0x1000 #define ERROR_TX_NORESP 0x2000 -static void IRAM_ATTR ps2_interrupt_handler(void *self_in); - -static void ps2_set_config(ps2io_ps2_obj_t* self) { - // turn on falling edge interrupt - gpio_set_intr_type(self->clk_pin, GPIO_INTR_NEGEDGE); - gpio_install_isr_service(ESP_INTR_FLAG_IRAM); - gpio_isr_handler_add(self->clk_pin, ps2_interrupt_handler, (void*)self); -} - -static void disable_interrupt(ps2io_ps2_obj_t* self) { - // turn off fallling edge interrupt - gpio_isr_handler_remove(self->clk_pin); -} - -static void resume_interrupt(ps2io_ps2_obj_t* self) { - self->state = STATE_IDLE; - gpio_isr_handler_add(self->clk_pin, ps2_interrupt_handler, (void*)self); -} - -static void clk_hi(ps2io_ps2_obj_t* self) { - // external pull-up - gpio_set_direction(self->clk_pin, GPIO_MODE_INPUT); - gpio_pullup_dis(self->clk_pin); -} - -static bool wait_clk_lo(ps2io_ps2_obj_t* self, uint32_t us) { - clk_hi(self); - common_hal_mcu_delay_us(1); - while (gpio_get_level(self->clk_pin) && us) { - --us; - common_hal_mcu_delay_us(1); - } - return us; -} - -static bool wait_clk_hi(ps2io_ps2_obj_t* self, uint32_t us) { - clk_hi(self); - common_hal_mcu_delay_us(1); - while (!gpio_get_level(self->clk_pin) && us) { - --us; - common_hal_mcu_delay_us(1); - } - return us; -} - -static void clk_lo(ps2io_ps2_obj_t* self) { - gpio_pullup_dis(self->clk_pin); - gpio_set_direction(self->clk_pin, GPIO_MODE_OUTPUT); - gpio_set_level(self->clk_pin, 0); -} - -static void data_hi(ps2io_ps2_obj_t* self) { - // external pull-up - gpio_set_direction(self->data_pin, GPIO_MODE_INPUT); - gpio_pullup_dis(self->data_pin); -} - -static bool wait_data_lo(ps2io_ps2_obj_t* self, uint32_t us) { - data_hi(self); - common_hal_mcu_delay_us(1); - while (gpio_get_level(self->data_pin) && us) { - --us; - common_hal_mcu_delay_us(1); - } - return us; -} - -static bool wait_data_hi(ps2io_ps2_obj_t* self, uint32_t us) { - data_hi(self); - common_hal_mcu_delay_us(1); - while (!gpio_get_level(self->data_pin) && us) { - --us; - common_hal_mcu_delay_us(1); - } - return us; -} - -static void data_lo(ps2io_ps2_obj_t* self) { - gpio_pullup_dis(self->data_pin); - gpio_set_direction(self->data_pin, GPIO_MODE_OUTPUT); - gpio_set_level(self->data_pin, 0); -} - -static void idle(ps2io_ps2_obj_t* self) { - clk_hi(self); - data_hi(self); -} - -static void inhibit(ps2io_ps2_obj_t* self) { - clk_lo(self); - data_hi(self); +void ps2_reset(void) { + gpio_uninstall_isr_service(); } static void delay_us(uint32_t t) { common_hal_mcu_delay_us(t); } +/* interrupt handling */ + static void IRAM_ATTR ps2_interrupt_handler(void *self_in) { // Grab the current time first. uint64_t current_tick = port_get_raw_ticks(NULL); @@ -222,11 +135,99 @@ static void IRAM_ATTR ps2_interrupt_handler(void *self_in) { } } -void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t* self, - const mcu_pin_obj_t* data_pin, const mcu_pin_obj_t* clk_pin) { +static void enable_interrupt(ps2io_ps2_obj_t* self) { + // turn on falling edge interrupt + gpio_install_isr_service(ESP_INTR_FLAG_IRAM); + gpio_set_intr_type(self->clk_pin, GPIO_INTR_NEGEDGE); + gpio_isr_handler_add(self->clk_pin, ps2_interrupt_handler, (void*)self); +} + +static void disable_interrupt(ps2io_ps2_obj_t* self) { + // turn off fallling edge interrupt + gpio_isr_handler_remove(self->clk_pin); +} + +static void resume_interrupt(ps2io_ps2_obj_t* self) { + self->state = STATE_IDLE; + gpio_isr_handler_add(self->clk_pin, ps2_interrupt_handler, (void*)self); +} + +/* gpio handling */ + +static void clk_hi(ps2io_ps2_obj_t* self) { + // external pull-up + gpio_set_direction(self->clk_pin, GPIO_MODE_INPUT); +} + +static bool wait_clk_lo(ps2io_ps2_obj_t* self, uint32_t us) { + clk_hi(self); + delay_us(1); + while (gpio_get_level(self->clk_pin) && us) { + --us; + delay_us(1); + } + return us; +} + +static bool wait_clk_hi(ps2io_ps2_obj_t* self, uint32_t us) { + clk_hi(self); + delay_us(1); + while (!gpio_get_level(self->clk_pin) && us) { + --us; + delay_us(1); + } + return us; +} + +static void clk_lo(ps2io_ps2_obj_t* self) { + gpio_set_direction(self->clk_pin, GPIO_MODE_OUTPUT); + gpio_set_level(self->clk_pin, 0); +} + +static void data_hi(ps2io_ps2_obj_t* self) { + // external pull-up + gpio_set_direction(self->data_pin, GPIO_MODE_INPUT); +} + +static bool wait_data_lo(ps2io_ps2_obj_t* self, uint32_t us) { + data_hi(self); + delay_us(1); + while (gpio_get_level(self->data_pin) && us) { + --us; + delay_us(1); + } + return us; +} + +static bool wait_data_hi(ps2io_ps2_obj_t* self, uint32_t us) { + data_hi(self); + delay_us(1); + while (!gpio_get_level(self->data_pin) && us) { + --us; + delay_us(1); + } + return us; +} + +static void data_lo(ps2io_ps2_obj_t* self) { + gpio_set_direction(self->data_pin, GPIO_MODE_OUTPUT); + gpio_set_level(self->data_pin, 0); +} + +static void idle(ps2io_ps2_obj_t* self) { clk_hi(self); data_hi(self); +} +static void inhibit(ps2io_ps2_obj_t* self) { + clk_lo(self); + data_hi(self); +} + +/* ps2io module functions */ + +void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t* self, + const mcu_pin_obj_t* data_pin, const mcu_pin_obj_t* clk_pin) { self->clk_pin = (gpio_num_t)clk_pin->number; self->data_pin = (gpio_num_t)data_pin->number; self->state = STATE_IDLE; @@ -235,11 +236,11 @@ void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t* self, self->bufposw = 0; self->waiting_cmd_response = false; + idle(self); + enable_interrupt(self); + claim_pin(clk_pin); claim_pin(data_pin); - - // set config will enable the interrupt. - ps2_set_config(self); } bool common_hal_ps2io_ps2_deinited(ps2io_ps2_obj_t* self) { @@ -257,10 +258,6 @@ void common_hal_ps2io_ps2_deinit(ps2io_ps2_obj_t* self) { self->data_pin = GPIO_NUM_MAX; } -void ps2_reset(void) { - gpio_uninstall_isr_service(); -} - uint16_t common_hal_ps2io_ps2_get_len(ps2io_ps2_obj_t* self) { return self->bufcount; } @@ -291,6 +288,8 @@ uint16_t common_hal_ps2io_ps2_clear_errors(ps2io_ps2_obj_t* self) { int16_t common_hal_ps2io_ps2_sendcmd(ps2io_ps2_obj_t* self, uint8_t b) { disable_interrupt(self); + + /* terminate a transmission if we have */ inhibit(self); delay_us(100); @@ -321,6 +320,7 @@ int16_t common_hal_ps2io_ps2_sendcmd(ps2io_ps2_obj_t* self, uint8_t b) { } } + /* Parity bit */ delay_us(15); if (parity) { data_hi(self); From 331aa6e59fd36b52afb4119068d0baa99c85ea3c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Nov 2020 11:43:18 -0600 Subject: [PATCH 18/64] displayio: When the display is tall, move blinka above the text This makes a more useful display on the portrait magtag, allowing 21 characters across instead of just 18. There are 20 full rows of text, instead of 21. The total number of characters increases slightly from 378 to 420. For comparison, the Commodore VIC 20 had 22 rows of 23 characters for a total of 506 characters. :-P --- supervisor/shared/display.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index afb3f3a9a6..a9ae258842 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -60,18 +60,21 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { #if CIRCUITPY_TERMINALIO displayio_tilegrid_t* grid = &supervisor_terminal_text_grid; - uint16_t width_in_tiles = (width_px - blinka_bitmap.width) / grid->tile_width; + bool tall = height_px > width_px; + uint16_t terminal_width_px = tall ? width_px : width_px - blinka_bitmap.width; + uint16_t terminal_height_px = tall ? height_px - blinka_bitmap.height : height_px ; + uint16_t width_in_tiles = terminal_width_px / grid->tile_width; // determine scale based on h if (width_in_tiles < 80) { scale = 1; } - width_in_tiles = (width_px - blinka_bitmap.width * scale) / (grid->tile_width * scale); + width_in_tiles = terminal_width_px / (grid->tile_width * scale); if (width_in_tiles < 1) { width_in_tiles = 1; } - uint16_t height_in_tiles = height_px / (grid->tile_height * scale); - uint16_t remaining_pixels = height_px % (grid->tile_height * scale); + uint16_t height_in_tiles = terminal_height_px / (grid->tile_height * scale); + uint16_t remaining_pixels = tall ? 0 : terminal_height_px % (grid->tile_height * scale); if (height_in_tiles < 1 || remaining_pixels > 0) { height_in_tiles += 1; } @@ -91,7 +94,8 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { if (tiles == NULL) { return; } - grid->y = 0; + grid->y = tall ? blinka_bitmap.height : 0; + grid->x = tall ? 0 : blinka_bitmap.width; grid->top_left_y = 0; if (remaining_pixels > 0) { grid->y -= (grid->tile_height - remaining_pixels); From bc9036f35370fcd0e4806c42dd47a8c6bb42a085 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Fri, 20 Nov 2020 00:15:30 +0530 Subject: [PATCH 19/64] use pointer to get nvs handle --- ports/esp32s2/common-hal/nvm/ByteArray.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ports/esp32s2/common-hal/nvm/ByteArray.c b/ports/esp32s2/common-hal/nvm/ByteArray.c index d90f7fbdc2..9f8ced3ec5 100644 --- a/ports/esp32s2/common-hal/nvm/ByteArray.c +++ b/ports/esp32s2/common-hal/nvm/ByteArray.c @@ -27,14 +27,13 @@ #include "common-hal/nvm/ByteArray.h" #include "py/runtime.h" - #include "nvs_flash.h" uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { return self->len; } -static nvs_handle get_nvs_handle(void) { +static void get_nvs_handle(nvs_handle_t * nvs_handle) { // Initialize NVS esp_err_t err = nvs_flash_init(); if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) { @@ -46,32 +45,31 @@ static nvs_handle get_nvs_handle(void) { ESP_ERROR_CHECK(err); // Open NVS handle - nvs_handle nvs_handle; - if (nvs_open("CPY", NVS_READWRITE, &nvs_handle) != ESP_OK) { + if (nvs_open("CPY", NVS_READWRITE, nvs_handle) != ESP_OK) { mp_raise_RuntimeError(translate("NVS Error")); } - return nvs_handle; } bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint8_t* values, uint32_t len) { char index[9]; - sprintf(index, "%i", start_index - CIRCUITPY_INTERNAL_NVM_START_ADDR); + sprintf(index, "%i", start_index); // start nvs - nvs_handle handle = get_nvs_handle(); + nvs_handle_t handle; + get_nvs_handle(&handle); bool status = ((nvs_set_u8(handle, (const char *)index, *values) == ESP_OK) && (nvs_commit(handle) == ESP_OK)); // close nvs nvs_close(handle); return status; } -// NVM memory is memory mapped so reading it is easy. void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint32_t len, uint8_t* values) { char index[9]; - sprintf(index, "%i", start_index - CIRCUITPY_INTERNAL_NVM_START_ADDR); + sprintf(index, "%i", start_index); // start nvs - nvs_handle handle = get_nvs_handle(); + nvs_handle_t handle; + get_nvs_handle(&handle); if (nvs_get_u8(handle, (const char *)index, values) != ESP_OK) { mp_raise_RuntimeError(translate("NVS Error")); } From a25b27520d077424219832d764e9e59da6759562 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Fri, 20 Nov 2020 00:22:00 +0530 Subject: [PATCH 20/64] update nvm implementation --- ports/esp32s2/common-hal/nvm/ByteArray.c | 40 ++++++++++++++++++++---- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/ports/esp32s2/common-hal/nvm/ByteArray.c b/ports/esp32s2/common-hal/nvm/ByteArray.c index 9f8ced3ec5..e304dd8302 100644 --- a/ports/esp32s2/common-hal/nvm/ByteArray.c +++ b/ports/esp32s2/common-hal/nvm/ByteArray.c @@ -26,6 +26,8 @@ #include "common-hal/nvm/ByteArray.h" +#include + #include "py/runtime.h" #include "nvs_flash.h" @@ -53,26 +55,52 @@ static void get_nvs_handle(nvs_handle_t * nvs_handle) { bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint8_t* values, uint32_t len) { char index[9]; - sprintf(index, "%i", start_index); + + uint8_t buffer[len]; + memcpy(buffer, values, len); + // start nvs nvs_handle_t handle; get_nvs_handle(&handle); - bool status = ((nvs_set_u8(handle, (const char *)index, *values) == ESP_OK) && (nvs_commit(handle) == ESP_OK)); + + // stage flash changes + for (uint32_t i = 0; i < len; i++) { + sprintf(index, "%i", start_index + i); + if (nvs_set_u8(handle, (const char *)index, buffer[i]) != ESP_OK) { + return false; + } + } + + // commit flash changes + if (nvs_commit(handle) != ESP_OK) { + return false; + } + // close nvs nvs_close(handle); - return status; + return true; } void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint32_t len, uint8_t* values) { char index[9]; - sprintf(index, "%i", start_index); + uint8_t buffer[len]; + // start nvs nvs_handle_t handle; get_nvs_handle(&handle); - if (nvs_get_u8(handle, (const char *)index, values) != ESP_OK) { - mp_raise_RuntimeError(translate("NVS Error")); + + // get from flash + for (uint32_t i = 0; i < len; i++) { + sprintf(index, "%i", start_index + i); + if (nvs_get_u8(handle, (const char *)index, &buffer[i]) != ESP_OK) { + mp_raise_RuntimeError(translate("NVS Error")); + } } + + // set into values + memcpy(values, buffer, len); + // close nvs nvs_close(handle); } From 0556f9f851f0bd5fdb392b925af1076affbf5e00 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Nov 2020 15:12:56 -0600 Subject: [PATCH 21/64] Revert "samd21: Enable terse error reporting on resource constrained chip family" This reverts commit 9a642fc0490c22b60460bcca8dec3b0b93344d81. --- ports/atmel-samd/mpconfigport.h | 1 - py/circuitpy_mpconfig.h | 2 -- 2 files changed, 3 deletions(-) diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 3069def33b..ed10da9b9d 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -42,7 +42,6 @@ #define CIRCUITPY_MCU_FAMILY samd21 #define MICROPY_PY_SYS_PLATFORM "Atmel SAMD21" #define SPI_FLASH_MAX_BAUDRATE 8000000 -#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE) #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0) #define MICROPY_PY_FUNCTION_ATTRS (0) // MICROPY_PY_UJSON depends on MICROPY_PY_IO diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 4c2e33be01..85e152670a 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -64,9 +64,7 @@ #define MICROPY_ENABLE_FINALISER (1) #define MICROPY_ENABLE_GC (1) #define MICROPY_ENABLE_SOURCE_LINE (1) -#ifndef MICROPY_ERROR_REPORTING #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL) -#endif #define MICROPY_FLOAT_HIGH_QUALITY_HASH (0) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) #define MICROPY_GC_ALLOC_THRESHOLD (0) From d5f6748d1bea832c6f483ca8b0095e776eaca2df Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Nov 2020 16:12:53 -0600 Subject: [PATCH 22/64] Use mp_raise instead of nlr_raise(new_exception) where possible This saves a bit of code space --- extmod/machine_mem.c | 2 +- extmod/moduheapq.c | 2 +- extmod/vfs_posix_file.c | 2 +- py/bc.c | 4 ++-- py/objstr.c | 6 ++---- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/extmod/machine_mem.c b/extmod/machine_mem.c index 6c6e110631..8944c3a666 100644 --- a/extmod/machine_mem.c +++ b/extmod/machine_mem.c @@ -21,7 +21,7 @@ STATIC uintptr_t machine_mem_get_addr(mp_obj_t addr_o, uint align) { uintptr_t addr = mp_obj_int_get_truncated(addr_o); if ((addr & (align - 1)) != 0) { - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, translate("address %08x is not aligned to %d bytes"), addr, align)); + mp_raise_ValueError_varg(translate("address %08x is not aligned to %d bytes"), addr, align); } return addr; } diff --git a/extmod/moduheapq.c b/extmod/moduheapq.c index bc4b97ff5b..50fe6c0513 100644 --- a/extmod/moduheapq.c +++ b/extmod/moduheapq.c @@ -62,7 +62,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_uheapq_heappush_obj, mod_uheapq_heappush); STATIC mp_obj_t mod_uheapq_heappop(mp_obj_t heap_in) { mp_obj_list_t *heap = get_heap(heap_in); if (heap->len == 0) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_IndexError, translate("empty heap"))); + mp_raise_IndexError(translate("empty heap")); } mp_obj_t item = heap->items[0]; heap->len -= 1; diff --git a/extmod/vfs_posix_file.c b/extmod/vfs_posix_file.c index 3f887785e7..593b8d6a29 100644 --- a/extmod/vfs_posix_file.c +++ b/extmod/vfs_posix_file.c @@ -24,7 +24,7 @@ typedef struct _mp_obj_vfs_posix_file_t { #ifdef MICROPY_CPYTHON_COMPAT STATIC void check_fd_is_open(const mp_obj_vfs_posix_file_t *o) { if (o->fd < 0) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, translate("I/O operation on closed file"))); + mp_raise_ValueError(translate("I/O operation on closed file")); } } #else diff --git a/py/bc.c b/py/bc.c index 6406713385..01131cb4c0 100644 --- a/py/bc.c +++ b/py/bc.c @@ -214,8 +214,8 @@ void mp_setup_code_state(mp_code_state_t *code_state, size_t n_args, size_t n_kw #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("unexpected keyword argument")); #else - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, - translate("unexpected keyword argument '%q'"), MP_OBJ_QSTR_VALUE(wanted_arg_name))); + mp_raise_TypeError_varg( + translate("unexpected keyword argument '%q'"), MP_OBJ_QSTR_VALUE(wanted_arg_name)); #endif } mp_obj_dict_store(dict, kwargs[2 * i], kwargs[2 * i + 1]); diff --git a/py/objstr.c b/py/objstr.c index edb562df27..6a03f5fc3e 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -2134,10 +2134,8 @@ STATIC NORETURN void bad_implicit_conversion(mp_obj_t self_in) { mp_raise_TypeError(translate("can't convert to str implicitly")); } else { const qstr src_name = mp_obj_get_type_qstr(self_in); - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, - translate("can't convert '%q' object to %q implicitly"), - src_name, src_name == MP_QSTR_str ? MP_QSTR_bytes : MP_QSTR_str)); - } + mp_raise_TypeError_varg(translate("can't convert '%q' object to %q implicitly"), + src_name, src_name == MP_QSTR_str ? MP_QSTR_bytes : MP_QSTR_str); } // use this if you will anyway convert the string to a qstr From c06fc8e02dc7c17e827e3fe736dc7226d7819452 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Nov 2020 16:13:54 -0600 Subject: [PATCH 23/64] Introduce, use mp_raise_arg1 This raises an exception with a given object value. Saves a bit of code size. --- extmod/modure.c | 6 +++--- extmod/moduzlib.c | 2 +- ports/unix/modjni.c | 4 ++-- py/modsys.c | 2 +- py/objdict.c | 6 +++--- py/objset.c | 2 +- py/objstr.c | 2 +- py/pystack.c | 4 ++-- py/runtime.c | 8 ++++++-- py/runtime.h | 1 + 10 files changed, 21 insertions(+), 16 deletions(-) diff --git a/extmod/modure.c b/extmod/modure.c index a20f3ee429..bb54bc732f 100644 --- a/extmod/modure.c +++ b/extmod/modure.c @@ -43,7 +43,7 @@ STATIC mp_obj_t match_group(mp_obj_t self_in, mp_obj_t no_in) { mp_obj_match_t *self = MP_OBJ_TO_PTR(self_in); mp_int_t no = mp_obj_get_int(no_in); if (no < 0 || no >= self->num_matches) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_IndexError, no_in)); + mp_raise_arg1(&mp_type_IndexError, no_in); } const char *start = self->caps[no * 2]; @@ -82,7 +82,7 @@ STATIC void match_span_helper(size_t n_args, const mp_obj_t *args, mp_obj_t span if (n_args == 2) { no = mp_obj_get_int(args[1]); if (no < 0 || no >= self->num_matches) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_IndexError, args[1])); + mp_raise_arg1(&mp_type_IndexError, args[1]); } } @@ -326,7 +326,7 @@ STATIC mp_obj_t re_sub_helper(mp_obj_t self_in, size_t n_args, const mp_obj_t *a } if (match_no >= (unsigned int)match->num_matches) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_IndexError, MP_OBJ_NEW_SMALL_INT(match_no))); + mp_raise_arg1(&mp_type_IndexError, MP_OBJ_NEW_SMALL_INT(match_no)); } const char *start_match = match->caps[match_no * 2]; diff --git a/extmod/moduzlib.c b/extmod/moduzlib.c index 8422e75983..b344f96429 100644 --- a/extmod/moduzlib.c +++ b/extmod/moduzlib.c @@ -179,7 +179,7 @@ STATIC mp_obj_t mod_uzlib_decompress(size_t n_args, const mp_obj_t *args) { return res; error: - nlr_raise(mp_obj_new_exception_arg1(&mp_type_ValueError, MP_OBJ_NEW_SMALL_INT(st))); + mp_raise_arg1(&mp_type_ValueError, MP_OBJ_NEW_SMALL_INT(st)); } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_uzlib_decompress_obj, 1, 3, mod_uzlib_decompress); diff --git a/ports/unix/modjni.c b/ports/unix/modjni.c index 8ec5ae54d9..82d1ccd559 100644 --- a/ports/unix/modjni.c +++ b/ports/unix/modjni.c @@ -102,9 +102,9 @@ STATIC void check_exception(void) { mp_obj_t py_e = new_jobject(exc); JJ1(ExceptionClear); if (JJ(IsInstanceOf, exc, IndexException_class)) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_IndexError, py_e)); + mp_raise_arg1(&mp_type_IndexError, py_e); } - nlr_raise(mp_obj_new_exception_arg1(&mp_type_Exception, py_e)); + mp_raise_arg1(&mp_type_Exception, py_e); } } diff --git a/py/modsys.c b/py/modsys.c index a1d2cf831c..31f28a36fa 100644 --- a/py/modsys.c +++ b/py/modsys.c @@ -96,7 +96,7 @@ STATIC mp_obj_t mp_sys_exit(size_t n_args, const mp_obj_t *args) { if (n_args == 0) { exc = mp_obj_new_exception(&mp_type_SystemExit); } else { - exc = mp_obj_new_exception_arg1(&mp_type_SystemExit, args[0]); + mp_raise_arg1(&mp_type_SystemExit, args[0]); } nlr_raise(exc); } diff --git a/py/objdict.c b/py/objdict.c index 63fd86f357..098aec5d2f 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -169,7 +169,7 @@ mp_obj_t mp_obj_dict_get(mp_obj_t self_in, mp_obj_t index) { mp_obj_dict_t *self = MP_OBJ_TO_PTR(self_in); mp_map_elem_t *elem = mp_map_lookup(&self->map, index, MP_MAP_LOOKUP); if (elem == NULL) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_KeyError, index)); + mp_raise_arg1(&mp_type_KeyError, index); } else { return elem->value; } @@ -185,7 +185,7 @@ STATIC mp_obj_t dict_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { mp_obj_dict_t *self = MP_OBJ_TO_PTR(self_in); mp_map_elem_t *elem = mp_map_lookup(&self->map, index, MP_MAP_LOOKUP); if (elem == NULL) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_KeyError, index)); + mp_raise_arg1(&mp_type_KeyError, index); } else { return elem->value; } @@ -272,7 +272,7 @@ STATIC mp_obj_t dict_get_helper(size_t n_args, const mp_obj_t *args, mp_map_look if (elem == NULL || elem->value == MP_OBJ_NULL) { if (n_args == 2) { if (lookup_kind == MP_MAP_LOOKUP_REMOVE_IF_FOUND) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_KeyError, args[1])); + mp_raise_arg1(&mp_type_KeyError, args[1]); } else { value = mp_const_none; } diff --git a/py/objset.c b/py/objset.c index 45b5c12606..c5d54aede5 100644 --- a/py/objset.c +++ b/py/objset.c @@ -378,7 +378,7 @@ STATIC mp_obj_t set_remove(mp_obj_t self_in, mp_obj_t item) { check_set(self_in); mp_obj_set_t *self = MP_OBJ_TO_PTR(self_in); if (mp_set_lookup(&self->set, item, MP_MAP_LOOKUP_REMOVE_IF_FOUND) == MP_OBJ_NULL) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_KeyError, item)); + mp_raise_arg1(&mp_type_KeyError, item); } return mp_const_none; } diff --git a/py/objstr.c b/py/objstr.c index 6a03f5fc3e..34ccab86d6 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -1087,7 +1087,7 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar field_name = lookup; mp_map_elem_t *key_elem = mp_map_lookup(kwargs, field_q, MP_MAP_LOOKUP); if (key_elem == NULL) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_KeyError, field_q)); + mp_raise_arg1(&mp_type_KeyError, field_q); } arg = key_elem->value; } diff --git a/py/pystack.c b/py/pystack.c index f79ea92101..0def75b109 100644 --- a/py/pystack.c +++ b/py/pystack.c @@ -43,8 +43,8 @@ void *mp_pystack_alloc(size_t n_bytes) { #endif if (MP_STATE_THREAD(pystack_cur) + n_bytes > MP_STATE_THREAD(pystack_end)) { // out of memory in the pystack - nlr_raise(mp_obj_new_exception_arg1(&mp_type_RuntimeError, - MP_OBJ_NEW_QSTR(MP_QSTR_pystack_space_exhausted))); + mp_raise_arg1(&mp_type_RuntimeError, + MP_OBJ_NEW_QSTR(MP_QSTR_pystack_space_exhausted)); } void *ptr = MP_STATE_THREAD(pystack_cur); MP_STATE_THREAD(pystack_cur) += n_bytes; diff --git a/py/runtime.c b/py/runtime.c index e63e2337d9..3745e16e30 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -1514,6 +1514,10 @@ NORETURN void m_malloc_fail(size_t num_bytes) { translate("memory allocation failed, allocating %u bytes"), (uint)num_bytes); } +NORETURN void mp_raise_arg1(const mp_obj_type_t *exc_type, mp_obj_t arg) { + nlr_raise(mp_obj_new_exception_arg1(exc_type, arg)); +} + NORETURN void mp_raise_msg(const mp_obj_type_t *exc_type, const compressed_string_t *msg) { if (msg == NULL) { nlr_raise(mp_obj_new_exception(exc_type)); @@ -1580,7 +1584,7 @@ NORETURN void mp_raise_TypeError_varg(const compressed_string_t *fmt, ...) { } NORETURN void mp_raise_OSError(int errno_) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(errno_))); + mp_raise_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(errno_)); } NORETURN void mp_raise_OSError_msg(const compressed_string_t *msg) { @@ -1607,7 +1611,7 @@ NORETURN void mp_raise_ConnectionError(const compressed_string_t *msg) { } NORETURN void mp_raise_BrokenPipeError(void) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_BrokenPipeError, MP_OBJ_NEW_SMALL_INT(MP_EPIPE))); + mp_raise_arg1(&mp_type_BrokenPipeError, MP_OBJ_NEW_SMALL_INT(MP_EPIPE)); } NORETURN void mp_raise_NotImplementedError(const compressed_string_t *msg) { diff --git a/py/runtime.h b/py/runtime.h index ad7d0feaba..5e8fda35c1 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -150,6 +150,7 @@ mp_obj_t mp_import_name(qstr name, mp_obj_t fromlist, mp_obj_t level); mp_obj_t mp_import_from(mp_obj_t module, qstr name); void mp_import_all(mp_obj_t module); +NORETURN void mp_raise_arg1(const mp_obj_type_t *exc_type, mp_obj_t arg); NORETURN void mp_raise_msg(const mp_obj_type_t *exc_type, const compressed_string_t *msg); NORETURN void mp_raise_msg_varg(const mp_obj_type_t *exc_type, const compressed_string_t *fmt, ...); NORETURN void mp_raise_msg_vlist(const mp_obj_type_t *exc_type, const compressed_string_t *fmt, va_list argptr); From b2b8520880e9d458adbd279a34b831f8d6b68d40 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Nov 2020 16:18:52 -0600 Subject: [PATCH 24/64] Always use preprocessor for MICROPY_ERROR_REPORTING This ensures that only the translate("") alternative that will be used is seen after preprocessing. Improves the quality of the Huffman encoding and reduces binary size slightly. Also makes one "enhanced" error message only occur when ERROR_REPORTING_DETAILED: Instead of the word-for-word python3 error message "Type object has no attribute '%q'", the message will be "'type' object has no attribute '%q'". Also reduces binary size. (that's rolled into this commit as it was right next to a change to use the preprocessor for MICROPY_ERROR_REPORTING) Note that the odd semicolon after "value_error:" in parsenum.c is necessary due to a detail of the C grammar, in which a declaration cannot follow a label directly. --- py/argcheck.c | 18 ++++---- py/builtinimport.c | 12 +++--- py/compile.c | 12 +++--- py/modbuiltins.c | 6 +-- py/modsys.c | 4 +- py/obj.c | 66 ++++++++++++++-------------- py/objnamedtuple.c | 20 ++++----- py/objstr.c | 105 +++++++++++++++++++++++---------------------- py/objtype.c | 24 +++++------ py/parsenum.c | 10 ++--- py/runtime.c | 76 ++++++++++++++++---------------- 11 files changed, 178 insertions(+), 175 deletions(-) diff --git a/py/argcheck.c b/py/argcheck.c index 9341c02a6c..af5c81bf37 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -99,12 +99,12 @@ void mp_arg_parse_all(size_t n_pos, const mp_obj_t *pos, mp_map_t *kws, size_t n mp_map_elem_t *kw = mp_map_lookup(kws, MP_OBJ_NEW_QSTR(allowed[i].qst), MP_MAP_LOOKUP); if (kw == NULL) { if (allowed[i].flags & MP_ARG_REQUIRED) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_arg_error_terse_mismatch(); - } else { + #else mp_raise_TypeError_varg( translate("'%q' argument required"), allowed[i].qst); - } + #endif } out_vals[i] = allowed[i].defval; continue; @@ -124,20 +124,20 @@ void mp_arg_parse_all(size_t n_pos, const mp_obj_t *pos, mp_map_t *kws, size_t n } if (pos_found < n_pos) { extra_positional: - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_arg_error_terse_mismatch(); - } else { + #else // TODO better error message mp_raise_TypeError(translate("extra positional arguments given")); - } + #endif } if (kws_found < kws->used) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_arg_error_terse_mismatch(); - } else { + #else // TODO better error message mp_raise_TypeError(translate("extra keyword arguments given")); - } + #endif } } diff --git a/py/builtinimport.c b/py/builtinimport.c index 47ffab5196..c4768cc777 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -426,12 +426,12 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) { mp_module_call_init(mod_name, module_obj); } else { // couldn't find the file, so fail - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_ImportError(translate("module not found")); - } else { + #else mp_raise_msg_varg(&mp_type_ImportError, translate("no module named '%q'"), mod_name); - } + #endif } } else { // found the file, so get the module @@ -538,12 +538,12 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) { #endif // Couldn't find the module, so fail - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_msg(&mp_type_ImportError, translate("module not found")); - } else { + #else nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ImportError, translate("no module named '%q'"), module_name_qstr)); - } + #endif } #endif // MICROPY_ENABLE_EXTERNAL_IMPORT diff --git a/py/compile.c b/py/compile.c index 04bcf5bc14..b4d81ed445 100644 --- a/py/compile.c +++ b/py/compile.c @@ -2486,21 +2486,21 @@ STATIC void compile_atom_brace(compiler_t *comp, mp_parse_node_struct_t *pns) { compile_node(comp, pn_i); if (is_dict) { if (!is_key_value) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE compile_syntax_error(comp, (mp_parse_node_t)pns, translate("invalid syntax")); - } else { + #else compile_syntax_error(comp, (mp_parse_node_t)pns, translate("expecting key:value for dict")); - } + #endif return; } EMIT(store_map); } else { if (is_key_value) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE compile_syntax_error(comp, (mp_parse_node_t)pns, translate("invalid syntax")); - } else { + #else compile_syntax_error(comp, (mp_parse_node_t)pns, translate("expecting just a value for set")); - } + #endif return; } } diff --git a/py/modbuiltins.c b/py/modbuiltins.c index 41e1d4e488..fe3c366eec 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -346,12 +346,12 @@ STATIC mp_obj_t mp_builtin_ord(mp_obj_t o_in) { } } - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("ord expects a character")); - } else { + #else mp_raise_TypeError_varg( translate("ord() expected a character, but string of length %d found"), (int)len); - } + #endif } MP_DEFINE_CONST_FUN_OBJ_1(mp_builtin_ord_obj, mp_builtin_ord); diff --git a/py/modsys.c b/py/modsys.c index 31f28a36fa..81628683d8 100644 --- a/py/modsys.c +++ b/py/modsys.c @@ -92,13 +92,11 @@ STATIC const MP_DEFINE_STR_OBJ(platform_obj, MICROPY_PY_SYS_PLATFORM); // exit([retval]): raise SystemExit, with optional argument given to the exception STATIC mp_obj_t mp_sys_exit(size_t n_args, const mp_obj_t *args) { - mp_obj_t exc; if (n_args == 0) { - exc = mp_obj_new_exception(&mp_type_SystemExit); + nlr_raise(mp_obj_new_exception(&mp_type_SystemExit)); } else { mp_raise_arg1(&mp_type_SystemExit, args[0]); } - nlr_raise(exc); } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_sys_exit_obj, 0, 1, mp_sys_exit); diff --git a/py/obj.c b/py/obj.c index 315e816e0b..d8e34746ca 100644 --- a/py/obj.c +++ b/py/obj.c @@ -262,12 +262,12 @@ mp_int_t mp_obj_get_int(mp_const_obj_t arg) { } else if (MP_OBJ_IS_TYPE(arg, &mp_type_int)) { return mp_obj_int_get_checked(arg); } else { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError_varg(translate("can't convert to %q"), MP_QSTR_int); - } else { + #else mp_raise_TypeError_varg( translate("can't convert %q to %q"), mp_obj_get_type_qstr(arg), MP_QSTR_int); - } + #endif } } @@ -325,12 +325,12 @@ mp_float_t mp_obj_get_float(mp_obj_t arg) { mp_float_t val; if (!mp_obj_get_float_maybe(arg, &val)) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError_varg(translate("can't convert to %q"), MP_QSTR_float); - } else { + #else mp_raise_TypeError_varg( translate("can't convert %q to %q"), mp_obj_get_type_qstr(arg), MP_QSTR_float); - } + #endif } return val; @@ -358,12 +358,12 @@ void mp_obj_get_complex(mp_obj_t arg, mp_float_t *real, mp_float_t *imag) { } else if (MP_OBJ_IS_TYPE(arg, &mp_type_complex)) { mp_obj_complex_get(arg, real, imag); } else { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError_varg(translate("can't convert to %q"), MP_QSTR_complex); - } else { + #else mp_raise_TypeError_varg( translate("can't convert %q to %q"), mp_obj_get_type_qstr(arg), MP_QSTR_complex); - } + #endif } } #endif @@ -376,12 +376,12 @@ void mp_obj_get_array(mp_obj_t o, size_t *len, mp_obj_t **items) { } else if (MP_OBJ_IS_TYPE(o, &mp_type_list)) { mp_obj_list_get(o, len, items); } else { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("expected tuple/list")); - } else { + #else mp_raise_TypeError_varg( translate("object '%q' is not a tuple or list"), mp_obj_get_type_qstr(o)); - } + #endif } } @@ -390,12 +390,12 @@ void mp_obj_get_array_fixed_n(mp_obj_t o, size_t len, mp_obj_t **items) { size_t seq_len; mp_obj_get_array(o, &seq_len, items); if (seq_len != len) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_ValueError(translate("tuple/list has wrong length")); - } else { + #else mp_raise_ValueError_varg(translate("requested length %d but object has length %d"), (int)len, (int)seq_len); - } + #endif } } @@ -405,13 +405,13 @@ size_t mp_get_index(const mp_obj_type_t *type, size_t len, mp_obj_t index, bool if (MP_OBJ_IS_SMALL_INT(index)) { i = MP_OBJ_SMALL_INT_VALUE(index); } else if (!mp_obj_get_int_maybe(index, &i)) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("indices must be integers")); - } else { + #else mp_raise_TypeError_varg( translate("%q indices must be integers, not %q"), type->name, mp_obj_get_type_qstr(index)); - } + #endif } if (i < 0) { @@ -425,12 +425,12 @@ size_t mp_get_index(const mp_obj_type_t *type, size_t len, mp_obj_t index, bool } } else { if (i < 0 || (mp_uint_t)i >= len) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_IndexError(translate("index out of range")); - } else { + #else mp_raise_msg_varg(&mp_type_IndexError, translate("%q index out of range"), type->name); - } + #endif } } @@ -460,12 +460,12 @@ mp_obj_t mp_obj_id(mp_obj_t o_in) { mp_obj_t mp_obj_len(mp_obj_t o_in) { mp_obj_t len = mp_obj_len_maybe(o_in); if (len == MP_OBJ_NULL) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("object has no len")); - } else { + #else mp_raise_TypeError_varg( translate("object of type '%q' has no len()"), mp_obj_get_type_qstr(o_in)); - } + #endif } else { return len; } @@ -503,26 +503,26 @@ mp_obj_t mp_obj_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t value) { } } if (value == MP_OBJ_NULL) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("object does not support item deletion")); - } else { + #else mp_raise_TypeError_varg( translate("'%q' object does not support item deletion"), mp_obj_get_type_qstr(base)); - } + #endif } else if (value == MP_OBJ_SENTINEL) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("object is not subscriptable")); - } else { + #else mp_raise_TypeError_varg( translate("'%q' object is not subscriptable"), mp_obj_get_type_qstr(base)); - } + #endif } else { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("object does not support item assignment")); - } else { + #else mp_raise_TypeError_varg( translate("'%q' object does not support item assignment"), mp_obj_get_type_qstr(base)); - } + #endif } } diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c index ab2f2f3c00..8b595da571 100644 --- a/py/objnamedtuple.c +++ b/py/objnamedtuple.c @@ -102,17 +102,17 @@ mp_obj_t namedtuple_make_new(const mp_obj_type_t *type_in, size_t n_args, const n_kw = kw_args->used; } if (n_args + n_kw != num_fields) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_arg_error_terse_mismatch(); - } else if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_NORMAL) { + #elif MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_NORMAL mp_raise_TypeError_varg( translate("function takes %d positional arguments but %d were given"), num_fields, n_args + n_kw); - } else if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_DETAILED) { + #else mp_raise_TypeError_varg( translate("%q() takes %d positional arguments but %d were given"), type->base.name, num_fields, n_args + n_kw); - } + #endif } // Create a tuple and set the type to this namedtuple @@ -128,20 +128,20 @@ mp_obj_t namedtuple_make_new(const mp_obj_type_t *type_in, size_t n_args, const qstr kw = mp_obj_str_get_qstr(kw_args->table[i].key); size_t id = mp_obj_namedtuple_find_field(type, kw); if (id == (size_t)-1) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_arg_error_terse_mismatch(); - } else { + #else mp_raise_TypeError_varg( translate("unexpected keyword argument '%q'"), kw); - } + #endif } if (tuple->items[id] != MP_OBJ_NULL) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_arg_error_terse_mismatch(); - } else { + #else mp_raise_TypeError_varg( translate("function got multiple values for argument '%q'"), kw); - } + #endif } tuple->items[id] = kw_args->table[i].value; } diff --git a/py/objstr.c b/py/objstr.c index 34ccab86d6..1a59aeaecd 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -971,11 +971,11 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar vstr_add_byte(&vstr, '}'); continue; } - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else { + #else mp_raise_ValueError(translate("single '}' encountered in format string")); - } + #endif } if (*str != '{') { vstr_add_byte(&vstr, *str); @@ -1010,18 +1010,18 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar if (str < top && (*str == 'r' || *str == 's')) { conversion = *str++; } else { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_NORMAL) { + #elif MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_NORMAL mp_raise_ValueError(translate("bad conversion specifier")); - } else { + #else if (str >= top) { mp_raise_ValueError( translate("end of format while looking for conversion specifier")); } else { mp_raise_ValueError_varg(translate("unknown conversion specifier %c"), *str); } - } + #endif } } @@ -1047,18 +1047,18 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar } } if (str >= top) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else { + #else mp_raise_ValueError(translate("unmatched '{' in format")); - } + #endif } if (*str != '}') { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { - terse_str_format_value_error(); - } else { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE +:w + #else mp_raise_ValueError(translate("expected ':' after format specifier")); - } + #endif } mp_obj_t arg = mp_const_none; @@ -1067,12 +1067,12 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar int index = 0; if (MP_LIKELY(unichar_isdigit(*field_name))) { if (*arg_i > 0) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else { + #else mp_raise_ValueError( translate("can't switch from automatic field numbering to manual field specification")); - } + #endif } field_name = str_to_int(field_name, field_name_top, &index); if ((uint)index >= n_args - 1) { @@ -1096,12 +1096,12 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar } } else { if (*arg_i < 0) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else { + #else mp_raise_ValueError( translate("can't switch from manual field specification to automatic field numbering")); - } + #endif } if ((uint)*arg_i >= n_args - 1) { mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_tuple); @@ -1189,11 +1189,11 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar type = *s++; } if (*s) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else { + #else mp_raise_ValueError(translate("invalid format specifier")); - } + #endif } vstr_clear(&format_spec_vstr); } @@ -1210,19 +1210,19 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar if (flags & (PF_FLAG_SHOW_SIGN | PF_FLAG_SPACE_SIGN)) { if (type == 's') { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else { + #else mp_raise_ValueError(translate("sign not allowed in string format specifier")); - } + #endif } if (type == 'c') { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else { + #else mp_raise_ValueError( translate("sign not allowed with integer format specifier 'c'")); - } + #endif } } @@ -1276,13 +1276,13 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar break; default: - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else { + #else mp_raise_ValueError_varg( translate("unknown format code '%c' for object of type '%q'"), type, mp_obj_get_type_qstr(arg)); - } + #endif } } @@ -1348,24 +1348,24 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar #endif default: - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else { + #else mp_raise_ValueError_varg( translate("unknown format code '%c' for object of type '%q'"), type, mp_obj_get_type_qstr(arg)); - } + #endif } } else { // arg doesn't look like a number if (align == '=') { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else { + #else mp_raise_ValueError( translate("'=' alignment not allowed in string format specifier")); - } + #endif } switch (type) { @@ -1384,13 +1384,13 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar } default: - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else { + #else mp_raise_ValueError_varg( translate("unknown format code '%c' for object of type '%q'"), type, mp_obj_get_type_qstr(arg)); - } + #endif } } } @@ -1442,11 +1442,11 @@ STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, size_t n_args, const mp_obj_ const byte *key = ++str; while (*str != ')') { if (str >= top) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else { + #else mp_raise_ValueError(translate("incomplete format key")); - } + #endif } ++str; } @@ -1500,11 +1500,11 @@ STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, size_t n_args, const mp_obj_ if (str >= top) { incomplete_format: - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else { + #else mp_raise_ValueError(translate("incomplete format")); - } + #endif } // Tuple value lookup @@ -1587,13 +1587,13 @@ not_enough_args: break; default: - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); - } else { + #else mp_raise_ValueError_varg( translate("unsupported format character '%c' (0x%x) at index %d"), *str, *str, str - start_str); - } + #endif } } @@ -2130,12 +2130,13 @@ bool mp_obj_str_equal(mp_obj_t s1, mp_obj_t s2) { } STATIC NORETURN void bad_implicit_conversion(mp_obj_t self_in) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("can't convert to str implicitly")); - } else { + #else const qstr src_name = mp_obj_get_type_qstr(self_in); mp_raise_TypeError_varg(translate("can't convert '%q' object to %q implicitly"), src_name, src_name == MP_QSTR_str ? MP_QSTR_bytes : MP_QSTR_str); + #endif } // use this if you will anyway convert the string to a qstr diff --git a/py/objtype.c b/py/objtype.c index ccd014c335..1254b015c9 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -373,12 +373,12 @@ mp_obj_t mp_obj_instance_make_new(const mp_obj_type_t *self, size_t n_args, cons m_del(mp_obj_t, args2, 2 + n_args + 2 * n_kw); } if (init_ret != mp_const_none) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("__init__() should return None")); - } else { + #else mp_raise_TypeError_varg(translate("__init__() should return None, not '%q'"), mp_obj_get_type_qstr(init_ret)); - } + #endif } } @@ -888,12 +888,12 @@ mp_obj_t mp_obj_instance_call(mp_obj_t self_in, size_t n_args, size_t n_kw, cons mp_obj_t member[2] = {MP_OBJ_NULL, MP_OBJ_NULL}; mp_obj_t call = mp_obj_instance_get_call(self_in, member); if (call == MP_OBJ_NULL) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("object not callable")); - } else { + #else mp_raise_TypeError_varg(translate("'%q' object is not callable"), mp_obj_get_type_qstr(self_in)); - } + #endif } mp_obj_instance_t *self = MP_OBJ_TO_PTR(self_in); if (call == MP_OBJ_SENTINEL) { @@ -1024,11 +1024,11 @@ STATIC mp_obj_t type_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp mp_obj_type_t *self = MP_OBJ_TO_PTR(self_in); if (self->make_new == NULL) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("cannot create instance")); - } else { + #else mp_raise_TypeError_varg(translate("cannot create '%q' instances"), self->name); - } + #endif } // create a map directly from the given args array and make a new instance @@ -1134,12 +1134,12 @@ mp_obj_t mp_obj_new_type(qstr name, mp_obj_t bases_tuple, mp_obj_t locals_dict) mp_obj_type_t *t = MP_OBJ_TO_PTR(bases_items[i]); // TODO: Verify with CPy, tested on function type if (t->make_new == NULL) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("type is not an acceptable base type")); - } else { + #else mp_raise_TypeError_varg( translate("type '%q' is not an acceptable base type"), t->name); - } + #endif } #if ENABLE_SPECIAL_ACCESSORS if (mp_obj_is_instance_type(t)) { diff --git a/py/parsenum.c b/py/parsenum.c index da63825e4b..a72829b203 100644 --- a/py/parsenum.c +++ b/py/parsenum.c @@ -145,16 +145,16 @@ overflow: goto have_ret_val; } -value_error: - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { +value_error: ; + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_obj_t exc = mp_obj_new_exception_msg(&mp_type_ValueError, translate("invalid syntax for integer")); raise_exc(exc, lex); - } else if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_NORMAL) { + #elif MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_NORMAL mp_obj_t exc = mp_obj_new_exception_msg_varg(&mp_type_ValueError, translate("invalid syntax for integer with base %d"), base); raise_exc(exc, lex); - } else { + #else vstr_t vstr; mp_print_t print; vstr_init_print(&vstr, 50, &print); @@ -163,7 +163,7 @@ value_error: mp_obj_t exc = mp_obj_new_exception_arg1(&mp_type_ValueError, mp_obj_new_str_from_vstr(&mp_type_str, &vstr)); raise_exc(exc, lex); - } + #endif } typedef enum { diff --git a/py/runtime.c b/py/runtime.c index 3745e16e30..a3acb954a6 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -177,12 +177,12 @@ mp_obj_t mp_load_global(qstr qst) { #endif elem = mp_map_lookup((mp_map_t*)&mp_module_builtins_globals.map, MP_OBJ_NEW_QSTR(qst), MP_MAP_LOOKUP); if (elem == NULL) { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_msg(&mp_type_NameError, translate("name not defined")); - } else { + #else nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_NameError, translate("name '%q' is not defined"), qst)); - } + #endif } } return elem->value; @@ -275,13 +275,13 @@ mp_obj_t mp_unary_op(mp_unary_op_t op, mp_obj_t arg) { return result; } } - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("unsupported type for operator")); - } else { + #else mp_raise_TypeError_varg( translate("unsupported type for %q: '%q'"), mp_unary_op_method_name[op], mp_obj_get_type_qstr(arg)); - } + #endif } } @@ -582,13 +582,13 @@ generic_binary_op: } unsupported_op: - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("unsupported type for operator")); - } else { + #else mp_raise_TypeError_varg( translate("unsupported types for %q: '%q', '%q'"), mp_binary_op_method_name[op], mp_obj_get_type_qstr(lhs), mp_obj_get_type_qstr(rhs)); - } + #endif zero_division: mp_raise_msg(&mp_type_ZeroDivisionError, translate("division by zero")); @@ -624,11 +624,11 @@ mp_obj_t mp_call_function_n_kw(mp_obj_t fun_in, size_t n_args, size_t n_kw, cons return type->call(fun_in, n_args, n_kw, args); } - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("object not callable")); - } else { + #else mp_raise_TypeError_varg(translate("'%q' object is not callable"), mp_obj_get_type_qstr(fun_in)); - } + #endif } // args contains: fun self/NULL arg(0) ... arg(n_args-2) arg(n_args-1) kw_key(0) kw_val(0) ... kw_key(n_kw-1) kw_val(n_kw-1) @@ -852,19 +852,19 @@ void mp_unpack_sequence(mp_obj_t seq_in, size_t num, mp_obj_t *items) { return; too_short: - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_ValueError(translate("wrong number of values to unpack")); - } else { + #else mp_raise_ValueError_varg(translate("need more than %d values to unpack"), (int)seq_len); - } + #endif too_long: - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_ValueError(translate("wrong number of values to unpack")); - } else { + #else mp_raise_ValueError_varg(translate("too many values to unpack (expected %d)"), (int)num); - } + #endif } // unpacked items are stored in reverse order into the array pointed to by items @@ -916,12 +916,12 @@ void mp_unpack_ex(mp_obj_t seq_in, size_t num_in, mp_obj_t *items) { return; too_short: - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_ValueError(translate("wrong number of values to unpack")); - } else { + #else mp_raise_ValueError_varg(translate("need more than %d values to unpack"), (int)seq_len); - } + #endif } mp_obj_t mp_load_attr(mp_obj_t base, qstr attr) { @@ -1094,9 +1094,9 @@ void mp_load_method(mp_obj_t base, qstr attr, mp_obj_t *dest) { if (dest[0] == MP_OBJ_NULL) { // no attribute/method called attr - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_AttributeError(translate("no such attribute")); - } else { + #elif MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_DETAILED // following CPython, we give a more detailed error message for type objects if (MP_OBJ_IS_TYPE(base, &mp_type_type)) { nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_AttributeError, @@ -1107,7 +1107,11 @@ void mp_load_method(mp_obj_t base, qstr attr, mp_obj_t *dest) { translate("'%q' object has no attribute '%q'"), mp_obj_get_type_qstr(base), attr)); } - } + #else + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_AttributeError, + translate("'%q' object has no attribute '%q'"), + mp_obj_get_type_qstr(base), attr)); + #endif } } @@ -1168,13 +1172,13 @@ void mp_store_attr(mp_obj_t base, qstr attr, mp_obj_t value) { } #endif } - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_AttributeError(translate("no such attribute")); - } else { + #else nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_AttributeError, translate("'%q' object cannot assign attribute '%q'"), mp_obj_get_type_qstr(base), attr)); - } + #endif } mp_obj_t mp_getiter(mp_obj_t o_in, mp_obj_iter_buf_t *iter_buf) { @@ -1209,12 +1213,12 @@ mp_obj_t mp_getiter(mp_obj_t o_in, mp_obj_iter_buf_t *iter_buf) { } // object not iterable - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("object not iterable")); - } else { + #else mp_raise_TypeError_varg( translate("'%q' object is not iterable"), mp_obj_get_type_qstr(o_in)); - } + #endif } // may return MP_OBJ_STOP_ITERATION as an optimisation instead of raise StopIteration() @@ -1231,12 +1235,12 @@ mp_obj_t mp_iternext_allow_raise(mp_obj_t o_in) { // __next__ exists, call it and return its result return mp_call_method_n_kw(0, 0, dest); } else { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("object not an iterator")); - } else { + #else mp_raise_TypeError_varg(translate("'%q' object is not an iterator"), mp_obj_get_type_qstr(o_in)); - } + #endif } } } @@ -1267,12 +1271,12 @@ mp_obj_t mp_iternext(mp_obj_t o_in) { } } } else { - if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { + #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(translate("object not an iterator")); - } else { + #else mp_raise_TypeError_varg(translate("'%q' object is not an iterator"), mp_obj_get_type_qstr(o_in)); - } + #endif } } } From aaca3eccf12d4b6ea6e294af81c8d19ad330be0c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Nov 2020 16:19:37 -0600 Subject: [PATCH 25/64] samd: PDMIn: Reduce code unrolling on samd21 only Instead of unrolling the code 16 times, unroll it 4 times and loop over it 4 times. This gives the same 16 iterations, but at an expense of less flash space. --- ports/atmel-samd/common-hal/audiobusio/PDMIn.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index 3c9ec05c25..8911aef2f1 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -337,7 +337,11 @@ const uint16_t sinc_filter [OVERSAMPLING] = { 94, 63, 39, 21, 9, 2, 0, 0 }; -#define REPEAT_16_TIMES(X) X X X X X X X X X X X X X X X X +#ifdef SAMD21 +#define REPEAT_16_TIMES(X) do { for(uint8_t j=0; j<4; j++) { X X X X } } while (0) +#else +#define REPEAT_16_TIMES(X) do { X X X X X X X X X X X X X X X X } while(0) +#endif static uint16_t filter_sample(uint32_t pdm_samples[4]) { uint16_t running_sum = 0; @@ -354,7 +358,7 @@ static uint16_t filter_sample(uint32_t pdm_samples[4]) { filter_ptr++; pdm_sample <<= 1; } - ) + ); } return running_sum; } From 982bce7259a9bbf7493f86258fc3395f31081648 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Nov 2020 16:23:35 -0600 Subject: [PATCH 26/64] py.mk: allow translation to be overriden in GNUmakefile I like to use local makefile overrides, in the file GNUmakefile (or, on case-sensitive systems, makefile) to set compilation choices. However, writing TRANSLATION := de_DE include Makefile did not work, because py.mk would override the TRANSLATION := specified in an earlier part of the makefiles (but not from the commandline). By using ?= instead of := the local makefile override works, but when TRANSLATION is not specified it continues to work as before. --- py/py.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/py.mk b/py/py.mk index acf5d127bc..eeb3b8650f 100644 --- a/py/py.mk +++ b/py/py.mk @@ -7,7 +7,7 @@ HEADER_BUILD = $(BUILD)/genhdr # file containing qstr defs for the core Python bit PY_QSTR_DEFS = $(PY_SRC)/qstrdefs.h -TRANSLATION := en_US +TRANSLATION ?= en_US # If qstr autogeneration is not disabled we specify the output header # for all collected qstrings. From 17a8bafe0513c81565d25a6633808c639d5fa1f6 Mon Sep 17 00:00:00 2001 From: BennyE Date: Thu, 19 Nov 2020 23:39:48 +0100 Subject: [PATCH 27/64] Choose best AP in range if no channel/bssid given --- ports/esp32s2/common-hal/wifi/Radio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 1945da207b..61c95dea82 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -142,6 +142,11 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t } else { config->sta.bssid_set = 0; } + // if channel and bssid both not set, do a full scan instead of fast scan + // this will ensure that the best AP is chosen automatically + if ((self->sta.bssid_set == 0) && (self->sta.channel == NULL)) { + config.scan_method = WIFI_ALL_CHANNEL_SCAN; + } esp_wifi_set_config(ESP_IF_WIFI_STA, config); self->starting_retries = 5; self->retries_left = 5; From 6760cdf678061abeaf2627e5903c8601eee6fc66 Mon Sep 17 00:00:00 2001 From: BennyE Date: Fri, 20 Nov 2020 00:11:17 +0100 Subject: [PATCH 28/64] Let connect() choose strongest AP if channel and BSSID are not given --- ports/esp32s2/common-hal/wifi/Radio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 61c95dea82..bcbca0ec7c 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -142,10 +142,10 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t } else { config->sta.bssid_set = 0; } - // if channel and bssid both not set, do a full scan instead of fast scan - // this will ensure that the best AP is chosen automatically - if ((self->sta.bssid_set == 0) && (self->sta.channel == NULL)) { - config.scan_method = WIFI_ALL_CHANNEL_SCAN; + // If channel is 0 (default/unset) and BSSID is not given, do a full scan instead of fast scan + // This will ensure that the best AP in range is chosen automatically + if ((config->sta.bssid_set == 0) && (config->sta.channel == 0)) { + config->sta.scan_method = WIFI_ALL_CHANNEL_SCAN; } esp_wifi_set_config(ESP_IF_WIFI_STA, config); self->starting_retries = 5; From 123210a989eae73fb60146d707f7ba890f8311ee Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 19 Nov 2020 17:13:24 -0800 Subject: [PATCH 29/64] Speed up JSON parsing with readinto Get a chunk of data from readinto instead of a single byte. This speeds up the parsing by reducing the number of function calls. Fixes #3703 --- extmod/modujson.c | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/extmod/modujson.c b/extmod/modujson.c index 431b5e0cf1..515606b70a 100644 --- a/extmod/modujson.c +++ b/extmod/modujson.c @@ -57,6 +57,8 @@ typedef struct _ujson_stream_t { int errcode; mp_obj_t python_readinto[2 + 1]; mp_obj_array_t bytearray_obj; + size_t start; + size_t end; byte cur; } ujson_stream_t; @@ -77,28 +79,43 @@ STATIC byte ujson_stream_next(ujson_stream_t *s) { return s->cur; } +// We read from an object's `readinto` method in chunks larger than the json +// parser needs to reduce the number of function calls done. + +#define CIRCUITPY_JSON_READ_CHUNK_SIZE 64 + STATIC mp_uint_t ujson_python_readinto(mp_obj_t obj, void *buf, mp_uint_t size, int *errcode) { ujson_stream_t* s = obj; - s->bytearray_obj.items = buf; - s->bytearray_obj.len = size; - *errcode = 0; - mp_obj_t ret = mp_call_method_n_kw(1, 0, s->python_readinto); - if (ret == mp_const_none) { - *errcode = MP_EAGAIN; - return MP_STREAM_ERROR; + + if (s->start == s->end) { + *errcode = 0; + mp_obj_t ret = mp_call_method_n_kw(1, 0, s->python_readinto); + if (ret == mp_const_none) { + *errcode = MP_EAGAIN; + return MP_STREAM_ERROR; + } + s->start = 0; + s->end = mp_obj_get_int(ret); } - return mp_obj_get_int(ret); + + *((uint8_t *)buf) = ((uint8_t*) s->bytearray_obj.items)[s->start]; + s->start++; + return 1; } STATIC mp_obj_t _mod_ujson_load(mp_obj_t stream_obj, bool return_first_json) { const mp_stream_p_t *stream_p = mp_proto_get(MP_QSTR_protocol_stream, stream_obj); ujson_stream_t s; + uint8_t character_buffer[CIRCUITPY_JSON_READ_CHUNK_SIZE]; if (stream_p == NULL) { + s.start = 0; + s.end = 0; mp_load_method(stream_obj, MP_QSTR_readinto, s.python_readinto); s.bytearray_obj.base.type = &mp_type_bytearray; s.bytearray_obj.typecode = BYTEARRAY_TYPECODE; + s.bytearray_obj.len = CIRCUITPY_JSON_READ_CHUNK_SIZE; s.bytearray_obj.free = 0; - // len and items are set at read time + s.bytearray_obj.items = character_buffer; s.python_readinto[2] = MP_OBJ_FROM_PTR(&s.bytearray_obj); s.stream_obj = &s; s.read = ujson_python_readinto; From 2773f534c946df46da5ba87c0968b5e4912a6b2b Mon Sep 17 00:00:00 2001 From: BennyE Date: Fri, 20 Nov 2020 09:40:32 +0100 Subject: [PATCH 30/64] Update ports/esp32s2/common-hal/wifi/Radio.c adding suggested changes --- ports/esp32s2/common-hal/wifi/Radio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index bcbca0ec7c..f7c431a56b 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -146,6 +146,8 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t // This will ensure that the best AP in range is chosen automatically if ((config->sta.bssid_set == 0) && (config->sta.channel == 0)) { config->sta.scan_method = WIFI_ALL_CHANNEL_SCAN; + } else { + config->sta.scan_method = WIFI_FAST_SCAN; } esp_wifi_set_config(ESP_IF_WIFI_STA, config); self->starting_retries = 5; From 0a06530d52524c76a026ed843165fa79a0526c1b Mon Sep 17 00:00:00 2001 From: Seth Kerr Date: Fri, 20 Nov 2020 15:06:57 -0500 Subject: [PATCH 31/64] adding CP-Sapling --- ports/atmel-samd/boards/CP_Sapling_m0/board.c | 40 +++++++++++++ .../boards/CP_Sapling_m0/mpconfigboard.h | 57 +++++++++++++++++++ .../boards/CP_Sapling_m0/mpconfigboard.mk | 24 ++++++++ ports/atmel-samd/boards/CP_Sapling_m0/pins.c | 38 +++++++++++++ 4 files changed, 159 insertions(+) create mode 100644 ports/atmel-samd/boards/CP_Sapling_m0/board.c create mode 100644 ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/CP_Sapling_m0/pins.c diff --git a/ports/atmel-samd/boards/CP_Sapling_m0/board.c b/ports/atmel-samd/boards/CP_Sapling_m0/board.c new file mode 100644 index 0000000000..b745bd9060 --- /dev/null +++ b/ports/atmel-samd/boards/CP_Sapling_m0/board.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 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 "boards/board.h" +#include "common-hal/microcontroller/Pin.h" +#include "supervisor/shared/board.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.h b/ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.h new file mode 100644 index 0000000000..c67f022eb8 --- /dev/null +++ b/ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.h @@ -0,0 +1,57 @@ +#define MICROPY_HW_BOARD_NAME "CP Sapling M0" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_HW_NEOPIXEL (&pin_PA15) + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define IGNORE_PIN_PA02 1 +#define IGNORE_PIN_PA03 1 +#define IGNORE_PIN_PA04 1 +#define IGNORE_PIN_PA05 1 +#define IGNORE_PIN_PA06 1 +#define IGNORE_PIN_PA07 1 +#define IGNORE_PIN_PA12 1 +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA20 1 +#define IGNORE_PIN_PA21 1 +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 +#define IGNORE_PIN_PB01 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PB04 1 +#define IGNORE_PIN_PB05 1 +#define IGNORE_PIN_PB06 1 +#define IGNORE_PIN_PB07 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PB10 1 +#define IGNORE_PIN_PB11 1 +#define IGNORE_PIN_PB12 1 +#define IGNORE_PIN_PB13 1 +#define IGNORE_PIN_PB14 1 +#define IGNORE_PIN_PB15 1 +#define IGNORE_PIN_PB16 1 +#define IGNORE_PIN_PB17 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PB30 1 +#define IGNORE_PIN_PB31 1 +#define IGNORE_PIN_PB00 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA09) +#define DEFAULT_I2C_BUS_SDA (&pin_PA08) + +#define DEFAULT_SPI_BUS_SS (&pin_PA22) +#define DEFAULT_SPI_BUS_SCK (&pin_PA19) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA18) +#define DEFAULT_SPI_BUS_MISO (&pin_PA17) diff --git a/ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.mk b/ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.mk new file mode 100644 index 0000000000..861a0a5f7d --- /dev/null +++ b/ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.mk @@ -0,0 +1,24 @@ +USB_VID = 0x1209 +USB_PID = 0x4DDD +USB_PRODUCT = "CP Sapling" +USB_MANUFACTURER = "Oak Development Technologies" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_FULL_BUILD = 0 + +SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif diff --git a/ports/atmel-samd/boards/CP_Sapling_m0/pins.c b/ports/atmel-samd/boards/CP_Sapling_m0/pins.c new file mode 100644 index 0000000000..ccffe2b3a1 --- /dev/null +++ b/ports/atmel-samd/boards/CP_Sapling_m0/pins.c @@ -0,0 +1,38 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA00) }, + + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA01) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_PA22) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA19) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA18) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) }, + + { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From b69bbfa3d6dbbe86216f4ea72df54cfd24612fe0 Mon Sep 17 00:00:00 2001 From: Seth Kerr Date: Fri, 20 Nov 2020 15:17:44 -0500 Subject: [PATCH 32/64] fixed issues with trailing whitespace check --- ports/atmel-samd/boards/CP_Sapling_m0/board.c | 2 +- ports/atmel-samd/boards/CP_Sapling_m0/pins.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/boards/CP_Sapling_m0/board.c b/ports/atmel-samd/boards/CP_Sapling_m0/board.c index b745bd9060..ce56366762 100644 --- a/ports/atmel-samd/boards/CP_Sapling_m0/board.c +++ b/ports/atmel-samd/boards/CP_Sapling_m0/board.c @@ -29,7 +29,7 @@ #include "supervisor/shared/board.h" #include "hal/include/hal_gpio.h" -void board_init(void) { +void board_init(void) { } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/CP_Sapling_m0/pins.c b/ports/atmel-samd/boards/CP_Sapling_m0/pins.c index ccffe2b3a1..d527aaddcb 100644 --- a/ports/atmel-samd/boards/CP_Sapling_m0/pins.c +++ b/ports/atmel-samd/boards/CP_Sapling_m0/pins.c @@ -7,7 +7,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA00) }, - + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA01) }, @@ -31,7 +31,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) }, - + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, }; From 29e91424d483f0b427957be1c859f7f758f6fbea Mon Sep 17 00:00:00 2001 From: Seth Kerr Date: Fri, 20 Nov 2020 15:29:35 -0500 Subject: [PATCH 33/64] removing cp sapling temporarily to read --- ports/atmel-samd/boards/CP_Sapling_m0/board.c | 40 ------------- .../boards/CP_Sapling_m0/mpconfigboard.h | 57 ------------------- .../boards/CP_Sapling_m0/mpconfigboard.mk | 24 -------- ports/atmel-samd/boards/CP_Sapling_m0/pins.c | 38 ------------- 4 files changed, 159 deletions(-) delete mode 100644 ports/atmel-samd/boards/CP_Sapling_m0/board.c delete mode 100644 ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.h delete mode 100644 ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.mk delete mode 100644 ports/atmel-samd/boards/CP_Sapling_m0/pins.c diff --git a/ports/atmel-samd/boards/CP_Sapling_m0/board.c b/ports/atmel-samd/boards/CP_Sapling_m0/board.c deleted file mode 100644 index ce56366762..0000000000 --- a/ports/atmel-samd/boards/CP_Sapling_m0/board.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 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 "boards/board.h" -#include "common-hal/microcontroller/Pin.h" -#include "supervisor/shared/board.h" -#include "hal/include/hal_gpio.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} diff --git a/ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.h b/ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.h deleted file mode 100644 index c67f022eb8..0000000000 --- a/ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.h +++ /dev/null @@ -1,57 +0,0 @@ -#define MICROPY_HW_BOARD_NAME "CP Sapling M0" -#define MICROPY_HW_MCU_NAME "samd21e18" - -#define MICROPY_HW_NEOPIXEL (&pin_PA15) - -#define MICROPY_PORT_A (0) -#define MICROPY_PORT_B (0) -#define MICROPY_PORT_C (0) - -#define IGNORE_PIN_PA02 1 -#define IGNORE_PIN_PA03 1 -#define IGNORE_PIN_PA04 1 -#define IGNORE_PIN_PA05 1 -#define IGNORE_PIN_PA06 1 -#define IGNORE_PIN_PA07 1 -#define IGNORE_PIN_PA12 1 -#define IGNORE_PIN_PA13 1 -#define IGNORE_PIN_PA14 1 -#define IGNORE_PIN_PA20 1 -#define IGNORE_PIN_PA21 1 -// USB is always used internally so skip the pin objects for it. -#define IGNORE_PIN_PA24 1 -#define IGNORE_PIN_PA25 1 -#define IGNORE_PIN_PA27 1 -#define IGNORE_PIN_PA28 1 -#define IGNORE_PIN_PA30 1 -#define IGNORE_PIN_PA31 1 -#define IGNORE_PIN_PB01 1 -#define IGNORE_PIN_PB02 1 -#define IGNORE_PIN_PB03 1 -#define IGNORE_PIN_PB04 1 -#define IGNORE_PIN_PB05 1 -#define IGNORE_PIN_PB06 1 -#define IGNORE_PIN_PB07 1 -#define IGNORE_PIN_PB08 1 -#define IGNORE_PIN_PB09 1 -#define IGNORE_PIN_PB10 1 -#define IGNORE_PIN_PB11 1 -#define IGNORE_PIN_PB12 1 -#define IGNORE_PIN_PB13 1 -#define IGNORE_PIN_PB14 1 -#define IGNORE_PIN_PB15 1 -#define IGNORE_PIN_PB16 1 -#define IGNORE_PIN_PB17 1 -#define IGNORE_PIN_PB22 1 -#define IGNORE_PIN_PB23 1 -#define IGNORE_PIN_PB30 1 -#define IGNORE_PIN_PB31 1 -#define IGNORE_PIN_PB00 1 - -#define DEFAULT_I2C_BUS_SCL (&pin_PA09) -#define DEFAULT_I2C_BUS_SDA (&pin_PA08) - -#define DEFAULT_SPI_BUS_SS (&pin_PA22) -#define DEFAULT_SPI_BUS_SCK (&pin_PA19) -#define DEFAULT_SPI_BUS_MOSI (&pin_PA18) -#define DEFAULT_SPI_BUS_MISO (&pin_PA17) diff --git a/ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.mk b/ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.mk deleted file mode 100644 index 861a0a5f7d..0000000000 --- a/ports/atmel-samd/boards/CP_Sapling_m0/mpconfigboard.mk +++ /dev/null @@ -1,24 +0,0 @@ -USB_VID = 0x1209 -USB_PID = 0x4DDD -USB_PRODUCT = "CP Sapling" -USB_MANUFACTURER = "Oak Development Technologies" - -CHIP_VARIANT = SAMD21E18A -CHIP_FAMILY = samd21 - -INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE -CIRCUITPY_FULL_BUILD = 0 - -SUPEROPT_GC = 0 - -CFLAGS_BOARD = --param max-inline-insns-auto=15 -ifeq ($(TRANSLATION), zh_Latn_pinyin) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -endif -ifeq ($(TRANSLATION), de_DE) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -SUPEROPT_VM = 0 -endif diff --git a/ports/atmel-samd/boards/CP_Sapling_m0/pins.c b/ports/atmel-samd/boards/CP_Sapling_m0/pins.c deleted file mode 100644 index d527aaddcb..0000000000 --- a/ports/atmel-samd/boards/CP_Sapling_m0/pins.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, - - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA00) }, - - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA01) }, - - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, - - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA22) }, - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA22) }, - { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_PA22) }, - - { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA19) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA19) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA19) }, - - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA17) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA17) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA17) }, - - { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA18) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA18) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA18) }, - - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) }, - - { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From c4f4cdd8c15ef54ed05533b3f4c9d28bf9f9c46f Mon Sep 17 00:00:00 2001 From: Seth Kerr Date: Fri, 20 Nov 2020 15:31:49 -0500 Subject: [PATCH 34/64] readding cp_sapling directory --- ports/atmel-samd/boards/cp_sapling_m0/board.c | 40 +++++++++++++ .../boards/cp_sapling_m0/mpconfigboard.h | 57 +++++++++++++++++++ .../boards/cp_sapling_m0/mpconfigboard.mk | 24 ++++++++ ports/atmel-samd/boards/cp_sapling_m0/pins.c | 38 +++++++++++++ 4 files changed, 159 insertions(+) create mode 100644 ports/atmel-samd/boards/cp_sapling_m0/board.c create mode 100644 ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/cp_sapling_m0/pins.c diff --git a/ports/atmel-samd/boards/cp_sapling_m0/board.c b/ports/atmel-samd/boards/cp_sapling_m0/board.c new file mode 100644 index 0000000000..b745bd9060 --- /dev/null +++ b/ports/atmel-samd/boards/cp_sapling_m0/board.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 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 "boards/board.h" +#include "common-hal/microcontroller/Pin.h" +#include "supervisor/shared/board.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.h b/ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.h new file mode 100644 index 0000000000..c67f022eb8 --- /dev/null +++ b/ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.h @@ -0,0 +1,57 @@ +#define MICROPY_HW_BOARD_NAME "CP Sapling M0" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_HW_NEOPIXEL (&pin_PA15) + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define IGNORE_PIN_PA02 1 +#define IGNORE_PIN_PA03 1 +#define IGNORE_PIN_PA04 1 +#define IGNORE_PIN_PA05 1 +#define IGNORE_PIN_PA06 1 +#define IGNORE_PIN_PA07 1 +#define IGNORE_PIN_PA12 1 +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA20 1 +#define IGNORE_PIN_PA21 1 +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 +#define IGNORE_PIN_PB01 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PB04 1 +#define IGNORE_PIN_PB05 1 +#define IGNORE_PIN_PB06 1 +#define IGNORE_PIN_PB07 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PB10 1 +#define IGNORE_PIN_PB11 1 +#define IGNORE_PIN_PB12 1 +#define IGNORE_PIN_PB13 1 +#define IGNORE_PIN_PB14 1 +#define IGNORE_PIN_PB15 1 +#define IGNORE_PIN_PB16 1 +#define IGNORE_PIN_PB17 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PB30 1 +#define IGNORE_PIN_PB31 1 +#define IGNORE_PIN_PB00 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA09) +#define DEFAULT_I2C_BUS_SDA (&pin_PA08) + +#define DEFAULT_SPI_BUS_SS (&pin_PA22) +#define DEFAULT_SPI_BUS_SCK (&pin_PA19) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA18) +#define DEFAULT_SPI_BUS_MISO (&pin_PA17) diff --git a/ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.mk b/ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.mk new file mode 100644 index 0000000000..861a0a5f7d --- /dev/null +++ b/ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.mk @@ -0,0 +1,24 @@ +USB_VID = 0x1209 +USB_PID = 0x4DDD +USB_PRODUCT = "CP Sapling" +USB_MANUFACTURER = "Oak Development Technologies" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_FULL_BUILD = 0 + +SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif diff --git a/ports/atmel-samd/boards/cp_sapling_m0/pins.c b/ports/atmel-samd/boards/cp_sapling_m0/pins.c new file mode 100644 index 0000000000..ccffe2b3a1 --- /dev/null +++ b/ports/atmel-samd/boards/cp_sapling_m0/pins.c @@ -0,0 +1,38 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA00) }, + + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA01) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_PA22) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA19) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA18) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) }, + + { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 1c92b1bf61cb0625a6ff7114623cd1cfdc6d5d75 Mon Sep 17 00:00:00 2001 From: Seth Kerr Date: Fri, 20 Nov 2020 15:35:52 -0500 Subject: [PATCH 35/64] forgot to run pre-commit local --- ports/atmel-samd/boards/cp_sapling_m0/board.c | 2 +- ports/atmel-samd/boards/cp_sapling_m0/pins.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/boards/cp_sapling_m0/board.c b/ports/atmel-samd/boards/cp_sapling_m0/board.c index b745bd9060..ce56366762 100644 --- a/ports/atmel-samd/boards/cp_sapling_m0/board.c +++ b/ports/atmel-samd/boards/cp_sapling_m0/board.c @@ -29,7 +29,7 @@ #include "supervisor/shared/board.h" #include "hal/include/hal_gpio.h" -void board_init(void) { +void board_init(void) { } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/cp_sapling_m0/pins.c b/ports/atmel-samd/boards/cp_sapling_m0/pins.c index ccffe2b3a1..d527aaddcb 100644 --- a/ports/atmel-samd/boards/cp_sapling_m0/pins.c +++ b/ports/atmel-samd/boards/cp_sapling_m0/pins.c @@ -7,7 +7,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA00) }, - + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA01) }, @@ -31,7 +31,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) }, - + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, }; From b34e36d1db127f84f4448f015406fa835cde48da Mon Sep 17 00:00:00 2001 From: Seth Kerr Date: Fri, 20 Nov 2020 15:44:53 -0500 Subject: [PATCH 36/64] fixing build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f3e728a05c..fa60332112 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -197,6 +197,7 @@ jobs: - "circuitplayground_express_crickit" - "circuitplayground_express_displayio" - "clue_nrf52840_express" + - "cp_sapling_m0" - "cp32-m4" - "datalore_ip_m4" - "datum_distance" From 0fb075ab7e55b9cb7b84ece6a0247fd0b73dedb2 Mon Sep 17 00:00:00 2001 From: Seth Kerr Date: Fri, 20 Nov 2020 16:15:50 -0500 Subject: [PATCH 37/64] changed tab to spaces in build.yml, passes local pre-commit --- .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 fa60332112..4d04e3f93b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -197,7 +197,7 @@ jobs: - "circuitplayground_express_crickit" - "circuitplayground_express_displayio" - "clue_nrf52840_express" - - "cp_sapling_m0" + - "cp_sapling_m0" - "cp32-m4" - "datalore_ip_m4" - "datum_distance" From 8301dcada00bdc63ac70de39ec5a0bdb6ae502ba Mon Sep 17 00:00:00 2001 From: Seth Kerr Date: Fri, 20 Nov 2020 16:26:33 -0500 Subject: [PATCH 38/64] I need to revisit the alphabet... --- .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 4d04e3f93b..8e72a40219 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -197,8 +197,8 @@ jobs: - "circuitplayground_express_crickit" - "circuitplayground_express_displayio" - "clue_nrf52840_express" - - "cp_sapling_m0" - "cp32-m4" + - "cp_sapling_m0" - "datalore_ip_m4" - "datum_distance" - "datum_imu" From f25ac45534c6bc00c4eb0d5aedb8fcdbb673a310 Mon Sep 17 00:00:00 2001 From: Noel Gaetan Date: Thu, 19 Nov 2020 17:19:09 +0000 Subject: [PATCH 39/64] Translated using Weblate (French) Currently translated at 100.0% (848 of 848 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index a15bbb8d50..b58ca6560b 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-10 15:30+0530\n" -"PO-Revision-Date: 2020-11-15 16:28+0000\n" -"Last-Translator: Antonin ENFRUN \n" +"PO-Revision-Date: 2020-11-20 22:28+0000\n" +"Last-Translator: Noel Gaetan \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -1027,7 +1027,7 @@ msgstr "Taille de tampon incorrecte" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" -msgstr "" +msgstr "L'initialisation a échoué par manque de mémoire" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" @@ -3715,7 +3715,7 @@ msgstr "les vecteurs doivent avoir la même longueur" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" -msgstr "" +msgstr "chien de garde non initialisé" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" From 7b5e826b18d8777e5dcc994ea41b29e099cc9fa1 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Thu, 19 Nov 2020 22:11:10 +0000 Subject: [PATCH 40/64] Translated using Weblate (Swedish) Currently translated at 100.0% (848 of 848 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 55e6368ae5..cc6fe8ad00 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: 2020-11-10 15:30+0530\n" -"PO-Revision-Date: 2020-11-15 16:28+0000\n" +"PO-Revision-Date: 2020-11-20 22:28+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -1014,7 +1014,7 @@ msgstr "Fel buffertstorlek" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" -msgstr "" +msgstr "Initieringen misslyckades på grund av minnesbrist" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" @@ -3672,7 +3672,7 @@ msgstr "vektorer måste ha samma längd" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" -msgstr "" +msgstr "watchdog är inte initierad" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" From 0b858440b0d64ede9e340de4862684c8be2b5b2b Mon Sep 17 00:00:00 2001 From: jgillick Date: Sun, 22 Nov 2020 01:15:05 -0800 Subject: [PATCH 41/64] Fix formatting. --- ports/stm/common-hal/microcontroller/Pin.c | 174 +++++++++------------ 1 file changed, 77 insertions(+), 97 deletions(-) diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 547ac87ae1..4b68d205bf 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -41,170 +41,150 @@ bool apa102_mosi_in_use; #endif #if defined(TFBGA216) -GPIO_TypeDef *ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH, GPIOI, GPIOJ, GPIOK}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH, GPIOI, GPIOJ, GPIOK}; #elif defined(LQFP144) -GPIO_TypeDef *ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG}; #elif defined(LQFP100_f4) || (LQFP100_x7) -GPIO_TypeDef *ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE}; #elif defined(LQFP64) -GPIO_TypeDef *ports[] = {GPIOA, GPIOB, GPIOC, GPIOD}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC, GPIOD}; #elif defined(UFQFPN48) -GPIO_TypeDef *ports[] = {GPIOA, GPIOB, GPIOC}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC}; #endif + #define GPIO_PORT_COUNT (MP_ARRAY_SIZE(ports)) STATIC uint16_t claimed_pins[GPIO_PORT_COUNT]; STATIC uint16_t __ALIGNED(4) never_reset_pins[GPIO_PORT_COUNT]; -void reset_all_pins(void) -{ +void reset_all_pins(void) { // Reset claimed pins - for (uint8_t i = 0; i < GPIO_PORT_COUNT; i++) - { + for (uint8_t i = 0; i < GPIO_PORT_COUNT; i++) { claimed_pins[i] = never_reset_pins[i]; } - for (uint8_t i = 0; i < GPIO_PORT_COUNT; i++) - { + for (uint8_t i = 0; i < GPIO_PORT_COUNT; i++) { HAL_GPIO_DeInit(ports[i], ~never_reset_pins[i]); } -#ifdef MICROPY_HW_NEOPIXEL + #ifdef MICROPY_HW_NEOPIXEL neopixel_in_use = false; -#endif -#ifdef MICROPY_HW_APA102_MOSI - apa102_sck_in_use = false; - apa102_mosi_in_use = false; -#endif + #endif + #ifdef MICROPY_HW_APA102_MOSI + apa102_sck_in_use = false; + apa102_mosi_in_use = false; + #endif } // Mark pin as free and return it to a quiescent state. -void reset_pin_number(uint8_t pin_port, uint8_t pin_number) -{ - if (pin_number == NO_PIN) - { +void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { + if ( pin_number == NO_PIN ) { return; } - if (pin_port == 0x0F) - { + if (pin_port == 0x0F) { return; } // Clear claimed bit & reset - claimed_pins[pin_port] &= ~(1 << pin_number); - never_reset_pins[pin_port] &= ~(1 << pin_number); - HAL_GPIO_DeInit(ports[pin_port], 1 << pin_number); + claimed_pins[pin_port] &= ~(1<port && pin_number == MICROPY_HW_NEOPIXEL->number) - { + #ifdef MICROPY_HW_NEOPIXEL + if (pin_port == MICROPY_HW_NEOPIXEL->port && pin_number == MICROPY_HW_NEOPIXEL->number) { neopixel_in_use = false; rgb_led_status_init(); return; } -#endif -#ifdef MICROPY_HW_APA102_MOSI - if ((pin_port == MICROPY_HW_APA102_MOSI->port && pin_number == MICROPY_HW_APA102_MOSI->number) || (pin_port == MICROPY_HW_APA102_SCK->port && pin_number == MICROPY_HW_APA102_MOSI->number)) - { - apa102_mosi_in_use = false; - apa102_sck_in_use = false; - rgb_led_status_init(); - return; - } -#endif + #endif + #ifdef MICROPY_HW_APA102_MOSI + if ((pin_port == MICROPY_HW_APA102_MOSI->port && pin_number == MICROPY_HW_APA102_MOSI->number) || (pin_port == MICROPY_HW_APA102_SCK->port && pin_number == MICROPY_HW_APA102_MOSI->number)) + { + apa102_mosi_in_use = false; + apa102_sck_in_use = false; + rgb_led_status_init(); + return; + } + #endif } -void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number) -{ - if (pin_number == NO_PIN) - { +void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number) { + if ( pin_number == NO_PIN ) { return; } - never_reset_pins[pin_port] |= 1 << pin_number; + never_reset_pins[pin_port] |= 1<port, pin->number); } -void common_hal_reset_pin(const mcu_pin_obj_t *pin) -{ +void common_hal_reset_pin(const mcu_pin_obj_t* pin) { reset_pin_number(pin->port, pin->number); } -void claim_pin(uint8_t pin_port, uint8_t pin_number) -{ +void claim_pin(uint8_t pin_port, uint8_t pin_number) { // Set bit in claimed_pins bitmask. - claimed_pins[pin_port] |= 1 << pin_number; + claimed_pins[pin_port] |= 1<port, pin->number); } -GPIO_TypeDef *pin_port(uint8_t pin_port) -{ +GPIO_TypeDef * pin_port(uint8_t pin_port) { return ports[pin_port]; } -uint16_t pin_mask(uint8_t pin_number) -{ - return 1 << pin_number; +uint16_t pin_mask(uint8_t pin_number) { + return 1<port * 16 + pin->number; } -void common_hal_mcu_pin_claim(const mcu_pin_obj_t *pin) -{ +void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { claim_pin(pin->port, pin->number); -#ifdef MICROPY_HW_NEOPIXEL - if (pin == MICROPY_HW_NEOPIXEL) - { + #ifdef MICROPY_HW_NEOPIXEL + if (pin == MICROPY_HW_NEOPIXEL) { neopixel_in_use = true; } -#endif -#ifdef MICROPY_HW_APA102_MOSI - if (pin == MICROPY_HW_APA102_MOSI) - { - apa102_mosi_in_use = true; - } - if (pin == MICROPY_HW_APA102_SCK) - { - apa102_sck_in_use = true; - } -#endif + #endif + #ifdef MICROPY_HW_APA102_MOSI + if (pin == MICROPY_HW_APA102_MOSI) + { + apa102_mosi_in_use = true; + } + if (pin == MICROPY_HW_APA102_SCK) + { + apa102_sck_in_use = true; + } + #endif } -void common_hal_mcu_pin_reset_number(uint8_t pin_no) -{ +void common_hal_mcu_pin_reset_number(uint8_t pin_no) { reset_pin_number(pin_no / 16, pin_no % 16); -} +} \ No newline at end of file From 381889f6bc025617fe85b248fae0f6b05ed50c01 Mon Sep 17 00:00:00 2001 From: jgillick Date: Sun, 22 Nov 2020 01:19:28 -0800 Subject: [PATCH 42/64] Cleanup --- .../boards/thunderpack_v12/mpconfigboard.h | 8 +- .../thunderpack_v12/stm32f4xx_hal_conf.h | 440 ------------------ ports/stm/common-hal/microcontroller/Pin.c | 52 +-- 3 files changed, 28 insertions(+), 472 deletions(-) delete mode 100644 ports/stm/boards/thunderpack_v12/stm32f4xx_hal_conf.h diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.h b/ports/stm/boards/thunderpack_v12/mpconfigboard.h index 4c71b8aeb2..426e0678da 100644 --- a/ports/stm/boards/thunderpack_v12/mpconfigboard.h +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.h @@ -30,10 +30,7 @@ #define CIRCUITPY_INTERNAL_NVM_SIZE (0x4000) #define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x08010000) #define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_4 - -// Putting the entire flash sector in the NVM byte array buffer -// would take up too much RAM. This limits how much of the sector we use. -#define NVM_BYTEARRAY_BUFFER_SIZE 512 +#define NVM_BYTEARRAY_BUFFER_SIZE 512 // Flash config #define FLASH_SIZE (0x80000) @@ -47,7 +44,6 @@ #define SPI_FLASH_CS_PIN (&pin_PB12) // Status LEDs -#define MICROPY_HW_LED_STATUS (&pin_PA02) #define MICROPY_HW_APA102_MOSI (&pin_PB08) #define MICROPY_HW_APA102_SCK (&pin_PB00) @@ -58,4 +54,4 @@ // General config #define BOARD_OSC_DIV (24) #define BOARD_OVERWRITE_SWD (1) -#define BOARD_NO_VBUS_SENSE (1) \ No newline at end of file +#define BOARD_NO_VBUS_SENSE (1) diff --git a/ports/stm/boards/thunderpack_v12/stm32f4xx_hal_conf.h b/ports/stm/boards/thunderpack_v12/stm32f4xx_hal_conf.h deleted file mode 100644 index 5cb5634223..0000000000 --- a/ports/stm/boards/thunderpack_v12/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -/* #define HAL_PCD_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)24000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 4b68d205bf..7d259e0521 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -71,8 +71,8 @@ void reset_all_pins(void) { neopixel_in_use = false; #endif #ifdef MICROPY_HW_APA102_MOSI - apa102_sck_in_use = false; - apa102_mosi_in_use = false; + apa102_sck_in_use = false; + apa102_mosi_in_use = false; #endif } @@ -98,13 +98,13 @@ void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { } #endif #ifdef MICROPY_HW_APA102_MOSI - if ((pin_port == MICROPY_HW_APA102_MOSI->port && pin_number == MICROPY_HW_APA102_MOSI->number) || (pin_port == MICROPY_HW_APA102_SCK->port && pin_number == MICROPY_HW_APA102_MOSI->number)) - { - apa102_mosi_in_use = false; - apa102_sck_in_use = false; - rgb_led_status_init(); - return; - } + if ((pin_port == MICROPY_HW_APA102_MOSI->port && pin_number == MICROPY_HW_APA102_MOSI->number) || (pin_port == MICROPY_HW_APA102_SCK->port && pin_number == MICROPY_HW_APA102_MOSI->number)) + { + apa102_mosi_in_use = false; + apa102_sck_in_use = false; + rgb_led_status_init(); + return; + } #endif } @@ -141,14 +141,14 @@ bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) { } #endif #ifdef MICROPY_HW_APA102_MOSI - if (pin == MICROPY_HW_APA102_MOSI) - { - return !apa102_mosi_in_use; - } - if (pin == MICROPY_HW_APA102_SCK) - { - return !apa102_sck_in_use; - } + if (pin == MICROPY_HW_APA102_MOSI) + { + return !apa102_mosi_in_use; + } + if (pin == MICROPY_HW_APA102_SCK) + { + return !apa102_sck_in_use; + } #endif return pin_number_is_free(pin->port, pin->number); @@ -174,17 +174,17 @@ void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { } #endif #ifdef MICROPY_HW_APA102_MOSI - if (pin == MICROPY_HW_APA102_MOSI) - { - apa102_mosi_in_use = true; - } - if (pin == MICROPY_HW_APA102_SCK) - { - apa102_sck_in_use = true; - } + if (pin == MICROPY_HW_APA102_MOSI) + { + apa102_mosi_in_use = true; + } + if (pin == MICROPY_HW_APA102_SCK) + { + apa102_sck_in_use = true; + } #endif } void common_hal_mcu_pin_reset_number(uint8_t pin_no) { reset_pin_number(pin_no / 16, pin_no % 16); -} \ No newline at end of file +} From 56634eb00e524a6f51a44f4041cd73a04528fe47 Mon Sep 17 00:00:00 2001 From: jgillick Date: Sun, 22 Nov 2020 01:31:41 -0800 Subject: [PATCH 43/64] Rename thunderpack to v11 --- .github/workflows/build.yml | 3 ++- ports/stm/boards/{thunderpack => thunderpack_v11}/board.c | 0 .../boards/{thunderpack => thunderpack_v11}/mpconfigboard.h | 0 .../boards/{thunderpack => thunderpack_v11}/mpconfigboard.mk | 0 ports/stm/boards/{thunderpack => thunderpack_v11}/pins.c | 0 5 files changed, 2 insertions(+), 1 deletion(-) rename ports/stm/boards/{thunderpack => thunderpack_v11}/board.c (100%) rename ports/stm/boards/{thunderpack => thunderpack_v11}/mpconfigboard.h (100%) rename ports/stm/boards/{thunderpack => thunderpack_v11}/mpconfigboard.mk (100%) rename ports/stm/boards/{thunderpack => thunderpack_v11}/pins.c (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f3e728a05c..c5762c4aba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -317,7 +317,8 @@ jobs: - "teensy40" - "teensy41" - "teknikio_bluebird" - - "thunderpack" + - "thunderpack_v11" + - "thunderpack_v12" - "tinkeringtech_scoutmakes_azul" - "trellis_m4_express" - "trinket_m0" diff --git a/ports/stm/boards/thunderpack/board.c b/ports/stm/boards/thunderpack_v11/board.c similarity index 100% rename from ports/stm/boards/thunderpack/board.c rename to ports/stm/boards/thunderpack_v11/board.c diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack_v11/mpconfigboard.h similarity index 100% rename from ports/stm/boards/thunderpack/mpconfigboard.h rename to ports/stm/boards/thunderpack_v11/mpconfigboard.h diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack_v11/mpconfigboard.mk similarity index 100% rename from ports/stm/boards/thunderpack/mpconfigboard.mk rename to ports/stm/boards/thunderpack_v11/mpconfigboard.mk diff --git a/ports/stm/boards/thunderpack/pins.c b/ports/stm/boards/thunderpack_v11/pins.c similarity index 100% rename from ports/stm/boards/thunderpack/pins.c rename to ports/stm/boards/thunderpack_v11/pins.c From fe6e50b770f7dffda1d49c503362c59e674224c2 Mon Sep 17 00:00:00 2001 From: jgillick Date: Sun, 22 Nov 2020 01:49:23 -0800 Subject: [PATCH 44/64] Update USB_PID --- ports/stm/boards/thunderpack_v12/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk index d11cfb7505..7bfe273673 100644 --- a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x806A +USB_PID = 0x8071 USB_PRODUCT = "Thunderpack STM32F411" USB_MANUFACTURER = "Jeremy Gillick" USB_DEVICES = "CDC,MSC" From f3b5ca5f01058cb1d50be09838bc55b22d3aae69 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sun, 22 Nov 2020 19:20:21 +0530 Subject: [PATCH 45/64] replace goto with conditional break --- ports/esp32s2/peripherals/timer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/peripherals/timer.c b/ports/esp32s2/peripherals/timer.c index 3aee33dc50..0ae1403874 100644 --- a/ports/esp32s2/peripherals/timer.c +++ b/ports/esp32s2/peripherals/timer.c @@ -46,6 +46,8 @@ void peripherals_timer_reset(void) { } void peripherals_timer_init(const timer_config_t * config, timer_index_t * timer) { + bool break_loop = false; + // get free timer for (uint8_t i = 0; i < 2; i++) { for (uint8_t j = 0; j < 2; j++) { @@ -53,16 +55,17 @@ void peripherals_timer_init(const timer_config_t * config, timer_index_t * timer timer->idx = (timer_idx_t)j; timer->group = (timer_group_t)i; timer_state[i][j] = TIMER_BUSY; - goto init_timer; + break_loop = true; + break; } else if (i == 1 && j == 1) { timer->idx = TIMER_MAX; timer->group = TIMER_GROUP_MAX; return; } } + if (break_loop) {break;} } -init_timer: // initialize timer module timer_init(timer->group, timer->idx, config); timer_set_counter_value(timer->group, timer->idx, 0); From f62ea25331678cc400c6149bbe3102c371540c6e Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 22 Nov 2020 19:08:27 -0500 Subject: [PATCH 46/64] ESP32S2: common_hal_mcu_delay_us() now calls mp_hal_delay_us() --- ports/esp32s2/common-hal/microcontroller/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/common-hal/microcontroller/__init__.c b/ports/esp32s2/common-hal/microcontroller/__init__.c index e5cfc7eef0..dba12b88b2 100644 --- a/ports/esp32s2/common-hal/microcontroller/__init__.c +++ b/ports/esp32s2/common-hal/microcontroller/__init__.c @@ -42,7 +42,7 @@ #include "freertos/FreeRTOS.h" void common_hal_mcu_delay_us(uint32_t delay) { - + mp_hal_delay_us(delay); } volatile uint32_t nesting_count = 0; From 661c20dd180343a3a5c7a52e63875888218422ba Mon Sep 17 00:00:00 2001 From: jgillick Date: Sun, 22 Nov 2020 18:25:37 -0800 Subject: [PATCH 47/64] Create a new linker script with more space for the firmware. --- ports/stm/boards/STM32F411_nvm_flash.ld | 29 +++++++++++++++++++ .../boards/thunderpack_v12/mpconfigboard.h | 12 ++++---- .../boards/thunderpack_v12/mpconfigboard.mk | 2 +- ports/stm/supervisor/internal_flash.h | 4 +++ 4 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 ports/stm/boards/STM32F411_nvm_flash.ld diff --git a/ports/stm/boards/STM32F411_nvm_flash.ld b/ports/stm/boards/STM32F411_nvm_flash.ld new file mode 100644 index 0000000000..ced739765d --- /dev/null +++ b/ports/stm/boards/STM32F411_nvm_flash.ld @@ -0,0 +1,29 @@ +/* + GNU linker script for STM32F411 with nvm and an external flash chip, and reserves + more space for the CircuitPython firmware and less for the filesystem + (since the filesystem will be on the external flash chip). +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 32K /* sectors 1,2 are 16K */ + FLASH_NVM (rwx) : ORIGIN = 0x0800C000, LENGTH = 16K /* sector 3 is 16K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 24K; +_minimum_heap_size = 16K; + +/* Define the top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.h b/ports/stm/boards/thunderpack_v12/mpconfigboard.h index 426e0678da..773ca297e5 100644 --- a/ports/stm/boards/thunderpack_v12/mpconfigboard.h +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.h @@ -28,14 +28,16 @@ // Non-volatile memory config #define CIRCUITPY_INTERNAL_NVM_SIZE (0x4000) -#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x08010000) -#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_4 +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x0800C000) +#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_3 #define NVM_BYTEARRAY_BUFFER_SIZE 512 // Flash config -#define FLASH_SIZE (0x80000) -#define FLASH_PAGE_SIZE (0x4000) -#define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000) +#define FLASH_SIZE (0x80000) +#define FLASH_PAGE_SIZE (0x4000) +#define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000) +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x8000 +#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 // On-board flash #define SPI_FLASH_MOSI_PIN (&pin_PB15) diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk index 7bfe273673..744565e69b 100644 --- a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk @@ -17,4 +17,4 @@ MCU_VARIANT = STM32F411xE MCU_PACKAGE = UFQFPN48 LD_COMMON = boards/common_nvm.ld -LD_FILE = boards/STM32F411_nvm.ld +LD_FILE = boards/STM32F411_nvm_flash.ld diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index ad5cba62d8..5746deac84 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -41,9 +41,13 @@ #ifdef STM32F411xE #define STM32_FLASH_SIZE 0x80000 //512KiB +#ifndef INTERNAL_FLASH_FILESYSTEM_SIZE #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB +#endif +#ifndef INTERNAL_FLASH_FILESYSTEM_START_ADDR #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 #endif +#endif #ifdef STM32F412Zx #define STM32_FLASH_SIZE 0x100000 //1MB From 5351a93c70fcacc50a154edac0a6d6d1028296e0 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 23 Nov 2020 13:39:14 +0700 Subject: [PATCH 48/64] update tinyusb to fix cdc connection race issue is fixed in https://github.com/hathach/tinyusb/pull/557 --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index 8b2c822557..b870d932e5 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 8b2c82255750488232eae72f3d5dcbacfd6227f3 +Subproject commit b870d932e5e1c6ece4227a5d49cc71e53a744149 From 4c5e7520f5950f831ea18866f49645c507d0f811 Mon Sep 17 00:00:00 2001 From: jgillick Date: Mon, 23 Nov 2020 00:25:41 -0800 Subject: [PATCH 49/64] Fix NVM by clearing FLASH_FLAG_PGPERR --- .../boards/thunderpack_v11/mpconfigboard.h | 2 +- .../boards/thunderpack_v12/mpconfigboard.h | 26 +++++++++---------- .../boards/thunderpack_v12/mpconfigboard.mk | 1 + ports/stm/common-hal/microcontroller/Pin.c | 15 ++++++----- ports/stm/common-hal/nvm/ByteArray.c | 2 +- ports/stm/supervisor/internal_flash.h | 4 +-- 6 files changed, 26 insertions(+), 24 deletions(-) diff --git a/ports/stm/boards/thunderpack_v11/mpconfigboard.h b/ports/stm/boards/thunderpack_v11/mpconfigboard.h index c2649e2555..7d4a8dff32 100644 --- a/ports/stm/boards/thunderpack_v11/mpconfigboard.h +++ b/ports/stm/boards/thunderpack_v11/mpconfigboard.h @@ -23,7 +23,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#define MICROPY_HW_BOARD_NAME "THUNDERPACK" +#define MICROPY_HW_BOARD_NAME "THUNDERPACK_v11" #define MICROPY_HW_MCU_NAME "STM32F411CE" // Non-volatile memory config diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.h b/ports/stm/boards/thunderpack_v12/mpconfigboard.h index 773ca297e5..57486da280 100644 --- a/ports/stm/boards/thunderpack_v12/mpconfigboard.h +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.h @@ -27,17 +27,16 @@ #define MICROPY_HW_MCU_NAME "STM32F411CE" // Non-volatile memory config -#define CIRCUITPY_INTERNAL_NVM_SIZE (0x4000) -#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x0800C000) -#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_3 -#define NVM_BYTEARRAY_BUFFER_SIZE 512 +#define CIRCUITPY_INTERNAL_NVM_SIZE (0x4000) +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x0800C000) +#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_3 +#define NVM_BYTEARRAY_BUFFER_SIZE 512 // Flash config -#define FLASH_SIZE (0x80000) -#define FLASH_PAGE_SIZE (0x4000) -#define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000) +#define FLASH_SIZE (0x80000) +#define FLASH_PAGE_SIZE (0x4000) +#define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000) #define INTERNAL_FLASH_FILESYSTEM_SIZE 0x8000 -#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 // On-board flash #define SPI_FLASH_MOSI_PIN (&pin_PB15) @@ -45,15 +44,14 @@ #define SPI_FLASH_SCK_PIN (&pin_PB13) #define SPI_FLASH_CS_PIN (&pin_PB12) +#define HSE_VALUE ((uint32_t)24000000U) +#define BOARD_OVERWRITE_SWD (1) +#define BOARD_NO_VBUS_SENSE (1) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) + // Status LEDs #define MICROPY_HW_APA102_MOSI (&pin_PB08) #define MICROPY_HW_APA102_SCK (&pin_PB00) - // I2C #define DEFAULT_I2C_BUS_SCL (&pin_PB06) #define DEFAULT_I2C_BUS_SDA (&pin_PB07) - -// General config -#define BOARD_OSC_DIV (24) -#define BOARD_OVERWRITE_SWD (1) -#define BOARD_NO_VBUS_SENSE (1) diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk index 744565e69b..d0bc22680f 100644 --- a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk @@ -11,6 +11,7 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C CIRCUITPY_NVM = 1 +CIRCUITPY_BLEIO_HCI = 0 MCU_SERIES = F4 MCU_VARIANT = STM32F411xE diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 7d259e0521..0e333c71cf 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -35,7 +35,7 @@ #ifdef MICROPY_HW_NEOPIXEL bool neopixel_in_use; #endif -#ifdef MICROPY_HW_APA102_MOSI +#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK) bool apa102_sck_in_use; bool apa102_mosi_in_use; #endif @@ -70,7 +70,7 @@ void reset_all_pins(void) { #ifdef MICROPY_HW_NEOPIXEL neopixel_in_use = false; #endif - #ifdef MICROPY_HW_APA102_MOSI + #if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK) apa102_sck_in_use = false; apa102_mosi_in_use = false; #endif @@ -97,8 +97,11 @@ void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { return; } #endif - #ifdef MICROPY_HW_APA102_MOSI - if ((pin_port == MICROPY_HW_APA102_MOSI->port && pin_number == MICROPY_HW_APA102_MOSI->number) || (pin_port == MICROPY_HW_APA102_SCK->port && pin_number == MICROPY_HW_APA102_MOSI->number)) + #if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK) + if ( + (pin_port == MICROPY_HW_APA102_MOSI->port && pin_number == MICROPY_HW_APA102_MOSI->number) + || (pin_port == MICROPY_HW_APA102_SCK->port && pin_number == MICROPY_HW_APA102_MOSI->number) + ) { apa102_mosi_in_use = false; apa102_sck_in_use = false; @@ -140,7 +143,7 @@ bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) { return !neopixel_in_use; } #endif - #ifdef MICROPY_HW_APA102_MOSI + #if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK) if (pin == MICROPY_HW_APA102_MOSI) { return !apa102_mosi_in_use; @@ -173,7 +176,7 @@ void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { neopixel_in_use = true; } #endif - #ifdef MICROPY_HW_APA102_MOSI + #if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK) if (pin == MICROPY_HW_APA102_MOSI) { apa102_mosi_in_use = true; diff --git a/ports/stm/common-hal/nvm/ByteArray.c b/ports/stm/common-hal/nvm/ByteArray.c index 462d3aa9de..b7a1ff0351 100644 --- a/ports/stm/common-hal/nvm/ByteArray.c +++ b/ports/stm/common-hal/nvm/ByteArray.c @@ -48,7 +48,7 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, // Erase flash sector HAL_FLASH_Unlock(); - __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGSERR ); + __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR ); FLASH_Erase_Sector(CIRCUITPY_INTERNAL_NVM_SECTOR, VOLTAGE_RANGE_3); // Write bytes to flash diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index 5746deac84..19ae03e0b3 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -42,10 +42,10 @@ #ifdef STM32F411xE #define STM32_FLASH_SIZE 0x80000 //512KiB #ifndef INTERNAL_FLASH_FILESYSTEM_SIZE -#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB + #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #endif #ifndef INTERNAL_FLASH_FILESYSTEM_START_ADDR -#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 + #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 #endif #endif From 9d8be648eec70c36b3a461c4ff45064357d11693 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 15 Nov 2020 11:48:53 -0600 Subject: [PATCH 50/64] ulab: Update to release tag 1.1.0 Disable certain classes of diagnostic when building ulab. We should submit patches upstream to (A) fix these errors and (B) upgrade their CI so that the problems are caught before we want to integrate with CircuitPython, but not right now. --- extmod/ulab | 2 +- locale/circuitpython.pot | 147 +++++++++++++++++++++++++++------------ py/py.mk | 2 +- 3 files changed, 106 insertions(+), 45 deletions(-) diff --git a/extmod/ulab b/extmod/ulab index 8242b84753..aa7e741530 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 8242b84753355433b61230ab6631c06e5ac77f35 +Subproject commit aa7e741530df471d206a4a321823a37a913a0eb8 diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index ec232615d1..c184d69313 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -855,6 +855,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "" @@ -1951,7 +1955,7 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" @@ -2030,10 +2034,6 @@ msgstr "" msgid "addresses is empty" msgstr "" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "" @@ -2042,6 +2042,10 @@ msgstr "" msgid "argsort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -2059,14 +2063,22 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -2076,15 +2088,15 @@ msgid "attributes not supported yet" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" +msgid "axis is out of bounds" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" +msgid "axis must be None, or an integer" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" +msgid "axis too long" msgstr "" #: py/builtinevex.c @@ -2288,6 +2300,10 @@ msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "" @@ -2304,10 +2320,6 @@ msgstr "" msgid "cannot perform relative import" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" - #: py/emitnative.c msgid "casting" msgstr "" @@ -2380,10 +2392,6 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2392,6 +2400,10 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" @@ -2400,10 +2412,6 @@ msgstr "" msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -2433,6 +2441,10 @@ msgstr "" msgid "diff argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2548,6 +2560,10 @@ msgstr "" msgid "first argument must be a function" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2601,8 +2617,8 @@ msgstr "" msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" msgstr "" #: py/argcheck.c @@ -2672,6 +2688,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2696,6 +2713,10 @@ msgstr "" msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" @@ -2704,6 +2725,10 @@ msgstr "" msgid "input array length must be power of 2" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" @@ -2716,6 +2741,22 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" @@ -2728,6 +2769,10 @@ msgstr "" msgid "input vectors must be of equal length" msgstr "" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2896,6 +2941,10 @@ msgstr "" msgid "max_length must be > 0" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "" @@ -2945,10 +2994,6 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -3031,6 +3076,10 @@ msgstr "" msgid "non-keyword arg after keyword arg" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "" @@ -3043,10 +3092,6 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -3099,6 +3144,10 @@ msgstr "" msgid "odd-length string" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -3121,6 +3170,14 @@ msgstr "" msgid "operands could not be broadcast together" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3255,6 +3312,10 @@ msgstr "" msgid "requested length %d but object has length %d" msgstr "" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "" @@ -3273,8 +3334,8 @@ msgstr "" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" msgstr "" #: py/objstr.c @@ -3300,7 +3361,7 @@ msgid "script compilation not supported" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" +msgid "shape must be a tuple" msgstr "" #: py/objstr.c @@ -3343,10 +3404,6 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" @@ -3452,6 +3509,10 @@ msgstr "" msgid "timestamp out of range for platform time_t" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "" @@ -3627,12 +3688,12 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" msgstr "" #: extmod/ulab/code/vector/vectorise.c diff --git a/py/py.mk b/py/py.mk index acf5d127bc..eb3ba27acb 100644 --- a/py/py.mk +++ b/py/py.mk @@ -109,7 +109,7 @@ ifeq ($(CIRCUITPY_ULAB),1) SRC_MOD += $(patsubst $(TOP)/%,%,$(wildcard $(TOP)/extmod/ulab/code/*.c)) SRC_MOD += $(patsubst $(TOP)/%,%,$(wildcard $(TOP)/extmod/ulab/code/*/*.c)) CFLAGS_MOD += -DCIRCUITPY_ULAB=1 -DMODULE_ULAB_ENABLED=1 -$(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-float-equal -Wno-sign-compare -DCIRCUITPY +$(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-missing-declarations -Wno-missing-prototypes -Wno-unused-parameter -Wno-float-equal -Wno-sign-compare -Wno-cast-align -Wno-shadow -DCIRCUITPY endif # External modules written in C. From 70e978f48b587620bb1407d9717f0a8fc3d4cf26 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 16 Nov 2020 16:57:01 -0600 Subject: [PATCH 51/64] stm: disable ulab on two resource-constrained boards --- ports/stm/boards/meowbit_v121/mpconfigboard.mk | 2 ++ ports/stm/boards/thunderpack/mpconfigboard.mk | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index c416700e3c..86b0cb5ab4 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -20,3 +20,5 @@ LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F401xe_boot.ld # For debugging - also comment BOOTLOADER_OFFSET and BOARD_VTOR_DEFER # LD_FILE = boards/STM32F401xe_fs.ld + +CIRCUITPY_ULAB = 0 diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack/mpconfigboard.mk index d303582e0e..8f645068d7 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack/mpconfigboard.mk @@ -15,3 +15,5 @@ MCU_PACKAGE = UFQFPN48 LD_COMMON = boards/common_nvm.ld LD_FILE = boards/STM32F411_nvm.ld + +CIRCUITPY_ULAB = 0 From 368fa88312c14d1a74f44b7539fb00c7ef8754f8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 23 Nov 2020 12:14:58 -0800 Subject: [PATCH 52/64] Ignore size parameter --- extmod/modujson.c | 1 + 1 file changed, 1 insertion(+) diff --git a/extmod/modujson.c b/extmod/modujson.c index 515606b70a..3bb4b33017 100644 --- a/extmod/modujson.c +++ b/extmod/modujson.c @@ -85,6 +85,7 @@ STATIC byte ujson_stream_next(ujson_stream_t *s) { #define CIRCUITPY_JSON_READ_CHUNK_SIZE 64 STATIC mp_uint_t ujson_python_readinto(mp_obj_t obj, void *buf, mp_uint_t size, int *errcode) { + (void) size; // Ignore size because we know it's always 1. ujson_stream_t* s = obj; if (s->start == s->end) { From efda9124374dcbffb4f8a58d227e439d34ca7760 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Mon, 23 Nov 2020 15:53:28 -0500 Subject: [PATCH 53/64] Add pin names from silk --- ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c index 40c9e91e4d..f1ce4b8c61 100644 --- a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c +++ b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c @@ -16,11 +16,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_EPD_CS), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, { MP_ROM_QSTR(MP_QSTR_BUTTON_B), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, { MP_ROM_QSTR(MP_QSTR_BUTTON_C), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_BUTTON_D), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO3) }, { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO4) }, @@ -36,6 +41,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO1) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, From 3730862362e914cc92b6977cb5d809856467f8f9 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Mon, 23 Nov 2020 15:56:36 -0500 Subject: [PATCH 54/64] Update to match silk rev 1 --- ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c index f1ce4b8c61..6c2dc1151a 100644 --- a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c +++ b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c @@ -41,7 +41,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO1) }, - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO1) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, From 7928a0d45419181d3f29c809aa0c3c87e58359e3 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Mon, 23 Nov 2020 16:02:45 -0500 Subject: [PATCH 55/64] Blank lines to group aliases. --- ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c index 6c2dc1151a..0cefb6dfbc 100644 --- a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c +++ b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c @@ -17,10 +17,13 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_PTR(&pin_GPIO15) }, { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_B), MP_ROM_PTR(&pin_GPIO14) }, { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_C), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_D), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, From bb064d719898568183ee9ee2b3c27c3ce5f211ff Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 24 Nov 2020 00:17:56 +0100 Subject: [PATCH 56/64] 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 | 147 +++++++++++++++++++-------- locale/cs.po | 147 +++++++++++++++++++-------- locale/de_DE.po | 207 ++++++++++++++++++++++++++++---------- locale/el.po | 147 +++++++++++++++++++-------- locale/es.po | 206 ++++++++++++++++++++++++++++---------- locale/fil.po | 147 +++++++++++++++++++-------- locale/fr.po | 211 +++++++++++++++++++++++++++++---------- locale/hi.po | 147 +++++++++++++++++++-------- locale/it_IT.po | 147 +++++++++++++++++++-------- locale/ja.po | 196 ++++++++++++++++++++++++++---------- locale/ko.po | 147 +++++++++++++++++++-------- locale/nl.po | 205 +++++++++++++++++++++++++++---------- locale/pl.po | 160 ++++++++++++++++++++--------- locale/pt_BR.po | 210 ++++++++++++++++++++++++++++---------- locale/sv.po | 208 ++++++++++++++++++++++++++++---------- locale/zh_Latn_pinyin.po | 208 ++++++++++++++++++++++++++++---------- 16 files changed, 2083 insertions(+), 757 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index d6672b1e40..782e846e99 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -873,6 +873,10 @@ msgstr "Penyebaran yang diperluas dengan respon pindai tidak didukung." msgid "FFT is defined for ndarrays only" msgstr "FFT didefinisikan hanya untuk ndarrays" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "" @@ -1991,7 +1995,7 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "PERINGATAN: Nama file kode anda mempunyai dua ekstensi\n" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" @@ -2076,10 +2080,6 @@ msgstr "" msgid "addresses is empty" msgstr "" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "" @@ -2088,6 +2088,10 @@ msgstr "" msgid "argsort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -2105,14 +2109,22 @@ msgstr "argumen num/types tidak cocok" msgid "argument should be a '%q' not a '%q'" msgstr "" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -2122,15 +2134,15 @@ msgid "attributes not supported yet" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" +msgid "axis is out of bounds" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" +msgid "axis must be None, or an integer" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" +msgid "axis too long" msgstr "" #: py/builtinevex.c @@ -2335,6 +2347,10 @@ msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "" @@ -2351,10 +2367,6 @@ msgstr "" msgid "cannot perform relative import" msgstr "tidak dapat melakukan relative import" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" - #: py/emitnative.c msgid "casting" msgstr "" @@ -2427,10 +2439,6 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2439,6 +2447,10 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" @@ -2447,10 +2459,6 @@ msgstr "" msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -2480,6 +2488,10 @@ msgstr "" msgid "diff argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2595,6 +2607,10 @@ msgstr "" msgid "first argument must be a function" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2648,8 +2664,8 @@ msgstr "fungsi mendapatkan nilai ganda untuk argumen '%q'" msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" msgstr "" #: py/argcheck.c @@ -2719,6 +2735,7 @@ msgstr "lapisan (padding) tidak benar" msgid "index is out of bounds" msgstr "" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index keluar dari jangkauan" @@ -2743,6 +2760,10 @@ msgstr "" msgid "inline assembler must be a function" msgstr "inline assembler harus sebuah fungsi" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" @@ -2751,6 +2772,10 @@ msgstr "" msgid "input array length must be power of 2" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" @@ -2763,6 +2788,22 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" @@ -2775,6 +2816,10 @@ msgstr "" msgid "input vectors must be of equal length" msgstr "" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2943,6 +2988,10 @@ msgstr "" msgid "max_length must be > 0" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "" @@ -2992,10 +3041,6 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -3078,6 +3123,10 @@ msgstr "non-keyword arg setelah */**" msgid "non-keyword arg after keyword arg" msgstr "non-keyword arg setelah keyword arg" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "" @@ -3090,10 +3139,6 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -3146,6 +3191,10 @@ msgstr "" msgid "odd-length string" msgstr "panjang data string memiliki keganjilan (odd-length)" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c #, fuzzy msgid "offset out of bounds" @@ -3169,6 +3218,14 @@ msgstr "" msgid "operands could not be broadcast together" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3303,6 +3360,10 @@ msgstr "relative import" msgid "requested length %d but object has length %d" msgstr "" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "anotasi return harus sebuah identifier" @@ -3321,8 +3382,8 @@ msgstr "" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" msgstr "" #: py/objstr.c @@ -3348,7 +3409,7 @@ msgid "script compilation not supported" msgstr "kompilasi script tidak didukung" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" +msgid "shape must be a tuple" msgstr "" #: py/objstr.c @@ -3391,10 +3452,6 @@ msgstr "memulai ulang software(soft reboot)\n" msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" @@ -3501,6 +3558,10 @@ msgstr "" msgid "timestamp out of range for platform time_t" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "" @@ -3676,12 +3737,12 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" msgstr "" #: extmod/ulab/code/vector/vectorise.c diff --git a/locale/cs.po b/locale/cs.po index bde3a20b87..6eb69fb672 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -859,6 +859,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "" @@ -1955,7 +1959,7 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" @@ -2034,10 +2038,6 @@ msgstr "" msgid "addresses is empty" msgstr "" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "" @@ -2046,6 +2046,10 @@ msgstr "" msgid "argsort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -2063,14 +2067,22 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -2080,15 +2092,15 @@ msgid "attributes not supported yet" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" +msgid "axis is out of bounds" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" +msgid "axis must be None, or an integer" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" +msgid "axis too long" msgstr "" #: py/builtinevex.c @@ -2292,6 +2304,10 @@ msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "" @@ -2308,10 +2324,6 @@ msgstr "" msgid "cannot perform relative import" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" - #: py/emitnative.c msgid "casting" msgstr "" @@ -2384,10 +2396,6 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2396,6 +2404,10 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" @@ -2404,10 +2416,6 @@ msgstr "" msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -2437,6 +2445,10 @@ msgstr "" msgid "diff argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2552,6 +2564,10 @@ msgstr "" msgid "first argument must be a function" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2605,8 +2621,8 @@ msgstr "" msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" msgstr "" #: py/argcheck.c @@ -2676,6 +2692,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2700,6 +2717,10 @@ msgstr "" msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" @@ -2708,6 +2729,10 @@ msgstr "" msgid "input array length must be power of 2" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" @@ -2720,6 +2745,22 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" @@ -2732,6 +2773,10 @@ msgstr "" msgid "input vectors must be of equal length" msgstr "" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2900,6 +2945,10 @@ msgstr "" msgid "max_length must be > 0" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "" @@ -2949,10 +2998,6 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -3035,6 +3080,10 @@ msgstr "" msgid "non-keyword arg after keyword arg" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "" @@ -3047,10 +3096,6 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -3103,6 +3148,10 @@ msgstr "" msgid "odd-length string" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -3125,6 +3174,14 @@ msgstr "" msgid "operands could not be broadcast together" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3259,6 +3316,10 @@ msgstr "" msgid "requested length %d but object has length %d" msgstr "" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "" @@ -3277,8 +3338,8 @@ msgstr "" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" msgstr "" #: py/objstr.c @@ -3304,7 +3365,7 @@ msgid "script compilation not supported" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" +msgid "shape must be a tuple" msgstr "" #: py/objstr.c @@ -3347,10 +3408,6 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" @@ -3456,6 +3513,10 @@ msgstr "" msgid "timestamp out of range for platform time_t" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "" @@ -3631,12 +3692,12 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" msgstr "" #: extmod/ulab/code/vector/vectorise.c diff --git a/locale/de_DE.po b/locale/de_DE.po index dabc486595..f103339109 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -870,6 +870,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "FFT ist nur für ndarrays definiert" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "SSL Handshake fehlgeschlagen" @@ -2004,7 +2008,7 @@ msgid "WARNING: Your code filename has two extensions\n" msgstr "" "WARNUNG: Der Dateiname deines Programms hat zwei Dateityperweiterungen\n" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" @@ -2093,10 +2097,6 @@ msgstr "Adresse außerhalb der Grenzen" msgid "addresses is empty" msgstr "adresses ist leer" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "arctan2 ist nur für Skalare und ndarrays implementiert" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "arg ist eine leere Sequenz" @@ -2105,6 +2105,10 @@ msgstr "arg ist eine leere Sequenz" msgid "argsort argument must be an ndarray" msgstr "Das Argument argsort muss ein ndarray sein" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "Argument hat falschen Typ" @@ -2122,14 +2126,22 @@ msgstr "Anzahl/Typen der Argumente passen nicht" msgid "argument should be a '%q' not a '%q'" msgstr "Argument sollte '%q' sein, nicht '%q'" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "Argumente müssen ndarrays sein" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "Array/Bytes auf der rechten Seite erforderlich" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "Sie haben versucht argmin/argmax von einer leeren Sequenz zu bekommen" @@ -2139,16 +2151,16 @@ msgid "attributes not supported yet" msgstr "Attribute werden noch nicht unterstützt" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" -msgstr "Die Achse muss -1, 0, Keine oder 1 sein" +msgid "axis is out of bounds" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" -msgstr "Die Achse muss -1, 0 oder 1 sein" +msgid "axis must be None, or an integer" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" -msgstr "Die Achse muss None, 0 oder 1 sein" +msgid "axis too long" +msgstr "" #: py/builtinevex.c msgid "bad compile mode" @@ -2359,6 +2371,10 @@ msgstr "" "kann nicht von der manuellen Feldspezifikation zur automatischen " "Feldnummerierung wechseln" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "Kann '%q' Instanzen nicht erstellen" @@ -2375,11 +2391,6 @@ msgstr "Name %q kann nicht importiert werden" msgid "cannot perform relative import" msgstr "kann keinen relativen Import durchführen" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" -"Array kann nicht umgeformt werden (inkompatible Eingabe- / Ausgabeform)" - #: py/emitnative.c msgid "casting" msgstr "Umwandlung (cast)" @@ -2454,10 +2465,6 @@ msgstr "Convolve-Argumente müssen ndarrays sein" msgid "convolve arguments must not be empty" msgstr "Convolve Argumente dürfen nicht leer sein" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "Eingabearray konnte nicht aus der Form übertragen werden" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "Vandermonde-Matrix konnte nicht invertiert werden" @@ -2466,6 +2473,10 @@ msgstr "Vandermonde-Matrix konnte nicht invertiert werden" msgid "couldn't determine SD card version" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" @@ -2474,10 +2485,6 @@ msgstr "" msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "ddof muss kleiner als die Länge des Datensatzes sein" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "Dezimalzahlen nicht unterstützt" @@ -2509,6 +2516,10 @@ msgstr "Die Wörterbuch-Aktualisierungssequenz hat eine falsche Länge" msgid "diff argument must be an ndarray" msgstr "diff Argument muss ein ndarray sein" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2624,6 +2635,10 @@ msgstr "" msgid "first argument must be a function" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "Das erste Argument muss iterierbar sein" @@ -2677,9 +2692,9 @@ msgstr "Funktion hat mehrere Werte für Argument '%q'" msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" -msgstr "Die Funktion ist nur für Skalare und Ndarrays implementiert" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" +msgstr "" #: py/argcheck.c #, c-format @@ -2749,6 +2764,7 @@ msgstr "padding ist inkorrekt" msgid "index is out of bounds" msgstr "Index ist außerhalb der Grenzen" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index außerhalb der Reichweite" @@ -2773,6 +2789,10 @@ msgstr "Länge von initial_value ist falsch" msgid "inline assembler must be a function" msgstr "inline assembler muss eine function sein" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "Das Eingabeargument muss eine Ganzzahl oder ein 2-Tupel sein" @@ -2781,6 +2801,10 @@ msgstr "Das Eingabeargument muss eine Ganzzahl oder ein 2-Tupel sein" msgid "input array length must be power of 2" msgstr "Die Länge des Eingabearrays muss eine Potenz von 2 sein" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "Eingabedaten müssen iterierbar sein" @@ -2793,6 +2817,22 @@ msgstr "Eingabematrix ist asymmetrisch" msgid "input matrix is singular" msgstr "Eingabematrix ist singulär" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "Die Eingabe muss eine quadratische Matrix sein" @@ -2805,6 +2845,10 @@ msgstr "Die Eingabe muss Tupel, Liste, Bereich oder Ndarray sein" msgid "input vectors must be of equal length" msgstr "Eingabevektoren müssen gleich lang sein" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "int() arg 2 muss >= 2 und <= 36 sein" @@ -2979,6 +3023,10 @@ msgstr "max_length muss 0-%d sein, wenn fixed_length %s ist" msgid "max_length must be > 0" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "maximale Rekursionstiefe überschritten" @@ -3028,10 +3076,6 @@ msgstr "muss ein Objekt verursachen (raise)" msgid "must use keyword argument for key function" msgstr "muss Schlüsselwortargument für key function verwenden" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "n muss zwischen 0 und 9 liegen" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "Name '%q' ist nirgends definiert worden (Schreibweise kontrollieren)" @@ -3114,6 +3158,10 @@ msgstr "Nicht-Schlüsselwort arg nach * / **" msgid "non-keyword arg after keyword arg" msgstr "Nicht-Schlüsselwort Argument nach Schlüsselwort Argument" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "keine 128-bit UUID" @@ -3127,10 +3175,6 @@ msgstr "" msgid "not enough arguments for format string" msgstr "Nicht genügend Argumente für den Formatierungs-String" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "Die Anzahl der Argumente muss 2 oder 3 sein" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "Die Anzahl der Punkte muss mindestens 2 betragen" @@ -3183,6 +3227,10 @@ msgstr "Objekt mit Pufferprotokoll (buffer protocol) erforderlich" msgid "odd-length string" msgstr "String mit ungerader Länge" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "offset außerhalb der Grenzen" @@ -3206,6 +3254,14 @@ msgstr "" msgid "operands could not be broadcast together" msgstr "Operanden konnten nicht zusammen gesendet werden" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "Die Operation ist für ndarrays nicht implementiert" @@ -3342,6 +3398,10 @@ msgstr "relativer Import" msgid "requested length %d but object has length %d" msgstr "die ersuchte Länge ist %d, aber das Objekt hat eine Länge von %d" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "Rückgabewert-Beschreibung muss ein Identifier sein" @@ -3360,9 +3420,9 @@ msgstr "rgb_pins[%d] dupliziert eine andere Pinbelegung" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "rgb_pins [%d] befindet sich nicht am selben Port wie clock" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" -msgstr "Die rechte Seite muss ein Ndarray oder ein Skalar sein" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" +msgstr "" #: py/objstr.c msgid "rsplit(None,n)" @@ -3389,8 +3449,8 @@ msgid "script compilation not supported" msgstr "kompilieren von Skripten nicht unterstützt" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" -msgstr "Form muss ein 2-Tupel sein" +msgid "shape must be a tuple" +msgstr "" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3432,10 +3492,6 @@ msgstr "weicher reboot\n" msgid "sort argument must be an ndarray" msgstr "sortierungs Argument muss ein ndarray sein" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" @@ -3542,6 +3598,10 @@ msgstr "Zeitlimit beim warten auf v2 Karte" msgid "timestamp out of range for platform time_t" msgstr "Zeitstempel außerhalb des Bereichs für Plattform time_t" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "zu viele Argumente mit dem angegebenen Format" @@ -3721,13 +3781,13 @@ msgstr "" msgid "window must be <= interval" msgstr "Fenster muss <= Intervall sein" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" -msgstr "falscher Argumenttyp" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" +msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" -msgstr "falscher Indextyp" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" +msgstr "" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" @@ -3777,6 +3837,49 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "arctan2 is implemented for scalars and ndarrays only" +#~ msgstr "arctan2 ist nur für Skalare und ndarrays implementiert" + +#~ msgid "axis must be -1, 0, None, or 1" +#~ msgstr "Die Achse muss -1, 0, Keine oder 1 sein" + +#~ msgid "axis must be -1, 0, or 1" +#~ msgstr "Die Achse muss -1, 0 oder 1 sein" + +#~ msgid "axis must be None, 0, or 1" +#~ msgstr "Die Achse muss None, 0 oder 1 sein" + +#~ msgid "cannot reshape array (incompatible input/output shape)" +#~ msgstr "" +#~ "Array kann nicht umgeformt werden (inkompatible Eingabe- / Ausgabeform)" + +#~ msgid "could not broadast input array from shape" +#~ msgstr "Eingabearray konnte nicht aus der Form übertragen werden" + +#~ msgid "ddof must be smaller than length of data set" +#~ msgstr "ddof muss kleiner als die Länge des Datensatzes sein" + +#~ msgid "function is implemented for scalars and ndarrays only" +#~ msgstr "Die Funktion ist nur für Skalare und Ndarrays implementiert" + +#~ msgid "n must be between 0, and 9" +#~ msgstr "n muss zwischen 0 und 9 liegen" + +#~ msgid "number of arguments must be 2, or 3" +#~ msgstr "Die Anzahl der Argumente muss 2 oder 3 sein" + +#~ msgid "right hand side must be an ndarray, or a scalar" +#~ msgstr "Die rechte Seite muss ein Ndarray oder ein Skalar sein" + +#~ msgid "shape must be a 2-tuple" +#~ msgstr "Form muss ein 2-Tupel sein" + +#~ msgid "wrong argument type" +#~ msgstr "falscher Argumenttyp" + +#~ msgid "wrong index type" +#~ msgstr "falscher Indextyp" + #~ msgid "" #~ "\n" #~ "To exit, please reset the board without " diff --git a/locale/el.po b/locale/el.po index 0d35c20ceb..85bf0ab44f 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -854,6 +854,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "" @@ -1950,7 +1954,7 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" @@ -2029,10 +2033,6 @@ msgstr "" msgid "addresses is empty" msgstr "" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "" @@ -2041,6 +2041,10 @@ msgstr "" msgid "argsort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -2058,14 +2062,22 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -2075,15 +2087,15 @@ msgid "attributes not supported yet" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" +msgid "axis is out of bounds" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" +msgid "axis must be None, or an integer" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" +msgid "axis too long" msgstr "" #: py/builtinevex.c @@ -2287,6 +2299,10 @@ msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "" @@ -2303,10 +2319,6 @@ msgstr "" msgid "cannot perform relative import" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" - #: py/emitnative.c msgid "casting" msgstr "" @@ -2379,10 +2391,6 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2391,6 +2399,10 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" @@ -2399,10 +2411,6 @@ msgstr "" msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -2432,6 +2440,10 @@ msgstr "" msgid "diff argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2547,6 +2559,10 @@ msgstr "" msgid "first argument must be a function" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2600,8 +2616,8 @@ msgstr "" msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" msgstr "" #: py/argcheck.c @@ -2671,6 +2687,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2695,6 +2712,10 @@ msgstr "" msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" @@ -2703,6 +2724,10 @@ msgstr "" msgid "input array length must be power of 2" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" @@ -2715,6 +2740,22 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" @@ -2727,6 +2768,10 @@ msgstr "" msgid "input vectors must be of equal length" msgstr "" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2895,6 +2940,10 @@ msgstr "" msgid "max_length must be > 0" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "" @@ -2944,10 +2993,6 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -3030,6 +3075,10 @@ msgstr "" msgid "non-keyword arg after keyword arg" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "" @@ -3042,10 +3091,6 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -3098,6 +3143,10 @@ msgstr "" msgid "odd-length string" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -3120,6 +3169,14 @@ msgstr "" msgid "operands could not be broadcast together" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3254,6 +3311,10 @@ msgstr "" msgid "requested length %d but object has length %d" msgstr "" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "" @@ -3272,8 +3333,8 @@ msgstr "" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" msgstr "" #: py/objstr.c @@ -3299,7 +3360,7 @@ msgid "script compilation not supported" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" +msgid "shape must be a tuple" msgstr "" #: py/objstr.c @@ -3342,10 +3403,6 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" @@ -3451,6 +3508,10 @@ msgstr "" msgid "timestamp out of range for platform time_t" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "" @@ -3626,12 +3687,12 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" msgstr "" #: extmod/ulab/code/vector/vectorise.c diff --git a/locale/es.po b/locale/es.po index bdb4b68a5d..538a2944e6 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: 2020-11-15 16:28+0000\n" "Last-Translator: RubenD \n" "Language-Team: \n" @@ -874,6 +874,10 @@ msgstr "No se admiten anuncios extendidos con respuesta de escaneo." msgid "FFT is defined for ndarrays only" msgstr "FFT se define solo para ndarrays" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "Fallo en saludo SSL" @@ -2004,7 +2008,7 @@ msgstr "Tiempo de espera agotado para lectura de voltaje" msgid "WARNING: Your code filename has two extensions\n" msgstr "ADVERTENCIA: El nombre de archivo de tu código tiene dos extensiones\n" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" "WatchDogTimer no se puede desinicializar luego de definirse en modo RESET" @@ -2092,10 +2096,6 @@ msgstr "address fuera de límites" msgid "addresses is empty" msgstr "addresses esta vacío" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "arctan2 se encuentra implementado solo para escalares y ndarrays" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "argumento es una secuencia vacía" @@ -2104,6 +2104,10 @@ msgstr "argumento es una secuencia vacía" msgid "argsort argument must be an ndarray" msgstr "El argumento para argsort debe ser un ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "el argumento tiene un tipo erroneo" @@ -2121,14 +2125,22 @@ msgstr "argumento número/tipos no coinciden" msgid "argument should be a '%q' not a '%q'" msgstr "argumento deberia ser un '%q' no un '%q'" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "argumentos deben ser ndarrays" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "array/bytes requeridos en el lado derecho" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "se trató de traer argmin/argmax de una secuencia vacía" @@ -2138,16 +2150,16 @@ msgid "attributes not supported yet" msgstr "atributos aún no soportados" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" -msgstr "eje debe ser -1, 0, None o 1" +msgid "axis is out of bounds" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" -msgstr "eje debe ser -1, 0, o 1" +msgid "axis must be None, or an integer" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" -msgstr "eje debe ser None, 0, o 1" +msgid "axis too long" +msgstr "" #: py/builtinevex.c msgid "bad compile mode" @@ -2355,6 +2367,10 @@ msgstr "" "no se puede cambiar de especificación de campo manual a numeración " "automática de campos" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "no se pueden crear '%q' instancias" @@ -2371,10 +2387,6 @@ msgstr "no se puede importar name '%q'" msgid "cannot perform relative import" msgstr "no se puedo realizar importación relativa" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "no se puede reformar el arreglo (forma de entrada/salida incompatible)" - #: py/emitnative.c msgid "casting" msgstr "convirtiendo tipo" @@ -2447,10 +2459,6 @@ msgstr "los argumentos para convolve deben ser ndarrays" msgid "convolve arguments must not be empty" msgstr "los argumentos para convolve no deben estar vacíos" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "no se pudo anunciar la matriz de entrada desde la forma" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "no se pudo invertir la matriz de Vandermonde" @@ -2459,6 +2467,10 @@ msgstr "no se pudo invertir la matriz de Vandermonde" msgid "couldn't determine SD card version" msgstr "no se pudo determinar la versión de la tarjeta SD" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "los datos deben permitir iteración" @@ -2467,10 +2479,6 @@ msgstr "los datos deben permitir iteración" msgid "data must be of equal length" msgstr "los datos deben ser de igual tamaño" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "ddof debe ser menor que la longitud del conjunto de datos" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "números decimales no soportados" @@ -2502,6 +2510,10 @@ msgstr "la secuencia de actualizacion del dict tiene una longitud incorrecta" msgid "diff argument must be an ndarray" msgstr "El argumento diff debe ser un ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2617,6 +2629,10 @@ msgstr "se debe poder llamar al primer argumento" msgid "first argument must be a function" msgstr "el primer argumento debe ser una función" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "el primer argumento debe permitir iteración" @@ -2670,9 +2686,9 @@ msgstr "la función tiene múltiples valores para el argumento '%q'" msgid "function has the same sign at the ends of interval" msgstr "la función tiene el mismo signo a extremos del intervalo" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" -msgstr "la función está implementada solo para escalares y ndarrays" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" +msgstr "" #: py/argcheck.c #, c-format @@ -2741,6 +2757,7 @@ msgstr "relleno (padding) incorrecto" msgid "index is out of bounds" msgstr "el índice está fuera de límites" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index fuera de rango" @@ -2765,6 +2782,10 @@ msgstr "el tamaño de initial_value es incorrecto" msgid "inline assembler must be a function" msgstr "ensamblador en línea debe ser una función" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "el argumento de entrada debe ser un entero o una tupla de par" @@ -2773,6 +2794,10 @@ msgstr "el argumento de entrada debe ser un entero o una tupla de par" msgid "input array length must be power of 2" msgstr "el tamaño del arreglo de entrada debe ser potencia de 2" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "los datos de entrada deben permitir iteración" @@ -2785,6 +2810,22 @@ msgstr "la matriz de entrada es asimétrica" msgid "input matrix is singular" msgstr "la matriz de entrada es singular" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "la entrada debe ser una matriz cuadrada" @@ -2797,6 +2838,10 @@ msgstr "la entrada debe ser una tupla, lista, rango o ndarray" msgid "input vectors must be of equal length" msgstr "los vectores de entrada deben ser de igual tamaño" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "int() arg 2 debe ser >= 2 y <= 36" @@ -2968,6 +3013,10 @@ msgstr "max_length debe ser 0-%d cuando fixed_length es %s" msgid "max_length must be > 0" msgstr "max_lenght debe ser > 0" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "profundidad máxima de recursión excedida" @@ -3017,10 +3066,6 @@ msgstr "debe hacer un raise de un objeto" msgid "must use keyword argument for key function" msgstr "debe utilizar argumento de palabra clave para la función clave" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "n debe estar entre 0 y 9" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "name '%q' no esta definido" @@ -3105,6 +3150,10 @@ msgstr "" "no deberia estar/tener agumento por palabra clave despues de argumento por " "palabra clave" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "no es 128-bit UUID" @@ -3118,10 +3167,6 @@ msgstr "" msgid "not enough arguments for format string" msgstr "no suficientes argumentos para format string" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "el número de argumentos debe ser 2 o 3" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "el número de puntos debe ser al menos 2" @@ -3174,6 +3219,10 @@ msgstr "objeto con protocolo de buffer requerido" msgid "odd-length string" msgstr "string de longitud impar" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "offset fuera de límites" @@ -3196,6 +3245,14 @@ msgstr "solo se admiten segmentos con step=1 (alias None)" msgid "operands could not be broadcast together" msgstr "los operandos no se pueden transmitir juntos" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "la operación no está implementada para ndarrays" @@ -3330,6 +3387,10 @@ msgstr "import relativo" msgid "requested length %d but object has length %d" msgstr "longitud solicitada %d pero el objeto tiene longitud %d" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "la anotación de retorno debe ser un identificador" @@ -3348,9 +3409,9 @@ msgstr "rgb_pins[%d] duplica otra asignación de pin" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "rgb_pins[%d] no está en el mismo puerto que el reloj" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" -msgstr "el lado derecho debe ser un ndarray o escalar" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" +msgstr "" #: py/objstr.c msgid "rsplit(None,n)" @@ -3377,8 +3438,8 @@ msgid "script compilation not supported" msgstr "script de compilación no soportado" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" -msgstr "la forma debe ser una tupla de 2" +msgid "shape must be a tuple" +msgstr "" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3420,10 +3481,6 @@ msgstr "reinicio suave\n" msgid "sort argument must be an ndarray" msgstr "argumento de ordenado debe ser un ndarray" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "el arreglo sos debe de forma (n_section, 6)" @@ -3530,6 +3587,10 @@ msgstr "tiempo de espera agotado esperando a tarjeta v2" msgid "timestamp out of range for platform time_t" msgstr "timestamp fuera de rango para plataform time_t" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "demasiados argumentos provistos con el formato dado" @@ -3705,13 +3766,13 @@ msgstr "el ancho debe ser mayor que cero" msgid "window must be <= interval" msgstr "la ventana debe ser <= intervalo" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" -msgstr "tipo de argumento incorrecto" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" +msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" -msgstr "tipo de índice incorrecto" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" +msgstr "" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" @@ -3761,6 +3822,49 @@ msgstr "zi debe ser de tipo flotante" msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" +#~ msgid "arctan2 is implemented for scalars and ndarrays only" +#~ msgstr "arctan2 se encuentra implementado solo para escalares y ndarrays" + +#~ msgid "axis must be -1, 0, None, or 1" +#~ msgstr "eje debe ser -1, 0, None o 1" + +#~ msgid "axis must be -1, 0, or 1" +#~ msgstr "eje debe ser -1, 0, o 1" + +#~ msgid "axis must be None, 0, or 1" +#~ msgstr "eje debe ser None, 0, o 1" + +#~ msgid "cannot reshape array (incompatible input/output shape)" +#~ msgstr "" +#~ "no se puede reformar el arreglo (forma de entrada/salida incompatible)" + +#~ msgid "could not broadast input array from shape" +#~ msgstr "no se pudo anunciar la matriz de entrada desde la forma" + +#~ msgid "ddof must be smaller than length of data set" +#~ msgstr "ddof debe ser menor que la longitud del conjunto de datos" + +#~ msgid "function is implemented for scalars and ndarrays only" +#~ msgstr "la función está implementada solo para escalares y ndarrays" + +#~ msgid "n must be between 0, and 9" +#~ msgstr "n debe estar entre 0 y 9" + +#~ msgid "number of arguments must be 2, or 3" +#~ msgstr "el número de argumentos debe ser 2 o 3" + +#~ msgid "right hand side must be an ndarray, or a scalar" +#~ msgstr "el lado derecho debe ser un ndarray o escalar" + +#~ msgid "shape must be a 2-tuple" +#~ msgstr "la forma debe ser una tupla de 2" + +#~ msgid "wrong argument type" +#~ msgstr "tipo de argumento incorrecto" + +#~ msgid "wrong index type" +#~ msgstr "tipo de índice incorrecto" + #~ msgid "specify size or data, but not both" #~ msgstr "especifique o tamaño o datos, pero no ambos" diff --git a/locale/fil.po b/locale/fil.po index c74e13c6c8..86178a9a14 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -867,6 +867,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "" @@ -1976,7 +1980,7 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "BABALA: Ang pangalan ng file ay may dalawang extension\n" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" @@ -2061,10 +2065,6 @@ msgstr "wala sa sakop ang address" msgid "addresses is empty" msgstr "walang laman ang address" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "arg ay walang laman na sequence" @@ -2073,6 +2073,10 @@ msgstr "arg ay walang laman na sequence" msgid "argsort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "may maling type ang argument" @@ -2090,14 +2094,22 @@ msgstr "hindi tugma ang argument num/types" msgid "argument should be a '%q' not a '%q'" msgstr "argument ay dapat na '%q' hindi '%q'" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "array/bytes kinakailangan sa kanang bahagi" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -2107,15 +2119,15 @@ msgid "attributes not supported yet" msgstr "attributes hindi sinusuportahan" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" +msgid "axis is out of bounds" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" +msgid "axis must be None, or an integer" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" +msgid "axis too long" msgstr "" #: py/builtinevex.c @@ -2326,6 +2338,10 @@ msgstr "" "hindi mapalitan ang manual field specification sa awtomatikong field " "numbering" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "hindi magawa '%q' instances" @@ -2342,10 +2358,6 @@ msgstr "hindi ma-import ang name %q" msgid "cannot perform relative import" msgstr "hindi maaring isagawa ang relative import" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" - #: py/emitnative.c msgid "casting" msgstr "casting" @@ -2418,10 +2430,6 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2430,6 +2438,10 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" @@ -2438,10 +2450,6 @@ msgstr "" msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "decimal numbers hindi sinusuportahan" @@ -2475,6 +2483,10 @@ msgstr "may mali sa haba ng dict update sequence" msgid "diff argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2591,6 +2603,10 @@ msgstr "" msgid "first argument must be a function" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2644,8 +2660,8 @@ msgstr "ang function ay nakakuha ng maraming values para sa argument '%q'" msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" msgstr "" #: py/argcheck.c @@ -2716,6 +2732,7 @@ msgstr "mali ang padding" msgid "index is out of bounds" msgstr "" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index wala sa sakop" @@ -2740,6 +2757,10 @@ msgstr "" msgid "inline assembler must be a function" msgstr "inline assembler ay dapat na function" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" @@ -2748,6 +2769,10 @@ msgstr "" msgid "input array length must be power of 2" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" @@ -2760,6 +2785,22 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" @@ -2772,6 +2813,10 @@ msgstr "" msgid "input vectors must be of equal length" msgstr "" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "int() arg 2 ay dapat >=2 at <= 36" @@ -2944,6 +2989,10 @@ msgstr "" msgid "max_length must be > 0" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "lumagpas ang maximum recursion depth" @@ -2993,10 +3042,6 @@ msgstr "dapat itaas ang isang object" msgid "must use keyword argument for key function" msgstr "dapat gumamit ng keyword argument para sa key function" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "name '%q' ay hindi defined" @@ -3079,6 +3124,10 @@ msgstr "non-keyword arg sa huli ng */**" msgid "non-keyword arg after keyword arg" msgstr "non-keyword arg sa huli ng keyword arg" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "" @@ -3091,10 +3140,6 @@ msgstr "hindi lahat ng arguments na i-convert habang string formatting" msgid "not enough arguments for format string" msgstr "kulang sa arguments para sa format string" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -3147,6 +3192,10 @@ msgstr "object na may buffer protocol kinakailangan" msgid "odd-length string" msgstr "odd-length string" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c #, fuzzy msgid "offset out of bounds" @@ -3170,6 +3219,14 @@ msgstr "ang mga slices lamang na may hakbang = 1 (aka None) ang sinusuportahan" msgid "operands could not be broadcast together" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3305,6 +3362,10 @@ msgstr "relative import" msgid "requested length %d but object has length %d" msgstr "hiniling ang haba %d ngunit may haba ang object na %d" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "return annotation ay dapat na identifier" @@ -3323,8 +3384,8 @@ msgstr "" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" msgstr "" #: py/objstr.c @@ -3352,7 +3413,7 @@ msgid "script compilation not supported" msgstr "script kompilasyon hindi supportado" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" +msgid "shape must be a tuple" msgstr "" #: py/objstr.c @@ -3395,10 +3456,6 @@ msgstr "malambot na reboot\n" msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" @@ -3506,6 +3563,10 @@ msgstr "" msgid "timestamp out of range for platform time_t" msgstr "wala sa sakop ng timestamp ang platform time_t" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "masyadong maraming mga argumento na ibinigay sa ibinigay na format" @@ -3681,12 +3742,12 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" msgstr "" #: extmod/ulab/code/vector/vectorise.c diff --git a/locale/fr.po b/locale/fr.po index b58ca6560b..17e6e905d1 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: 2020-11-20 22:28+0000\n" "Last-Translator: Noel Gaetan \n" "Language: fr\n" @@ -879,6 +879,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "La FFT est définie pour les ndarrays uniquement" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "Échec du handshake SSL" @@ -2014,7 +2018,7 @@ msgstr "La lecture de la tension a expiré" msgid "WARNING: Your code filename has two extensions\n" msgstr "ATTENTION : le nom de fichier de votre code a deux extensions\n" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" "WatchDogTimer ne peut pas être désinitialisé une fois que le mode est réglé " @@ -2102,10 +2106,6 @@ msgstr "adresse hors limites" msgid "addresses is empty" msgstr "adresses vides" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "arctan2 est implémenté uniquement pour les scalaires et les ndarrays" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "l'argument est une séquence vide" @@ -2114,6 +2114,10 @@ msgstr "l'argument est une séquence vide" msgid "argsort argument must be an ndarray" msgstr "L'argument argsort doit être un ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "l'argument est d'un mauvais type" @@ -2131,14 +2135,22 @@ msgstr "argument num/types ne correspond pas" msgid "argument should be a '%q' not a '%q'" msgstr "l'argument devrait être un(e) '%q', pas '%q'" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "les arguments doivent être des ndarrays" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "tableau/octets requis à droite" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "tenter d'obtenir argmin / argmax d'une séquence vide" @@ -2148,16 +2160,16 @@ msgid "attributes not supported yet" msgstr "attribut pas encore supporté" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" -msgstr "l'axe doit être -1, 0, None ou 1" +msgid "axis is out of bounds" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" -msgstr "l'axe doit être -1, 0 ou 1" +msgid "axis must be None, or an integer" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" -msgstr "l'axe doit être None, 0 ou 1" +msgid "axis too long" +msgstr "" #: py/builtinevex.c msgid "bad compile mode" @@ -2369,6 +2381,10 @@ msgstr "" "impossible de passer d'une spécification manuelle des champs à une " "énumération auto" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "ne peut pas créer une instance de '%q'" @@ -2385,11 +2401,6 @@ msgstr "ne peut pas importer le nom %q" msgid "cannot perform relative import" msgstr "ne peut pas réaliser un import relatif" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" -"ne peut pas remodeler le tableau (forme d'entrée / sortie incompatible)" - #: py/emitnative.c msgid "casting" msgstr "typage" @@ -2464,10 +2475,6 @@ msgstr "les arguments convolve doivent être des ndarrays" msgid "convolve arguments must not be empty" msgstr "les arguments convolve ne doivent pas être vides" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "n'a pas pu diffuser le tableau d'entrée à partir de la forme" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "n'a pas pu inverser la matrice Vandermonde" @@ -2476,6 +2483,10 @@ msgstr "n'a pas pu inverser la matrice Vandermonde" msgid "couldn't determine SD card version" msgstr "impossible de déterminer la version de la carte SD" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "les données doivent être les objets iterables" @@ -2484,10 +2495,6 @@ msgstr "les données doivent être les objets iterables" msgid "data must be of equal length" msgstr "les données doivent être de longueur égale" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "ddof doit être inférieur à la longueur de l'ensemble de données" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "nombres décimaux non supportés" @@ -2519,6 +2526,10 @@ msgstr "la séquence de mise à jour de dict a une mauvaise longueur" msgid "diff argument must be an ndarray" msgstr "l'argument diff doit être un ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2636,6 +2647,10 @@ msgstr "le premier argument doit être un appelable" msgid "first argument must be a function" msgstr "le premier argument doit être une fonction" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "le premier argument doit être un itérable" @@ -2689,10 +2704,9 @@ msgstr "la fonction a reçu plusieurs valeurs pour l'argument '%q'" msgid "function has the same sign at the ends of interval" msgstr "la fonction a le même signe aux extrémités de l’intervalle" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" msgstr "" -"la fonction est implémentée pour les scalaires et les ndarrays uniquement" #: py/argcheck.c #, c-format @@ -2761,6 +2775,7 @@ msgstr "espacement incorrect" msgid "index is out of bounds" msgstr "l'index est hors limites" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index hors gamme" @@ -2786,6 +2801,10 @@ msgstr "la longueur de initial_value est incorrecte" msgid "inline assembler must be a function" msgstr "l'assembleur doit être une fonction" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "l'argument d'entrée doit être un entier ou un tuple 2" @@ -2794,6 +2813,10 @@ msgstr "l'argument d'entrée doit être un entier ou un tuple 2" msgid "input array length must be power of 2" msgstr "la longueur du tableau d'entrée doit être une puissance de 2" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "les données d'entrée doivent être un itérable" @@ -2806,6 +2829,22 @@ msgstr "la matrice d'entrée est asymétrique" msgid "input matrix is singular" msgstr "la matrice d'entrée est singulière" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "l'entrée doit être une matrice carrée" @@ -2818,6 +2857,10 @@ msgstr "l'entrée doit être tuple, list, range ou ndarray" msgid "input vectors must be of equal length" msgstr "les vecteurs d'entrée doivent être de longueur égale" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "l'argument 2 de int() doit être >=2 et <=36" @@ -2990,6 +3033,10 @@ msgstr "max_length doit être 0-%d lorsque fixed_length est %s" msgid "max_length must be > 0" msgstr "max_length doit être > 0" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "profondeur maximale de récursivité dépassée" @@ -3039,10 +3086,6 @@ msgstr "doit lever un objet" msgid "must use keyword argument for key function" msgstr "doit utiliser un argument nommé pour une fonction key" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "n doit être compris entre 0 et 9" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "nom '%q' non défini" @@ -3126,6 +3169,10 @@ msgstr "argument non-nommé après */**" msgid "non-keyword arg after keyword arg" msgstr "argument non-nommé après argument nommé" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "n'est pas un UUID 128 bits" @@ -3139,10 +3186,6 @@ msgstr "" msgid "not enough arguments for format string" msgstr "pas assez d'arguments pour la chaîne de format" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "le nombre d'arguments doit être 2 ou 3" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "le nombre de points doit être d'au moins 2" @@ -3195,6 +3238,10 @@ msgstr "un objet avec un protocole de tampon est nécessaire" msgid "odd-length string" msgstr "chaîne de longueur impaire" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "décalage hors limites" @@ -3217,6 +3264,14 @@ msgstr "seules les tranches avec 'step=1' (cad None) sont supportées" msgid "operands could not be broadcast together" msgstr "les opérandes ne pouvaient pas être diffusés ensemble" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "l'opération n'est pas implémentée sur les ndarrays" @@ -3354,6 +3409,10 @@ msgstr "import relatif" msgid "requested length %d but object has length %d" msgstr "la longueur requise est %d mais l'objet est long de %d" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "l'annotation de return doit être un identifiant" @@ -3372,9 +3431,9 @@ msgstr "rgb_pins[%d] duplique une autre affectation de broches" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "rgb_pins[%d] n'est pas sur le même port que l'horloge" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" -msgstr "le côté droit doit être un ndarray ou un scalaire" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" +msgstr "" #: py/objstr.c msgid "rsplit(None,n)" @@ -3401,8 +3460,8 @@ msgid "script compilation not supported" msgstr "compilation de script non supportée" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" -msgstr "la forme doit être un tuple 2" +msgid "shape must be a tuple" +msgstr "" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3444,10 +3503,6 @@ msgstr "redémarrage logiciel\n" msgid "sort argument must be an ndarray" msgstr "l'argument de «sort» doit être un ndarray" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "sorted axis ne peut pas dépasser 65535" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "le tableau sos doit être de forme (n_section, 6)" @@ -3554,6 +3609,10 @@ msgstr "Délai d’expiration dépassé en attendant une carte v2" msgid "timestamp out of range for platform time_t" msgstr "'timestamp' hors bornes pour 'time_t' de la plateforme" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "trop d'arguments fournis avec ce format" @@ -3729,13 +3788,13 @@ msgstr "width doit être plus grand que zero" msgid "window must be <= interval" msgstr "la fenêtre doit être <= intervalle" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" -msgstr "type d'argument incorrect" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" +msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" -msgstr "type d'index incorrect" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" +msgstr "" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" @@ -3785,6 +3844,54 @@ 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 "arctan2 is implemented for scalars and ndarrays only" +#~ msgstr "" +#~ "arctan2 est implémenté uniquement pour les scalaires et les ndarrays" + +#~ msgid "axis must be -1, 0, None, or 1" +#~ msgstr "l'axe doit être -1, 0, None ou 1" + +#~ msgid "axis must be -1, 0, or 1" +#~ msgstr "l'axe doit être -1, 0 ou 1" + +#~ msgid "axis must be None, 0, or 1" +#~ msgstr "l'axe doit être None, 0 ou 1" + +#~ msgid "cannot reshape array (incompatible input/output shape)" +#~ msgstr "" +#~ "ne peut pas remodeler le tableau (forme d'entrée / sortie incompatible)" + +#~ msgid "could not broadast input array from shape" +#~ msgstr "n'a pas pu diffuser le tableau d'entrée à partir de la forme" + +#~ msgid "ddof must be smaller than length of data set" +#~ msgstr "ddof doit être inférieur à la longueur de l'ensemble de données" + +#~ msgid "function is implemented for scalars and ndarrays only" +#~ msgstr "" +#~ "la fonction est implémentée pour les scalaires et les ndarrays uniquement" + +#~ msgid "n must be between 0, and 9" +#~ msgstr "n doit être compris entre 0 et 9" + +#~ msgid "number of arguments must be 2, or 3" +#~ msgstr "le nombre d'arguments doit être 2 ou 3" + +#~ msgid "right hand side must be an ndarray, or a scalar" +#~ msgstr "le côté droit doit être un ndarray ou un scalaire" + +#~ msgid "shape must be a 2-tuple" +#~ msgstr "la forme doit être un tuple 2" + +#~ msgid "sorted axis can't be longer than 65535" +#~ msgstr "sorted axis ne peut pas dépasser 65535" + +#~ msgid "wrong argument type" +#~ msgstr "type d'argument incorrect" + +#~ msgid "wrong index type" +#~ msgstr "type d'index incorrect" + #~ msgid "Must provide SCK pin" #~ msgstr "Vous devez fournir un code PIN SCK" diff --git a/locale/hi.po b/locale/hi.po index 6c49e1f01f..3b006f1989 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -854,6 +854,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "" @@ -1950,7 +1954,7 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" @@ -2029,10 +2033,6 @@ msgstr "" msgid "addresses is empty" msgstr "" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "" @@ -2041,6 +2041,10 @@ msgstr "" msgid "argsort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -2058,14 +2062,22 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -2075,15 +2087,15 @@ msgid "attributes not supported yet" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" +msgid "axis is out of bounds" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" +msgid "axis must be None, or an integer" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" +msgid "axis too long" msgstr "" #: py/builtinevex.c @@ -2287,6 +2299,10 @@ msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "" @@ -2303,10 +2319,6 @@ msgstr "" msgid "cannot perform relative import" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" - #: py/emitnative.c msgid "casting" msgstr "" @@ -2379,10 +2391,6 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2391,6 +2399,10 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" @@ -2399,10 +2411,6 @@ msgstr "" msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -2432,6 +2440,10 @@ msgstr "" msgid "diff argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2547,6 +2559,10 @@ msgstr "" msgid "first argument must be a function" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2600,8 +2616,8 @@ msgstr "" msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" msgstr "" #: py/argcheck.c @@ -2671,6 +2687,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2695,6 +2712,10 @@ msgstr "" msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" @@ -2703,6 +2724,10 @@ msgstr "" msgid "input array length must be power of 2" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" @@ -2715,6 +2740,22 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" @@ -2727,6 +2768,10 @@ msgstr "" msgid "input vectors must be of equal length" msgstr "" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2895,6 +2940,10 @@ msgstr "" msgid "max_length must be > 0" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "" @@ -2944,10 +2993,6 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -3030,6 +3075,10 @@ msgstr "" msgid "non-keyword arg after keyword arg" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "" @@ -3042,10 +3091,6 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -3098,6 +3143,10 @@ msgstr "" msgid "odd-length string" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -3120,6 +3169,14 @@ msgstr "" msgid "operands could not be broadcast together" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3254,6 +3311,10 @@ msgstr "" msgid "requested length %d but object has length %d" msgstr "" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "" @@ -3272,8 +3333,8 @@ msgstr "" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" msgstr "" #: py/objstr.c @@ -3299,7 +3360,7 @@ msgid "script compilation not supported" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" +msgid "shape must be a tuple" msgstr "" #: py/objstr.c @@ -3342,10 +3403,6 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" @@ -3451,6 +3508,10 @@ msgstr "" msgid "timestamp out of range for platform time_t" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "" @@ -3626,12 +3687,12 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" msgstr "" #: extmod/ulab/code/vector/vectorise.c diff --git a/locale/it_IT.po b/locale/it_IT.po index fc0f016752..652bc56fd5 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -867,6 +867,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "" @@ -1985,7 +1989,7 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "ATTENZIONE: Il nome del sorgente ha due estensioni\n" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" @@ -2064,10 +2068,6 @@ msgstr "indirizzo fuori limite" msgid "addresses is empty" msgstr "gli indirizzi sono vuoti" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "l'argomento è una sequenza vuota" @@ -2076,6 +2076,10 @@ msgstr "l'argomento è una sequenza vuota" msgid "argsort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "il tipo dell'argomento è errato" @@ -2093,14 +2097,22 @@ msgstr "discrepanza di numero/tipo di argomenti" msgid "argument should be a '%q' not a '%q'" msgstr "l'argomento dovrebbe essere un '%q' e non un '%q'" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -2110,15 +2122,15 @@ msgid "attributes not supported yet" msgstr "attributi non ancora supportati" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" +msgid "axis is out of bounds" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" +msgid "axis must be None, or an integer" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" +msgid "axis too long" msgstr "" #: py/builtinevex.c @@ -2326,6 +2338,10 @@ msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "creare '%q' istanze" @@ -2342,10 +2358,6 @@ msgstr "impossibile imporate il nome %q" msgid "cannot perform relative import" msgstr "impossibile effettuare l'importazione relativa" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" - #: py/emitnative.c msgid "casting" msgstr "casting" @@ -2420,10 +2432,6 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2432,6 +2440,10 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" @@ -2440,10 +2452,6 @@ msgstr "" msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "numeri decimali non supportati" @@ -2476,6 +2484,10 @@ msgstr "sequanza di aggiornamento del dizionario ha la lunghezza errata" msgid "diff argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2592,6 +2604,10 @@ msgstr "" msgid "first argument must be a function" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2645,8 +2661,8 @@ msgstr "la funzione ha ricevuto valori multipli per l'argomento '%q'" msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" msgstr "" #: py/argcheck.c @@ -2717,6 +2733,7 @@ msgstr "padding incorretto" msgid "index is out of bounds" msgstr "" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "indice fuori intervallo" @@ -2741,6 +2758,10 @@ msgstr "" msgid "inline assembler must be a function" msgstr "inline assembler deve essere una funzione" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" @@ -2749,6 +2770,10 @@ msgstr "" msgid "input array length must be power of 2" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" @@ -2761,6 +2786,22 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" @@ -2773,6 +2814,10 @@ msgstr "" msgid "input vectors must be of equal length" msgstr "" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "il secondo argomanto di int() deve essere >= 2 e <= 36" @@ -2946,6 +2991,10 @@ msgstr "" msgid "max_length must be > 0" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "profondità massima di ricorsione superata" @@ -2995,10 +3044,6 @@ msgstr "deve lanciare un oggetto" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "nome '%q'non definito" @@ -3082,6 +3127,10 @@ msgstr "argomento non nominato dopo */**" msgid "non-keyword arg after keyword arg" msgstr "argomento non nominato seguito da argomento nominato" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "" @@ -3096,10 +3145,6 @@ msgstr "" msgid "not enough arguments for format string" msgstr "argomenti non sufficienti per la stringa di formattazione" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -3152,6 +3197,10 @@ msgstr "" msgid "odd-length string" msgstr "stringa di lunghezza dispari" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c #, fuzzy msgid "offset out of bounds" @@ -3175,6 +3224,14 @@ msgstr "solo slice con step=1 (aka None) sono supportate" msgid "operands could not be broadcast together" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3312,6 +3369,10 @@ msgstr "importazione relativa" msgid "requested length %d but object has length %d" msgstr "lunghezza %d richiesta ma l'oggetto ha lunghezza %d" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "" @@ -3330,8 +3391,8 @@ msgstr "" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" msgstr "" #: py/objstr.c @@ -3359,7 +3420,7 @@ msgid "script compilation not supported" msgstr "compilazione dello scrip non suportata" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" +msgid "shape must be a tuple" msgstr "" #: py/objstr.c @@ -3402,10 +3463,6 @@ msgstr "soft reboot\n" msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" @@ -3513,6 +3570,10 @@ msgstr "" msgid "timestamp out of range for platform time_t" msgstr "timestamp è fuori intervallo per il time_t della piattaforma" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "troppi argomenti forniti con il formato specificato" @@ -3688,12 +3749,12 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" msgstr "" #: extmod/ulab/code/vector/vectorise.c diff --git a/locale/ja.po b/locale/ja.po index f3dfc6c900..26025c19e4 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: 2020-11-12 22:51+0000\n" "Last-Translator: sporeball \n" "Language-Team: none\n" @@ -867,6 +867,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "FFTはndarrayでのみ使えます" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "" @@ -1975,7 +1979,7 @@ msgstr "電圧読み取りがタイムアウト" msgid "WARNING: Your code filename has two extensions\n" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" @@ -2054,10 +2058,6 @@ msgstr "アドレスが範囲外" msgid "addresses is empty" msgstr "" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "" @@ -2066,6 +2066,10 @@ msgstr "" msgid "argsort argument must be an ndarray" msgstr "argsortの引数はndarrayでなければなりません" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -2083,14 +2087,22 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "引数には '%q' が必要('%q' ではなく)" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "引数はndarrayでなければなりません" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "右辺にはarray/bytesが必要" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -2100,16 +2112,16 @@ msgid "attributes not supported yet" msgstr "属性は未対応です" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" -msgstr "axisは -1, 0, 1, None のいずれかでなければなりません" +msgid "axis is out of bounds" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" -msgstr "axisは -1, 0, 1 のいずれかでなければなりません" +msgid "axis must be None, or an integer" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" -msgstr "axisは None, 0, 1 のいずれか" +msgid "axis too long" +msgstr "" #: py/builtinevex.c msgid "bad compile mode" @@ -2312,6 +2324,10 @@ msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "手動と自動のフィールド指定は混在できません" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "" @@ -2328,10 +2344,6 @@ msgstr "" msgid "cannot perform relative import" msgstr "相対インポートはできません" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "入力/出力シェイプが互換でなくreshapeできません" - #: py/emitnative.c msgid "casting" msgstr "" @@ -2406,10 +2418,6 @@ msgstr "convolve引数はndarrayでなければなりません" msgid "convolve arguments must not be empty" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "ヴァンデルモンド行列の逆行列を求められません" @@ -2418,6 +2426,10 @@ msgstr "ヴァンデルモンド行列の逆行列を求められません" msgid "couldn't determine SD card version" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "dataはイテレート可能でなければなりません" @@ -2426,10 +2438,6 @@ msgstr "dataはイテレート可能でなければなりません" msgid "data must be of equal length" msgstr "dataは同じ長さでなければなりません" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -2461,6 +2469,10 @@ msgstr "" msgid "diff argument must be an ndarray" msgstr "引数はndarrayでなければなりません" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2576,6 +2588,10 @@ msgstr "1つ目の引数は呼び出し可能でなければなりません" msgid "first argument must be a function" msgstr "1つ目の引数は関数でなければなりません" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "1つ目の引数はイテレート可能でなければなりません" @@ -2629,9 +2645,9 @@ msgstr "" msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" -msgstr "スカラ値およびndarrayのみを受け取ります" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" +msgstr "" #: py/argcheck.c #, c-format @@ -2700,6 +2716,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "インデクスが範囲外" @@ -2725,6 +2742,10 @@ msgstr "" msgid "inline assembler must be a function" msgstr "インラインアセンブラは関数でなければなりません" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" @@ -2733,6 +2754,10 @@ msgstr "" msgid "input array length must be power of 2" msgstr "入力array長は2の累乗でなければなりません" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" @@ -2745,6 +2770,22 @@ msgstr "入力行列が非対称" msgid "input matrix is singular" msgstr "入力が非正則行列" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "入力は正方行列でなければなりません" @@ -2757,6 +2798,10 @@ msgstr "入力はtuple, list, range, ndarrayでなければなりません" msgid "input vectors must be of equal length" msgstr "" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "int()の第2引数は2以上36以下でなければなりません" @@ -2925,6 +2970,10 @@ msgstr "" msgid "max_length must be > 0" msgstr "max_lengthは0より大きくなければなりません" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "最大の再帰深度を超えました" @@ -2974,10 +3023,6 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "nは0から9まで" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "名前 '%q' は定義されていません" @@ -3060,6 +3105,10 @@ msgstr "*/** の後に非キーワード引数は置けません" msgid "non-keyword arg after keyword arg" msgstr "キーワード引数の後に非キーワード引数は置けません" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "128ビットのUUIDではありません" @@ -3072,10 +3121,6 @@ msgstr "文字列書式化で全ての引数が使われていません" msgid "not enough arguments for format string" msgstr "書式化文字列への引数が足りません" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "引数は2個または3個でなければなりません" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -3128,6 +3173,10 @@ msgstr "" msgid "odd-length string" msgstr "奇数長の文字列" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -3150,6 +3199,14 @@ msgstr "" msgid "operands could not be broadcast together" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "この演算はndarray上で実装されていません" @@ -3286,6 +3343,10 @@ msgstr "相対インポート" msgid "requested length %d but object has length %d" msgstr "必要な長さは%dですがオブジェクトの長さは%d" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "戻り値のアノテーションは識別子でなければなりません" @@ -3304,9 +3365,9 @@ msgstr "" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "rgb_pins[%d]はクロックと同じポートではありません" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" -msgstr "右辺は ndarray またはスカラ値でなければなりません" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" +msgstr "" #: py/objstr.c msgid "rsplit(None,n)" @@ -3332,8 +3393,8 @@ msgid "script compilation not supported" msgstr "スクリプトのコンパイルは非対応" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" -msgstr "shapeは2値のタプルでなければなりません" +msgid "shape must be a tuple" +msgstr "" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3375,10 +3436,6 @@ msgstr "ソフトリブート\n" msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" @@ -3484,6 +3541,10 @@ msgstr "v2カードの待機がタイムアウトしました" msgid "timestamp out of range for platform time_t" msgstr "timestampがプラットフォームのtime_tの範囲外" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "指定された書式に対して引数が多すぎます" @@ -3659,13 +3720,13 @@ msgstr "" msgid "window must be <= interval" msgstr "windowはinterval以下でなければなりません" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" -msgstr "引数の型が不正" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" +msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" -msgstr "インデクスの型が不正" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" +msgstr "" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" @@ -3715,6 +3776,39 @@ msgstr "ziはfloat値でなければなりません" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "axis must be -1, 0, None, or 1" +#~ msgstr "axisは -1, 0, 1, None のいずれかでなければなりません" + +#~ msgid "axis must be -1, 0, or 1" +#~ msgstr "axisは -1, 0, 1 のいずれかでなければなりません" + +#~ msgid "axis must be None, 0, or 1" +#~ msgstr "axisは None, 0, 1 のいずれか" + +#~ msgid "cannot reshape array (incompatible input/output shape)" +#~ msgstr "入力/出力シェイプが互換でなくreshapeできません" + +#~ msgid "function is implemented for scalars and ndarrays only" +#~ msgstr "スカラ値およびndarrayのみを受け取ります" + +#~ msgid "n must be between 0, and 9" +#~ msgstr "nは0から9まで" + +#~ msgid "number of arguments must be 2, or 3" +#~ msgstr "引数は2個または3個でなければなりません" + +#~ msgid "right hand side must be an ndarray, or a scalar" +#~ msgstr "右辺は ndarray またはスカラ値でなければなりません" + +#~ msgid "shape must be a 2-tuple" +#~ msgstr "shapeは2値のタプルでなければなりません" + +#~ msgid "wrong argument type" +#~ msgstr "引数の型が不正" + +#~ msgid "wrong index type" +#~ msgstr "インデクスの型が不正" + #~ msgid "Must provide SCK pin" #~ msgstr "SCKピンが必要" diff --git a/locale/ko.po b/locale/ko.po index bfa49ab70c..a7967210d3 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -859,6 +859,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "" @@ -1956,7 +1960,7 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" @@ -2035,10 +2039,6 @@ msgstr "" msgid "addresses is empty" msgstr "" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "" @@ -2047,6 +2047,10 @@ msgstr "" msgid "argsort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -2064,14 +2068,22 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -2081,15 +2093,15 @@ msgid "attributes not supported yet" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" +msgid "axis is out of bounds" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" +msgid "axis must be None, or an integer" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" +msgid "axis too long" msgstr "" #: py/builtinevex.c @@ -2293,6 +2305,10 @@ msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "" @@ -2309,10 +2325,6 @@ msgstr "" msgid "cannot perform relative import" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" - #: py/emitnative.c msgid "casting" msgstr "" @@ -2385,10 +2397,6 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2397,6 +2405,10 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" @@ -2405,10 +2417,6 @@ msgstr "" msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -2438,6 +2446,10 @@ msgstr "" msgid "diff argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2553,6 +2565,10 @@ msgstr "" msgid "first argument must be a function" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2606,8 +2622,8 @@ msgstr "" msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" msgstr "" #: py/argcheck.c @@ -2677,6 +2693,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2701,6 +2718,10 @@ msgstr "" msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" @@ -2709,6 +2730,10 @@ msgstr "" msgid "input array length must be power of 2" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" @@ -2721,6 +2746,22 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" @@ -2733,6 +2774,10 @@ msgstr "" msgid "input vectors must be of equal length" msgstr "" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2901,6 +2946,10 @@ msgstr "" msgid "max_length must be > 0" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "" @@ -2950,10 +2999,6 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -3036,6 +3081,10 @@ msgstr "" msgid "non-keyword arg after keyword arg" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "" @@ -3048,10 +3097,6 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -3104,6 +3149,10 @@ msgstr "" msgid "odd-length string" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -3126,6 +3175,14 @@ msgstr "" msgid "operands could not be broadcast together" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3260,6 +3317,10 @@ msgstr "" msgid "requested length %d but object has length %d" msgstr "" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "" @@ -3278,8 +3339,8 @@ msgstr "" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" msgstr "" #: py/objstr.c @@ -3305,7 +3366,7 @@ msgid "script compilation not supported" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" +msgid "shape must be a tuple" msgstr "" #: py/objstr.c @@ -3348,10 +3409,6 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" @@ -3457,6 +3514,10 @@ msgstr "" msgid "timestamp out of range for platform time_t" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "" @@ -3632,12 +3693,12 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" msgstr "" #: extmod/ulab/code/vector/vectorise.c diff --git a/locale/nl.po b/locale/nl.po index 7625cdb26b..f9847fd81f 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: 2020-10-27 16:47+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -867,6 +867,10 @@ msgstr "Extended advertisements met scan antwoord niet ondersteund." msgid "FFT is defined for ndarrays only" msgstr "FFT alleen voor ndarrays gedefineerd" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "SSL handdruk mislukt" @@ -1997,7 +2001,7 @@ msgstr "Voltage lees time-out" msgid "WARNING: Your code filename has two extensions\n" msgstr "WAARSCHUWING: De bestandsnaam van de code heeft twee extensies\n" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" "WatchDogTimer kan niet worden gedeïnitialiseerd zodra de modus in ingesteld " @@ -2085,10 +2089,6 @@ msgstr "adres buiten bereik" msgid "addresses is empty" msgstr "adressen zijn leeg" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "arctan2 is alleen geïmplementeerd voor scalars en ndarrays" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "arg is een lege sequentie" @@ -2097,6 +2097,10 @@ msgstr "arg is een lege sequentie" msgid "argsort argument must be an ndarray" msgstr "argsort argument moet een ndarray zijn" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "argument heeft onjuist type" @@ -2114,14 +2118,22 @@ msgstr "argument num/typen komen niet overeen" msgid "argument should be a '%q' not a '%q'" msgstr "argument moet een '%q' zijn en niet een '%q'" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "argumenten moeten ndarrays zijn" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "array/bytes vereist aan de rechterkant" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "poging om argmin/argmax van een lege sequentie te krijgen" @@ -2131,16 +2143,16 @@ msgid "attributes not supported yet" msgstr "attributen nog niet ondersteund" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" -msgstr "as moet -1, 0, None, of 1 zijn" +msgid "axis is out of bounds" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" -msgstr "as moet -1, 0, of 1 zijn" +msgid "axis must be None, or an integer" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" -msgstr "as moet None, 0, of 1 zijn" +msgid "axis too long" +msgstr "" #: py/builtinevex.c msgid "bad compile mode" @@ -2344,6 +2356,10 @@ msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "kan niet schakelen tussen handmatige en automatische veld specificatie" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "kan geen instanties van '%q' creëren" @@ -2360,10 +2376,6 @@ msgstr "kan naam %q niet importeren" msgid "cannot perform relative import" msgstr "kan geen relatieve import uitvoeren" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "kan de array niet hervormen (niet verenigbare input/output vorm)" - #: py/emitnative.c msgid "casting" msgstr "casting" @@ -2437,10 +2449,6 @@ msgstr "convolutie argumenten moeten ndarrays zijn" msgid "convolve arguments must not be empty" msgstr "convolutie argumenten mogen niet leeg zijn" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "kon de invoerarray niet vanuit vorm uitzenden" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "kon de Vandermonde matrix niet omkeren" @@ -2449,6 +2457,10 @@ msgstr "kon de Vandermonde matrix niet omkeren" msgid "couldn't determine SD card version" msgstr "kon SD kaart versie niet bepalen" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "data moet itereerbaar zijn" @@ -2457,10 +2469,6 @@ msgstr "data moet itereerbaar zijn" msgid "data must be of equal length" msgstr "data moet van gelijke lengte zijn" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "ddof kleiner dan de lengte van de data set" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "decimale getallen zijn niet ondersteund" @@ -2492,6 +2500,10 @@ msgstr "dict update sequence heeft de verkeerde lengte" msgid "diff argument must be an ndarray" msgstr "diff argument moet een ndarray zijn" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2607,6 +2619,10 @@ msgstr "eerste argument moet een aanroepbare (callable) zijn" msgid "first argument must be a function" msgstr "eerste argument moet een functie zijn" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "eerst argument moet een iterabel zijn" @@ -2660,9 +2676,9 @@ msgstr "functie kreeg meedere waarden voor argument '%q'" msgid "function has the same sign at the ends of interval" msgstr "functie heeft hetzelfde teken aan beide uiteinden van het interval" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" -msgstr "funtie is alleen geïmplementeerd voor scalars en ndarrays" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" +msgstr "" #: py/argcheck.c #, c-format @@ -2732,6 +2748,7 @@ msgstr "vulling (padding) is onjuist" msgid "index is out of bounds" msgstr "index is buiten bereik" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index is buiten bereik" @@ -2756,6 +2773,10 @@ msgstr "lengte van initial_value is onjuist" msgid "inline assembler must be a function" msgstr "inline assembler moet een functie zijn" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "invoerargument moet een integer of 2-tuple zijn" @@ -2764,6 +2785,10 @@ msgstr "invoerargument moet een integer of 2-tuple zijn" msgid "input array length must be power of 2" msgstr "invoer array lengte moet een macht van 2 zijn" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "invoerdata moet itereerbaar zijn" @@ -2776,6 +2801,22 @@ msgstr "invoermatrix is asymmetrisch" msgid "input matrix is singular" msgstr "invoermatrix is singulier" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "invoer moet een vierkante matrix zijn" @@ -2788,6 +2829,10 @@ msgstr "invoer moet een tuple, lijst, bereik of ndarray zijn" msgid "input vectors must be of equal length" msgstr "invoervectors moeten van gelijke lengte zijn" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "int() argument 2 moet >=2 en <= 36 zijn" @@ -2959,6 +3004,10 @@ msgstr "max_length moet 0-%d zijn als fixed_length %s is" msgid "max_length must be > 0" msgstr "max_length moet >0 zijn" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "maximale recursiediepte overschreden" @@ -3008,10 +3057,6 @@ msgstr "moet een object oproepen (raise)" msgid "must use keyword argument for key function" msgstr "voor sleutelfunctie moet een trefwoordargument gebruikt worden" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "n moet tussen 0 en 9 liggen" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "naam '%q' is niet gedefinieerd" @@ -3094,6 +3139,10 @@ msgstr "niet-trefwoord argument na */**" msgid "non-keyword arg after keyword arg" msgstr "niet-trefwoord argument na trefwoord argument" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "geen 128-bit UUID" @@ -3106,10 +3155,6 @@ msgstr "niet alle argumenten omgezet bij formattering van string" msgid "not enough arguments for format string" msgstr "niet genoeg argumenten om string te formatteren" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "aantal argumenten moet 2 of 3 zijn" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "aantal punten moet minimaal 2 zijn" @@ -3162,6 +3207,10 @@ msgstr "object met buffer protocol vereist" msgid "odd-length string" msgstr "string met oneven lengte" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "offset buiten bereik" @@ -3184,6 +3233,14 @@ msgstr "alleen segmenten met step=1 (ook wel None) worden ondersteund" msgid "operands could not be broadcast together" msgstr "operands konden niet samen verzonden worden" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "bewerking is voor ndarrays niet geïmplementeerd" @@ -3319,6 +3376,10 @@ msgstr "relatieve import" msgid "requested length %d but object has length %d" msgstr "gevraagde lengte is %d maar object heeft lengte %d" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "return annotatie moet een identifier zijn" @@ -3337,9 +3398,9 @@ msgstr "rgb_pins[%d] is hetzelfde als een andere pintoewijzing" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "rgb_pins[%d] bevindt zich niet op dezelfde poort als klok" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" -msgstr "de rechterkant moet een ndarray of scalar zijn" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" +msgstr "" #: py/objstr.c msgid "rsplit(None,n)" @@ -3366,8 +3427,8 @@ msgid "script compilation not supported" msgstr "scriptcompilatie wordt niet ondersteund" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" -msgstr "vorm moet een 2-tuple zijn" +msgid "shape must be a tuple" +msgstr "" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3409,10 +3470,6 @@ msgstr "zachte herstart\n" msgid "sort argument must be an ndarray" msgstr "sorteerargument moet een ndarray zijn" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "sos array moet vorm (n_section, 6) hebben" @@ -3518,6 +3575,10 @@ msgstr "timeout bij wachten op v2 kaart" msgid "timestamp out of range for platform time_t" msgstr "timestamp buiten bereik voor platform time_t" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "te veel argumenten opgegeven bij dit formaat" @@ -3693,13 +3754,13 @@ msgstr "breedte moet groter dan nul zijn" msgid "window must be <= interval" msgstr "window moet <= interval zijn" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" -msgstr "onjuist argumenttype" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" +msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" -msgstr "onjuist indextype" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" +msgstr "" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" @@ -3749,6 +3810,48 @@ msgstr "zi moet van type float zijn" msgid "zi must be of shape (n_section, 2)" msgstr "zi moet vorm (n_section, 2) hebben" +#~ msgid "arctan2 is implemented for scalars and ndarrays only" +#~ msgstr "arctan2 is alleen geïmplementeerd voor scalars en ndarrays" + +#~ msgid "axis must be -1, 0, None, or 1" +#~ msgstr "as moet -1, 0, None, of 1 zijn" + +#~ msgid "axis must be -1, 0, or 1" +#~ msgstr "as moet -1, 0, of 1 zijn" + +#~ msgid "axis must be None, 0, or 1" +#~ msgstr "as moet None, 0, of 1 zijn" + +#~ msgid "cannot reshape array (incompatible input/output shape)" +#~ msgstr "kan de array niet hervormen (niet verenigbare input/output vorm)" + +#~ msgid "could not broadast input array from shape" +#~ msgstr "kon de invoerarray niet vanuit vorm uitzenden" + +#~ msgid "ddof must be smaller than length of data set" +#~ msgstr "ddof kleiner dan de lengte van de data set" + +#~ msgid "function is implemented for scalars and ndarrays only" +#~ msgstr "funtie is alleen geïmplementeerd voor scalars en ndarrays" + +#~ msgid "n must be between 0, and 9" +#~ msgstr "n moet tussen 0 en 9 liggen" + +#~ msgid "number of arguments must be 2, or 3" +#~ msgstr "aantal argumenten moet 2 of 3 zijn" + +#~ msgid "right hand side must be an ndarray, or a scalar" +#~ msgstr "de rechterkant moet een ndarray of scalar zijn" + +#~ msgid "shape must be a 2-tuple" +#~ msgstr "vorm moet een 2-tuple zijn" + +#~ msgid "wrong argument type" +#~ msgstr "onjuist argumenttype" + +#~ msgid "wrong index type" +#~ msgstr "onjuist indextype" + #~ msgid "Must provide SCK pin" #~ msgstr "SCK pin moet opgegeven worden" diff --git a/locale/pl.po b/locale/pl.po index f04887e682..1873af488f 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: 2020-11-11 19:13+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -867,6 +867,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "" @@ -1966,7 +1970,7 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "UWAGA: Nazwa pliku ma dwa rozszerzenia\n" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" @@ -2051,10 +2055,6 @@ msgstr "adres poza zakresem" msgid "addresses is empty" msgstr "adres jest pusty" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "arg jest puste" @@ -2063,6 +2063,10 @@ msgstr "arg jest puste" msgid "argsort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "argument ma zły typ" @@ -2080,14 +2084,22 @@ msgstr "zła liczba lub typ argumentów" msgid "argument should be a '%q' not a '%q'" msgstr "argument powinien być '%q' a nie '%q'" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "tablica/bytes wymagane po prawej stronie" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -2097,15 +2109,15 @@ msgid "attributes not supported yet" msgstr "atrybuty nie są jeszcze obsługiwane" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" +msgid "axis is out of bounds" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" +msgid "axis must be None, or an integer" msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" +msgid "axis too long" msgstr "" #: py/builtinevex.c @@ -2309,6 +2321,10 @@ msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "nie można zmienić z ręcznego numerowaniu pól do automatycznego" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "nie można tworzyć instancji '%q'" @@ -2325,10 +2341,6 @@ msgstr "nie można zaimportować nazwy %q" msgid "cannot perform relative import" msgstr "nie można wykonać relatywnego importu" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" - #: py/emitnative.c msgid "casting" msgstr "rzutowanie" @@ -2401,10 +2413,6 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2413,6 +2421,10 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "nie można określić wersji karty SD" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" @@ -2421,10 +2433,6 @@ msgstr "" msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "liczby dziesiętne nieobsługiwane" @@ -2455,6 +2463,10 @@ msgstr "sekwencja ma złą długość" msgid "diff argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2570,6 +2582,10 @@ msgstr "" msgid "first argument must be a function" msgstr "pierwszy argument musi być funkcją" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "pierwszy argument musi być iterowalny" @@ -2623,8 +2639,8 @@ msgstr "funkcja dostała wiele wartości dla argumentu '%q'" msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" msgstr "" #: py/argcheck.c @@ -2694,6 +2710,7 @@ msgstr "złe wypełnienie" msgid "index is out of bounds" msgstr "indeks jest poza zakresem" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "indeks poza zakresem" @@ -2718,6 +2735,10 @@ msgstr "długość initial_value jest nieprawidłowa" msgid "inline assembler must be a function" msgstr "wtrącony asembler musi być funkcją" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" @@ -2726,6 +2747,10 @@ msgstr "" msgid "input array length must be power of 2" msgstr "długość tablicy wejściowej musi być potęgą 2" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" @@ -2738,6 +2763,22 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "wejście musi być macierzą kwadratową" @@ -2750,6 +2791,10 @@ msgstr "" msgid "input vectors must be of equal length" msgstr "wektory wejściowe muszą być równej długości" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "argument 2 do int() busi być pomiędzy 2 a 36" @@ -2918,6 +2963,10 @@ msgstr "" msgid "max_length must be > 0" msgstr "max_length musi być > 0" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "przekroczono dozwoloną głębokość rekurencji" @@ -2967,10 +3016,6 @@ msgstr "wyjątek musi być obiektem" msgid "must use keyword argument for key function" msgstr "funkcja key musi być podana jako argument nazwany" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "nazwa '%q' niezdefiniowana" @@ -3053,6 +3098,10 @@ msgstr "argument nienazwany po */**" msgid "non-keyword arg after keyword arg" msgstr "argument nienazwany po nazwanym" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "to nie jest 128-bitowy UUID" @@ -3065,10 +3114,6 @@ msgstr "nie wszystkie argumenty wykorzystane w formatowaniu" msgid "not enough arguments for format string" msgstr "nie dość argumentów przy formatowaniu" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "liczba argumentów musi wynosić 2 lub 3" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "liczba punktów musi wynosić co najmniej 2" @@ -3121,6 +3166,10 @@ msgstr "wymagany obiekt z protokołem buforu" msgid "odd-length string" msgstr "łańcuch o nieparzystej długości" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "offset poza zakresem" @@ -3143,6 +3192,14 @@ msgstr "tylko fragmenty ze step=1 (lub None) są wspierane" msgid "operands could not be broadcast together" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3278,6 +3335,10 @@ msgstr "relatywny import" msgid "requested length %d but object has length %d" msgstr "zażądano długości %d ale obiekt ma długość %d" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "anotacja wartości musi być identyfikatorem" @@ -3296,8 +3357,8 @@ msgstr "" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" msgstr "" #: py/objstr.c @@ -3324,7 +3385,7 @@ msgid "script compilation not supported" msgstr "kompilowanie skryptów nieobsługiwane" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" +msgid "shape must be a tuple" msgstr "" #: py/objstr.c @@ -3367,10 +3428,6 @@ msgstr "programowy reset\n" msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" @@ -3476,6 +3533,10 @@ msgstr "" msgid "timestamp out of range for platform time_t" msgstr "timestamp poza zakresem dla time_t na tej platformie" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "zbyt wiele argumentów podanych dla tego formatu" @@ -3651,13 +3712,13 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" -msgstr "zły typ argumentu" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" +msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" -msgstr "zły typ indeksu" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" +msgstr "" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" @@ -3707,6 +3768,15 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "number of arguments must be 2, or 3" +#~ msgstr "liczba argumentów musi wynosić 2 lub 3" + +#~ msgid "wrong argument type" +#~ msgstr "zły typ argumentu" + +#~ msgid "wrong index type" +#~ msgstr "zły typ indeksu" + #~ msgid "Must provide SCK pin" #~ msgstr "Należy podać pin SCK" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 4cf204ae81..baa125f1d1 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: 2020-11-18 00:28+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -876,6 +876,10 @@ msgstr "Anúncios estendidos não compatíveis com a resposta da varredura." msgid "FFT is defined for ndarrays only" msgstr "O FFT é definido apenas para ndarrays" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "Houve uma falha no handshake do SSL" @@ -2011,7 +2015,7 @@ msgstr "O tempo limite de leitura da tensão expirou" msgid "WARNING: Your code filename has two extensions\n" msgstr "AVISO: Seu arquivo de código tem duas extensões\n" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" "O WatchDogTimer não pode ser não-inicializado uma vez que o modo é definido " @@ -2100,10 +2104,6 @@ msgstr "endereço fora dos limites" msgid "addresses is empty" msgstr "os endereços estão vazios" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "O arctan2 está implementado apenas para escalares e ndarrays" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "o arg é uma sequência vazia" @@ -2112,6 +2112,10 @@ msgstr "o arg é uma sequência vazia" msgid "argsort argument must be an ndarray" msgstr "O argumento argsort deve ser um ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "argumento tem tipo errado" @@ -2129,14 +2133,22 @@ msgstr "o argumento num/tipos não combinam" msgid "argument should be a '%q' not a '%q'" msgstr "o argumento deve ser um '%q' e não um '%q'" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "os argumentos devem ser ndarrays" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "matriz/bytes são necessários no lado direito" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "tente obter argmin/argmax de uma sequência vazia" @@ -2146,16 +2158,16 @@ msgid "attributes not supported yet" msgstr "atributos ainda não suportados" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" -msgstr "o eixo deve ser -1, 0, Nenhum ou 1" +msgid "axis is out of bounds" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" -msgstr "o eixo deve ser -1, 0 ou 1" +msgid "axis must be None, or an integer" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" -msgstr "o eixo deve ser Nenhum, 0 ou 1" +msgid "axis too long" +msgstr "" #: py/builtinevex.c msgid "bad compile mode" @@ -2362,6 +2374,10 @@ msgid "" msgstr "" "não é possível alternar da especificação de campo manual para a automática" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "não é possível criar instâncias '%q'" @@ -2378,11 +2394,6 @@ msgstr "não pode importar nome %q" msgid "cannot perform relative import" msgstr "não pode executar a importação relativa" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" -"não é possível remodelar a matriz (formato de entrada/saída incompatível)" - #: py/emitnative.c msgid "casting" msgstr "fundição" @@ -2457,10 +2468,6 @@ msgstr "os argumentos convolutivos devem ser ndarrays" msgid "convolve arguments must not be empty" msgstr "os argumentos convolutivos não devem estar vazios" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "não foi possível transmitir a matriz da entrada a partir da forma" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "não foi possível inverter a matriz Vandermonde" @@ -2469,6 +2476,10 @@ msgstr "não foi possível inverter a matriz Vandermonde" msgid "couldn't determine SD card version" msgstr "não foi possível determinar a versão do cartão SD" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "os dados devem ser iteráveis" @@ -2477,10 +2488,6 @@ msgstr "os dados devem ser iteráveis" msgid "data must be of equal length" msgstr "os dados devem ser de igual comprimento" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "O ddof deve ser menor que o comprimento do conjunto dos dados" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "os números decimais não são compatíveis" @@ -2513,6 +2520,10 @@ msgstr "sequência da atualização dict tem o comprimento errado" msgid "diff argument must be an ndarray" msgstr "O argumento diff deve ser um ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2628,6 +2639,10 @@ msgstr "o primeiro argumento deve ser chamável" msgid "first argument must be a function" msgstr "o primeiro argumento deve ser uma função" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "o primeiro argumento deve ser um iterável" @@ -2681,9 +2696,9 @@ msgstr "A função obteve vários valores para o argumento '%q'" msgid "function has the same sign at the ends of interval" msgstr "a função tem o mesmo sinal nas extremidades do intervalo" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" -msgstr "A função foi implementada apenas para escalares e ndarrays" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" +msgstr "" #: py/argcheck.c #, c-format @@ -2752,6 +2767,7 @@ msgstr "preenchimento incorreto" msgid "index is out of bounds" msgstr "o índice está fora dos limites" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "Índice fora do intervalo" @@ -2776,6 +2792,10 @@ msgstr "O comprimento do initial_value está errado" msgid "inline assembler must be a function" msgstr "o assembler em linha deve ser uma função" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "o argumento da entrada deve ser um número inteiro ou uma tupla de 2" @@ -2784,6 +2804,10 @@ msgstr "o argumento da entrada deve ser um número inteiro ou uma tupla de 2" msgid "input array length must be power of 2" msgstr "comprimento da matriz da entrada deve ter potência de 2" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "os dados da entrada devem ser iteráveis" @@ -2796,6 +2820,22 @@ msgstr "a matriz da entrada é assimétrica" msgid "input matrix is singular" msgstr "a matriz da entrada é singular" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "a entrada deve ser uma matriz quadrada" @@ -2808,6 +2848,10 @@ msgstr "A entrada deve ser tupla, lista, intervalo ou matriz" msgid "input vectors must be of equal length" msgstr "os vetores da entrada devem ter o mesmo comprimento" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "int() arg 2 deve ser >= 2 e <= 36" @@ -2979,6 +3023,10 @@ msgstr "o max_length deve ser 0-%d quando Fixed_length for %s" msgid "max_length must be > 0" msgstr "max_length deve ser > 0" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "a recursão máxima da profundidade foi excedida" @@ -3030,10 +3078,6 @@ msgstr "deve levantar um objeto" msgid "must use keyword argument for key function" msgstr "deve usar o argumento da palavra-chave para a função da chave" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "n deve estar entre 0 e 9" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "o nome '%q' não está definido" @@ -3116,6 +3160,10 @@ msgstr "um arg sem palavra-chave após */ **" msgid "non-keyword arg after keyword arg" msgstr "um arg não-palavra-chave após a palavra-chave arg" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "não é um UUID com 128 bits" @@ -3128,10 +3176,6 @@ msgstr "nem todos os argumentos são convertidos durante a formatação da strin msgid "not enough arguments for format string" msgstr "argumentos insuficientes para o formato da string" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "a quantidade dos argumentos deve ser 2 ou 3" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "a quantidade dos pontos deve ser pelo menos 2" @@ -3184,6 +3228,10 @@ msgstr "é necessário objeto com protocolo do buffer" msgid "odd-length string" msgstr "sequência com comprimento ímpar" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "desvio fora dos limites" @@ -3207,6 +3255,14 @@ msgstr "" msgid "operands could not be broadcast together" msgstr "os operandos não puderam ser transmitidos juntos" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "a operação não foi implementada nos ndarrays" @@ -3345,6 +3401,10 @@ msgstr "importação relativa" msgid "requested length %d but object has length %d" msgstr "o comprimento solicitado %d, porém o objeto tem comprimento %d" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "a anotação do retorno deve ser um identificador" @@ -3363,9 +3423,9 @@ msgstr "rgb_pins[%d] duplica outra atribuição dos pinos" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "rgb_pins[%d] não está na mesma porta que o clock" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" -msgstr "o lado direito deve ser um ndarray ou um escalar" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" +msgstr "" #: py/objstr.c msgid "rsplit(None,n)" @@ -3392,8 +3452,8 @@ msgid "script compilation not supported" msgstr "compilação de script não suportada" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" -msgstr "a forma deve ser uma tupla de 2" +msgid "shape must be a tuple" +msgstr "" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3435,10 +3495,6 @@ msgstr "reinicialização soft\n" msgid "sort argument must be an ndarray" msgstr "o argumento da classificação deve ser um ndarray" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "o eixo ordenado não pode ser maior do que 65535" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "o sos da matriz deve estar na forma (n_section, 6)" @@ -3544,6 +3600,10 @@ msgstr "o tempo limite na espera pelo cartão v2" msgid "timestamp out of range for platform time_t" msgstr "timestamp fora do intervalo para a plataforma time_t" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "Muitos argumentos fornecidos com o formato dado" @@ -3719,13 +3779,13 @@ msgstr "a largura deve ser maior que zero" msgid "window must be <= interval" msgstr "a janela deve ser <= intervalo" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" -msgstr "tipo do argumento errado" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" +msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" -msgstr "tipo do índice errado" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" +msgstr "" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" @@ -3775,6 +3835,52 @@ 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 "arctan2 is implemented for scalars and ndarrays only" +#~ msgstr "O arctan2 está implementado apenas para escalares e ndarrays" + +#~ msgid "axis must be -1, 0, None, or 1" +#~ msgstr "o eixo deve ser -1, 0, Nenhum ou 1" + +#~ msgid "axis must be -1, 0, or 1" +#~ msgstr "o eixo deve ser -1, 0 ou 1" + +#~ msgid "axis must be None, 0, or 1" +#~ msgstr "o eixo deve ser Nenhum, 0 ou 1" + +#~ msgid "cannot reshape array (incompatible input/output shape)" +#~ msgstr "" +#~ "não é possível remodelar a matriz (formato de entrada/saída incompatível)" + +#~ msgid "could not broadast input array from shape" +#~ msgstr "não foi possível transmitir a matriz da entrada a partir da forma" + +#~ msgid "ddof must be smaller than length of data set" +#~ msgstr "O ddof deve ser menor que o comprimento do conjunto dos dados" + +#~ msgid "function is implemented for scalars and ndarrays only" +#~ msgstr "A função foi implementada apenas para escalares e ndarrays" + +#~ msgid "n must be between 0, and 9" +#~ msgstr "n deve estar entre 0 e 9" + +#~ msgid "number of arguments must be 2, or 3" +#~ msgstr "a quantidade dos argumentos deve ser 2 ou 3" + +#~ msgid "right hand side must be an ndarray, or a scalar" +#~ msgstr "o lado direito deve ser um ndarray ou um escalar" + +#~ msgid "shape must be a 2-tuple" +#~ msgstr "a forma deve ser uma tupla de 2" + +#~ msgid "sorted axis can't be longer than 65535" +#~ msgstr "o eixo ordenado não pode ser maior do que 65535" + +#~ msgid "wrong argument type" +#~ msgstr "tipo do argumento errado" + +#~ msgid "wrong index type" +#~ msgstr "tipo do índice errado" + #~ msgid "specify size or data, but not both" #~ msgstr "defina o tamanho ou os dados, porém não ambos" diff --git a/locale/sv.po b/locale/sv.po index cc6fe8ad00..02847044fb 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: 2020-11-20 22:28+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -867,6 +867,10 @@ msgstr "Utökad annonsering i kombination med skanningssvar stöds inte." msgid "FFT is defined for ndarrays only" msgstr "FFT är enbart definierade för ndarrays" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "Misslyckad SSL-handskakning" @@ -1993,7 +1997,7 @@ msgstr "Avläsning av spänning tog för lång tid" msgid "WARNING: Your code filename has two extensions\n" msgstr "VARNING: Ditt filnamn för kod har två tillägg\n" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "WatchDogTimer kan inte avinitialiseras när läget är inställt på RESET" @@ -2078,10 +2082,6 @@ msgstr "adress utanför gränsen" msgid "addresses is empty" msgstr "adresserna är tomma" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "arctan2 är enbart implementerad för scalar och ndarray" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "arg är en tom sekvens" @@ -2090,6 +2090,10 @@ msgstr "arg är en tom sekvens" msgid "argsort argument must be an ndarray" msgstr "argumentet argsort måste vara en ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "argumentet har fel typ" @@ -2107,14 +2111,22 @@ msgstr "argument antal/typ matchar inte" msgid "argument should be a '%q' not a '%q'" msgstr "argumentet skall vara en '%q', inte en '%q'" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "argumenten måste vara ndarray" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "array/bytes krävs på höger sida" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "försök att få argmin/argmax för en tom sekvens" @@ -2124,16 +2136,16 @@ msgid "attributes not supported yet" msgstr "attribut stöds inte än" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" -msgstr "axis ska vara -1, 0, None eller 1" +msgid "axis is out of bounds" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" -msgstr "axis ska vara -1, 0 eller 1" +msgid "axis must be None, or an integer" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" -msgstr "axis ska vara None, 0, eller 1" +msgid "axis too long" +msgstr "" #: py/builtinevex.c msgid "bad compile mode" @@ -2338,6 +2350,10 @@ msgid "" msgstr "" "kan inte byta från manuell fältspecifikation till automatisk fältnumrering" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "kan inte skapa instanser av '%q'" @@ -2354,10 +2370,6 @@ msgstr "kan inte importera namn %q" msgid "cannot perform relative import" msgstr "kan inte utföra relativ import" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "kan inte omforma matris (inkompatibel indata-/utdataform)" - #: py/emitnative.c msgid "casting" msgstr "casting inte implementerad" @@ -2430,10 +2442,6 @@ msgstr "Argumenten convolve måste vara ndarray:er" msgid "convolve arguments must not be empty" msgstr "Argumenten convolve kan inte vara tomma" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "Kan inte sända indatamatris från form" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "kan inte invertera Vandermonde-matris" @@ -2442,6 +2450,10 @@ msgstr "kan inte invertera Vandermonde-matris" msgid "couldn't determine SD card version" msgstr "kan inte avgöra SD-kortversion" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "data måste vara itererbar" @@ -2450,10 +2462,6 @@ msgstr "data måste vara itererbar" msgid "data must be of equal length" msgstr "data måste vara av samma längd" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "ddof måste vara mindre än längden på datauppsättningen" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "decimaltal stöds inte" @@ -2486,6 +2494,10 @@ msgstr "uppdateringssekvensen för dict har fel längd" msgid "diff argument must be an ndarray" msgstr "argumentet diff måste vara en ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2601,6 +2613,10 @@ msgstr "första argumentet måste vara en callable" msgid "first argument must be a function" msgstr "första argumentet måste vara en funktion" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "första argumentet måste vara en iterable" @@ -2654,9 +2670,9 @@ msgstr "funktionen fick flera värden för argumentet '%q'" msgid "function has the same sign at the ends of interval" msgstr "funktionen har samma teckenvärden vid slutet av intervall" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" -msgstr "funktionen är endast implementerad för scalar och ndarray" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" +msgstr "" #: py/argcheck.c #, c-format @@ -2725,6 +2741,7 @@ msgstr "felaktig utfyllnad" msgid "index is out of bounds" msgstr "index är utanför gränserna" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index utanför intervallet" @@ -2749,6 +2766,10 @@ msgstr "initial_value-längd är fel" msgid "inline assembler must be a function" msgstr "inline assembler måste vara en funktion" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "indataargumentet måste vara ett heltal eller en 2-tupel" @@ -2757,6 +2778,10 @@ msgstr "indataargumentet måste vara ett heltal eller en 2-tupel" msgid "input array length must be power of 2" msgstr "indataarraylängden måste vara en multipel av 2" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "indata måste vara en iterable" @@ -2769,6 +2794,22 @@ msgstr "indatamatrisen är asymmetrisk" msgid "input matrix is singular" msgstr "indatamatrisen är singulär" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "indata måste vara kvadratmatris" @@ -2781,6 +2822,10 @@ msgstr "indata måste vara tupel, lista, range, eller ndarray" msgid "input vectors must be of equal length" msgstr "indatavektorer måste ha samma längd" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "int() arg 2 måste vara >= 2 och <= 36" @@ -2952,6 +2997,10 @@ msgstr "max_length måste vara 0-%d när fixed_length är %s" msgid "max_length must be > 0" msgstr "max_length måste vara > 0" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "maximal rekursionsdjup överskriden" @@ -3001,10 +3050,6 @@ msgstr "måste ge ett objekt" msgid "must use keyword argument for key function" msgstr "måste använda nyckelordsargument för nyckelfunktion" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "n måste vara mellan 0 och 9" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "namnet '%q' är inte definierat" @@ -3087,6 +3132,10 @@ msgstr "icke nyckelord arg efter * / **" msgid "non-keyword arg after keyword arg" msgstr "icke nyckelord arg efter nyckelord arg" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "inte en 128-bitars UUID" @@ -3099,10 +3148,6 @@ msgstr "inte alla argument omvandlade under strängformatering" msgid "not enough arguments for format string" msgstr "inte tillräckligt med argument för formatsträng" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "antal argument måste vara 2 eller 3" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "antal punkter måste vara minst 2" @@ -3155,6 +3200,10 @@ msgstr "objekt med buffertprotokoll krävs" msgid "odd-length string" msgstr "sträng har udda längd" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "offset utanför gränserna" @@ -3177,6 +3226,14 @@ msgstr "endast segment med steg=1 (aka Ingen) stöds" msgid "operands could not be broadcast together" msgstr "operander kan inte sändas tillsammans" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "åtgärden är inte implementerad för ndarray:er" @@ -3312,6 +3369,10 @@ msgstr "relativ import" msgid "requested length %d but object has length %d" msgstr "begärd längd %d men objektet har längden %d" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "retur-annotation måste vara en identifierare" @@ -3330,9 +3391,9 @@ msgstr "rgb_pins[%d] duplicerar en annan pinntilldelning" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "rgb_pins[%d] är inte på samma port som en klocka" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" -msgstr "höger sida måste vara en ndarray, eller en scalar" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" +msgstr "" #: py/objstr.c msgid "rsplit(None,n)" @@ -3359,8 +3420,8 @@ msgid "script compilation not supported" msgstr "skriptkompilering stöds inte" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" -msgstr "shape måste vara en 2-tupel" +msgid "shape must be a tuple" +msgstr "" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3402,10 +3463,6 @@ msgstr "mjuk omstart\n" msgid "sort argument must be an ndarray" msgstr "argumentet sort måste vara en ndarray" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "sorterad axel kan inte vara längre än 65535" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "sos array måste ha form (n_section, 6)" @@ -3511,6 +3568,10 @@ msgstr "timeout för v2-kort" msgid "timestamp out of range for platform time_t" msgstr "timestamp utom räckvidd för plattformens \"time_t\"" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "för många argument för det givna formatet" @@ -3686,13 +3747,13 @@ msgstr "width måste vara större än noll" msgid "window must be <= interval" msgstr "window måste vara <= interval" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" -msgstr "fel typ av argument" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" +msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" -msgstr "fel indextyp" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" +msgstr "" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" @@ -3742,6 +3803,51 @@ 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 "arctan2 is implemented for scalars and ndarrays only" +#~ msgstr "arctan2 är enbart implementerad för scalar och ndarray" + +#~ msgid "axis must be -1, 0, None, or 1" +#~ msgstr "axis ska vara -1, 0, None eller 1" + +#~ msgid "axis must be -1, 0, or 1" +#~ msgstr "axis ska vara -1, 0 eller 1" + +#~ msgid "axis must be None, 0, or 1" +#~ msgstr "axis ska vara None, 0, eller 1" + +#~ msgid "cannot reshape array (incompatible input/output shape)" +#~ msgstr "kan inte omforma matris (inkompatibel indata-/utdataform)" + +#~ msgid "could not broadast input array from shape" +#~ msgstr "Kan inte sända indatamatris från form" + +#~ msgid "ddof must be smaller than length of data set" +#~ msgstr "ddof måste vara mindre än längden på datauppsättningen" + +#~ msgid "function is implemented for scalars and ndarrays only" +#~ msgstr "funktionen är endast implementerad för scalar och ndarray" + +#~ msgid "n must be between 0, and 9" +#~ msgstr "n måste vara mellan 0 och 9" + +#~ msgid "number of arguments must be 2, or 3" +#~ msgstr "antal argument måste vara 2 eller 3" + +#~ msgid "right hand side must be an ndarray, or a scalar" +#~ msgstr "höger sida måste vara en ndarray, eller en scalar" + +#~ msgid "shape must be a 2-tuple" +#~ msgstr "shape måste vara en 2-tupel" + +#~ msgid "sorted axis can't be longer than 65535" +#~ msgstr "sorterad axel kan inte vara längre än 65535" + +#~ msgid "wrong argument type" +#~ msgstr "fel typ av argument" + +#~ msgid "wrong index type" +#~ msgstr "fel indextyp" + #~ msgid "specify size or data, but not both" #~ msgstr "ange storlek eller data, men inte båda" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index e94ae8173f..134efec903 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-10 15:30+0530\n" +"POT-Creation-Date: 2020-11-23 10:10-0600\n" "PO-Revision-Date: 2020-11-19 01:28+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -865,6 +865,10 @@ msgstr "Bù zhīchí dài yǒu sǎomiáo xiǎngyìng de kuòzhǎn guǎngbò." msgid "FFT is defined for ndarrays only" msgstr "FFT jǐn wéi ndarrays dìng yì" +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" msgstr "SSL wòshǒu shībài" @@ -1984,7 +1988,7 @@ msgstr "Diànyā dòu qǔ chāoshí" msgid "WARNING: Your code filename has two extensions\n" msgstr "Jǐnggào: Nǐ de dàimǎ wénjiàn míng yǒu liǎng gè kuòzhǎn míng\n" -#: shared-bindings/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "Yīdàn jiāng móshì shèzhì wèi RESET, jiù wúfǎ chūshǐhuà WatchDog Timer" @@ -2070,10 +2074,6 @@ msgstr "dìzhǐ chāochū biānjiè" msgid "addresses is empty" msgstr "dìzhǐ wèi kōng" -#: extmod/ulab/code/vector/vectorise.c -msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "arctan2 jǐn zhēnduì biāoliàng hé ndarray shíxiàn" - #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "cānshù shì yīgè kōng de xùliè" @@ -2082,6 +2082,10 @@ msgstr "cānshù shì yīgè kōng de xùliè" msgid "argsort argument must be an ndarray" msgstr "argsort cānshù bìxū shì ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "cānshù lèixíng cuòwù" @@ -2099,14 +2103,22 @@ msgstr "cānshù biānhào/lèixíng bù pǐpèi" msgid "argument should be a '%q' not a '%q'" msgstr "cānshù yīnggāi shì '%q', 'bùshì '%q'" -#: extmod/ulab/code/linalg/linalg.c +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" msgstr "cānshù bìxū shì ndarrays" +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "yòu cè xūyào shùzǔ/zì jié" +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "chángshì huòqǔ kōng xùliè de argmin/ argmax" @@ -2116,16 +2128,16 @@ msgid "attributes not supported yet" msgstr "shǔxìng shàngwèi zhīchí" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, None, or 1" -msgstr "zhóu bìxū wèi-1,0, wú huò 1" +msgid "axis is out of bounds" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be -1, 0, or 1" -msgstr "zhóu bìxū wèi-1,0 huò 1" +msgid "axis must be None, or an integer" +msgstr "" #: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, 0, or 1" -msgstr "zhóu bìxū wèi None,0 huò 1" +msgid "axis too long" +msgstr "" #: py/builtinevex.c msgid "bad compile mode" @@ -2328,6 +2340,10 @@ msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "wúfǎ cóng shǒudòng zìduàn guīgé qiēhuàn dào zìdòng zìduàn biānhào" +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + #: py/objtype.c msgid "cannot create '%q' instances" msgstr "wúfǎ chuàngjiàn '%q' ' shílì" @@ -2344,10 +2360,6 @@ msgstr "wúfǎ dǎorù míngchēng %q" msgid "cannot perform relative import" msgstr "wúfǎ zhíxíng xiāngguān dǎorù" -#: extmod/ulab/code/ndarray.c -msgid "cannot reshape array (incompatible input/output shape)" -msgstr "wúfǎ zhěngxíng shùzǔ (bù jiānróng de shūrù/shūchū xíngzhuàng)" - #: py/emitnative.c msgid "casting" msgstr "tóuyǐng" @@ -2423,10 +2435,6 @@ msgstr "juàn jī cānshù bìxū shì ndarrays" msgid "convolve arguments must not be empty" msgstr "juàn jī cān shǔ bùnéng wéi kōng" -#: extmod/ulab/code/ndarray.c -msgid "could not broadast input array from shape" -msgstr "wúfǎ guǎngbò xíngzhuàng de shūrù shùzǔ" - #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "wúfǎ fǎn zhuǎn fàndéméng dé jǔzhèn" @@ -2435,6 +2443,10 @@ msgstr "wúfǎ fǎn zhuǎn fàndéméng dé jǔzhèn" msgid "couldn't determine SD card version" msgstr "wúfǎ quèdìng SD kǎ bǎnběn" +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "shùjù bìxū shì kě diédài de" @@ -2443,10 +2455,6 @@ msgstr "shùjù bìxū shì kě diédài de" msgid "data must be of equal length" msgstr "shùjù chángdù bìxū xiāngděng" -#: extmod/ulab/code/numerical/numerical.c -msgid "ddof must be smaller than length of data set" -msgstr "ddof bìxū xiǎoyú shùjù jí de chángdù" - #: py/parsenum.c msgid "decimal numbers not supported" msgstr "bù zhīchí xiǎoshù shù" @@ -2478,6 +2486,10 @@ msgstr "yǔfǎ gēngxīn xùliè de chángdù cuòwù" msgid "diff argument must be an ndarray" msgstr "bùtóng de cānshù bìxū shì ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -2593,6 +2605,10 @@ msgstr "dì yī gè cānshù bìxū shì kě tiáo yòng de" msgid "first argument must be a function" msgstr "dì yīgè cānshù bìxū shì yī gè hánshù" +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "dì yī gè cānshù bìxū shì kě diédài de" @@ -2646,9 +2662,9 @@ msgstr "hánshù huòdé cānshù '%q' de duōchóng zhí" msgid "function has the same sign at the ends of interval" msgstr "hánshù zài jiàngé mòwěi jùyǒu xiāngtóng de fúhào" -#: extmod/ulab/code/compare/compare.c -msgid "function is implemented for scalars and ndarrays only" -msgstr "gāi hánshù jǐn zhēnduì biāoliàng hé ndarray shíxiàn" +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" +msgstr "" #: py/argcheck.c #, c-format @@ -2717,6 +2733,7 @@ msgstr "bù zhèngquè de tiánchōng" msgid "index is out of bounds" msgstr "suǒyǐn chāochū fànwéi" +#: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "suǒyǐn chāochū fànwéi" @@ -2741,6 +2758,10 @@ msgstr "Initial_value chángdù cuòwù" msgid "inline assembler must be a function" msgstr "nèi lián jíhé bìxū shì yīgè hánshù" +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "shūrù cānshù bìxū shì zhěngshù huò 2 yuán zǔ" @@ -2749,6 +2770,10 @@ msgstr "shūrù cānshù bìxū shì zhěngshù huò 2 yuán zǔ" msgid "input array length must be power of 2" msgstr "shūrù shùzǔ de chángdù bìxū shì 2 de mì" +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "shūrù shùjù bìxū shì kě diédài de" @@ -2761,6 +2786,22 @@ msgstr "shūrù jǔzhèn bù duìchèn" msgid "input matrix is singular" msgstr "shūrù jǔzhèn shì qíyì de" +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "shūrù bìxū wèi fāng jǔzhèn" @@ -2773,6 +2814,10 @@ msgstr "shūrù bìxū shì yuán zǔ, lièbiǎo, fànwéi huò ndarray" msgid "input vectors must be of equal length" msgstr "shūrù xiàngliàng de chángdù bìxū xiāngděng" +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "zhěngshù() cānshù 2 bìxū > = 2 qiě <= 36" @@ -2942,6 +2987,10 @@ msgstr "Dāng gùdìng chángdù wèi %s shí, zuìdà chángdù bìxū wèi 0-% msgid "max_length must be > 0" msgstr "Max_length bìxū > 0" +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "chāochū zuìdà dìguī shēndù" @@ -2991,10 +3040,6 @@ msgstr "bìxū tíchū duìxiàng" msgid "must use keyword argument for key function" msgstr "bìxū shǐyòng guānjiàn cí cānshù" -#: extmod/ulab/code/numerical/numerical.c -msgid "n must be between 0, and 9" -msgstr "n bìxū jiè yú 0 dào 9 zhī jiān" - #: py/runtime.c msgid "name '%q' is not defined" msgstr "míngchēng '%q' wèi dìngyì" @@ -3077,6 +3122,10 @@ msgstr "zài */** zhīhòu fēi guānjiàn cí cānshù" msgid "non-keyword arg after keyword arg" msgstr "guānjiàn zì cānshù zhīhòu de fēi guānjiàn zì cānshù" +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "bùshì 128 wèi UUID" @@ -3089,10 +3138,6 @@ msgstr "bùshì zì chuàn géshì huà guòchéng zhōng zhuǎnhuàn de suǒyǒ msgid "not enough arguments for format string" msgstr "géshì zìfú chuàn cān shǔ bùzú" -#: extmod/ulab/code/poly/poly.c -msgid "number of arguments must be 2, or 3" -msgstr "cānshù shùliàng bìxū wèi 2 huò 3" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "diǎnshù bìxū zhìshǎo wèi 2" @@ -3145,6 +3190,10 @@ msgstr "xūyào huǎnchōng qū xiéyì de duìxiàng" msgid "odd-length string" msgstr "jīshù zìfú chuàn" +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "piānlí biānjiè" @@ -3167,6 +3216,14 @@ msgstr "jǐn zhīchí bù zhǎng = 1(jí wú) de qiēpiàn" msgid "operands could not be broadcast together" msgstr "cāozuò shǔ bùnéng yīqǐ guǎngbò" +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented for flattened array" +msgstr "" + #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "cāozuò wèi zài ndarrays shàng shíxiàn" @@ -3301,6 +3358,10 @@ msgstr "xiāngduì dǎorù" msgid "requested length %d but object has length %d" msgstr "qǐngqiú chángdù %d dàn duìxiàng chángdù %d" +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + #: py/compile.c msgid "return annotation must be an identifier" msgstr "fǎnhuí zhùshì bìxū shì biāozhì fú" @@ -3319,9 +3380,9 @@ msgstr "rgb_pins[%d] fùzhì lìng yīgè yǐn jiǎo fēnpèi" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "rgb_pins[%d] yǔ shízhōng bùzài tóng yīgè duānkǒu shàng" -#: extmod/ulab/code/ndarray.c -msgid "right hand side must be an ndarray, or a scalar" -msgstr "yòubiān bìxū shì ndarray huò biāoliàng" +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" +msgstr "" #: py/objstr.c msgid "rsplit(None,n)" @@ -3348,8 +3409,8 @@ msgid "script compilation not supported" msgstr "bù zhīchí jiǎoběn biānyì" #: extmod/ulab/code/ndarray.c -msgid "shape must be a 2-tuple" -msgstr "xíngzhuàng bìxū shì 2 yuán zǔ" +msgid "shape must be a tuple" +msgstr "" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3391,10 +3452,6 @@ msgstr "ruǎn chóngqǐ\n" msgid "sort argument must be an ndarray" msgstr "páixù cānshù bìxū shì ndarray" -#: extmod/ulab/code/numerical/numerical.c -msgid "sorted axis can't be longer than 65535" -msgstr "pái xù zhóu bù néng chāo guò 65535" - #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "sos shùzǔ de xíngzhuàng bìxū wèi (n_section, 6)" @@ -3500,6 +3557,10 @@ msgstr "děngdài v2 kǎ chāoshí" msgid "timestamp out of range for platform time_t" msgstr "time_t shíjiān chuō chāochū píngtái fànwéi" +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "tígōng jǐ dìng géshì de cānshù tài duō" @@ -3675,13 +3736,13 @@ msgstr "kuāndù bìxū dàyú líng" msgid "window must be <= interval" msgstr "Chuāngkǒu bìxū shì <= jiàngé" -#: extmod/ulab/code/linalg/linalg.c -msgid "wrong argument type" -msgstr "cuòwù de cānshù lèixíng" +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" +msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "wrong index type" -msgstr "cuòwù de suǒyǐn lèixíng" +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" +msgstr "" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" @@ -3731,6 +3792,51 @@ 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 "arctan2 is implemented for scalars and ndarrays only" +#~ msgstr "arctan2 jǐn zhēnduì biāoliàng hé ndarray shíxiàn" + +#~ msgid "axis must be -1, 0, None, or 1" +#~ msgstr "zhóu bìxū wèi-1,0, wú huò 1" + +#~ msgid "axis must be -1, 0, or 1" +#~ msgstr "zhóu bìxū wèi-1,0 huò 1" + +#~ msgid "axis must be None, 0, or 1" +#~ msgstr "zhóu bìxū wèi None,0 huò 1" + +#~ msgid "cannot reshape array (incompatible input/output shape)" +#~ msgstr "wúfǎ zhěngxíng shùzǔ (bù jiānróng de shūrù/shūchū xíngzhuàng)" + +#~ msgid "could not broadast input array from shape" +#~ msgstr "wúfǎ guǎngbò xíngzhuàng de shūrù shùzǔ" + +#~ msgid "ddof must be smaller than length of data set" +#~ msgstr "ddof bìxū xiǎoyú shùjù jí de chángdù" + +#~ msgid "function is implemented for scalars and ndarrays only" +#~ msgstr "gāi hánshù jǐn zhēnduì biāoliàng hé ndarray shíxiàn" + +#~ msgid "n must be between 0, and 9" +#~ msgstr "n bìxū jiè yú 0 dào 9 zhī jiān" + +#~ msgid "number of arguments must be 2, or 3" +#~ msgstr "cānshù shùliàng bìxū wèi 2 huò 3" + +#~ msgid "right hand side must be an ndarray, or a scalar" +#~ msgstr "yòubiān bìxū shì ndarray huò biāoliàng" + +#~ msgid "shape must be a 2-tuple" +#~ msgstr "xíngzhuàng bìxū shì 2 yuán zǔ" + +#~ msgid "sorted axis can't be longer than 65535" +#~ msgstr "pái xù zhóu bù néng chāo guò 65535" + +#~ msgid "wrong argument type" +#~ msgstr "cuòwù de cānshù lèixíng" + +#~ msgid "wrong index type" +#~ msgstr "cuòwù de suǒyǐn lèixíng" + #~ msgid "Must provide SCK pin" #~ msgstr "bì xū tí gòng SCK yǐn jiǎo" From 2635132ce590a44e79dbee8230fe92dbba8e3667 Mon Sep 17 00:00:00 2001 From: Seth Kerr Date: Mon, 23 Nov 2020 19:21:12 -0500 Subject: [PATCH 57/64] adding 'haxpress' kind of build for CP Sapling for use with SPI Flash --- .../boards/cp_sapling_m0_spiflash/board.c | 40 ++++++++++++ .../cp_sapling_m0_spiflash/mpconfigboard.h | 62 +++++++++++++++++++ .../cp_sapling_m0_spiflash/mpconfigboard.mk | 33 ++++++++++ .../boards/cp_sapling_m0_spiflash/pins.c | 38 ++++++++++++ .../atmel-samd/boards/icy-tree-sof-m0/board.c | 44 +++++++++++++ .../boards/icy-tree-sof-m0/mpconfigboard.h | 55 ++++++++++++++++ .../boards/icy-tree-sof-m0/mpconfigboard.mk | 24 +++++++ .../atmel-samd/boards/icy-tree-sof-m0/pins.c | 49 +++++++++++++++ 8 files changed, 345 insertions(+) create mode 100644 ports/atmel-samd/boards/cp_sapling_m0_spiflash/board.c create mode 100644 ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/cp_sapling_m0_spiflash/pins.c create mode 100644 ports/atmel-samd/boards/icy-tree-sof-m0/board.c create mode 100644 ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/icy-tree-sof-m0/pins.c diff --git a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/board.c b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/board.c new file mode 100644 index 0000000000..ce56366762 --- /dev/null +++ b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/board.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 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 "boards/board.h" +#include "common-hal/microcontroller/Pin.h" +#include "supervisor/shared/board.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.h b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.h new file mode 100644 index 0000000000..a129566d2d --- /dev/null +++ b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.h @@ -0,0 +1,62 @@ +#define MICROPY_HW_BOARD_NAME "CP Sapling M0" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_HW_NEOPIXEL (&pin_PA15) + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define SPI_FLASH_MOSI_PIN &pin_PA18 +#define SPI_FLASH_MISO_PIN &pin_PA17 +#define SPI_FLASH_SCK_PIN &pin_PA19 +#define SPI_FLASH_CS_PIN &pin_PA22 + +#define IGNORE_PIN_PA02 1 +#define IGNORE_PIN_PA03 1 +#define IGNORE_PIN_PA04 1 +#define IGNORE_PIN_PA05 1 +#define IGNORE_PIN_PA06 1 +#define IGNORE_PIN_PA07 1 +#define IGNORE_PIN_PA12 1 +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA20 1 +#define IGNORE_PIN_PA21 1 +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 +#define IGNORE_PIN_PB01 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PB04 1 +#define IGNORE_PIN_PB05 1 +#define IGNORE_PIN_PB06 1 +#define IGNORE_PIN_PB07 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PB10 1 +#define IGNORE_PIN_PB11 1 +#define IGNORE_PIN_PB12 1 +#define IGNORE_PIN_PB13 1 +#define IGNORE_PIN_PB14 1 +#define IGNORE_PIN_PB15 1 +#define IGNORE_PIN_PB16 1 +#define IGNORE_PIN_PB17 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PB30 1 +#define IGNORE_PIN_PB31 1 +#define IGNORE_PIN_PB00 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA09) +#define DEFAULT_I2C_BUS_SDA (&pin_PA08) + +#define DEFAULT_SPI_BUS_SS (&pin_PA22) +#define DEFAULT_SPI_BUS_SCK (&pin_PA19) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA18) +#define DEFAULT_SPI_BUS_MISO (&pin_PA17) diff --git a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk new file mode 100644 index 0000000000..c81209db3b --- /dev/null +++ b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk @@ -0,0 +1,33 @@ +USB_VID = 0x1209 +USB_PID = 0x4DDD +USB_PRODUCT = "CP Sapling" +USB_MANUFACTURER = "Oak Development Technologies" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 0 +LONGINT_IMPL = MPZ +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = AT25DF081A + +CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_COUNTIO = 0 +CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_I2CPERIPHERAL = 0 + +SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif diff --git a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/pins.c b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/pins.c new file mode 100644 index 0000000000..d527aaddcb --- /dev/null +++ b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/pins.c @@ -0,0 +1,38 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA00) }, + + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA01) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_PA22) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA19) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA18) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) }, + + { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/icy-tree-sof-m0/board.c b/ports/atmel-samd/boards/icy-tree-sof-m0/board.c new file mode 100644 index 0000000000..1a65a561f7 --- /dev/null +++ b/ports/atmel-samd/boards/icy-tree-sof-m0/board.c @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 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 "boards/board.h" +#include "common-hal/microcontroller/Pin.h" +#include "supervisor/shared/board.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { + gpio_set_pin_function(PIN_PA15, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_direction(PIN_PA15, GPIO_DIRECTION_OUT); + gpio_set_pin_level(PIN_PA15, true); // Turn on neopixel by default + never_reset_pin_number(PIN_PA15); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.h b/ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.h new file mode 100644 index 0000000000..713d2c03eb --- /dev/null +++ b/ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.h @@ -0,0 +1,55 @@ +#define MICROPY_HW_BOARD_NAME "Adafruit QT Py M0" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_HW_NEOPIXEL (&pin_PA18) + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define IGNORE_PIN_PA00 1 +#define IGNORE_PIN_PA01 1 +#define IGNORE_PIN_PA12 1 +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA20 1 +#define IGNORE_PIN_PA21 1 +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 +#define IGNORE_PIN_PB01 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PB04 1 +#define IGNORE_PIN_PB05 1 +#define IGNORE_PIN_PB06 1 +#define IGNORE_PIN_PB07 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PB10 1 +#define IGNORE_PIN_PB11 1 +#define IGNORE_PIN_PB12 1 +#define IGNORE_PIN_PB13 1 +#define IGNORE_PIN_PB14 1 +#define IGNORE_PIN_PB15 1 +#define IGNORE_PIN_PB16 1 +#define IGNORE_PIN_PB17 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PB30 1 +#define IGNORE_PIN_PB31 1 +#define IGNORE_PIN_PB00 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA17) +#define DEFAULT_I2C_BUS_SDA (&pin_PA16) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA11) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA10) +#define DEFAULT_SPI_BUS_MISO (&pin_PA09) + +#define DEFAULT_UART_BUS_RX (&pin_PA07) +#define DEFAULT_UART_BUS_TX (&pin_PA06) diff --git a/ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.mk b/ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.mk new file mode 100644 index 0000000000..964cbe643a --- /dev/null +++ b/ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.mk @@ -0,0 +1,24 @@ +USB_VID = 0x239A +USB_PID = 0x80CC +USB_PRODUCT = "QT Py M0" +USB_MANUFACTURER = "Adafruit Industries LLC" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_FULL_BUILD = 0 + +SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif diff --git a/ports/atmel-samd/boards/icy-tree-sof-m0/pins.c b/ports/atmel-samd/boards/icy-tree-sof-m0/pins.c new file mode 100644 index 0000000000..636c48bffc --- /dev/null +++ b/ports/atmel-samd/boards/icy-tree-sof-m0/pins.c @@ -0,0 +1,49 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA03) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA05) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA16) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA06) }, + + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA07) }, + + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA11) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA09) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA10) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_PA15) }, + + { 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_global_dict_table); From 0e628caa6f0697ee8747df50c6ad3bfd9a76e4f6 Mon Sep 17 00:00:00 2001 From: Seth Kerr Date: Mon, 23 Nov 2020 19:23:22 -0500 Subject: [PATCH 58/64] forgot the build.yml files --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e72a40219..06cc49923d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -199,6 +199,7 @@ jobs: - "clue_nrf52840_express" - "cp32-m4" - "cp_sapling_m0" + - "cp_sapling_m0_spiflash" - "datalore_ip_m4" - "datum_distance" - "datum_imu" From e5cee989771f6c79b91e8c3a039d167bf7022fa4 Mon Sep 17 00:00:00 2001 From: Seth Kerr Date: Mon, 23 Nov 2020 19:31:06 -0500 Subject: [PATCH 59/64] removing icy tree files/directory --- .../atmel-samd/boards/icy-tree-sof-m0/board.c | 44 --------------- .../boards/icy-tree-sof-m0/mpconfigboard.h | 55 ------------------- .../boards/icy-tree-sof-m0/mpconfigboard.mk | 24 -------- .../atmel-samd/boards/icy-tree-sof-m0/pins.c | 49 ----------------- 4 files changed, 172 deletions(-) delete mode 100644 ports/atmel-samd/boards/icy-tree-sof-m0/board.c delete mode 100644 ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.h delete mode 100644 ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.mk delete mode 100644 ports/atmel-samd/boards/icy-tree-sof-m0/pins.c diff --git a/ports/atmel-samd/boards/icy-tree-sof-m0/board.c b/ports/atmel-samd/boards/icy-tree-sof-m0/board.c deleted file mode 100644 index 1a65a561f7..0000000000 --- a/ports/atmel-samd/boards/icy-tree-sof-m0/board.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 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 "boards/board.h" -#include "common-hal/microcontroller/Pin.h" -#include "supervisor/shared/board.h" -#include "hal/include/hal_gpio.h" - -void board_init(void) { - gpio_set_pin_function(PIN_PA15, GPIO_PIN_FUNCTION_OFF); - gpio_set_pin_direction(PIN_PA15, GPIO_DIRECTION_OUT); - gpio_set_pin_level(PIN_PA15, true); // Turn on neopixel by default - never_reset_pin_number(PIN_PA15); -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} diff --git a/ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.h b/ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.h deleted file mode 100644 index 713d2c03eb..0000000000 --- a/ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.h +++ /dev/null @@ -1,55 +0,0 @@ -#define MICROPY_HW_BOARD_NAME "Adafruit QT Py M0" -#define MICROPY_HW_MCU_NAME "samd21e18" - -#define MICROPY_HW_NEOPIXEL (&pin_PA18) - -#define MICROPY_PORT_A (0) -#define MICROPY_PORT_B (0) -#define MICROPY_PORT_C (0) - -#define IGNORE_PIN_PA00 1 -#define IGNORE_PIN_PA01 1 -#define IGNORE_PIN_PA12 1 -#define IGNORE_PIN_PA13 1 -#define IGNORE_PIN_PA14 1 -#define IGNORE_PIN_PA20 1 -#define IGNORE_PIN_PA21 1 -// USB is always used internally so skip the pin objects for it. -#define IGNORE_PIN_PA24 1 -#define IGNORE_PIN_PA25 1 -#define IGNORE_PIN_PA27 1 -#define IGNORE_PIN_PA28 1 -#define IGNORE_PIN_PA30 1 -#define IGNORE_PIN_PA31 1 -#define IGNORE_PIN_PB01 1 -#define IGNORE_PIN_PB02 1 -#define IGNORE_PIN_PB03 1 -#define IGNORE_PIN_PB04 1 -#define IGNORE_PIN_PB05 1 -#define IGNORE_PIN_PB06 1 -#define IGNORE_PIN_PB07 1 -#define IGNORE_PIN_PB08 1 -#define IGNORE_PIN_PB09 1 -#define IGNORE_PIN_PB10 1 -#define IGNORE_PIN_PB11 1 -#define IGNORE_PIN_PB12 1 -#define IGNORE_PIN_PB13 1 -#define IGNORE_PIN_PB14 1 -#define IGNORE_PIN_PB15 1 -#define IGNORE_PIN_PB16 1 -#define IGNORE_PIN_PB17 1 -#define IGNORE_PIN_PB22 1 -#define IGNORE_PIN_PB23 1 -#define IGNORE_PIN_PB30 1 -#define IGNORE_PIN_PB31 1 -#define IGNORE_PIN_PB00 1 - -#define DEFAULT_I2C_BUS_SCL (&pin_PA17) -#define DEFAULT_I2C_BUS_SDA (&pin_PA16) - -#define DEFAULT_SPI_BUS_SCK (&pin_PA11) -#define DEFAULT_SPI_BUS_MOSI (&pin_PA10) -#define DEFAULT_SPI_BUS_MISO (&pin_PA09) - -#define DEFAULT_UART_BUS_RX (&pin_PA07) -#define DEFAULT_UART_BUS_TX (&pin_PA06) diff --git a/ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.mk b/ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.mk deleted file mode 100644 index 964cbe643a..0000000000 --- a/ports/atmel-samd/boards/icy-tree-sof-m0/mpconfigboard.mk +++ /dev/null @@ -1,24 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x80CC -USB_PRODUCT = "QT Py M0" -USB_MANUFACTURER = "Adafruit Industries LLC" - -CHIP_VARIANT = SAMD21E18A -CHIP_FAMILY = samd21 - -INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE -CIRCUITPY_FULL_BUILD = 0 - -SUPEROPT_GC = 0 - -CFLAGS_BOARD = --param max-inline-insns-auto=15 -ifeq ($(TRANSLATION), zh_Latn_pinyin) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -endif -ifeq ($(TRANSLATION), de_DE) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -SUPEROPT_VM = 0 -endif diff --git a/ports/atmel-samd/boards/icy-tree-sof-m0/pins.c b/ports/atmel-samd/boards/icy-tree-sof-m0/pins.c deleted file mode 100644 index 636c48bffc..0000000000 --- a/ports/atmel-samd/boards/icy-tree-sof-m0/pins.c +++ /dev/null @@ -1,49 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, - - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA03) }, - - { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, - - { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA05) }, - - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA16) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA16) }, - - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA17) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA17) }, - - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA06) }, - - { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA07) }, - - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA11) }, - - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA09) }, - - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA10) }, - - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA18) }, - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_PA15) }, - - { 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_global_dict_table); From 6ff24410ebe9e75456b9d5d64f37fbe019caf42c Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Tue, 24 Nov 2020 11:44:11 +0530 Subject: [PATCH 60/64] use values pointer directly --- ports/esp32s2/common-hal/nvm/ByteArray.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/ports/esp32s2/common-hal/nvm/ByteArray.c b/ports/esp32s2/common-hal/nvm/ByteArray.c index e304dd8302..71321e7e65 100644 --- a/ports/esp32s2/common-hal/nvm/ByteArray.c +++ b/ports/esp32s2/common-hal/nvm/ByteArray.c @@ -26,8 +26,6 @@ #include "common-hal/nvm/ByteArray.h" -#include - #include "py/runtime.h" #include "nvs_flash.h" @@ -56,9 +54,6 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint8_t* values, uint32_t len) { char index[9]; - uint8_t buffer[len]; - memcpy(buffer, values, len); - // start nvs nvs_handle_t handle; get_nvs_handle(&handle); @@ -66,7 +61,7 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, // stage flash changes for (uint32_t i = 0; i < len; i++) { sprintf(index, "%i", start_index + i); - if (nvs_set_u8(handle, (const char *)index, buffer[i]) != ESP_OK) { + if (nvs_set_u8(handle, (const char *)index, values[i]) != ESP_OK) { return false; } } @@ -84,7 +79,6 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint32_t len, uint8_t* values) { char index[9]; - uint8_t buffer[len]; // start nvs nvs_handle_t handle; @@ -93,14 +87,11 @@ void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, // get from flash for (uint32_t i = 0; i < len; i++) { sprintf(index, "%i", start_index + i); - if (nvs_get_u8(handle, (const char *)index, &buffer[i]) != ESP_OK) { + if (nvs_get_u8(handle, (const char *)index, &values[i]) != ESP_OK) { mp_raise_RuntimeError(translate("NVS Error")); } } - // set into values - memcpy(values, buffer, len); - // close nvs nvs_close(handle); } From f8499a468e79999decdf5002016bbfe99994f47b Mon Sep 17 00:00:00 2001 From: jgillick Date: Mon, 23 Nov 2020 22:56:38 -0800 Subject: [PATCH 61/64] Remove filesystem from linker script. --- .../{STM32F411_nvm_flash.ld => STM32F411_nvm_nofs.ld} | 10 ++++------ ports/stm/boards/thunderpack_v12/mpconfigboard.h | 4 ++-- ports/stm/boards/thunderpack_v12/mpconfigboard.mk | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) rename ports/stm/boards/{STM32F411_nvm_flash.ld => STM32F411_nvm_nofs.ld} (64%) diff --git a/ports/stm/boards/STM32F411_nvm_flash.ld b/ports/stm/boards/STM32F411_nvm_nofs.ld similarity index 64% rename from ports/stm/boards/STM32F411_nvm_flash.ld rename to ports/stm/boards/STM32F411_nvm_nofs.ld index ced739765d..e4630518cd 100644 --- a/ports/stm/boards/STM32F411_nvm_flash.ld +++ b/ports/stm/boards/STM32F411_nvm_nofs.ld @@ -1,7 +1,6 @@ /* - GNU linker script for STM32F411 with nvm and an external flash chip, and reserves - more space for the CircuitPython firmware and less for the filesystem - (since the filesystem will be on the external flash chip). + GNU linker script for STM32F411 with nvm and an external flash chip. + No space is reserved for a filesystem. */ /* Specify the memory areas */ @@ -9,9 +8,8 @@ MEMORY { FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 32K /* sectors 1,2 are 16K */ - FLASH_NVM (rwx) : ORIGIN = 0x0800C000, LENGTH = 16K /* sector 3 is 16K */ - FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + FLASH_NVM (rwx) : ORIGIN = 0x08004000, LENGTH = 16K /* sector 1 is 16K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08008000, LENGTH = 480K /* sector 2,3 is 16k, sector 4 is 64K, sectors 5,6,7 are 128K */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.h b/ports/stm/boards/thunderpack_v12/mpconfigboard.h index 57486da280..fb5f389a37 100644 --- a/ports/stm/boards/thunderpack_v12/mpconfigboard.h +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.h @@ -28,8 +28,8 @@ // Non-volatile memory config #define CIRCUITPY_INTERNAL_NVM_SIZE (0x4000) -#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x0800C000) -#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_3 +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x08004000) +#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_1 #define NVM_BYTEARRAY_BUFFER_SIZE 512 // Flash config diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk index d0bc22680f..a2e1da1011 100644 --- a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk @@ -18,4 +18,4 @@ MCU_VARIANT = STM32F411xE MCU_PACKAGE = UFQFPN48 LD_COMMON = boards/common_nvm.ld -LD_FILE = boards/STM32F411_nvm_flash.ld +LD_FILE = boards/STM32F411_nvm_nofs.ld From 686edcef3f392ce96ae86bd66e91b6c93f2f986f Mon Sep 17 00:00:00 2001 From: Seth Kerr Date: Tue, 24 Nov 2020 07:41:32 -0500 Subject: [PATCH 62/64] fixing PID issues with CI Test (whoops) --- .../atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.h | 2 +- .../atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.h b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.h index a129566d2d..9c69c48026 100644 --- a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.h +++ b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.h @@ -1,4 +1,4 @@ -#define MICROPY_HW_BOARD_NAME "CP Sapling M0" +#define MICROPY_HW_BOARD_NAME "CP Sapling M0 w/ SPI Flash" #define MICROPY_HW_MCU_NAME "samd21e18" #define MICROPY_HW_NEOPIXEL (&pin_PA15) 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 c81209db3b..99e13f7910 100644 --- a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk +++ b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk @@ -1,6 +1,6 @@ USB_VID = 0x1209 -USB_PID = 0x4DDD -USB_PRODUCT = "CP Sapling" +USB_PID = 0x4DDE +USB_PRODUCT = "CP Sapling M0 w/ SPI Flash" USB_MANUFACTURER = "Oak Development Technologies" CHIP_VARIANT = SAMD21E18A From bafa0501d17eb55726a8decfe19d6f055190d6b1 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 24 Nov 2020 22:06:59 +0700 Subject: [PATCH 63/64] update to have tud_connected() --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index b870d932e5..218b80e63a 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit b870d932e5e1c6ece4227a5d49cc71e53a744149 +Subproject commit 218b80e63ab6ff87c1851e403f08b3d716d68f5e From c451b22255706989f58cfd88be486e5117979a28 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 24 Nov 2020 10:26:47 -0600 Subject: [PATCH 64/64] Disable 3-arg pow() function on m0 boards `pow(a, b, c)` can compute `(a ** b) % c` efficiently (in time and memory). This can be useful for extremely specific applications, like implementing the RSA cryptosystem. For typical uses of CircuitPython, this is not an important feature. A survey of the bundle and learn system didn't find any uses. Disable it on M0 builds so that we can fit in needed upgrades to the USB stack. --- ports/atmel-samd/mpconfigport.mk | 4 ++++ py/circuitpy_mpconfig.h | 2 +- py/circuitpy_mpconfig.mk | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 1929e146d3..17e3995bf5 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -29,6 +29,10 @@ ifndef CIRCUITPY_AUDIOMP3 CIRCUITPY_AUDIOMP3 = 0 endif +ifndef CIRCUITPY_BUILTINS_POW3 +CIRCUITPY_BUILTINS_POW3 = 0 +endif + ifndef CIRCUITPY_FREQUENCYIO CIRCUITPY_FREQUENCYIO = 0 endif diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 85e152670a..28fd4095c4 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -184,7 +184,7 @@ typedef long mp_off_t; // Turning off FULL_BUILD removes some functionality to reduce flash size on tiny SAMD21s #define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (CIRCUITPY_FULL_BUILD) #define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD) -#define MICROPY_PY_BUILTINS_POW3 (CIRCUITPY_FULL_BUILD) +#define MICROPY_PY_BUILTINS_POW3 (CIRCUITPY_BUILTINS_POW3) #define MICROPY_COMP_FSTRING_LITERAL (MICROPY_CPYTHON_COMPAT) #define MICROPY_MODULE_WEAK_LINKS (0) #define MICROPY_PY_ALL_SPECIAL_METHODS (CIRCUITPY_FULL_BUILD) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index a6aabec33d..08e7737180 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -90,6 +90,9 @@ CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO) CIRCUITPY_BOARD ?= 1 CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD) +CIRCUITPY_BUILTINS_POW3 ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_BUILTINS_POW3=$(CIRCUITPY_BUILTINS_POW3) + CIRCUITPY_BUSIO ?= 1 CFLAGS += -DCIRCUITPY_BUSIO=$(CIRCUITPY_BUSIO)