From 47849a9e58d5f6d06bb92e00b3de567da1a356dd Mon Sep 17 00:00:00 2001 From: sommersoft Date: Mon, 29 Jun 2020 18:18:25 -0500 Subject: [PATCH 001/251] 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 dc10e968149f50fbc88158bcb3f78380667abb40 Mon Sep 17 00:00:00 2001 From: Noel Gaetan Date: Sat, 17 Oct 2020 16:54:13 +0200 Subject: [PATCH 002/251] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 29db397932..15b4cfc892 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ SPDX-License-Identifier: MIT # Contributing Please note that this project is released with a -[Contributor Code of Conduct](https://github.com/adafruit/circuitpython/blob/main/CODE_OF_CONDUCT.md). +[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. Participation covers any forum used to converse about CircuitPython including unofficial and official spaces. Failure to do so will result in corrective actions such as time out or ban from the project. From 7cf776d39e9c9e4694b65b636f456630b462958c Mon Sep 17 00:00:00 2001 From: Noel Gaetan Date: Sat, 17 Oct 2020 17:11:17 +0200 Subject: [PATCH 003/251] Update CONTRIBUTING.md test fix url 404 --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 15b4cfc892..c94e8db8c6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,8 @@ SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://g SPDX-License-Identifier: MIT --> + + # Contributing Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). From ff69ab603d0ccec3b44ce72e5f365a0c91d33b97 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Wed, 21 Oct 2020 17:07:30 -0400 Subject: [PATCH 004/251] fix CPB SPI pin definitions --- ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h index 17b044b145..ef34465dcd 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h @@ -59,8 +59,8 @@ #define DEFAULT_I2C_BUS_SCL (&pin_P0_04) #define DEFAULT_I2C_BUS_SDA (&pin_P0_05) -#define DEFAULT_SPI_BUS_SCK (&pin_P0_05) -#define DEFAULT_SPI_BUS_MOSI (&pin_P1_03) +#define DEFAULT_SPI_BUS_SCK (&pin_P0_02) +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_03) #define DEFAULT_SPI_BUS_MISO (&pin_P0_29) #define DEFAULT_UART_BUS_RX (&pin_P0_30) From f431f859e74a92099079bd8753c2319566dbf3c7 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 22 Oct 2020 21:32:44 +0530 Subject: [PATCH 005/251] Initial support for native touchio --- ports/esp32s2/common-hal/touchio/TouchIn.c | 109 ++++++++++++++++++++ ports/esp32s2/common-hal/touchio/TouchIn.h | 42 ++++++++ ports/esp32s2/common-hal/touchio/__init__.c | 1 + ports/esp32s2/mpconfigport.mk | 4 + ports/esp32s2/peripherals/pins.c | 95 +++++++++-------- ports/esp32s2/peripherals/pins.h | 1 + 6 files changed, 208 insertions(+), 44 deletions(-) create mode 100644 ports/esp32s2/common-hal/touchio/TouchIn.c create mode 100644 ports/esp32s2/common-hal/touchio/TouchIn.h create mode 100644 ports/esp32s2/common-hal/touchio/__init__.c diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.c b/ports/esp32s2/common-hal/touchio/TouchIn.c new file mode 100644 index 0000000000..7d30d1a325 --- /dev/null +++ b/ports/esp32s2/common-hal/touchio/TouchIn.c @@ -0,0 +1,109 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 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 "shared-bindings/touchio/TouchIn.h" +#include "py/runtime.h" + +#include "driver/touch_pad.h" + +static const touch_pad_t touch_pad[] = { + TOUCH_PAD_NUM1, + TOUCH_PAD_NUM2, + TOUCH_PAD_NUM3, + TOUCH_PAD_NUM4, + TOUCH_PAD_NUM5, + TOUCH_PAD_NUM6, + TOUCH_PAD_NUM7, + TOUCH_PAD_NUM8, + TOUCH_PAD_NUM9, + TOUCH_PAD_NUM10, + TOUCH_PAD_NUM11, + TOUCH_PAD_NUM12, + TOUCH_PAD_NUM13, + TOUCH_PAD_NUM14 +}; + +static uint16_t get_raw_reading(touchio_touchin_obj_t *self) { + uint32_t touch_value; + touch_pad_read_raw_data(touch_pad[self->pin], &touch_value); + return touch_value; +} + +void common_hal_touchio_touchin_construct(touchio_touchin_obj_t* self, + const mcu_pin_obj_t *pin) { + if (!pin->has_touch) { + mp_raise_ValueError(translate("Invalid pin")); + } + claim_pin(pin); + + touch_pad_init(); + touch_pad_config(touch_pad[pin->number]); + + touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER); + touch_pad_fsm_start(); + + // Initial values for pins will vary, depending on what peripherals the pins + // share on-chip. + + // Set a "touched" threshold not too far above the initial value. + // For simple finger touch, the values may vary as much as a factor of two, + // but for touches using fruit or other objects, the difference is much less. + + self->pin = pin->number; + self->threshold = get_raw_reading(self) + 100; +} + +bool common_hal_touchio_touchin_deinited(touchio_touchin_obj_t* self) { + return self->pin == 0xff; +} + +void common_hal_touchio_touchin_deinit(touchio_touchin_obj_t* self) { + if (common_hal_touchio_touchin_deinited(self)) { + return; + } + + //touch_pad_deinit(); + + reset_pin_number(self->pin); + self->pin = 0xff; +} + +bool common_hal_touchio_touchin_get_value(touchio_touchin_obj_t *self) { + uint16_t reading = get_raw_reading(self); + return reading > self->threshold; +} + +uint16_t common_hal_touchio_touchin_get_raw_value(touchio_touchin_obj_t *self) { + return get_raw_reading(self); +} + +uint16_t common_hal_touchio_touchin_get_threshold(touchio_touchin_obj_t *self) { + return self->threshold; +} + +void common_hal_touchio_touchin_set_threshold(touchio_touchin_obj_t *self, uint16_t new_threshold) { + self->threshold = new_threshold; +} diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.h b/ports/esp32s2/common-hal/touchio/TouchIn.h new file mode 100644 index 0000000000..81d80c9dd9 --- /dev/null +++ b/ports/esp32s2/common-hal/touchio/TouchIn.h @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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_TOUCHIO_TOUCHIN_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_TOUCHIO_TOUCHIN_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + uint8_t pin; + uint16_t threshold; +} touchio_touchin_obj_t; + +void touchin_reset(void); + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_TOUCHIO_TOUCHIN_H diff --git a/ports/esp32s2/common-hal/touchio/__init__.c b/ports/esp32s2/common-hal/touchio/__init__.c new file mode 100644 index 0000000000..d2290447c9 --- /dev/null +++ b/ports/esp32s2/common-hal/touchio/__init__.c @@ -0,0 +1 @@ +// No touchio module functions. diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 4e8a7bdef2..60a3a14ca9 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -26,4 +26,8 @@ CIRCUITPY_USB_MIDI = 0 CIRCUITPY_WIFI = 1 CIRCUITPY_ESPIDF = 1 +ifndef CIRCUITPY_TOUCHIO_USE_NATIVE +CIRCUITPY_TOUCHIO_USE_NATIVE = 1 +endif + CIRCUITPY_MODULE ?= none diff --git a/ports/esp32s2/peripherals/pins.c b/ports/esp32s2/peripherals/pins.c index 2c8b61c627..e372c84b1d 100755 --- a/ports/esp32s2/peripherals/pins.c +++ b/ports/esp32s2/peripherals/pins.c @@ -29,55 +29,62 @@ #define NO_ADC 0 #define NO_ADC_CHANNEL ADC_CHANNEL_MAX +#define TOUCH \ + .has_touch = true, + +#define NO_TOUCH \ + .has_touch = false, + // This macro is used to simplify pin definition in boards//pins.c -#define PIN(p_name, p_number, p_adc_index, p_adc_channel) \ +#define PIN(p_name, p_number, p_adc_index, p_adc_channel, p_touch_channel) \ const mcu_pin_obj_t pin_## p_name = { \ PIN_PREFIX_VALUES \ .number = p_number, \ .adc_index = p_adc_index, \ .adc_channel = p_adc_channel, \ + p_touch_channel \ } -PIN(GPIO0, 0, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO1, 1, ADC_UNIT_1, ADC_CHANNEL_0); -PIN(GPIO2, 2, ADC_UNIT_1, ADC_CHANNEL_1); -PIN(GPIO3, 3, ADC_UNIT_1, ADC_CHANNEL_2); -PIN(GPIO4, 4, ADC_UNIT_1, ADC_CHANNEL_3); -PIN(GPIO5, 5, ADC_UNIT_1, ADC_CHANNEL_4); -PIN(GPIO6, 6, ADC_UNIT_1, ADC_CHANNEL_5); -PIN(GPIO7, 7, ADC_UNIT_1, ADC_CHANNEL_6); -PIN(GPIO8, 8, ADC_UNIT_1, ADC_CHANNEL_7); -PIN(GPIO9, 9, ADC_UNIT_1, ADC_CHANNEL_8); -PIN(GPIO10, 10, ADC_UNIT_1, ADC_CHANNEL_9); -PIN(GPIO11, 11, ADC_UNIT_2, ADC_CHANNEL_0); -PIN(GPIO12, 12, ADC_UNIT_2, ADC_CHANNEL_1); -PIN(GPIO13, 13, ADC_UNIT_2, ADC_CHANNEL_2); -PIN(GPIO14, 14, ADC_UNIT_2, ADC_CHANNEL_3); -PIN(GPIO15, 15, ADC_UNIT_2, ADC_CHANNEL_4); -PIN(GPIO16, 16, ADC_UNIT_2, ADC_CHANNEL_5); -PIN(GPIO17, 17, ADC_UNIT_2, ADC_CHANNEL_6); -PIN(GPIO18, 18, ADC_UNIT_2, ADC_CHANNEL_7); -PIN(GPIO19, 19, ADC_UNIT_2, ADC_CHANNEL_8); -PIN(GPIO20, 20, ADC_UNIT_2, ADC_CHANNEL_9); -PIN(GPIO21, 21, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO26, 26, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO27, 27, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO28, 28, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO29, 29, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO30, 30, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO31, 31, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO32, 32, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO33, 33, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO34, 34, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO35, 35, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO36, 36, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO37, 37, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO38, 38, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO39, 39, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO40, 40, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO41, 41, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO42, 42, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO43, 43, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO44, 44, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO45, 45, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO46, 46, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO0, 0, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO1, 1, ADC_UNIT_1, ADC_CHANNEL_0, TOUCH); +PIN(GPIO2, 2, ADC_UNIT_1, ADC_CHANNEL_1, TOUCH); +PIN(GPIO3, 3, ADC_UNIT_1, ADC_CHANNEL_2, TOUCH); +PIN(GPIO4, 4, ADC_UNIT_1, ADC_CHANNEL_3, TOUCH); +PIN(GPIO5, 5, ADC_UNIT_1, ADC_CHANNEL_4, TOUCH); +PIN(GPIO6, 6, ADC_UNIT_1, ADC_CHANNEL_5, TOUCH); +PIN(GPIO7, 7, ADC_UNIT_1, ADC_CHANNEL_6, TOUCH); +PIN(GPIO8, 8, ADC_UNIT_1, ADC_CHANNEL_7, TOUCH); +PIN(GPIO9, 9, ADC_UNIT_1, ADC_CHANNEL_8, TOUCH); +PIN(GPIO10, 10, ADC_UNIT_1, ADC_CHANNEL_9, TOUCH); +PIN(GPIO11, 11, ADC_UNIT_2, ADC_CHANNEL_0, TOUCH); +PIN(GPIO12, 12, ADC_UNIT_2, ADC_CHANNEL_1, TOUCH); +PIN(GPIO13, 13, ADC_UNIT_2, ADC_CHANNEL_2, TOUCH); +PIN(GPIO14, 14, ADC_UNIT_2, ADC_CHANNEL_3, TOUCH); +PIN(GPIO15, 15, ADC_UNIT_2, ADC_CHANNEL_4, NO_TOUCH); +PIN(GPIO16, 16, ADC_UNIT_2, ADC_CHANNEL_5, NO_TOUCH); +PIN(GPIO17, 17, ADC_UNIT_2, ADC_CHANNEL_6, NO_TOUCH); +PIN(GPIO18, 18, ADC_UNIT_2, ADC_CHANNEL_7, NO_TOUCH); +PIN(GPIO19, 19, ADC_UNIT_2, ADC_CHANNEL_8, NO_TOUCH); +PIN(GPIO20, 20, ADC_UNIT_2, ADC_CHANNEL_9, NO_TOUCH); +PIN(GPIO21, 21, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO26, 26, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO27, 27, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO28, 28, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO29, 29, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO30, 30, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO31, 31, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO32, 32, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO33, 33, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO34, 34, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO35, 35, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO36, 36, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO37, 37, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO38, 38, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO39, 39, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO40, 40, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO41, 41, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO42, 42, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO43, 43, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO44, 44, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO45, 45, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO46, 46, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); diff --git a/ports/esp32s2/peripherals/pins.h b/ports/esp32s2/peripherals/pins.h index 84123a80e6..8be57f320f 100644 --- a/ports/esp32s2/peripherals/pins.h +++ b/ports/esp32s2/peripherals/pins.h @@ -41,6 +41,7 @@ typedef struct { PIN_PREFIX_FIELDS gpio_num_t number; + bool has_touch:1; uint8_t adc_index:2; uint8_t adc_channel:6; } mcu_pin_obj_t; From ef97ed6ab6938bc9c12987d7584cbc715a0f85bf Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Fri, 23 Oct 2020 13:17:49 +0530 Subject: [PATCH 006/251] Update touchio implementation --- ports/esp32s2/common-hal/touchio/TouchIn.c | 41 ++++------ ports/esp32s2/common-hal/touchio/TouchIn.h | 2 +- ports/esp32s2/peripherals/pins.c | 94 +++++++++++----------- ports/esp32s2/peripherals/pins.h | 3 +- 4 files changed, 62 insertions(+), 78 deletions(-) diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.c b/ports/esp32s2/common-hal/touchio/TouchIn.c index 7d30d1a325..3e3e4b5511 100644 --- a/ports/esp32s2/common-hal/touchio/TouchIn.c +++ b/ports/esp32s2/common-hal/touchio/TouchIn.c @@ -29,42 +29,31 @@ #include "driver/touch_pad.h" -static const touch_pad_t touch_pad[] = { - TOUCH_PAD_NUM1, - TOUCH_PAD_NUM2, - TOUCH_PAD_NUM3, - TOUCH_PAD_NUM4, - TOUCH_PAD_NUM5, - TOUCH_PAD_NUM6, - TOUCH_PAD_NUM7, - TOUCH_PAD_NUM8, - TOUCH_PAD_NUM9, - TOUCH_PAD_NUM10, - TOUCH_PAD_NUM11, - TOUCH_PAD_NUM12, - TOUCH_PAD_NUM13, - TOUCH_PAD_NUM14 -}; - static uint16_t get_raw_reading(touchio_touchin_obj_t *self) { uint32_t touch_value; - touch_pad_read_raw_data(touch_pad[self->pin], &touch_value); + touch_pad_read_raw_data((touch_pad_t)self->pin->touch_channel, &touch_value); + if (touch_value > UINT16_MAX) { + return UINT16_MAX; + } return touch_value; } void common_hal_touchio_touchin_construct(touchio_touchin_obj_t* self, const mcu_pin_obj_t *pin) { - if (!pin->has_touch) { + if (pin->touch_channel == TOUCH_PAD_MAX) { mp_raise_ValueError(translate("Invalid pin")); } claim_pin(pin); touch_pad_init(); - touch_pad_config(touch_pad[pin->number]); + touch_pad_config((touch_pad_t)pin->touch_channel); touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER); touch_pad_fsm_start(); + // wait for "raw data" to reset + mp_hal_delay_ms(10); + // Initial values for pins will vary, depending on what peripherals the pins // share on-chip. @@ -72,23 +61,21 @@ void common_hal_touchio_touchin_construct(touchio_touchin_obj_t* self, // For simple finger touch, the values may vary as much as a factor of two, // but for touches using fruit or other objects, the difference is much less. - self->pin = pin->number; + self->pin = pin; self->threshold = get_raw_reading(self) + 100; } bool common_hal_touchio_touchin_deinited(touchio_touchin_obj_t* self) { - return self->pin == 0xff; + return self->pin == NULL; } void common_hal_touchio_touchin_deinit(touchio_touchin_obj_t* self) { if (common_hal_touchio_touchin_deinited(self)) { return; } - - //touch_pad_deinit(); - - reset_pin_number(self->pin); - self->pin = 0xff; + touch_pad_deinit(); + reset_pin_number(self->pin->touch_channel); + self->pin = NULL; } bool common_hal_touchio_touchin_get_value(touchio_touchin_obj_t *self) { diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.h b/ports/esp32s2/common-hal/touchio/TouchIn.h index 81d80c9dd9..585bb37bf1 100644 --- a/ports/esp32s2/common-hal/touchio/TouchIn.h +++ b/ports/esp32s2/common-hal/touchio/TouchIn.h @@ -33,7 +33,7 @@ typedef struct { mp_obj_base_t base; - uint8_t pin; + const mcu_pin_obj_t * pin; uint16_t threshold; } touchio_touchin_obj_t; diff --git a/ports/esp32s2/peripherals/pins.c b/ports/esp32s2/peripherals/pins.c index e372c84b1d..0d3d89ad50 100755 --- a/ports/esp32s2/peripherals/pins.c +++ b/ports/esp32s2/peripherals/pins.c @@ -29,11 +29,7 @@ #define NO_ADC 0 #define NO_ADC_CHANNEL ADC_CHANNEL_MAX -#define TOUCH \ - .has_touch = true, - -#define NO_TOUCH \ - .has_touch = false, +#define NO_TOUCH_CHANNEL TOUCH_PAD_MAX // This macro is used to simplify pin definition in boards//pins.c #define PIN(p_name, p_number, p_adc_index, p_adc_channel, p_touch_channel) \ @@ -42,49 +38,49 @@ const mcu_pin_obj_t pin_## p_name = { \ .number = p_number, \ .adc_index = p_adc_index, \ .adc_channel = p_adc_channel, \ - p_touch_channel \ + .touch_channel = p_touch_channel, \ } -PIN(GPIO0, 0, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO1, 1, ADC_UNIT_1, ADC_CHANNEL_0, TOUCH); -PIN(GPIO2, 2, ADC_UNIT_1, ADC_CHANNEL_1, TOUCH); -PIN(GPIO3, 3, ADC_UNIT_1, ADC_CHANNEL_2, TOUCH); -PIN(GPIO4, 4, ADC_UNIT_1, ADC_CHANNEL_3, TOUCH); -PIN(GPIO5, 5, ADC_UNIT_1, ADC_CHANNEL_4, TOUCH); -PIN(GPIO6, 6, ADC_UNIT_1, ADC_CHANNEL_5, TOUCH); -PIN(GPIO7, 7, ADC_UNIT_1, ADC_CHANNEL_6, TOUCH); -PIN(GPIO8, 8, ADC_UNIT_1, ADC_CHANNEL_7, TOUCH); -PIN(GPIO9, 9, ADC_UNIT_1, ADC_CHANNEL_8, TOUCH); -PIN(GPIO10, 10, ADC_UNIT_1, ADC_CHANNEL_9, TOUCH); -PIN(GPIO11, 11, ADC_UNIT_2, ADC_CHANNEL_0, TOUCH); -PIN(GPIO12, 12, ADC_UNIT_2, ADC_CHANNEL_1, TOUCH); -PIN(GPIO13, 13, ADC_UNIT_2, ADC_CHANNEL_2, TOUCH); -PIN(GPIO14, 14, ADC_UNIT_2, ADC_CHANNEL_3, TOUCH); -PIN(GPIO15, 15, ADC_UNIT_2, ADC_CHANNEL_4, NO_TOUCH); -PIN(GPIO16, 16, ADC_UNIT_2, ADC_CHANNEL_5, NO_TOUCH); -PIN(GPIO17, 17, ADC_UNIT_2, ADC_CHANNEL_6, NO_TOUCH); -PIN(GPIO18, 18, ADC_UNIT_2, ADC_CHANNEL_7, NO_TOUCH); -PIN(GPIO19, 19, ADC_UNIT_2, ADC_CHANNEL_8, NO_TOUCH); -PIN(GPIO20, 20, ADC_UNIT_2, ADC_CHANNEL_9, NO_TOUCH); -PIN(GPIO21, 21, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO26, 26, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO27, 27, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO28, 28, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO29, 29, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO30, 30, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO31, 31, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO32, 32, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO33, 33, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO34, 34, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO35, 35, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO36, 36, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO37, 37, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO38, 38, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO39, 39, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO40, 40, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO41, 41, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO42, 42, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO43, 43, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO44, 44, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO45, 45, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO46, 46, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO0, 0, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO1, 1, ADC_UNIT_1, ADC_CHANNEL_0, TOUCH_PAD_NUM1); +PIN(GPIO2, 2, ADC_UNIT_1, ADC_CHANNEL_1, TOUCH_PAD_NUM2); +PIN(GPIO3, 3, ADC_UNIT_1, ADC_CHANNEL_2, TOUCH_PAD_NUM3); +PIN(GPIO4, 4, ADC_UNIT_1, ADC_CHANNEL_3, TOUCH_PAD_NUM4); +PIN(GPIO5, 5, ADC_UNIT_1, ADC_CHANNEL_4, TOUCH_PAD_NUM5); +PIN(GPIO6, 6, ADC_UNIT_1, ADC_CHANNEL_5, TOUCH_PAD_NUM6); +PIN(GPIO7, 7, ADC_UNIT_1, ADC_CHANNEL_6, TOUCH_PAD_NUM7); +PIN(GPIO8, 8, ADC_UNIT_1, ADC_CHANNEL_7, TOUCH_PAD_NUM8); +PIN(GPIO9, 9, ADC_UNIT_1, ADC_CHANNEL_8, TOUCH_PAD_NUM9); +PIN(GPIO10, 10, ADC_UNIT_1, ADC_CHANNEL_9, TOUCH_PAD_NUM10); +PIN(GPIO11, 11, ADC_UNIT_2, ADC_CHANNEL_0, TOUCH_PAD_NUM11); +PIN(GPIO12, 12, ADC_UNIT_2, ADC_CHANNEL_1, TOUCH_PAD_NUM12); +PIN(GPIO13, 13, ADC_UNIT_2, ADC_CHANNEL_2, TOUCH_PAD_NUM13); +PIN(GPIO14, 14, ADC_UNIT_2, ADC_CHANNEL_3, TOUCH_PAD_NUM14); +PIN(GPIO15, 15, ADC_UNIT_2, ADC_CHANNEL_4, NO_TOUCH_CHANNEL); +PIN(GPIO16, 16, ADC_UNIT_2, ADC_CHANNEL_5, NO_TOUCH_CHANNEL); +PIN(GPIO17, 17, ADC_UNIT_2, ADC_CHANNEL_6, NO_TOUCH_CHANNEL); +PIN(GPIO18, 18, ADC_UNIT_2, ADC_CHANNEL_7, NO_TOUCH_CHANNEL); +PIN(GPIO19, 19, ADC_UNIT_2, ADC_CHANNEL_8, NO_TOUCH_CHANNEL); +PIN(GPIO20, 20, ADC_UNIT_2, ADC_CHANNEL_9, NO_TOUCH_CHANNEL); +PIN(GPIO21, 21, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO26, 26, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO27, 27, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO28, 28, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO29, 29, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO30, 30, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO31, 31, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO32, 32, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO33, 33, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO34, 34, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO35, 35, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO36, 36, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO37, 37, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO38, 38, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO39, 39, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO40, 40, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO41, 41, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO42, 42, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO43, 43, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO44, 44, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO45, 45, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO46, 46, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); diff --git a/ports/esp32s2/peripherals/pins.h b/ports/esp32s2/peripherals/pins.h index 8be57f320f..c78eb83851 100644 --- a/ports/esp32s2/peripherals/pins.h +++ b/ports/esp32s2/peripherals/pins.h @@ -37,13 +37,14 @@ #include "components/hal/include/hal/gpio_types.h" #include "components/hal/include/hal/adc_types.h" +#include "components/hal/include/hal/touch_sensor_types.h" typedef struct { PIN_PREFIX_FIELDS gpio_num_t number; - bool has_touch:1; uint8_t adc_index:2; uint8_t adc_channel:6; + uint8_t touch_channel; } mcu_pin_obj_t; extern const mcu_pin_obj_t pin_GPIO0; From 2ebd06f8ee3d5818cd0c61468a7e12072b59c973 Mon Sep 17 00:00:00 2001 From: 0-Arngerdur-1 Date: Fri, 23 Oct 2020 15:14:45 -0500 Subject: [PATCH 007/251] Fix typos and fix translate --- locale/es.po | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/locale/es.po b/locale/es.po index b3a4333a80..e2ae41ee3d 100644 --- a/locale/es.po +++ b/locale/es.po @@ -168,7 +168,7 @@ msgstr "'%s' espera un registro" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects a special register" -msgstr "'%s' espera un carácter" +msgstr "'%s' espera un registro especial" #: py/emitinlinethumb.c #, c-format @@ -239,7 +239,7 @@ msgstr "el objeto 'coroutine' no es un iterador" #: py/compile.c msgid "'data' requires at least 2 arguments" -msgstr "'data' requiere como minomo 2 argumentos" +msgstr "'data' requiere como mínimo 2 argumentos" #: py/compile.c msgid "'data' requires integer arguments" @@ -255,7 +255,7 @@ msgstr "'return' fuera de una función" #: py/compile.c msgid "'yield from' inside async function" -msgstr "'yield from' dentro función asincrónica" +msgstr "'yield from' dentro de una función asincrónica" #: py/compile.c msgid "'yield' outside function" @@ -289,7 +289,7 @@ msgstr "ADC2 está siendo usado por WiFi" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" -msgstr "La dirección debe ser %d bytes de largo" +msgstr "La dirección debe tener %d bytes de largo" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" @@ -318,9 +318,7 @@ msgstr "Todos los canales de eventos estan siendo usados" #: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "All sync event channels in use" -msgstr "" -"Todos los canales de eventos de sincronización (sync event channels) están " -"siendo utilizados" +msgstr "Todos los canales de eventos de sincronización (sync event channels) están siendo utilizados" #: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" @@ -347,7 +345,7 @@ msgstr "Ya se encuentra publicando." #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" -msgstr "Ya se tiene un escucha todas-las-coincidencias" +msgstr "Ya se tiene un escucha de todas las coincidencias" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c @@ -370,7 +368,7 @@ msgstr "Funcionalidad AnalogOut no soportada" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut es solo de 16 bits. Value debe ser menos a 65536." +msgstr "AnalogOut es solo de 16 bits. El valor debe ser menor que 65536." #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "AnalogOut not supported on given pin" @@ -383,7 +381,7 @@ msgstr "Otro envío ya está activo" #: shared-bindings/pulseio/PulseOut.c msgid "Array must contain halfwords (type 'H')" -msgstr "Array debe contener media palabra (type 'H')" +msgstr "El array debe contener medias palabras (escriba 'H')" #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." @@ -4013,7 +4011,7 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgstr "Falló el iniciar borrado de flash, err 0x%04x" #~ msgid "Flash write failed" -#~ msgstr "Falló la escritura" +#~ msgstr "Falló la escritura flash" #~ msgid "Flash write failed to start, err 0x%04x" #~ msgstr "Falló el iniciar la escritura de flash, err 0x%04x" @@ -4070,7 +4068,7 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgstr "Sin soporte PulseIn para %q" #~ msgid "No hardware support for analog out." -#~ msgstr "Sin soporte de hardware para analog out" +#~ msgstr "Sin soporte de hardware para salida analógica" #~ msgid "Not connected." #~ msgstr "No conectado." @@ -4079,24 +4077,24 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgstr "Solo formato Windows, BMP sin comprimir soportado %d" #~ msgid "Only bit maps of 8 bit color or less are supported" -#~ msgstr "Solo se admiten bit maps de color de 8 bits o menos" +#~ msgstr "Solo se admiten mapas de bits de color de 8 bits o menos" #~ msgid "" #~ "Only monochrome, indexed 8bpp, and 16bpp or greater BMPs supported: %d " #~ "bpp given" #~ msgstr "" #~ "Solo se admiten BMP monocromos, indexados de 8bpp y 16bpp o superiores:%d " -#~ "bppdado" +#~ "bpp dado" #, fuzzy #~ msgid "Only slices with step=1 (aka None) are supported" -#~ msgstr "solo se admiten segmentos con step=1 (alias None)" +#~ msgstr "Solo se admiten segmentos con step=1 (alias None)" #~ msgid "Only true color (24 bpp or higher) BMP supported %x" #~ msgstr "Solo color verdadero (24 bpp o superior) BMP admitido %x" #~ msgid "Only tx supported on UART1 (GPIO2)." -#~ msgstr "Solo tx soportada en UART1 (GPIO2)" +#~ msgstr "Solo tx soportada en UART1 (GPIO2)." #~ msgid "PWM not supported on pin %d" #~ msgstr "El pin %d no soporta PWM" @@ -4111,11 +4109,11 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgstr "Pines no válidos para SPI" #~ msgid "Pixel beyond bounds of buffer" -#~ msgstr "Pixel beyond bounds of buffer" +#~ msgstr "Píxel fuera de los límites del búfer" #, fuzzy #~ msgid "Range out of bounds" -#~ msgstr "address fuera de límites" +#~ msgstr "Rango fuera de límites" #~ msgid "STA must be active" #~ msgstr "STA debe estar activo" @@ -4135,10 +4133,10 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgstr "" #~ "El heap de CircuitPython estaba corrupto porque el stack era demasiado " #~ "pequeño.\n" -#~ "Aumente los límites del tamaño del stacj y presione reset (después de " +#~ "Aumente los límites del tamaño del stack y presione reset (después de " #~ "expulsarCIRCUITPY).\n" #~ "Si no cambió el stack, entonces reporte un issue aquí con el contenido " -#~ "desu unidad CIRCUITPY:\n" +#~ "de su unidad CIRCUITPY:\n" #~ msgid "" #~ "The microcontroller's power dipped. Please make sure your power supply " @@ -4191,7 +4189,7 @@ msgstr "zi debe ser una forma (n_section,2)" #~ "malo ha sucedido.\n" #~ msgid "bad GATT role" -#~ msgstr "mal GATT role" +#~ msgstr "rol de GATT malo" #~ msgid "bits must be 8" #~ msgstr "bits debe ser 8" @@ -4224,7 +4222,7 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgstr "no se puede establecer STA config" #~ msgid "characteristics includes an object that is not a Characteristic" -#~ msgstr "characteristics incluye un objeto que no es una Characteristica" +#~ msgstr "characteristics incluye un objeto que no es una Characteristic" #~ msgid "color buffer must be a buffer or int" #~ msgstr "color buffer deber ser un buffer o un int" From b4eb27557d98084024e9392dcb64bf9724c04517 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 24 Oct 2020 07:26:01 -0500 Subject: [PATCH 008/251] workflows: Upload stubs to s3 --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa576bbf0a..0792d36a01 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -111,11 +111,13 @@ jobs: with: name: mpy-cross.static-x64-windows path: mpy-cross/mpy-cross.static.exe - - name: Upload mpy-cross builds to S3 + - name: Upload stubs and mpy-cross builds to S3 run: | [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static-raspbian s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-raspbian-${{ env.CP_VERSION }} --no-progress --region us-east-1 [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-amd64-linux-${{ env.CP_VERSION }} --no-progress --region us-east-1 [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static.exe s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-x64-windows-${{ env.CP_VERSION }}.exe --no-progress --region us-east-1 + zip -9 circuitpython-stubs.CP_VERSION }}.zip stubs + [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/mpy-cross/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From 4cad5478e6b6abe6c15546fee4d1a81e180f6d15 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 24 Oct 2020 13:15:50 -0500 Subject: [PATCH 009/251] ulab: Incorporate bugfixes (update to tag 0.54.5) In particular, this closes #3954. --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 11a7ecff6d..7f2c1ae52b 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 11a7ecff6d76a02644ff23a734b792afaa615e44 +Subproject commit 7f2c1ae52bee57ce32ac0a74652610cc233d3442 From 543316a8fbaa78db485c1135b8f9ee5c2d1982e3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 25 Oct 2020 13:26:55 -0500 Subject: [PATCH 010/251] ulab: Update again .. pull in various doc build fixes that prevented the previous commit from building. This is still "0.54.5", the tag was updated in micropython-ulab (since no functional difference was introduced, only doc and CI differences, I imagine) --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 7f2c1ae52b..8242b84753 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 7f2c1ae52bee57ce32ac0a74652610cc233d3442 +Subproject commit 8242b84753355433b61230ab6631c06e5ac77f35 From 85aa851714f8bc24817b2d56b3286419b43b537a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 25 Oct 2020 15:21:13 -0500 Subject: [PATCH 011/251] make translate --- locale/circuitpython.pot | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index cf92b0584a..cc058e61a2 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-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-25 15:21-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2863,6 +2863,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3295,6 +3303,10 @@ 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 "" From c43011f149b981b4f9919a221f4ad4e9861b43a1 Mon Sep 17 00:00:00 2001 From: Senuros Date: Sun, 25 Oct 2020 22:08:10 +0100 Subject: [PATCH 012/251] Improving German translation --- locale/de_DE.po | 62 ++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index e54b670a90..0e2e5a038e 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -73,7 +73,7 @@ msgstr "Der Index %q befindet sich außerhalb des Bereiches" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "" +msgstr "%q Indizes müssen Integer sein, nicht %q" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -81,7 +81,7 @@ msgstr "%q Liste muss eine Liste sein" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q muss >= 0 sein" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -97,11 +97,11 @@ msgstr "%q muss ein Tupel der Länge 2 sein" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q außerhalb des Bereichs" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" -msgstr "" +msgstr "%q Pin ungültig" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -117,11 +117,11 @@ msgstr "'%q' Argument erforderlich" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "" +msgstr "'%q' Objekt kann das Attribut '%q' nicht zuweisen" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "" +msgstr "'%q' Objekt unterstützt '%q' nicht" #: py/obj.c msgid "'%q' object does not support item assignment" @@ -129,11 +129,11 @@ msgstr "" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "" +msgstr "'%q' objekt unterstützt das " #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "" +msgstr "'%q' Objekt hat kein Attribut '%q'" #: py/runtime.c msgid "'%q' object is not an iterator" @@ -141,7 +141,7 @@ msgstr "" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" -msgstr "" +msgstr "'%q' Objekt ist kein callable" #: py/runtime.c msgid "'%q' object is not iterable" @@ -280,7 +280,7 @@ msgstr "Ein Hardware Interrupt Kanal wird schon benutzt" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "ADC2 wird vom WiFi benutzt" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format @@ -346,11 +346,11 @@ msgstr "" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "Läuft bereits" #: ports/esp32s2/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" -msgstr "" +msgstr "Sucht bereits nach wifi Netzwerken" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -390,7 +390,7 @@ msgstr "Es darf höchstens %d %q spezifiziert werden (nicht %d)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "Versuche %d Blöcke zu allokieren" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." @@ -400,7 +400,7 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "Authentication failure" -msgstr "" +msgstr "Authentifizierungsfehler" #: main.c msgid "Auto-reload is off.\n" @@ -478,11 +478,11 @@ msgstr "Die Pufferlänge %d ist zu groß. Sie muss kleiner als %d sein" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "Die Pufferlänge muss ein vielfaches von 512 sein" #: ports/stm/common-hal/sdioio/SDCard.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "" +msgstr "Der Puffer muss ein vielfaches von 512 bytes sein" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -660,7 +660,7 @@ msgstr "Beschädigter raw code" #: ports/cxd56/common-hal/camera/Camera.c msgid "Could not initialize Camera" -msgstr "" +msgstr "Konnte Kamera nicht initialisieren" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -668,7 +668,7 @@ msgstr "" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "Could not initialize SDCard" -msgstr "" +msgstr "Konnte SDKarte nicht initialisieren" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c @@ -701,7 +701,7 @@ msgstr "" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" -msgstr "" +msgstr "Konnte Adresse nicht setzen" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" @@ -818,7 +818,7 @@ msgstr "Characteristic wird erwartet" #: shared-bindings/_bleio/Adapter.c msgid "Expected a DigitalInOut" -msgstr "" +msgstr "DigitanInOut wird erwartet" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" @@ -826,7 +826,7 @@ msgstr "Ein Service wird erwartet" #: shared-bindings/_bleio/Adapter.c msgid "Expected a UART" -msgstr "" +msgstr "UART wird erwartet" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -853,7 +853,7 @@ msgstr "FFT ist nur für ndarrays definiert" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" -msgstr "" +msgstr "SSL Handshake fehlgeschlagen" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -918,16 +918,16 @@ msgstr "Datei existiert" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" -msgstr "" +msgstr "Filter zu komplex" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "Format nicht unterstützt" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" -msgstr "" +msgstr "Framepuffer benötigt %d bytes" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." @@ -968,7 +968,7 @@ msgstr "Hardware in benutzung, probiere alternative Pins" #: shared-bindings/wifi/Radio.c msgid "Hostname must be between 1 and 253 characters" -msgstr "" +msgstr "Der Hostname muss zwischen 1 und 253 Zeichen haben" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -980,7 +980,7 @@ msgstr "I2C-Init-Fehler" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "I2SOut nicht verfügbar" #: shared-bindings/aesio/aes.c #, c-format @@ -1026,12 +1026,12 @@ msgstr "Interner Fehler #%d" #: shared-bindings/sdioio/SDCard.c msgid "Invalid %q" -msgstr "" +msgstr "Ungültiger %q" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" -msgstr "Ungültiger %q pin" +msgstr "Ungültiger %q Pin" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c @@ -1049,7 +1049,7 @@ msgstr "Ungültige BMP-Datei" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "Ungültige BSSID" #: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c @@ -1100,7 +1100,7 @@ msgstr "Ungültige format chunk size" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "" +msgstr "Ungültige Frequenz" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" From 998661246cc84330a239e33a89e2ce6f8f3e9c38 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sun, 25 Oct 2020 21:03:27 +0000 Subject: [PATCH 013/251] Translated using Weblate (Swedish) Currently translated at 100.0% (836 of 836 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 22007e11f3..989b8257e7 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-10-16 19:50-0500\n" -"PO-Revision-Date: 2020-10-22 01:12+0000\n" +"PO-Revision-Date: 2020-10-26 02:36+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.3.1\n" +"X-Generator: Weblate 4.3.2-dev\n" #: main.c msgid "" @@ -494,7 +494,7 @@ msgstr "Bufferten är för stor och kan inte allokeras" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "Buffert år %d bytes för kort" +msgstr "Buffert är %d bytes för kort" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -2161,7 +2161,7 @@ msgstr "buffert för liten" #: shared-bindings/socketpool/Socket.c msgid "buffer too small for requested bytes" -msgstr "buffertför liten för begärd längd" +msgstr "buffert för liten för begärd längd" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" From 396d92f867c66673c8dffc77f7c0cbcaa83a157f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 21 Oct 2020 10:38:01 -0500 Subject: [PATCH 014/251] esp32s2: Add canio This works in loopback mode, though the hardware filtering only permits a single address or mask filter. --- ports/esp32s2/Makefile | 4 +- .../espressif_kaluga_1/mpconfigboard.mk | 2 +- ports/esp32s2/common-hal/canio/CAN.c | 297 ++++++++++++++++++ ports/esp32s2/common-hal/canio/CAN.h | 52 +++ ports/esp32s2/common-hal/canio/Listener.c | 182 +++++++++++ ports/esp32s2/common-hal/canio/Listener.h | 40 +++ ports/esp32s2/common-hal/canio/__init__.c | 25 ++ ports/esp32s2/common-hal/canio/__init__.h | 27 ++ ports/esp32s2/mpconfigport.mk | 1 + 9 files changed, 627 insertions(+), 3 deletions(-) create mode 100644 ports/esp32s2/common-hal/canio/CAN.c create mode 100644 ports/esp32s2/common-hal/canio/CAN.h create mode 100644 ports/esp32s2/common-hal/canio/Listener.c create mode 100644 ports/esp32s2/common-hal/canio/Listener.h create mode 100644 ports/esp32s2/common-hal/canio/__init__.c create mode 100644 ports/esp32s2/common-hal/canio/__init__.h diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 8d891edd02..5d8ccad50d 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -331,10 +331,10 @@ $(BUILD)/firmware.uf2: $(BUILD)/circuitpython-firmware.bin $(Q)$(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xbfdd4eee -b 0x0000 -c -o $@ $^ flash: $(BUILD)/firmware.bin - esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ + esptool.py --chip esp32s2 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ flash-circuitpython-only: $(BUILD)/circuitpython-firmware.bin - esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x10000 $^ + esptool.py --chip esp32s2 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x10000 $^ include $(TOP)/py/mkrules.mk diff --git a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk index ba85e46efc..2dce038819 100644 --- a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk @@ -11,7 +11,7 @@ LONGINT_IMPL = MPZ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_FREQ=80m CIRCUITPY_ESP_FLASH_SIZE=4MB CIRCUITPY_MODULE=wrover diff --git a/ports/esp32s2/common-hal/canio/CAN.c b/ports/esp32s2/common-hal/canio/CAN.c new file mode 100644 index 0000000000..f1741969db --- /dev/null +++ b/ports/esp32s2/common-hal/canio/CAN.c @@ -0,0 +1,297 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/runtime.h" +#include "py/mperrno.h" + +#include "common-hal/canio/CAN.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/util.h" +#include "supervisor/port.h" +#include "hal/twai_ll.h" + +#include "hal/twai_types.h" + +STATIC bool reserved_can; + +twai_timing_config_t get_t_config(int baudrate) { + switch(baudrate) { + case 1000000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_1MBITS(); + return t_config; + } + case 800000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_800KBITS(); + return t_config; + } + case 500000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_500KBITS(); + return t_config; + } + case 250000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_250KBITS(); + return t_config; + } + case 125000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_125KBITS(); + return t_config; + } + case 100000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_100KBITS(); + return t_config; + } + case 50000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_50KBITS(); + return t_config; + } + case 25000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_25KBITS(); + return t_config; + } + case 20000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_20KBITS(); + return t_config; + } + case 16000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_16KBITS(); + return t_config; + } + case 12500: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_12_5KBITS(); + return t_config; + } + case 10000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_10KBITS(); + return t_config; + } + case 5000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_5KBITS(); + return t_config; + } + case 1000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_1KBITS(); + return t_config; + } + default: + mp_raise_ValueError(translate("Baudrate not supported by peripheral")); + } +} + +__attribute__((optimize("O0"))) +void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mcu_pin_obj_t *rx, int baudrate, bool loopback, bool silent) +{ +#define DIV_ROUND(a, b) (((a) + (b)/2) / (b)) +#define DIV_ROUND_UP(a, b) (((a) + (b) - 1) / (b)) + if (reserved_can) { + mp_raise_ValueError(translate("All CAN peripherals are in use")); + } + + if (loopback && silent) { + mp_raise_ValueError(translate("loopback + silent mode not supported by peripheral")); + } + + self->t_config = get_t_config(baudrate);; + twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(-1, -1, TWAI_MODE_NORMAL); + g_config.tx_io = tx->number; + g_config.rx_io = rx->number; + if (loopback) { + g_config.mode = TWAI_MODE_NO_ACK; + } + if (silent) { + g_config.mode = TWAI_MODE_LISTEN_ONLY; + } + self->g_config = g_config; + + { + twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL(); + self->f_config = f_config; + } + + esp_err_t result = twai_driver_install(&self->g_config, &self->t_config, &self->f_config); + if (result == ESP_ERR_NO_MEM) { + mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); + } else if (result == ESP_ERR_INVALID_ARG) { + mp_raise_ValueError(translate("Invalid pins")); + } else if (result != ESP_OK) { + mp_raise_OSError_msg_varg(translate("twai_driver_install returned esp-idf error #%d"), (int)result); + } + + result = twai_start(); + if (result != ESP_OK) { + mp_raise_OSError_msg_varg(translate("twai_start returned esp-idf error #%d"), (int)result); + } + + self->silent = silent; + self->loopback = loopback; + self->baudrate = baudrate; + self->tx_pin = tx; + self->rx_pin = rx; + + claim_pin(tx); + claim_pin(rx); + + reserved_can = true; +} + +bool common_hal_canio_can_loopback_get(canio_can_obj_t *self) +{ + return self->loopback; +} + +int common_hal_canio_can_baudrate_get(canio_can_obj_t *self) +{ + return self->baudrate; +} + +int common_hal_canio_can_transmit_error_count_get(canio_can_obj_t *self) +{ + twai_status_info_t info; + twai_get_status_info(&info); + return info.tx_error_counter; +} + +int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self) +{ + twai_status_info_t info; + twai_get_status_info(&info); + return info.rx_error_counter; +} + +canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self) { + twai_status_info_t info; + twai_get_status_info(&info); + if (info.state == TWAI_STATE_BUS_OFF || info.state == TWAI_STATE_RECOVERING) { + return BUS_STATE_OFF; + } + if (info.tx_error_counter > 127 || info.rx_error_counter > 127) { + return BUS_STATE_ERROR_PASSIVE; + } + if (info.tx_error_counter > 96 || info.rx_error_counter > 96) { + return BUS_STATE_ERROR_WARNING; + } + return BUS_STATE_ERROR_ACTIVE; +} + +static void can_restart(void) { + twai_status_info_t info; + twai_get_status_info(&info); + if (info.state != TWAI_STATE_BUS_OFF) { + return; + } + twai_initiate_recovery(); + // wait 100ms (hard coded for now) for bus to recover + uint64_t deadline = port_get_raw_ticks(NULL) + 100; + do { + twai_get_status_info(&info); + } while (port_get_raw_ticks(NULL) < deadline && (info.state == TWAI_STATE_BUS_OFF || info.state == TWAI_STATE_RECOVERING)); +} + +void canio_maybe_auto_restart(canio_can_obj_t *self) { + if (self->auto_restart) can_restart(); +} + +void common_hal_canio_can_restart(canio_can_obj_t *self) { + if (!common_hal_canio_can_auto_restart_get(self)) { + can_restart(); + } +} + +bool common_hal_canio_can_auto_restart_get(canio_can_obj_t *self) { + return self->auto_restart; +} + +void common_hal_canio_can_auto_restart_set(canio_can_obj_t *self, bool value) { + self->auto_restart = value; + canio_maybe_auto_restart(self); +} + +void common_hal_canio_can_send(canio_can_obj_t *self, mp_obj_t message_in) +{ + canio_maybe_auto_restart(self); + canio_message_obj_t *message = message_in; + bool rtr = message->base.type == &canio_remote_transmission_request_type; + twai_message_t message_out = { + .extd = message->extended, + .rtr = rtr, + .self = self->loopback, + .identifier = message->id, + .data_length_code = message->size, + }; + if (!rtr) { + memcpy(message_out.data, message->data, message->size); + } + // Allow transmission to occur in background + twai_transmit(&message_out, 0); +} + +bool common_hal_canio_can_silent_get(canio_can_obj_t *self) { + return self->silent; +} + +bool common_hal_canio_can_deinited(canio_can_obj_t *self) { + return !self->tx_pin; +} + +void common_hal_canio_can_check_for_deinit(canio_can_obj_t *self) { + if (common_hal_canio_can_deinited(self)) { + raise_deinited_error(); + } +} + +void common_hal_canio_can_deinit(canio_can_obj_t *self) +{ + if (self->tx_pin) { + (void)twai_stop(); + (void)twai_driver_uninstall(); + reset_pin_number(self->tx_pin->number); + reset_pin_number(self->rx_pin->number); + reserved_can = false; + } + self->tx_pin = NULL; + self->rx_pin = NULL; +} + +void common_hal_canio_reset(void) { + (void)twai_stop(); + (void)twai_driver_uninstall(); + reserved_can = false; +} diff --git a/ports/esp32s2/common-hal/canio/CAN.h b/ports/esp32s2/common-hal/canio/CAN.h new file mode 100644 index 0000000000..e15d515908 --- /dev/null +++ b/ports/esp32s2/common-hal/canio/CAN.h @@ -0,0 +1,52 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include "py/obj.h" +#include "shared-bindings/canio/__init__.h" +#include "shared-bindings/canio/CAN.h" +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/canio/__init__.h" +#include "shared-module/canio/Message.h" + +#include "driver/twai.h" + +#define FILTER_BANK_COUNT (28) + +typedef struct canio_can_obj { + mp_obj_base_t base; + int baudrate; + const mcu_pin_obj_t *rx_pin; + const mcu_pin_obj_t *tx_pin; + bool loopback:1; + bool silent:1; + bool auto_restart:1; + bool fifo_in_use:1; + twai_filter_config_t f_config; + twai_general_config_t g_config; + twai_timing_config_t t_config; +} canio_can_obj_t; diff --git a/ports/esp32s2/common-hal/canio/Listener.c b/ports/esp32s2/common-hal/canio/Listener.c new file mode 100644 index 0000000000..fddbfeb583 --- /dev/null +++ b/ports/esp32s2/common-hal/canio/Listener.c @@ -0,0 +1,182 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include + +#include "py/obj.h" +#include "py/runtime.h" + +#include "common-hal/canio/__init__.h" +#include "common-hal/canio/Listener.h" +#include "shared-bindings/canio/Listener.h" +#include "shared-bindings/util.h" +#include "supervisor/shared/tick.h" +#include "supervisor/shared/safe_mode.h" + +#include "hal/twai_ll.h" + +// IDE = "extended ID" flag of packet header. We always add this bit to the +// mask because a match is always for just one kind of address length +#define FILTER16_IDE (1<<3) +#define FILTER32_IDE (1<<2) + +// Work around a problem reported at +// https://github.com/espressif/esp-idf/issues/6020 where +// twai_ll_set_acc_filter does not work under -Os optimization +__attribute__((optimize("O0"))) +__attribute__((noinline)) +static void canio_set_acc_filter(twai_dev_t* hw, uint32_t code, uint32_t mask, bool single_filter) +{ + uint32_t code_swapped = __builtin_bswap32(code); + uint32_t mask_swapped = __builtin_bswap32(mask); + for (int i = 0; i < 4; i++) { + hw->acceptance_filter.acr[i].val = ((code_swapped >> (i * 8)) & 0xFF); + hw->acceptance_filter.amr[i].val = ((mask_swapped >> (i * 8)) & 0xFF); + } + hw->mode_reg.afm = single_filter; +} + +STATIC void install_standard_filter(canio_listener_obj_t *self, canio_match_obj_t *match) { + canio_set_acc_filter(&TWAI, match->id << 21, ~(match->mask << 21), true); + self->extended = false; + self->standard = true; +} + +STATIC void install_extended_filter(canio_listener_obj_t *self, canio_match_obj_t *match) { + canio_set_acc_filter(&TWAI, match->id << 3, ~(match->mask << 3), true); + self->extended = true; + self->standard = false; +} + +STATIC void install_all_match_filter(canio_listener_obj_t *self) { + canio_set_acc_filter(&TWAI, 0u, ~0u, true); + self->extended = true; + self->standard = true; +} + +__attribute__((noinline,optimize("O0"))) +void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **matches) { + twai_ll_enter_reset_mode(&TWAI); + + if (!nmatch) { + install_all_match_filter(self); + } else { + canio_match_obj_t *match = matches[0]; + if (match->extended) { + install_extended_filter(self, match); + } else { + install_standard_filter(self, match); + } + } + + twai_ll_exit_reset_mode(&TWAI); +} + + +void common_hal_canio_listener_construct(canio_listener_obj_t *self, canio_can_obj_t *can, size_t nmatch, canio_match_obj_t **matches, float timeout) { + if (can->fifo_in_use) { + mp_raise_ValueError(translate("All RX FIFOs in use")); + } + if (nmatch > 1) { + mp_raise_ValueError(translate("Filters too complex")); + } + + // Nothing can fail now so it's safe to assign self->can + can->fifo_in_use = 1; + self->can = can; + self->pending = false; + + set_filters(self, nmatch, matches); + self->extended = self->standard = true; + + common_hal_canio_listener_set_timeout(self, timeout); +} + +void common_hal_canio_listener_set_timeout(canio_listener_obj_t *self, float timeout) { + self->timeout_ms = (int)MICROPY_FLOAT_C_FUN(ceil)(timeout * 1000); +} + +float common_hal_canio_listener_get_timeout(canio_listener_obj_t *self) { + return self->timeout_ms / 1000.0f; +} + +void common_hal_canio_listener_check_for_deinit(canio_listener_obj_t *self) { + if (!self->can) { + raise_deinited_error(); + } + common_hal_canio_can_check_for_deinit(self->can); +} + +// The API has no peek method so we must receive a packet into a holding area +// and then we can say that we have 1 message pending +int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self) { + while (!self->pending && twai_receive(&self->message_in, 0) == ESP_OK) { + if (self->message_in.extd && self->extended) { + self->pending = true; + } + if (!self->message_in.extd && self->standard) { + self->pending = true; + } + } + return self->pending; +} + +mp_obj_t common_hal_canio_listener_receive(canio_listener_obj_t *self) { + if (!common_hal_canio_listener_in_waiting(self)) { + uint64_t deadline = supervisor_ticks_ms64() + self->timeout_ms; + do { + if (supervisor_ticks_ms64() > deadline) { + return NULL; + } + } while (!common_hal_canio_listener_in_waiting(self)); + } + + bool rtr = self->message_in.rtr; + + int dlc = self->message_in.data_length_code; + canio_message_obj_t *message = m_new_obj(canio_message_obj_t); + message->base.type = rtr ? &canio_remote_transmission_request_type : &canio_message_type; + message->extended = self->message_in.extd; + message->id = self->message_in.identifier; + message->size = dlc; + + if (!rtr) { + MP_STATIC_ASSERT(sizeof(self->message_in.data) == sizeof(message->data)); + memcpy(message->data, self->message_in.data, sizeof(message->data)); + } + + self->pending = false; + + return message; +} + +void common_hal_canio_listener_deinit(canio_listener_obj_t *self) { + if (self->can) { + self->can->fifo_in_use = false; + } + self->can = NULL; +} diff --git a/ports/esp32s2/common-hal/canio/Listener.h b/ports/esp32s2/common-hal/canio/Listener.h new file mode 100644 index 0000000000..d24900e435 --- /dev/null +++ b/ports/esp32s2/common-hal/canio/Listener.h @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include "common-hal/canio/CAN.h" +#include "shared-module/canio/Match.h" + +typedef struct canio_listener_obj { + mp_obj_base_t base; + canio_can_obj_t *can; + bool extended:1; + bool standard:1; + bool pending:1; + twai_message_t message_in; + uint32_t timeout_ms; +} canio_listener_obj_t; diff --git a/ports/esp32s2/common-hal/canio/__init__.c b/ports/esp32s2/common-hal/canio/__init__.c new file mode 100644 index 0000000000..7932bfc2da --- /dev/null +++ b/ports/esp32s2/common-hal/canio/__init__.c @@ -0,0 +1,25 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ diff --git a/ports/esp32s2/common-hal/canio/__init__.h b/ports/esp32s2/common-hal/canio/__init__.h new file mode 100644 index 0000000000..20b6638cd8 --- /dev/null +++ b/ports/esp32s2/common-hal/canio/__init__.h @@ -0,0 +1,27 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 4e8a7bdef2..c9863572a5 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -16,6 +16,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_FULL_BUILD = 1 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_CANIO = 1 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 From bdc13437910320c0784902661b16b6171720f1ab Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 21 Oct 2020 11:30:33 -0500 Subject: [PATCH 015/251] make translate --- locale/circuitpython.pot | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 7ed2d1ba1d..94a6a8514d 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -288,11 +288,16 @@ msgstr "" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -407,6 +412,10 @@ msgid "" "disable.\n" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -775,7 +784,7 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -901,6 +910,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1119,7 +1129,7 @@ msgstr "" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2837,6 +2847,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3181,6 +3195,8 @@ msgstr "" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3432,6 +3448,16 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c From 32f2a8d54cf54bb3f9dcba33f4b617d4dcf8b596 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 26 Oct 2020 11:03:54 -0400 Subject: [PATCH 016/251] Fix readme link --- ports/esp32s2/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/README.md b/ports/esp32s2/README.md index 8a6dfbd2d8..f3e678de85 100644 --- a/ports/esp32s2/README.md +++ b/ports/esp32s2/README.md @@ -30,18 +30,20 @@ Connect these pins using a [USB adapter](https://www.adafruit.com/product/4090) ## Building and flashing ## -Before building or flashing the ESP32-S2, you must [install the esp-idf](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html). This must be re-done ever time the esp-idf is updated, but not every time you build. Run `cd ports/esp32s2` from `circuitpython/` to move to the esp32s2 port root, and run: +Before building or flashing the ESP32-S2, you must [install the esp-idf](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/get-started/index.html). This must be re-done ever time the esp-idf is updated, but not every time you build. Run `cd ports/esp32s2` from `circuitpython/` to move to the esp32s2 port root, and run: ``` ./esp-idf/install.sh ``` -Additionally, any time you open a new bash environment for building or flashing, you must add the esp-idf tools to your path: +After this initial installation, you must add the esp-idf tools to your path. You must also do this **any time you open a new bash environment for building or flashing**: ``` . esp-idf/export.sh ``` +When Circuitpython updates the ESP-IDF to a new release, you may need to run this installation process again. The exact commands used may also vary based on your bash environment. + Building boards such as the Saola is typically done through `make flash`. The default port is `tty.SLAB_USBtoUART`, which will only work on certain Mac setups. On most machines, both Mac and Linux, you will need to set the port yourself by running `ls /dev/tty.usb*` and selecting the one that only appears when your development board is plugged in. An example make command with the port setting is as follows: ``` From c9f7df3bab8c46cc51b12eefc95391a00ba8c7e1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 26 Oct 2020 10:06:49 -0500 Subject: [PATCH 017/251] canio: Give implementation-specific limits for CAN.Listen --- shared-bindings/canio/CAN.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/shared-bindings/canio/CAN.c b/shared-bindings/canio/CAN.c index 6dae36943a..4982a97b9d 100644 --- a/shared-bindings/canio/CAN.c +++ b/shared-bindings/canio/CAN.c @@ -214,7 +214,24 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_can_restart_obj, canio_can_restart); //| //| An empty filter list causes all messages to be accepted. //| -//| Timeout dictates how long receive() and next() will block.""" +//| Timeout dictates how long receive() and next() will block. +//| +//| Platform specific notes: +//| +//| SAM E5x supports two Listeners. Filter blocks are shared between the two +//| listeners. There are 4 standard filter blocks and 4 extended filter blocks. +//| Each block can either match 2 single addresses or a mask of addresses. +//| The number of filter blocks can be increased, up to a hardware maximum, by +//| rebuilding CircuitPython, but this decreases the CircuitPython free +//| memory even if canio is not used. +//| +//| STM32F405 supports two Listeners. Filter blocks are shared between the two listeners. +//| There are 14 filter blocks. Each block can match 2 standard addresses with +//| mask or 1 extended address with mask. +//| +//| ESP32S2 supports one Listener. There is a single filter block, which can either match a +//| standard address with mask or an extended address with mask. +//| """ //| ... //| STATIC mp_obj_t canio_can_listen(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { From 81ab6a05d0652688d446fc75c838be95f13fb32b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 26 Oct 2020 13:25:00 -0700 Subject: [PATCH 018/251] Use old translation date to avoid merge conflict --- locale/circuitpython.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index cc058e61a2..a5581e7fa7 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-10-25 15:21-0500\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" From 1117edae63df7b66f1575980bf54d6836f9a8aa8 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Sat, 24 Oct 2020 17:13:10 +0200 Subject: [PATCH 019/251] Fix erroneous claim of board.I2C() by deinited display. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At the end of a session that called displayio.release_displays() (and did not initialize a new display), a board.I2C() bus that was previously used by a display would wrongly be considered still in use. While I can’t think of any unrecoverable problem this would cause in the next session, it violates the assumption that a soft reboot resets everything not needed by displays, potentially leading to confusion. By itself, this change does not fix the problem yet - rather, it introduces the same issue as in #3581 for SPI. This needs to be solved in the same way for I2C and SPI. --- shared-module/board/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 39b68a0f11..856103b7b6 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -139,7 +139,7 @@ void reset_board_busses(void) { bool display_using_i2c = false; #if CIRCUITPY_DISPLAYIO for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { - if (displays[i].i2cdisplay_bus.bus == i2c_singleton) { + if (displays[i].bus_base.type == &displayio_i2cdisplay_type && displays[i].i2cdisplay_bus.bus == i2c_singleton) { display_using_i2c = true; break; } From f4f80e07ca3dc2f5a93484e5342540837a94a505 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Sat, 24 Oct 2020 17:23:17 +0200 Subject: [PATCH 020/251] Fix lost board.SPI and board.I2C after being used by display. Fixes #3581. Pins were marked as never_reset by common_hal_displayio_fourwire_construct() and common_hal_sharpdisplay_framebuffer_construct(), but these marks were never removed, so at the end of a session after displayio.release_displays(), {spi|i2c}_singleton would be set to NULL but the pins would not be reset. In the next session, board.SPI() and board.I2C() were unable to reconstruct the object because the pins were still in use. For symmetry with creation of the singleton, add deinitialization before setting it to NULL in reset_board_busses(). This makes the pins resettable, so that reset_port(), moved behind it, then resets them. --- main.c | 4 +++- shared-module/board/__init__.c | 14 +++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index b43b3b8c80..80b163f607 100755 --- a/main.c +++ b/main.c @@ -234,10 +234,12 @@ void cleanup_after_vm(supervisor_allocation* heap) { common_hal_canio_reset(); #endif - reset_port(); + // reset_board_busses() first because it may release pins from the never_reset state, so that + // reset_port() can reset them. #if CIRCUITPY_BOARD reset_board_busses(); #endif + reset_port(); reset_board(); reset_status_led(); } diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 856103b7b6..967b430d2b 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -145,8 +145,11 @@ void reset_board_busses(void) { } } #endif - if (!display_using_i2c) { - i2c_singleton = NULL; + if (i2c_singleton != NULL) { + if (!display_using_i2c) { + common_hal_busio_i2c_deinit(i2c_singleton); + i2c_singleton = NULL; + } } #endif #if BOARD_SPI @@ -169,9 +172,10 @@ void reset_board_busses(void) { // make sure SPI lock is not held over a soft reset if (spi_singleton != NULL) { common_hal_busio_spi_unlock(spi_singleton); - } - if (!display_using_spi) { - spi_singleton = NULL; + if (!display_using_spi) { + common_hal_busio_spi_deinit(spi_singleton); + spi_singleton = NULL; + } } #endif #if BOARD_UART From 99a3750a2cfd1da8cdd266ca9a0367f0c3a54092 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Sat, 24 Oct 2020 17:50:11 +0200 Subject: [PATCH 021/251] Fix lost board.SPI and board.I2C after explicitly deiniting them. After calling board.SPI().deinit(), calling board.SPI() again would return the unusable deinited object and there was no way of getting it back into an initialized state until the end of the session. --- shared-bindings/board/__init__.c | 10 ++++++++-- shared-module/board/__init__.c | 10 ++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 6837fc41c2..717698408a 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -28,6 +28,12 @@ #include "py/runtime.h" #include "shared-bindings/board/__init__.h" +#if BOARD_I2C +#include "shared-bindings/busio/I2C.h" +#endif +#if BOARD_SPI +#include "shared-bindings/busio/SPI.h" +#endif //| """Board specific pin names //| @@ -45,7 +51,7 @@ #if BOARD_I2C mp_obj_t board_i2c(void) { mp_obj_t singleton = common_hal_board_get_i2c(); - if (singleton != NULL) { + if (singleton != NULL && !common_hal_busio_i2c_deinited(singleton)) { return singleton; } assert_pin_free(DEFAULT_I2C_BUS_SDA); @@ -69,7 +75,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(board_i2c_obj, board_i2c); #if BOARD_SPI mp_obj_t board_spi(void) { mp_obj_t singleton = common_hal_board_get_spi(); - if (singleton != NULL) { + if (singleton != NULL && !common_hal_busio_spi_deinited(singleton)) { return singleton; } assert_pin_free(DEFAULT_SPI_BUS_SCK); diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 967b430d2b..2f1c34e565 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -55,9 +55,8 @@ mp_obj_t common_hal_board_get_i2c(void) { } mp_obj_t common_hal_board_create_i2c(void) { - if (i2c_singleton != NULL) { - return i2c_singleton; - } + // All callers have either already verified this or come so early that it can't be otherwise. + assert(i2c_singleton == NULL || common_hal_busio_i2c_deinited(i2c_singleton)); busio_i2c_obj_t *self = &i2c_obj; self->base.type = &busio_i2c_type; @@ -79,9 +78,8 @@ mp_obj_t common_hal_board_get_spi(void) { } mp_obj_t common_hal_board_create_spi(void) { - if (spi_singleton != NULL) { - return spi_singleton; - } + // All callers have either already verified this or come so early that it can't be otherwise. + assert(spi_singleton == NULL || common_hal_busio_spi_deinited(spi_singleton)); busio_spi_obj_t *self = &spi_obj; self->base.type = &busio_spi_type; From 5deb045a8112100de3cb28fdb7b6c56444663503 Mon Sep 17 00:00:00 2001 From: Gaetan Date: Mon, 26 Oct 2020 23:32:57 +0100 Subject: [PATCH 022/251] Ready to PR * ../../.github/workflows/build.yml + boards/holyiot_nrf52840/board.c + boards/holyiot_nrf52840/mpconfigboard.h + boards/holyiot_nrf52840/mpconfigboard.mk + boards/holyiot_nrf52840/pins.c --- .github/workflows/build.yml | 1 + ports/nrf/boards/holyiot_nrf52840/board.c | 38 ++++++++++++ .../boards/holyiot_nrf52840/mpconfigboard.h | 33 +++++++++++ .../boards/holyiot_nrf52840/mpconfigboard.mk | 8 +++ ports/nrf/boards/holyiot_nrf52840/pins.c | 59 +++++++++++++++++++ 5 files changed, 139 insertions(+) create mode 100644 ports/nrf/boards/holyiot_nrf52840/board.c create mode 100644 ports/nrf/boards/holyiot_nrf52840/mpconfigboard.h create mode 100644 ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk create mode 100644 ports/nrf/boards/holyiot_nrf52840/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index feb6a7f633..cada55aaa4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -214,6 +214,7 @@ jobs: - "hallowing_m0_express" - "hallowing_m4_express" - "hiibot_bluefi" + - "holyiot_nrf52840" - "ikigaisense_vita" - "imxrt1010_evk" - "imxrt1020_evk" diff --git a/ports/nrf/boards/holyiot_nrf52840/board.c b/ports/nrf/boards/holyiot_nrf52840/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/nrf/boards/holyiot_nrf52840/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/nrf/boards/holyiot_nrf52840/mpconfigboard.h b/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.h new file mode 100644 index 0000000000..3b64d3a629 --- /dev/null +++ b/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.h @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * + * + * 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 "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "Holyiot nRF52840" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_HW_LED_STATUS (&pin_P0_19) diff --git a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk b/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk new file mode 100644 index 0000000000..d85de75071 --- /dev/null +++ b/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk @@ -0,0 +1,8 @@ +USB_VID = 0x239A +USB_PID = 0x80A0 +USB_PRODUCT = "HOLYIOTNRF52840" +USB_MANUFACTURER = "Holyiot" + +MCU_CHIP = nrf52840 + +INTERNAL_FLASH_FILESYSTEM = 1 \ No newline at end of file diff --git a/ports/nrf/boards/holyiot_nrf52840/pins.c b/ports/nrf/boards/holyiot_nrf52840/pins.c new file mode 100644 index 0000000000..4e2593e58f --- /dev/null +++ b/ports/nrf/boards/holyiot_nrf52840/pins.c @@ -0,0 +1,59 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + + { MP_ROM_QSTR(MP_QSTR_P1_10), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_P1_11), MP_ROM_PTR(&pin_P1_11) }, + { MP_ROM_QSTR(MP_QSTR_P1_13), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_P1_15), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_P0_03), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_P0_02), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_P0_28), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_P0_29), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_P0_30), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_P0_31), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_P0_04), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_P0_05), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_P1_14), MP_ROM_PTR(&pin_P1_14) }, + { MP_ROM_QSTR(MP_QSTR_P1_12), MP_ROM_PTR(&pin_P1_12) }, + { MP_ROM_QSTR(MP_QSTR_P0_25), MP_ROM_PTR(&pin_P0_25) }, + { MP_ROM_QSTR(MP_QSTR_P0_11), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_P1_08), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_P0_27), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_P0_08), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_P0_06), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_P0_26), MP_ROM_PTR(&pin_P0_26) }, + + { MP_ROM_QSTR(MP_QSTR_P0_10), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_P0_09), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_P1_06), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_P1_04), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_P1_02), MP_ROM_PTR(&pin_P1_02) }, + { MP_ROM_QSTR(MP_QSTR_P1_01), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_P1_03), MP_ROM_PTR(&pin_P1_03) }, + { MP_ROM_QSTR(MP_QSTR_P1_00), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_P0_22), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_P1_07), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_P1_05), MP_ROM_PTR(&pin_P1_05) }, + { MP_ROM_QSTR(MP_QSTR_P0_24), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_P0_20), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_P0_17), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_P0_15), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_P0_14), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_P0_13), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_P0_16), MP_ROM_PTR(&pin_P0_16) }, + + + { MP_ROM_QSTR(MP_QSTR_P0_07), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_P1_09), MP_ROM_PTR(&pin_P1_09) }, + { MP_ROM_QSTR(MP_QSTR_P0_12), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_P0_23), MP_ROM_PTR(&pin_P0_23) }, + { MP_ROM_QSTR(MP_QSTR_P0_21), MP_ROM_PTR(&pin_P0_21) }, + { MP_ROM_QSTR(MP_QSTR_P0_19), MP_ROM_PTR(&pin_P0_19) }, + + // RESET { MP_ROM_QSTR(MP_QSTR_P0_18), MP_ROM_PTR(&pin_P0_18) }, + +}; + + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); \ No newline at end of file From cfaa02ef19c2370cfa8dc5d7fc27664f34d9c90c Mon Sep 17 00:00:00 2001 From: Gaetan Date: Mon, 26 Oct 2020 23:36:54 +0100 Subject: [PATCH 023/251] Fix error --- CONTRIBUTING.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c94e8db8c6..15b4cfc892 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,8 +4,6 @@ SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://g SPDX-License-Identifier: MIT --> - - # Contributing Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). From fc591c8d847ad543ee2e8a368574783e2c230309 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 19 Oct 2020 18:30:26 -0700 Subject: [PATCH 024/251] Add EInk Portal --- .../adafruit_esp32s2_eink_portal/board.c | 47 +++++++++++++++++++ .../mpconfigboard.h | 45 ++++++++++++++++++ .../mpconfigboard.mk | 17 +++++++ .../adafruit_esp32s2_eink_portal/pins.c | 39 +++++++++++++++ .../adafruit_esp32s2_eink_portal/sdkconfig | 33 +++++++++++++ 5 files changed, 181 insertions(+) create mode 100644 ports/esp32s2/boards/adafruit_esp32s2_eink_portal/board.c create mode 100644 ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.h create mode 100644 ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c create mode 100644 ports/esp32s2/boards/adafruit_esp32s2_eink_portal/sdkconfig diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/board.c b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/board.c new file mode 100644 index 0000000000..9f708874bf --- /dev/null +++ b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/board.c @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.h b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.h new file mode 100644 index 0000000000..5a17a0cad1 --- /dev/null +++ b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "EInk Portal" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO1) + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO34) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO33) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.mk b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.mk new file mode 100644 index 0000000000..31aff57da4 --- /dev/null +++ b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x239A +USB_PID = 0x80E6 +USB_PRODUCT = "EInk Portal" +USB_MANUFACTURER = "Adafruit" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wrover diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c new file mode 100644 index 0000000000..2cf3d24029 --- /dev/null +++ b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c @@ -0,0 +1,39 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_AD1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_SPEAKER_ENABLE), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_EPD_BUSY), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_EPD_RESET), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_EPD_DC), MP_ROM_PTR(&pin_GPIO7) }, + { 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_BUTTON_B), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_C), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_D), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + + { 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_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/esp32s2/boards/adafruit_esp32s2_eink_portal/sdkconfig b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/sdkconfig new file mode 100644 index 0000000000..9d8bbde967 --- /dev/null +++ b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/sdkconfig @@ -0,0 +1,33 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 + +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config From 0d1649880f1c23ec6c9c0a4834f3712a8495f9d8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 26 Oct 2020 16:58:00 -0700 Subject: [PATCH 025/251] Add grayscale EInk support --- shared-bindings/displayio/EPaperDisplay.c | 35 +++++++++++++++++++---- shared-bindings/displayio/EPaperDisplay.h | 2 +- shared-module/displayio/ColorConverter.c | 9 +++--- shared-module/displayio/EPaperDisplay.c | 15 ++++++---- shared-module/displayio/EPaperDisplay.h | 1 + shared-module/displayio/Palette.h | 1 + shared-module/displayio/display_core.c | 1 + 7 files changed, 48 insertions(+), 16 deletions(-) diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 8be4ee4c4a..e0326d9c82 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -49,7 +49,19 @@ //| Most people should not use this class directly. Use a specific display driver instead that will //| contain the startup and shutdown sequences at minimum.""" //| -//| def __init__(self, display_bus: _DisplayBus, start_sequence: ReadableBuffer, stop_sequence: ReadableBuffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: Optional[int] = None, set_row_window_command: Optional[int] = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: Optional[int] = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False) -> None: +//| def __init__(self, display_bus: _DisplayBus, +//| start_sequence: ReadableBuffer, stop_sequence: ReadableBuffer, *, +//| width: int, height: int, ram_width: int, ram_height: int, +//| colstart: int = 0, rowstart: int = 0, rotation: int = 0, +//| set_column_window_command: Optional[int] = None, +//| set_row_window_command: Optional[int] = None, single_byte_bounds: bool = False, +//| write_black_ram_command: int, black_bits_inverted: bool = False, +//| write_color_ram_command: Optional[int] = None, +//| color_bits_inverted: bool = False, highlight_color: int = 0x000000, +//| refresh_display_command: int, refresh_time: float = 40, +//| busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True, +//| seconds_per_frame: float = 180, always_toggle_chip_select: bool = False, +//| grayscale: bool = False) -> None: //| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every @@ -84,11 +96,18 @@ //| :param microcontroller.Pin busy_pin: Pin used to signify the display is busy //| :param bool busy_state: State of the busy pin when the display is busy //| :param float seconds_per_frame: Minimum number of seconds between screen refreshes -//| :param bool always_toggle_chip_select: When True, chip select is toggled every byte""" +//| :param bool always_toggle_chip_select: When True, chip select is toggled every byte +//| :param bool grayscale: When true, the color ram is the low bit of 2-bit grayscale""" //| ... //| STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_display_bus, ARG_start_sequence, ARG_stop_sequence, ARG_width, ARG_height, ARG_ram_width, ARG_ram_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_set_column_window_command, ARG_set_row_window_command, ARG_set_current_column_command, ARG_set_current_row_command, ARG_write_black_ram_command, ARG_black_bits_inverted, ARG_write_color_ram_command, ARG_color_bits_inverted, ARG_highlight_color, ARG_refresh_display_command, ARG_refresh_time, ARG_busy_pin, ARG_busy_state, ARG_seconds_per_frame, ARG_always_toggle_chip_select }; + enum { ARG_display_bus, ARG_start_sequence, ARG_stop_sequence, ARG_width, ARG_height, + ARG_ram_width, ARG_ram_height, ARG_colstart, ARG_rowstart, ARG_rotation, + ARG_set_column_window_command, ARG_set_row_window_command, ARG_set_current_column_command, + ARG_set_current_row_command, ARG_write_black_ram_command, ARG_black_bits_inverted, + ARG_write_color_ram_command, ARG_color_bits_inverted, ARG_highlight_color, + ARG_refresh_display_command, ARG_refresh_time, ARG_busy_pin, ARG_busy_state, + ARG_seconds_per_frame, ARG_always_toggle_chip_select, ARG_grayscale }; static const mp_arg_t allowed_args[] = { { MP_QSTR_display_bus, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_start_sequence, MP_ARG_REQUIRED | MP_ARG_OBJ }, @@ -115,6 +134,7 @@ STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size { MP_QSTR_busy_state, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, { MP_QSTR_seconds_per_frame, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NEW_SMALL_INT(180)} }, { MP_QSTR_always_toggle_chip_select, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, + { MP_QSTR_grayscale, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); @@ -151,11 +171,14 @@ STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size self, display_bus, start_bufinfo.buf, start_bufinfo.len, stop_bufinfo.buf, stop_bufinfo.len, - args[ARG_width].u_int, args[ARG_height].u_int, args[ARG_ram_width].u_int, args[ARG_ram_height].u_int, args[ARG_colstart].u_int, args[ARG_rowstart].u_int, rotation, + args[ARG_width].u_int, args[ARG_height].u_int, args[ARG_ram_width].u_int, args[ARG_ram_height].u_int, + args[ARG_colstart].u_int, args[ARG_rowstart].u_int, rotation, args[ARG_set_column_window_command].u_int, args[ARG_set_row_window_command].u_int, args[ARG_set_current_column_command].u_int, args[ARG_set_current_row_command].u_int, - args[ARG_write_black_ram_command].u_int, args[ARG_black_bits_inverted].u_bool, write_color_ram_command, args[ARG_color_bits_inverted].u_bool, highlight_color, args[ARG_refresh_display_command].u_int, refresh_time, - busy_pin, args[ARG_busy_state].u_bool, seconds_per_frame, args[ARG_always_toggle_chip_select].u_bool + args[ARG_write_black_ram_command].u_int, args[ARG_black_bits_inverted].u_bool, write_color_ram_command, + args[ARG_color_bits_inverted].u_bool, highlight_color, args[ARG_refresh_display_command].u_int, refresh_time, + busy_pin, args[ARG_busy_state].u_bool, seconds_per_frame, + args[ARG_always_toggle_chip_select].u_bool, args[ARG_grayscale].u_bool ); return self; diff --git a/shared-bindings/displayio/EPaperDisplay.h b/shared-bindings/displayio/EPaperDisplay.h index e4b81c8838..352de899a9 100644 --- a/shared-bindings/displayio/EPaperDisplay.h +++ b/shared-bindings/displayio/EPaperDisplay.h @@ -44,7 +44,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* uint16_t set_column_window_command, uint16_t set_row_window_command, uint16_t set_current_column_command, uint16_t set_current_row_command, uint16_t write_black_ram_command, bool black_bits_inverted, uint16_t write_color_ram_command, bool color_bits_inverted, uint32_t highlight_color, uint16_t refresh_display_command, mp_float_t refresh_time, - const mcu_pin_obj_t* busy_pin, bool busy_state, mp_float_t seconds_per_frame, bool always_toggle_chip_select); + const mcu_pin_obj_t* busy_pin, bool busy_state, mp_float_t seconds_per_frame, bool always_toggle_chip_select, bool grayscale); bool common_hal_displayio_epaperdisplay_refresh(displayio_epaperdisplay_obj_t* self); diff --git a/shared-module/displayio/ColorConverter.c b/shared-module/displayio/ColorConverter.c index dc64da03da..03ec99ceb1 100644 --- a/shared-module/displayio/ColorConverter.c +++ b/shared-module/displayio/ColorConverter.c @@ -165,9 +165,9 @@ void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _d g8 = MIN(255,g8 + (randg&0x03)); } else { int bitmask = 0xFF >> colorspace->depth; - b8 = MIN(255,b8 + (randb&bitmask)); - r8 = MIN(255,r8 + (randr&bitmask)); - g8 = MIN(255,g8 + (randg&bitmask)); + b8 = MIN(255,b8 + (randb & bitmask)); + r8 = MIN(255,r8 + (randr & bitmask)); + g8 = MIN(255,g8 + (randg & bitmask)); } pixel = r8 << 16 | g8 << 8 | b8; } @@ -196,7 +196,8 @@ void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _d return; } else if (colorspace->grayscale && colorspace->depth <= 8) { uint8_t luma = displayio_colorconverter_compute_luma(pixel); - output_color->pixel = luma >> (8 - colorspace->depth); + size_t bitmask = (1 << colorspace->depth) - 1; + output_color->pixel = (luma >> colorspace->grayscale_bit) & bitmask; output_color->opaque = true; return; } diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 46c7ea82e1..514b99a13b 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -49,7 +49,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* uint16_t set_column_window_command, uint16_t set_row_window_command, uint16_t set_current_column_command, uint16_t set_current_row_command, uint16_t write_black_ram_command, bool black_bits_inverted, uint16_t write_color_ram_command, bool color_bits_inverted, uint32_t highlight_color, uint16_t refresh_display_command, mp_float_t refresh_time, - const mcu_pin_obj_t* busy_pin, bool busy_state, mp_float_t seconds_per_frame, bool chip_select) { + const mcu_pin_obj_t* busy_pin, bool busy_state, mp_float_t seconds_per_frame, bool chip_select, bool grayscale) { if (highlight_color != 0x000000) { self->core.colorspace.tricolor = true; self->core.colorspace.tricolor_hue = displayio_colorconverter_compute_hue(highlight_color); @@ -72,6 +72,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* self->refreshing = false; self->milliseconds_per_frame = seconds_per_frame * 1000; self->chip_select = chip_select ? CHIP_SELECT_TOGGLE_EVERY_BYTE : CHIP_SELECT_UNTOUCHED; + self->grayscale = grayscale; self->start_sequence = start_sequence; self->start_sequence_len = start_sequence_len; @@ -230,17 +231,16 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c uint32_t mask[mask_length]; uint8_t passes = 1; - if (self->core.colorspace.tricolor) { + if (self->core.colorspace.tricolor || self->grayscale) { passes = 2; } for (uint8_t pass = 0; pass < passes; pass++) { uint16_t remaining_rows = displayio_area_height(&clipped); - // added false parameter at end for SH1107_addressing quirk if (self->set_row_window_command != NO_COMMAND) { displayio_display_core_set_region_to_update(&self->core, self->set_column_window_command, self->set_row_window_command, self->set_current_column_command, self->set_current_row_command, - false, self->chip_select, &clipped, false); + false, self->chip_select, &clipped, false /* SH1107_addressing */); } uint8_t write_command = self->write_black_ram_command; @@ -270,8 +270,13 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c memset(buffer, 0, buffer_size * sizeof(buffer[0])); self->core.colorspace.grayscale = true; + self->core.colorspace.grayscale_bit = 7; if (pass == 1) { - self->core.colorspace.grayscale = false; + if (self->grayscale) { // 4-color grayscale + self->core.colorspace.grayscale_bit = 6; + } else { // Tri-color + self->core.colorspace.grayscale = false; + } } displayio_display_core_fill_area(&self->core, &subrectangle, mask, buffer); diff --git a/shared-module/displayio/EPaperDisplay.h b/shared-module/displayio/EPaperDisplay.h index 3b9f6e3680..4103fe5fce 100644 --- a/shared-module/displayio/EPaperDisplay.h +++ b/shared-module/displayio/EPaperDisplay.h @@ -55,6 +55,7 @@ typedef struct { bool black_bits_inverted; bool color_bits_inverted; bool refreshing; + bool grayscale; display_chip_select_behavior_t chip_select; } displayio_epaperdisplay_obj_t; diff --git a/shared-module/displayio/Palette.h b/shared-module/displayio/Palette.h index da72f250f9..993912cc51 100644 --- a/shared-module/displayio/Palette.h +++ b/shared-module/displayio/Palette.h @@ -37,6 +37,7 @@ typedef struct { uint8_t bytes_per_cell; uint8_t tricolor_hue; uint8_t tricolor_luma; + uint8_t grayscale_bit; // The lowest grayscale bit. Normally 8 - depth. bool grayscale; bool tricolor; bool pixels_in_byte_share_row; diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 411f9f3736..57d33b5651 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -48,6 +48,7 @@ void displayio_display_core_construct(displayio_display_core_t* self, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word) { self->colorspace.depth = color_depth; self->colorspace.grayscale = grayscale; + self->colorspace.grayscale_bit = 8 - color_depth; self->colorspace.pixels_in_byte_share_row = pixels_in_byte_share_row; self->colorspace.bytes_per_cell = bytes_per_cell; self->colorspace.reverse_pixels_in_byte = reverse_pixels_in_byte; From 95cb5961d26a4e1e048d48266d21547dc9229ba9 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 26 Oct 2020 16:58:56 -0700 Subject: [PATCH 026/251] Fix ESP32-S2 SPI when DMA is sometimes used --- ports/esp32s2/common-hal/busio/SPI.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 1906ca6f00..490419f34a 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -357,6 +357,9 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_ou } else { hal->dma_enabled = 0; burst_length = sizeof(hal->hw->data_buf); + // When switching to non-DMA, we need to make sure DMA is off. Otherwise, + // the S2 will transmit zeroes instead of our data. + spi_ll_txdma_disable(hal->hw); } // This rounds up. From d86c6a74a48adc1e559845acd9821d4ad6f63590 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 26 Oct 2020 17:06:04 -0700 Subject: [PATCH 027/251] Add to CI build --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa576bbf0a..95bd2bfa47 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -418,6 +418,7 @@ jobs: fail-fast: false matrix: board: + - "adafruit_esp32s2_eink_portal" - "adafruit_metro_esp32s2" - "electroniccats_bastwifi" - "espressif_kaluga_1" From 2ba66599670c0d3d0f5ef5dc8780c34cf9d61231 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 26 Oct 2020 19:07:37 -0500 Subject: [PATCH 028/251] esp32s2: Makefile: restore --no-stub --- ports/esp32s2/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 5d8ccad50d..8d891edd02 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -331,10 +331,10 @@ $(BUILD)/firmware.uf2: $(BUILD)/circuitpython-firmware.bin $(Q)$(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xbfdd4eee -b 0x0000 -c -o $@ $^ flash: $(BUILD)/firmware.bin - esptool.py --chip esp32s2 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ + esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ flash-circuitpython-only: $(BUILD)/circuitpython-firmware.bin - esptool.py --chip esp32s2 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x10000 $^ + esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x10000 $^ include $(TOP)/py/mkrules.mk From 3a501a04951849ddd83455706fe87a6950d051fe Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 26 Oct 2020 19:18:37 -0500 Subject: [PATCH 029/251] esp32s2: canio: respond to review comments * explain the introduction of the temporary variable in get_t_config * get rid of unneeded __attribute__ * get rid of unneeded members of canio_can_obj_t * get rid of unneeded header inclusion --- ports/esp32s2/common-hal/canio/CAN.c | 14 ++++++-------- ports/esp32s2/common-hal/canio/CAN.h | 3 --- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/ports/esp32s2/common-hal/canio/CAN.c b/ports/esp32s2/common-hal/canio/CAN.c index f1741969db..768fde2431 100644 --- a/ports/esp32s2/common-hal/canio/CAN.c +++ b/ports/esp32s2/common-hal/canio/CAN.c @@ -33,7 +33,6 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" #include "supervisor/port.h" -#include "hal/twai_ll.h" #include "hal/twai_types.h" @@ -43,6 +42,10 @@ twai_timing_config_t get_t_config(int baudrate) { switch(baudrate) { case 1000000: { + // TWAI_TIMING_CONFIG_abc expands to a C designated initializer list + // { .brp = 4, ...}. This is only acceptable to the compiler as an + // initializer and 'return TWAI_TIMING_CONFIG_1MBITS()` is not valid. + // Instead, introduce a temporary, named variable and return it. twai_timing_config_t t_config = TWAI_TIMING_CONFIG_1MBITS(); return t_config; } @@ -116,7 +119,6 @@ twai_timing_config_t get_t_config(int baudrate) { } } -__attribute__((optimize("O0"))) void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mcu_pin_obj_t *rx, int baudrate, bool loopback, bool silent) { #define DIV_ROUND(a, b) (((a) + (b)/2) / (b)) @@ -129,7 +131,7 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mc mp_raise_ValueError(translate("loopback + silent mode not supported by peripheral")); } - self->t_config = get_t_config(baudrate);; + twai_timing_config_t t_config = get_t_config(baudrate); twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(-1, -1, TWAI_MODE_NORMAL); g_config.tx_io = tx->number; g_config.rx_io = rx->number; @@ -139,14 +141,10 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mc if (silent) { g_config.mode = TWAI_MODE_LISTEN_ONLY; } - self->g_config = g_config; - { twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL(); - self->f_config = f_config; - } - esp_err_t result = twai_driver_install(&self->g_config, &self->t_config, &self->f_config); + esp_err_t result = twai_driver_install(&g_config, &t_config, &f_config); if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } else if (result == ESP_ERR_INVALID_ARG) { diff --git a/ports/esp32s2/common-hal/canio/CAN.h b/ports/esp32s2/common-hal/canio/CAN.h index e15d515908..85fb6972be 100644 --- a/ports/esp32s2/common-hal/canio/CAN.h +++ b/ports/esp32s2/common-hal/canio/CAN.h @@ -46,7 +46,4 @@ typedef struct canio_can_obj { bool silent:1; bool auto_restart:1; bool fifo_in_use:1; - twai_filter_config_t f_config; - twai_general_config_t g_config; - twai_timing_config_t t_config; } canio_can_obj_t; From ba0a3769e343b465c82dde4aafe99bcf11c84dbe Mon Sep 17 00:00:00 2001 From: _fonzlate Date: Mon, 26 Oct 2020 17:08:51 +0000 Subject: [PATCH 030/251] Translated using Weblate (Dutch) Currently translated at 100.0% (836 of 836 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/nl/ --- locale/nl.po | 122 ++++++++++++++++++++++++++------------------------- 1 file changed, 63 insertions(+), 59 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index ca7530c0fd..59b1f2e73b 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -6,15 +6,15 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-16 19:50-0500\n" -"PO-Revision-Date: 2020-09-09 16:05+0000\n" -"Last-Translator: Jelle Jager \n" +"PO-Revision-Date: 2020-10-27 16:47+0000\n" +"Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.3-dev\n" +"X-Generator: Weblate 4.3.2-dev\n" #: main.c msgid "" @@ -98,7 +98,7 @@ msgstr "%q moet een tuple van lengte 2 zijn" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q buiten bereik" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" @@ -252,7 +252,7 @@ msgstr "'return' buiten de functie" #: py/compile.c msgid "'yield from' inside async function" -msgstr "" +msgstr "'yield from' binnen asynchrone functie" #: py/compile.c msgid "'yield' outside function" @@ -281,7 +281,7 @@ msgstr "Een hardware interrupt kanaal is al in gebruik" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "ADC2 wordt gebruikt door WiFi" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format @@ -299,7 +299,7 @@ msgstr "Alle I2C peripherals zijn in gebruik" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "Alle RX FIFO's zijn in gebruik" #: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" @@ -342,7 +342,7 @@ msgstr "Advertising is al bezig." #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" -msgstr "" +msgstr "Heeft al een luisteraar voor 'all-matches'" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c @@ -351,7 +351,7 @@ msgstr "Wordt al uitgevoerd" #: ports/esp32s2/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" -msgstr "" +msgstr "Zoekt al naar WiFi netwerken" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -399,7 +399,7 @@ msgstr "heap allocatie geprobeerd terwijl MicroPython VM niet draait." #: shared-bindings/wifi/Radio.c msgid "Authentication failure" -msgstr "" +msgstr "Authenticatiefout" #: main.c msgid "Auto-reload is off.\n" @@ -617,7 +617,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap.\n" -msgstr "" +msgstr "CircuitPython kon het heap geheugen niet toewijzen.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -658,7 +658,7 @@ msgstr "Corrupt raw code" #: ports/cxd56/common-hal/camera/Camera.c msgid "Could not initialize Camera" -msgstr "" +msgstr "Kon camera niet initialiseren" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -695,7 +695,7 @@ msgstr "Kan PWM niet herstarten" #: ports/esp32s2/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" -msgstr "" +msgstr "Kon klok niet ophalen" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" @@ -789,7 +789,7 @@ msgstr "ECB werkt alleen met 16 bytes tegelijkertijd" #: ports/esp32s2/common-hal/busio/SPI.c msgid "ESP-IDF memory allocation failed" -msgstr "" +msgstr "ESP-IDF geheugen toewijzing mislukt" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -850,7 +850,7 @@ msgstr "FFT alleen voor ndarrays gedefineerd" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" -msgstr "" +msgstr "SSL handdruk mislukt" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -877,11 +877,11 @@ msgstr "Mislukt een RX buffer van %d bytes te alloceren" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" -msgstr "" +msgstr "Kon WiFi geheugen niet toewijzen" #: ports/esp32s2/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" -msgstr "" +msgstr "Kon WiFi scan geheugen niet toewijzen" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" @@ -893,7 +893,7 @@ msgstr "Verbinding mislukt: timeout" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to init wifi" -msgstr "" +msgstr "Kon WiFi niet initialiseren" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" @@ -915,11 +915,11 @@ msgstr "Bestand bestaat" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" -msgstr "" +msgstr "Filters zijn te complex" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "Formaat wordt niet ondersteund" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format @@ -963,7 +963,7 @@ msgstr "Hardware in gebruik, probeer alternatieve pinnen" #: shared-bindings/wifi/Radio.c msgid "Hostname must be between 1 and 253 characters" -msgstr "" +msgstr "Hostnaam moet tussen 1 en 253 karakters zijn" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -996,7 +996,7 @@ msgstr "Incorrecte buffer grootte" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" -msgstr "" +msgstr "Invoer duurt te lang" #: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" @@ -1044,7 +1044,7 @@ msgstr "Ongeldig BMP bestand" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "Ongeldig BSSID" #: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c @@ -1095,7 +1095,7 @@ msgstr "Ongeldig formaat stuk grootte" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "" +msgstr "Onjuiste frequentie" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" @@ -1218,7 +1218,7 @@ msgstr "Maximale x waarde indien gespiegeld is %d" #: shared-bindings/canio/Message.c msgid "Messages limited to 8 bytes" -msgstr "" +msgstr "Berichten zijn beperkt tot 8 bytes" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." @@ -1330,11 +1330,11 @@ msgstr "Geen lange integer ondersteuning" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" -msgstr "" +msgstr "Geen kanalen meer beschikbaar" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more timers available" -msgstr "" +msgstr "Geen timers meer beschikbaar" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." @@ -1342,7 +1342,7 @@ msgstr "Geen timers meer beschikbaar op deze pin." #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" -msgstr "" +msgstr "Geen netwerk met dat SSID gevonden" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1366,7 +1366,7 @@ msgstr "Nordic Soft Device assertion mislukt." #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" -msgstr "" +msgstr "Geen geldige IP string" #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1384,7 +1384,7 @@ msgstr "Opgeslagen code wordt niet uitgevoerd.\n" #: shared-bindings/_bleio/__init__.c msgid "Not settable" -msgstr "" +msgstr "Niet instelbaar" #: shared-bindings/util.c msgid "" @@ -1403,11 +1403,11 @@ msgstr "Alleen 8 of 16 bit mono met " #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" +msgstr "Alleen IPv4 SOCK_STREAM sockets worden ondersteund" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" -msgstr "" +msgstr "Alleen IPv4 adressen worden ondersteund" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1428,15 +1428,15 @@ msgstr "" #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" -msgstr "" +msgstr "Er kan maar één kleur per keer transparant zijn" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" -msgstr "" +msgstr "Alleen raw int ondersteund voor IP" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Out of sockets" -msgstr "" +msgstr "Geen sockets meer beschikbaar" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1510,6 +1510,8 @@ msgid "" "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " "instead" msgstr "" +"Poort ondersteund geen PWM drager. Geef een pin, frequentie en inschakeltijd " +"op" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c @@ -1519,6 +1521,8 @@ msgid "" "Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " "instead" msgstr "" +"Poort accepteert geen pin of frequentie. Stel een PWMOut Carrier samen en " +"geef die op" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -1584,7 +1588,7 @@ msgstr "Verversing te snel" #: shared-bindings/canio/RemoteTransmissionRequest.c msgid "RemoteTransmissionRequests limited to 8 bytes" -msgstr "" +msgstr "RemoteTransmissionRequests is beperkt tot 8 bytes" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" @@ -1657,11 +1661,11 @@ msgstr "Serializer in gebruik" #: shared-bindings/ssl/SSLContext.c msgid "Server side context cannot have hostname" -msgstr "" +msgstr "Context aan de serverkant kan geen hostnaam hebben" #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" -msgstr "" +msgstr "Afmeting niet ondersteund" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." @@ -1676,7 +1680,7 @@ msgstr "Slices niet ondersteund" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" -msgstr "" +msgstr "SocketPool kan alleen met wifi.radio gebruikt worden" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" @@ -1724,7 +1728,7 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" -msgstr "" +msgstr "De lengte van rgb_pins moet 6, 12, 18, 24 of 30 zijn" #: supervisor/shared/safe_mode.c msgid "" @@ -1783,7 +1787,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "To exit, please reset the board without " -msgstr "" +msgstr "Om te beëindigen, reset het bord zonder " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1856,7 +1860,7 @@ msgstr "Niet in staat buffers voor gesigneerde conversie te alloceren" #: ports/esp32s2/common-hal/busio/I2C.c msgid "Unable to create lock" -msgstr "" +msgstr "Kan vergrendeling niet maken" #: shared-module/displayio/I2CDisplay.c #, c-format @@ -1887,11 +1891,11 @@ msgstr "Onverwacht mrfx uuid type" #: ports/esp32s2/common-hal/socketpool/Socket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" -msgstr "" +msgstr "Niet behandelde ESP TLS fout %d %d %x %d" #: shared-bindings/wifi/Radio.c msgid "Unknown failure" -msgstr "" +msgstr "Onbekende fout" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -2009,7 +2013,7 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "WiFi password must be between 8 and 63 characters" -msgstr "" +msgstr "WiFi wachtwoord moet tussen 8 en 63 karakters bevatten" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" @@ -2164,7 +2168,7 @@ msgstr "buffer te klein" #: shared-bindings/socketpool/Socket.c msgid "buffer too small for requested bytes" -msgstr "" +msgstr "buffer te klein voor gevraagde bytes" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" @@ -2185,7 +2189,7 @@ msgstr "butes > 8 niet ondersteund" #: py/objarray.c msgid "bytes length not a multiple of item size" -msgstr "" +msgstr "bytes lengte is geen veelvoud van itemgrootte" #: py/objstr.c msgid "bytes value out of range" @@ -2503,11 +2507,11 @@ msgstr "uitzonderingen moeten afleiden van BaseException" #: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" -msgstr "" +msgstr "verwachtte '%q' maar ontving '%q'" #: shared-bindings/canio/CAN.c msgid "expected '%q' or '%q' but got '%q'" -msgstr "" +msgstr "verwachtte '%q' of '%q' maar ontving '%q'" #: py/objstr.c msgid "expected ':' after format specifier" @@ -2721,7 +2725,7 @@ msgstr "oorspronkelijke waarden moeten itereerbaar zijn" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "initial_value length is wrong" -msgstr "" +msgstr "lengte van initial_value is onjuist" #: py/compile.c msgid "inline assembler must be a function" @@ -2798,7 +2802,7 @@ msgstr "ongeldige formaatspecificatie" #: shared-bindings/wifi/Radio.c msgid "invalid hostname" -msgstr "" +msgstr "onjuiste hostnaam" #: extmod/modussl_axtls.c msgid "invalid key" @@ -3162,11 +3166,11 @@ msgstr "ord() verwacht een teken (char) maar vond een string van lengte %d" #: shared-bindings/displayio/Bitmap.c msgid "out of range of source" -msgstr "" +msgstr "buiten bereik van bron" #: shared-bindings/displayio/Bitmap.c msgid "out of range of target" -msgstr "" +msgstr "buiten bereik van doel" #: py/objint_mpz.c msgid "overflow converting long int to machine word" @@ -3175,7 +3179,7 @@ msgstr "overloop bij converteren van long int naar machine word" #: py/modstruct.c #, c-format msgid "pack expected %d items for packing (got %d)" -msgstr "" +msgstr "pack verwachtte %d elementen (ontving %d)" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" @@ -3244,7 +3248,7 @@ msgstr "pow() met 3 argumenten vereist integers" #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" -msgstr "" +msgstr "druk bootknop in bij opstarten.\n" #: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h #: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -3252,7 +3256,7 @@ msgstr "" #: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "pressing both buttons at start up.\n" -msgstr "" +msgstr "druk beide knoppen in bij opstarten.\n" #: extmod/modutimeq.c msgid "queue overflow" @@ -3379,7 +3383,7 @@ msgstr "sosfilt vereist itereerbare argumenten" #: shared-bindings/displayio/Bitmap.c msgid "source palette too large" -msgstr "" +msgstr "bronpalet te groot" #: py/objstr.c msgid "start/end indices" @@ -3514,7 +3518,7 @@ msgstr "objecttype '%q' heeft geen attribuut '%q'" #: py/objgenerator.c msgid "type object 'generator' has no attribute '__await__'" -msgstr "" +msgstr "het type object 'generator' heeft geen attribuut '__await__'" #: py/objtype.c msgid "type takes 1 or 3 arguments" @@ -3624,7 +3628,7 @@ msgstr "watchdog time-out moet groter zijn dan 0" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" -msgstr "" +msgstr "breedte moet groter dan nul zijn" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" From f2e79ce89da0ed926a5b10c22e0cd3fc81197e6c Mon Sep 17 00:00:00 2001 From: Jelle Jager Date: Mon, 26 Oct 2020 16:37:46 +0000 Subject: [PATCH 031/251] Translated using Weblate (Dutch) Currently translated at 100.0% (836 of 836 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/nl/ --- locale/nl.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 59b1f2e73b..f6efee0195 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2020-10-27 16:47+0000\n" -"Last-Translator: _fonzlate \n" +"Last-Translator: Jelle Jager \n" "Language-Team: none\n" "Language: nl\n" "MIME-Version: 1.0\n" @@ -481,7 +481,7 @@ msgstr "Buffer lengte moet een veelvoud van 512 zijn" #: ports/stm/common-hal/sdioio/SDCard.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "Buffer moet een veelvoud van 512 zijn" +msgstr "Buffer moet een veelvoud van 512 bytes zijn" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" From e00ae204db06f6505f9965fb5433d8e3cb4e220c Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 27 Oct 2020 17:48:01 +0100 Subject: [PATCH 032/251] 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 | 12 ++++++++++++ locale/cs.po | 12 ++++++++++++ locale/de_DE.po | 12 ++++++++++++ locale/el.po | 12 ++++++++++++ locale/es.po | 20 +++++++++++++++++--- locale/fil.po | 12 ++++++++++++ locale/fr.po | 12 ++++++++++++ locale/hi.po | 12 ++++++++++++ locale/it_IT.po | 12 ++++++++++++ locale/ja.po | 12 ++++++++++++ locale/ko.po | 12 ++++++++++++ locale/nl.po | 12 ++++++++++++ locale/pl.po | 12 ++++++++++++ locale/pt_BR.po | 12 ++++++++++++ locale/sv.po | 12 ++++++++++++ locale/zh_Latn_pinyin.po | 12 ++++++++++++ 16 files changed, 197 insertions(+), 3 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 958ff1e6b2..94a874826d 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -2918,6 +2918,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3351,6 +3359,10 @@ 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 "" diff --git a/locale/cs.po b/locale/cs.po index 6a3d00d993..b8da707413 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -2875,6 +2875,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3307,6 +3315,10 @@ 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 "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 0e2e5a038e..4d43a26557 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -2954,6 +2954,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "maximale Rekursionstiefe überschritten" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3392,6 +3400,10 @@ 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 "" diff --git a/locale/el.po b/locale/el.po index 5e55065b30..80fdb7eca1 100644 --- a/locale/el.po +++ b/locale/el.po @@ -2870,6 +2870,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3302,6 +3310,10 @@ 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 "" diff --git a/locale/es.po b/locale/es.po index 5cf9cf8654..38e0ff8d39 100644 --- a/locale/es.po +++ b/locale/es.po @@ -318,7 +318,9 @@ msgstr "Todos los canales de eventos estan siendo usados" #: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "All sync event channels in use" -msgstr "Todos los canales de eventos de sincronización (sync event channels) están siendo utilizados" +msgstr "" +"Todos los canales de eventos de sincronización (sync event channels) están " +"siendo utilizados" #: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" @@ -2941,6 +2943,14 @@ msgstr "max_lenght debe ser > 0" msgid "maximum recursion depth exceeded" msgstr "profundidad máxima de recursión excedida" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3378,6 +3388,10 @@ 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)" @@ -4135,8 +4149,8 @@ msgstr "zi debe ser una forma (n_section,2)" #~ "pequeño.\n" #~ "Aumente los límites del tamaño del stack y presione reset (después de " #~ "expulsarCIRCUITPY).\n" -#~ "Si no cambió el stack, entonces reporte un issue aquí con el contenido " -#~ "de su unidad CIRCUITPY:\n" +#~ "Si no cambió el stack, entonces reporte un issue aquí con el contenido de " +#~ "su unidad CIRCUITPY:\n" #~ msgid "" #~ "The microcontroller's power dipped. Please make sure your power supply " diff --git a/locale/fil.po b/locale/fil.po index 7a91f5c859..838bca98ba 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -2919,6 +2919,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "lumagpas ang maximum recursion depth" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3355,6 +3363,10 @@ 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 "" diff --git a/locale/fr.po b/locale/fr.po index cf0ea4fc31..b4a15ee1f9 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -2965,6 +2965,14 @@ msgstr "max_length doit être > 0" msgid "maximum recursion depth exceeded" msgstr "profondeur maximale de récursivité dépassée" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3404,6 +3412,10 @@ 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 "" + #: 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)" diff --git a/locale/hi.po b/locale/hi.po index bd6d5395bf..9174580a26 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -2870,6 +2870,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3302,6 +3310,10 @@ 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 "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 9ed3bb1e1c..6345c095c7 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -2921,6 +2921,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "profondità massima di ricorsione superata" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3362,6 +3370,10 @@ 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 "" diff --git a/locale/ja.po b/locale/ja.po index 8c3751c8e8..abd2e1803d 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -2900,6 +2900,14 @@ msgstr "max_lengthは0より大きくなければなりません" msgid "maximum recursion depth exceeded" msgstr "最大の再帰深度を超えました" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3335,6 +3343,10 @@ 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 "" diff --git a/locale/ko.po b/locale/ko.po index 9c5750b9f5..e5b728b846 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -2876,6 +2876,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3308,6 +3316,10 @@ 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 "" diff --git a/locale/nl.po b/locale/nl.po index f6efee0195..234bb930ae 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -2934,6 +2934,14 @@ msgstr "max_length moet >0 zijn" msgid "maximum recursion depth exceeded" msgstr "maximale recursiediepte overschreden" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3369,6 +3377,10 @@ 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" diff --git a/locale/pl.po b/locale/pl.po index f6292a0a3b..cadb2c43eb 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -2893,6 +2893,14 @@ msgstr "max_length musi być > 0" msgid "maximum recursion depth exceeded" msgstr "przekroczono dozwoloną głębokość rekurencji" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3327,6 +3335,10 @@ 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 "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b80afeb1aa..2c3d9b2074 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -2954,6 +2954,14 @@ msgstr "max_length deve ser > 0" msgid "maximum recursion depth exceeded" msgstr "a recursão máxima da profundidade foi excedida" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3395,6 +3403,10 @@ 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 "" + #: 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)" diff --git a/locale/sv.po b/locale/sv.po index 989b8257e7..f2fa50189b 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -2927,6 +2927,14 @@ msgstr "max_length måste vara > 0" msgid "maximum recursion depth exceeded" msgstr "maximal rekursionsdjup överskriden" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3362,6 +3370,10 @@ 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 "" + #: 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)" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 13d0dfa796..5ed34cc6c3 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -2917,6 +2917,14 @@ msgstr "Max_length bìxū > 0" msgid "maximum recursion depth exceeded" msgstr "chāochū zuìdà dìguī shēndù" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3351,6 +3359,10 @@ 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 "" + #: 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)" From 80029f6929ebbf6c0a02c5320e59220b0501bd55 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 28 Oct 2020 00:12:13 +0530 Subject: [PATCH 033/251] rotaryio implementation for esp32s2 --- .../common-hal/rotaryio/IncrementalEncoder.c | 115 ++++++++++++++++++ .../common-hal/rotaryio/IncrementalEncoder.h | 41 +++++++ ports/esp32s2/common-hal/rotaryio/__init__.c | 1 + ports/esp32s2/mpconfigport.mk | 2 +- 4 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c create mode 100644 ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h create mode 100644 ports/esp32s2/common-hal/rotaryio/__init__.c diff --git a/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c new file mode 100644 index 0000000000..bbff363740 --- /dev/null +++ b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c @@ -0,0 +1,115 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 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 "common-hal/rotaryio/IncrementalEncoder.h" + +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "driver/pcnt.h" + +static void pcnt_reset(int unit) { + // Initialize PCNT's counter + pcnt_counter_pause(unit); + pcnt_counter_clear(unit); + + // Everything is set up, now go to counting + pcnt_counter_resume(unit); +} + +static void pcnt_init(int unit, rotaryio_incrementalencoder_obj_t* self) { + // Prepare configuration for the PCNT unit + pcnt_config_t pcnt_config = { + // Set PCNT input signal and control GPIOs + .pulse_gpio_num = self->pin_a->number, + .ctrl_gpio_num = self->pin_b->number, + .channel = PCNT_CHANNEL_0, + .unit = unit, + // What to do on the positive / negative edge of pulse input? + .pos_mode = PCNT_COUNT_DEC, // Count up on the positive edge + .neg_mode = PCNT_COUNT_INC, // Keep the counter value on the negative edge + // What to do when control input is low or high? + .lctrl_mode = PCNT_MODE_REVERSE, // Reverse counting direction if low + .hctrl_mode = PCNT_MODE_KEEP, // Keep the primary counter mode if high + }; + // Initialize PCNT unit + pcnt_unit_config(&pcnt_config); + + // Configure channel 1 + pcnt_config.pulse_gpio_num = self->pin_b->number; + pcnt_config.ctrl_gpio_num = self->pin_a->number; + pcnt_config.channel = PCNT_CHANNEL_1; + pcnt_config.pos_mode = PCNT_COUNT_INC; + pcnt_config.neg_mode = PCNT_COUNT_DEC; + pcnt_unit_config(&pcnt_config); + + // Configure and enable the input filter + pcnt_set_filter_value(unit, 100); + pcnt_filter_enable(unit); + + pcnt_reset(unit); +} + +void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencoder_obj_t* self, + const mcu_pin_obj_t* pin_a, const mcu_pin_obj_t* pin_b) { + claim_pin(pin_a); + claim_pin(pin_b); + + self->pin_a = pin_a; + self->pin_b = pin_b; + + self->position = 0; + + pcnt_init(PCNT_UNIT_0, self); +} + +bool common_hal_rotaryio_incrementalencoder_deinited(rotaryio_incrementalencoder_obj_t* self) { + return self->pin_a == NULL; +} + +void common_hal_rotaryio_incrementalencoder_deinit(rotaryio_incrementalencoder_obj_t* self) { + if (common_hal_rotaryio_incrementalencoder_deinited(self)) { + return; + } + + reset_pin_number(self->pin_a->number); + self->pin_a = NULL; + + reset_pin_number(self->pin_b->number); + self->pin_b = NULL; +} + +mp_int_t common_hal_rotaryio_incrementalencoder_get_position(rotaryio_incrementalencoder_obj_t* self) { + int16_t count = 0; + pcnt_get_counter_value(PCNT_UNIT_0, &count); + return self->position+count; +} + +void common_hal_rotaryio_incrementalencoder_set_position(rotaryio_incrementalencoder_obj_t* self, + mp_int_t new_position) { + self->position = new_position; + pcnt_reset(PCNT_UNIT_0); +} diff --git a/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h new file mode 100644 index 0000000000..0cc2830fb7 --- /dev/null +++ b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h @@ -0,0 +1,41 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 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. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t * pin_a; + const mcu_pin_obj_t * pin_b; + mp_int_t position; +} rotaryio_incrementalencoder_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H diff --git a/ports/esp32s2/common-hal/rotaryio/__init__.c b/ports/esp32s2/common-hal/rotaryio/__init__.c new file mode 100644 index 0000000000..0aae79c26a --- /dev/null +++ b/ports/esp32s2/common-hal/rotaryio/__init__.c @@ -0,0 +1 @@ +// No rotaryio module functions. diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 4e8a7bdef2..dadab37515 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -19,7 +19,7 @@ CIRCUITPY_AUDIOIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 -CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_ROTARYIO = 1 CIRCUITPY_NVM = 0 # We don't have enough endpoints to include MIDI. CIRCUITPY_USB_MIDI = 0 From 54c0e98a37fc3c997d3a7a566a67e33d1636f46a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 27 Oct 2020 13:58:23 -0700 Subject: [PATCH 034/251] Fix openbook build --- ports/atmel-samd/boards/openbook_m4/board.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/openbook_m4/board.c b/ports/atmel-samd/boards/openbook_m4/board.c index f0010f6d78..07dd1741ac 100644 --- a/ports/atmel-samd/boards/openbook_m4/board.c +++ b/ports/atmel-samd/boards/openbook_m4/board.c @@ -97,7 +97,8 @@ void board_init(void) { &pin_PA01, // busy_pin false, // busy_state 5, // seconds_per_frame - false); // chip_select (don't always toggle chip select) + false, // chip_select (don't always toggle chip select) + false); // grayscale } bool board_requests_safe_mode(void) { From 91e85e8037c058f5029f9ba61d6da952eeac436e Mon Sep 17 00:00:00 2001 From: Adolfo Jayme Barrientos Date: Tue, 27 Oct 2020 17:19:22 +0000 Subject: [PATCH 035/251] Translated using Weblate (Spanish) Currently translated at 99.6% (836 of 839 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/es.po b/locale/es.po index 38e0ff8d39..6b8b96d2d7 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,15 +8,15 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-16 19:50-0500\n" -"PO-Revision-Date: 2020-10-22 22:15+0000\n" -"Last-Translator: Alvaro Figueroa \n" +"PO-Revision-Date: 2020-10-27 21:01+0000\n" +"Last-Translator: Adolfo Jayme Barrientos \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.3.1\n" +"X-Generator: Weblate 4.3.2-dev\n" #: main.c msgid "" @@ -33,7 +33,7 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" "\n" -"Reporte un problema con el contenido de su unidad CIRCUITPY en\n" +"Presente un problema con el contenido de su unidad CIRCUITPY en\n" "https://github.com/adafruit/circuitpython/issues\n" #: py/obj.c From 54c26a772ba071d129c0e30e8fc6d44e1be74029 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 27 Oct 2020 16:59:40 +0000 Subject: [PATCH 036/251] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (839 of 839 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 2c3d9b2074..16631c32a7 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-16 19:50-0500\n" -"PO-Revision-Date: 2020-10-21 19:58+0000\n" +"PO-Revision-Date: 2020-10-27 21:01+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.3.1\n" +"X-Generator: Weblate 4.3.2-dev\n" #: main.c msgid "" @@ -2956,11 +2956,11 @@ msgstr "a recursão máxima da profundidade foi excedida" #: extmod/ulab/code/approx/approx.c msgid "maxiter must be > 0" -msgstr "" +msgstr "maxiter deve ser > 0" #: extmod/ulab/code/approx/approx.c msgid "maxiter should be > 0" -msgstr "" +msgstr "maxiter pode ser > 0" #: py/runtime.c #, c-format @@ -3405,7 +3405,7 @@ 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 "" +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)" From 32f6f64a288903395358b4be73a92fe03a71fc67 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 27 Oct 2020 22:01:17 +0100 Subject: [PATCH 037/251] 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 | 32 +++++++++++++++++++++++++++++--- locale/cs.po | 32 +++++++++++++++++++++++++++++--- locale/de_DE.po | 32 +++++++++++++++++++++++++++++--- locale/el.po | 32 +++++++++++++++++++++++++++++--- locale/es.po | 32 +++++++++++++++++++++++++++++--- locale/fil.po | 32 +++++++++++++++++++++++++++++--- locale/fr.po | 32 +++++++++++++++++++++++++++++--- locale/hi.po | 32 +++++++++++++++++++++++++++++--- locale/it_IT.po | 32 +++++++++++++++++++++++++++++--- locale/ja.po | 32 +++++++++++++++++++++++++++++--- locale/ko.po | 32 +++++++++++++++++++++++++++++--- locale/nl.po | 32 +++++++++++++++++++++++++++++--- locale/pl.po | 32 +++++++++++++++++++++++++++++--- locale/pt_BR.po | 32 +++++++++++++++++++++++++++++--- locale/sv.po | 32 +++++++++++++++++++++++++++++--- locale/zh_Latn_pinyin.po | 32 +++++++++++++++++++++++++++++--- 16 files changed, 464 insertions(+), 48 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 94a874826d..7debab27ac 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -292,11 +292,16 @@ msgstr "Alamat harus sepanjang %d byte" msgid "Address type out of range" msgstr "Jenis alamat di luar batas" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Semua perangkat I2C sedang digunakan" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -413,6 +418,10 @@ msgstr "" "Auto-reload aktif. Silahkan simpan data-data (files) melalui USB untuk " "menjalankannya atau masuk ke REPL untukmenonaktifkan.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -793,7 +802,7 @@ msgstr "Mode kendara tidak digunakan saat arah input." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB hanya beroperasi pada 16 byte di satu waktu" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -919,6 +928,7 @@ msgid "File exists" msgstr "File sudah ada" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1140,7 +1150,7 @@ msgstr "Pin untuk channel kanan tidak valid" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2884,6 +2894,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3237,6 +3251,8 @@ msgstr "" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3493,6 +3509,16 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/cs.po b/locale/cs.po index b8da707413..e4f677d8e2 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -292,11 +292,16 @@ msgstr "" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -411,6 +416,10 @@ msgid "" "disable.\n" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -779,7 +788,7 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -905,6 +914,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1123,7 +1133,7 @@ msgstr "" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2841,6 +2851,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3193,6 +3207,8 @@ msgstr "" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3448,6 +3464,16 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/de_DE.po b/locale/de_DE.po index 4d43a26557..141a5e8c03 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -291,11 +291,16 @@ msgstr "Die Adresse muss %d Bytes lang sein" msgid "Address type out of range" msgstr "Adresstyp außerhalb des zulässigen Bereichs" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -414,6 +419,10 @@ msgstr "" "Automatisches Neuladen ist aktiv. Speichere Dateien über USB um sie " "auszuführen oder verbinde dich mit der REPL zum Deaktivieren.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -789,7 +798,7 @@ msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist." msgid "ECB only operates on 16 bytes at a time" msgstr "Die EZB arbeitet jeweils nur mit 16 Bytes" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -916,6 +925,7 @@ msgid "File exists" msgstr "Datei existiert" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filter zu komplex" @@ -1140,7 +1150,7 @@ msgstr "Ungültiger Pin für rechten Kanal" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2920,6 +2930,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "long int wird in diesem Build nicht unterstützt" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "fehlformatierter f-string" @@ -3276,6 +3290,8 @@ msgstr "pow () mit 3 Argumenten erfordert Integer" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3534,6 +3550,16 @@ msgstr "Tupelindex außerhalb des Bereichs" msgid "tuple/list has wrong length" msgstr "tupel/list hat falsche Länge" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/el.po b/locale/el.po index 80fdb7eca1..cc6da670cd 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -287,11 +287,16 @@ msgstr "" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -406,6 +411,10 @@ msgid "" "disable.\n" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -774,7 +783,7 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -900,6 +909,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1118,7 +1128,7 @@ msgstr "" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2836,6 +2846,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3188,6 +3202,8 @@ msgstr "" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3443,6 +3459,16 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/es.po b/locale/es.po index 6b8b96d2d7..348af34067 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-27 21:01+0000\n" "Last-Translator: Adolfo Jayme Barrientos \n" "Language-Team: \n" @@ -295,11 +295,16 @@ msgstr "La dirección debe tener %d bytes de largo" msgid "Address type out of range" msgstr "Tipo de dirección fuera de rango" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Todos los periféricos I2C están siendo usados" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Todos los FIFOs de RX en uso" @@ -420,6 +425,10 @@ msgstr "" "Auto-reload habilitado. Simplemente guarda los archivos via USB para " "ejecutarlos o entra al REPL para desabilitarlos.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -794,7 +803,7 @@ msgstr "Modo Drive no se usa cuando la dirección es input." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB solo opera sobre 16 bytes a la vez" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "Fallo ESP-IDF al tomar la memoria" @@ -920,6 +929,7 @@ msgid "File exists" msgstr "El archivo ya existe" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filtros muy complejos" @@ -1141,7 +1151,7 @@ msgstr "Pin inválido para canal derecho" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2909,6 +2919,10 @@ msgstr "variable local referenciada antes de la asignación" msgid "long int not supported in this build" msgstr "long int no soportado en esta compilación" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "cadena-f mal formada" @@ -3264,6 +3278,8 @@ msgstr "pow() con 3 argumentos requiere enteros" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3522,6 +3538,16 @@ msgstr "tuple index fuera de rango" msgid "tuple/list has wrong length" msgstr "tupla/lista tiene una longitud incorrecta" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/fil.po b/locale/fil.po index 838bca98ba..7bc33dba3e 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -289,11 +289,16 @@ msgstr "ang palette ay dapat 32 bytes ang haba" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -411,6 +416,10 @@ msgstr "" "Ang awtomatikong pag re-reload ay ON. i-save lamang ang mga files sa USB " "para patakbuhin sila o pasukin ang REPL para i-disable ito.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -785,7 +794,7 @@ msgstr "Drive mode ay hindi ginagamit kapag ang direksyon ay input." msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -913,6 +922,7 @@ msgid "File exists" msgstr "Mayroong file" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1133,7 +1143,7 @@ msgstr "Mali ang pin para sa kanang channel" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2885,6 +2895,10 @@ msgstr "local variable na reference bago na i-assign" msgid "long int not supported in this build" msgstr "long int hindi sinusuportahan sa build na ito" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3239,6 +3253,8 @@ msgstr "pow() na may 3 argumento kailangan ng integers" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3498,6 +3514,16 @@ msgstr "indeks ng tuple wala sa sakop" msgid "tuple/list has wrong length" msgstr "mali ang haba ng tuple/list" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/fr.po b/locale/fr.po index b4a15ee1f9..920e22cb0c 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-22 20:48+0000\n" "Last-Translator: Antonin ENFRUN \n" "Language: fr\n" @@ -296,11 +296,16 @@ msgstr "L'adresse doit être longue de %d octets" msgid "Address type out of range" msgstr "Type d'adresse hors plage" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Tous les périphériques I2C sont utilisés" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Tout les RX FIFOs sont utilisé" @@ -420,6 +425,10 @@ msgstr "" "Auto-chargement activé. Copiez simplement les fichiers en USB pour les " "lancer ou entrez sur REPL pour le désactiver.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -798,7 +807,7 @@ msgstr "Le mode Drive n'est pas utilisé quand la direction est 'input'." msgid "ECB only operates on 16 bytes at a time" msgstr "La BCE ne fonctionne que sur 16 octets à la fois" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "ESP-IDF échec d'allocation de la mémoire" @@ -925,6 +934,7 @@ msgid "File exists" msgstr "Le fichier existe" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filtre trop complexe" @@ -1146,7 +1156,7 @@ msgstr "Broche invalide pour le canal droit" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2931,6 +2941,10 @@ msgstr "variable locale référencée avant d'être assignée" msgid "long int not supported in this build" msgstr "entiers longs non supportés dans cette build" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "f-string mal formé" @@ -3288,6 +3302,8 @@ msgstr "pow() avec 3 arguments nécessite des entiers" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3546,6 +3562,16 @@ msgstr "index du tuple hors gamme" msgid "tuple/list has wrong length" msgstr "tuple/liste a une mauvaise longueur" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/hi.po b/locale/hi.po index 9174580a26..4966ad8e80 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -287,11 +287,16 @@ msgstr "" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -406,6 +411,10 @@ msgid "" "disable.\n" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -774,7 +783,7 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -900,6 +909,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1118,7 +1128,7 @@ msgstr "" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2836,6 +2846,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3188,6 +3202,8 @@ msgstr "" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3443,6 +3459,16 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/it_IT.po b/locale/it_IT.po index 6345c095c7..82840c8523 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -288,11 +288,16 @@ msgstr "la palette deve essere lunga 32 byte" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -410,6 +415,10 @@ msgstr "" "L'auto-reload è attivo. Salva i file su USB per eseguirli o entra nel REPL " "per disabilitarlo.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -785,7 +794,7 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -913,6 +922,7 @@ msgid "File exists" msgstr "File esistente" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1135,7 +1145,7 @@ msgstr "Pin non valido per il canale destro" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2887,6 +2897,10 @@ msgstr "variabile locale richiamata prima di un assegnamento" msgid "long int not supported in this build" msgstr "long int non supportata in questa build" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3246,6 +3260,8 @@ msgstr "pow() con 3 argomenti richiede interi" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3505,6 +3521,16 @@ msgstr "indice della tupla fuori intervallo" msgid "tuple/list has wrong length" msgstr "tupla/lista ha la lunghezza sbagliata" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/ja.po b/locale/ja.po index abd2e1803d..ae7e51ba6b 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -294,11 +294,16 @@ msgstr "アドレスは、%dバイト長でなければなりません" msgid "Address type out of range" msgstr "address_typeが範囲外" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "全てのI2C周辺機器が使用中" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "全てのRX FIFOが使用中" @@ -415,6 +420,10 @@ msgstr "" "オートリロードがオンです。ファイルをUSB経由で保存するだけで実行できます。REPL" "に入ると無効化します。\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -787,7 +796,7 @@ msgstr "方向がinputのときドライブモードは使われません" msgid "ECB only operates on 16 bytes at a time" msgstr "ECBは一度に16バイトの演算のみを行います" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -913,6 +922,7 @@ msgid "File exists" msgstr "ファイルが存在します" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1133,7 +1143,7 @@ msgstr "右チャネルのピンが不正" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2866,6 +2876,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "このビルドはlong intに非対応" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "不正な形式のf-string" @@ -3220,6 +3234,8 @@ msgstr "pow()の第3引数には整数が必要" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3476,6 +3492,16 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "タプル/リストの長さが正しくありません" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/ko.po b/locale/ko.po index e5b728b846..858a036c83 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -290,11 +290,16 @@ msgstr "" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "사용중인 모든 I2C주변 기기" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -411,6 +416,10 @@ msgstr "" "자동 새로 고침이 켜져 있습니다. USB를 통해 파일을 저장하여 실행하십시오. 비활" "성화하려면 REPL을 입력하십시오.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -779,7 +788,7 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -905,6 +914,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1123,7 +1133,7 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2842,6 +2852,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3194,6 +3208,8 @@ msgstr "" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3449,6 +3465,16 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/nl.po b/locale/nl.po index 234bb930ae..bf05abb721 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-27 16:47+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -292,11 +292,16 @@ msgstr "Adres moet %d bytes lang zijn" msgid "Address type out of range" msgstr "Adres type buiten bereik" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Alle I2C peripherals zijn in gebruik" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Alle RX FIFO's zijn in gebruik" @@ -413,6 +418,10 @@ msgstr "" "Auto-herlaad staat aan. Sla bestanden simpelweg op over USB om uit te voeren " "of start REPL om uit te schakelen.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -787,7 +796,7 @@ msgstr "Drive modus niet gebruikt als de richting input is." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB werkt alleen met 16 bytes tegelijkertijd" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "ESP-IDF geheugen toewijzing mislukt" @@ -913,6 +922,7 @@ msgid "File exists" msgstr "Bestand bestaat" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filters zijn te complex" @@ -1135,7 +1145,7 @@ msgstr "Ongeldige pin voor rechter kanaal" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2900,6 +2910,10 @@ msgstr "verwijzing naar een (nog) niet toegewezen lokale variabele" msgid "long int not supported in this build" msgstr "long int wordt niet ondersteund in deze build" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "onjuist gevormde f-string" @@ -3253,6 +3267,8 @@ msgstr "pow() met 3 argumenten vereist integers" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3510,6 +3526,16 @@ msgstr "tuple index buiten bereik" msgid "tuple/list has wrong length" msgstr "tuple of lijst heeft onjuiste lengte" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/pl.po b/locale/pl.po index cadb2c43eb..1dbb0ba12b 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-09-29 01:39+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -294,11 +294,16 @@ msgstr "Adres musi mieć %d bajtów" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Wszystkie peryferia I2C w użyciu" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -415,6 +420,10 @@ msgstr "" "Samo-przeładowywanie włączone. Po prostu zapisz pliki przez USB aby je " "uruchomić, albo wejdź w konsolę aby wyłączyć.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -787,7 +796,7 @@ msgstr "Tryb sterowania nieużywany w trybie wejścia." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB działa tylko na 16 bajtach naraz" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -913,6 +922,7 @@ msgid "File exists" msgstr "Plik istnieje" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1133,7 +1143,7 @@ msgstr "Zła nóżka dla prawego kanału" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2859,6 +2869,10 @@ msgstr "zmienna lokalna użyta przed przypisaniem" msgid "long int not supported in this build" msgstr "long int jest nieobsługiwany" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3212,6 +3226,8 @@ msgstr "trzyargumentowe pow() wymaga liczb całkowitych" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3468,6 +3484,16 @@ msgstr "indeks krotki poza zakresem" msgid "tuple/list has wrong length" msgstr "krotka/lista ma złą długość" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 16631c32a7..8696d7509a 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-27 21:01+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -296,11 +296,16 @@ msgstr "O endereço deve ter %d bytes de comprimento" msgid "Address type out of range" msgstr "O tipo do endereço está fora do alcance" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Todos os periféricos I2C estão em uso" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Todos os FIFOs RX estão em uso" @@ -419,6 +424,10 @@ msgstr "" "O recarregamento automático está ativo. Simplesmente salve os arquivos via " "USB para executá-los ou digite REPL para desativar.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -796,7 +805,7 @@ msgstr "O modo do controlador não é usado quando a direção for inserida." msgid "ECB only operates on 16 bytes at a time" msgstr "O BCE opera apenas com 16 bytes por vez" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "Houve uma falha na alocação da memória ESP-IDF" @@ -922,6 +931,7 @@ msgid "File exists" msgstr "Arquivo já existe" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Os filtros são muito complexos" @@ -1144,7 +1154,7 @@ msgstr "Pino inválido para canal direito" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2920,6 +2930,10 @@ msgstr "a variável local referenciada antes da atribuição" msgid "long int not supported in this build" msgstr "o long int não é suportado nesta compilação" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "f-string malformado" @@ -3279,6 +3293,8 @@ msgstr "o pow() com 3 argumentos requer números inteiros" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3536,6 +3552,16 @@ msgstr "o índice da tupla está fora do intervalo" msgid "tuple/list has wrong length" msgstr "a tupla/lista está com tamanho incorreto" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/sv.po b/locale/sv.po index f2fa50189b..53ed60acae 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-26 02:36+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -292,11 +292,16 @@ msgstr "Adressen måste vara %d byte lång" msgid "Address type out of range" msgstr "Adresstyp utanför intervallet" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "All I2C-kringutrustning används" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Alla RX FIFO i bruk" @@ -413,6 +418,10 @@ msgstr "" "Autoladdning är på. Spara bara filer via USB för att köra dem eller ange " "REPL för att inaktivera.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -787,7 +796,7 @@ msgstr "Drivläge används inte när riktning är input." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB arbetar endast på 16 byte åt gången" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "ESP-IDF-minnetilldelning misslyckades" @@ -913,6 +922,7 @@ msgid "File exists" msgstr "Filen finns redan" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filter för komplexa" @@ -1133,7 +1143,7 @@ msgstr "Ogiltig pinne för höger kanal" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2893,6 +2903,10 @@ msgstr "lokal variabel refererad före tilldelning" msgid "long int not supported in this build" msgstr "long int stöds inte i denna build" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "f-sträng har felaktigt format" @@ -3246,6 +3260,8 @@ msgstr "pow() med 3 argument kräver heltal" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3503,6 +3519,16 @@ msgstr "tupelindex utanför intervallet" msgid "tuple/list has wrong length" msgstr "tupel/lista har fel längd" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 5ed34cc6c3..9b32993eb0 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-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-22 20:48+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -294,11 +294,16 @@ msgstr "Dìzhǐ bìxū shì %d zì jié zhǎng" msgid "Address type out of range" msgstr "Dìzhǐ lèixíng chāochū fànwéi" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Suǒyǒu shǐyòng zhōng de RX FIFO" @@ -415,6 +420,10 @@ msgstr "" "Zìdòng chóngxīn jiāzài. Zhǐ xū tōngguò USB bǎocún wénjiàn lái yùnxíng tāmen " "huò shūrù REPL jìnyòng.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -785,7 +794,7 @@ msgstr "Fāngxiàng shūrù shí qūdòng móshì méiyǒu shǐyòng." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB yí cì zhǐ shǐ yòng 16 gè zì jié" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "ESP-IDF nèicún fēnpèi shībài" @@ -911,6 +920,7 @@ msgid "File exists" msgstr "Wénjiàn cúnzài" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "guò lǜ qì tài fù zá" @@ -1131,7 +1141,7 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2883,6 +2893,10 @@ msgstr "fùzhí qián yǐnyòng de júbù biànliàng" msgid "long int not supported in this build" msgstr "cǐ bǎnběn bù zhīchí zhǎng zhěngshù" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "jīxíng de f-string" @@ -3235,6 +3249,8 @@ msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3492,6 +3508,16 @@ msgstr "yuán zǔ suǒyǐn chāochū fànwéi" msgid "tuple/list has wrong length" msgstr "yuán zǔ/lièbiǎo chángdù cuòwù" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c From d0426b3438a934257c5351f7eb2d9cdd79881c03 Mon Sep 17 00:00:00 2001 From: Noel Gaetan Date: Tue, 27 Oct 2020 23:54:46 +0100 Subject: [PATCH 038/251] Update pins.c fix mistake --- ports/nrf/boards/holyiot_nrf52840/pins.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/boards/holyiot_nrf52840/pins.c b/ports/nrf/boards/holyiot_nrf52840/pins.c index 4e2593e58f..cdec4dfa8e 100644 --- a/ports/nrf/boards/holyiot_nrf52840/pins.c +++ b/ports/nrf/boards/holyiot_nrf52840/pins.c @@ -51,9 +51,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_21), MP_ROM_PTR(&pin_P0_21) }, { MP_ROM_QSTR(MP_QSTR_P0_19), MP_ROM_PTR(&pin_P0_19) }, - // RESET { MP_ROM_QSTR(MP_QSTR_P0_18), MP_ROM_PTR(&pin_P0_18) }, + // RESET { MP_ROM_QSTR(MP_QSTR_P0_18), MP_ROM_PTR(&pin_P0_18) } }; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 27827a4fef74dc66996ecb670f01ad5d58500899 Mon Sep 17 00:00:00 2001 From: Gaetan Date: Wed, 28 Oct 2020 00:34:07 +0100 Subject: [PATCH 039/251] =?UTF-8?q?Fix=20EOF=20error=20modifi=C3=A9=C2=A0:?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20mpconfigboard.mk=20modifi=C3=A9?= =?UTF-8?q?=C2=A0:=20=20=20=20=20=20=20=20=20pins.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk | 2 +- ports/nrf/boards/holyiot_nrf52840/pins.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk b/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk index d85de75071..ead2059531 100644 --- a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk +++ b/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk @@ -5,4 +5,4 @@ USB_MANUFACTURER = "Holyiot" MCU_CHIP = nrf52840 -INTERNAL_FLASH_FILESYSTEM = 1 \ No newline at end of file +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/holyiot_nrf52840/pins.c b/ports/nrf/boards/holyiot_nrf52840/pins.c index 4e2593e58f..604744e0ea 100644 --- a/ports/nrf/boards/holyiot_nrf52840/pins.c +++ b/ports/nrf/boards/holyiot_nrf52840/pins.c @@ -43,7 +43,6 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_13), MP_ROM_PTR(&pin_P0_13) }, { MP_ROM_QSTR(MP_QSTR_P0_16), MP_ROM_PTR(&pin_P0_16) }, - { MP_ROM_QSTR(MP_QSTR_P0_07), MP_ROM_PTR(&pin_P0_07) }, { MP_ROM_QSTR(MP_QSTR_P1_09), MP_ROM_PTR(&pin_P1_09) }, { MP_ROM_QSTR(MP_QSTR_P0_12), MP_ROM_PTR(&pin_P0_12) }, @@ -55,5 +54,4 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { }; - -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 9b911b2211715e9da7ae55b691f54fe2f33a4486 Mon Sep 17 00:00:00 2001 From: Gaetan Date: Wed, 28 Oct 2020 00:38:07 +0100 Subject: [PATCH 040/251] =?UTF-8?q?modifi=C3=A9=C2=A0:=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20pins.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ports/nrf/boards/holyiot_nrf52840/pins.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/nrf/boards/holyiot_nrf52840/pins.c b/ports/nrf/boards/holyiot_nrf52840/pins.c index 604744e0ea..8e06675916 100644 --- a/ports/nrf/boards/holyiot_nrf52840/pins.c +++ b/ports/nrf/boards/holyiot_nrf52840/pins.c @@ -50,8 +50,12 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_21), MP_ROM_PTR(&pin_P0_21) }, { MP_ROM_QSTR(MP_QSTR_P0_19), MP_ROM_PTR(&pin_P0_19) }, - // RESET { MP_ROM_QSTR(MP_QSTR_P0_18), MP_ROM_PTR(&pin_P0_18) }, + // RESET { MP_ROM_QSTR(MP_QSTR_P0_18), MP_ROM_PTR(&pin_P0_18) } }; +<<<<<<< HEAD +======= + +>>>>>>> d0426b3438a934257c5351f7eb2d9cdd79881c03 MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From b44011d196a0a7294fca1e1825054761979ba075 Mon Sep 17 00:00:00 2001 From: Gaetan Date: Wed, 28 Oct 2020 01:43:42 +0100 Subject: [PATCH 041/251] fix railing Whitespace pin.c --- ports/nrf/boards/holyiot_nrf52840/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/boards/holyiot_nrf52840/pins.c b/ports/nrf/boards/holyiot_nrf52840/pins.c index c9e222b671..83be4f0ac7 100644 --- a/ports/nrf/boards/holyiot_nrf52840/pins.c +++ b/ports/nrf/boards/holyiot_nrf52840/pins.c @@ -49,7 +49,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_23), MP_ROM_PTR(&pin_P0_23) }, { MP_ROM_QSTR(MP_QSTR_P0_21), MP_ROM_PTR(&pin_P0_21) }, { MP_ROM_QSTR(MP_QSTR_P0_19), MP_ROM_PTR(&pin_P0_19) }, - + // RESET { MP_ROM_QSTR(MP_QSTR_P0_18), MP_ROM_PTR(&pin_P0_18) } }; From 5e3bfa1956ca4d327fcad23ce508ebbdaeac4d69 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 28 Oct 2020 20:08:25 +0530 Subject: [PATCH 042/251] countio implementation for esp32s2 --- ports/esp32s2/common-hal/countio/Counter.c | 69 +++++++++++++++++++++ ports/esp32s2/common-hal/countio/Counter.h | 15 +++++ ports/esp32s2/common-hal/countio/__init__.c | 1 + ports/esp32s2/mpconfigport.mk | 2 +- 4 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 ports/esp32s2/common-hal/countio/Counter.c create mode 100644 ports/esp32s2/common-hal/countio/Counter.h create mode 100644 ports/esp32s2/common-hal/countio/__init__.c diff --git a/ports/esp32s2/common-hal/countio/Counter.c b/ports/esp32s2/common-hal/countio/Counter.c new file mode 100644 index 0000000000..6a76a163d7 --- /dev/null +++ b/ports/esp32s2/common-hal/countio/Counter.c @@ -0,0 +1,69 @@ +#include "common-hal/countio/Counter.h" + +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "driver/pcnt.h" + +static void pcnt_init(countio_counter_obj_t* self) { + int unit = PCNT_UNIT_0; + // Prepare configuration for the PCNT unit + pcnt_config_t pcnt_config = { + // Set PCNT input signal and control GPIOs + .pulse_gpio_num = self->pin->number, + .ctrl_gpio_num = PCNT_PIN_NOT_USED, + .channel = PCNT_CHANNEL_0, + .unit = unit, + // What to do on the positive / negative edge of pulse input? + .pos_mode = PCNT_COUNT_INC, // Count up on the positive edge + .neg_mode = PCNT_COUNT_DIS, // Keep the counter value on the negative edge + }; + // Initialize PCNT unit + pcnt_unit_config(&pcnt_config); + + // Configure and enable the input filter + pcnt_set_filter_value(unit, 100); + pcnt_filter_enable(unit); + + // Initialize PCNT's counter + pcnt_counter_pause(unit); + pcnt_counter_clear(unit); + + // Everything is set up, now go to counting + pcnt_counter_resume(unit); +} + +void common_hal_countio_counter_construct(countio_counter_obj_t* self, + const mcu_pin_obj_t* pin) { + claim_pin(pin); + self->pin = pin; + pcnt_init(self); +} + +bool common_hal_countio_counter_deinited(countio_counter_obj_t* self) { + return self->pin == NULL; +} + +void common_hal_countio_counter_deinit(countio_counter_obj_t* self) { + if (common_hal_countio_counter_deinited(self)) { + return; + } + reset_pin_number(self->pin->number); + self->pin = NULL; +} + +mp_int_t common_hal_countio_counter_get_count(countio_counter_obj_t* self) { + int16_t count; + pcnt_get_counter_value(PCNT_UNIT_0, &count); + return count+self->count; +} + +void common_hal_countio_counter_set_count(countio_counter_obj_t* self, + mp_int_t new_count) { + self->count = new_count; + pcnt_counter_clear(PCNT_UNIT_0); +} + +void common_hal_countio_counter_reset(countio_counter_obj_t* self) { + common_hal_countio_counter_set_count(self, 0); +} diff --git a/ports/esp32s2/common-hal/countio/Counter.h b/ports/esp32s2/common-hal/countio/Counter.h new file mode 100644 index 0000000000..3406f9daaf --- /dev/null +++ b/ports/esp32s2/common-hal/countio/Counter.h @@ -0,0 +1,15 @@ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNTER_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNTER_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t * pin; + mp_int_t count; +} countio_counter_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNT_H diff --git a/ports/esp32s2/common-hal/countio/__init__.c b/ports/esp32s2/common-hal/countio/__init__.c new file mode 100644 index 0000000000..b95b20d153 --- /dev/null +++ b/ports/esp32s2/common-hal/countio/__init__.c @@ -0,0 +1 @@ +//No countio module functions diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index c06c89c909..bdb25a87b8 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -17,7 +17,7 @@ CIRCUITPY_FULL_BUILD = 1 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_CANIO = 1 -CIRCUITPY_COUNTIO = 0 +CIRCUITPY_COUNTIO = 1 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_ROTARYIO = 0 From 5ab2f16f64f0935ac8ad6fa776c435d55a3cff1e Mon Sep 17 00:00:00 2001 From: Gaetan Date: Wed, 28 Oct 2020 22:08:10 +0100 Subject: [PATCH 043/251] =?UTF-8?q?Change=20Board=20Name=20to=20ADM=5FB=5F?= =?UTF-8?q?NRF52840=5F1=20edit=20=20=20:=20=20=20=20=20=20=20=20=20.github?= =?UTF-8?q?/workflows/build.yml=20rename=C2=A0:=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?ports/nrf/boards/holyiot=5Fnrf52840/board.c=20->=20ports/nrf/bo?= =?UTF-8?q?ards/ADM=5FB=5FNRF52840=5F1/board.c=20rename=C2=A0:=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20ports/nrf/boards/holyiot=5Fnrf52840/mpconfigboar?= =?UTF-8?q?d.h=20->=20ports/nrf/boards/ADM=5FB=5FNRF52840=5F1/mpconfigboar?= =?UTF-8?q?d.h=20rename=C2=A0:=20=20=20=20=20=20=20=20=20ports/nrf/boards/?= =?UTF-8?q?holyiot=5Fnrf52840/mpconfigboard.mk=20->=20ports/nrf/boards/ADM?= =?UTF-8?q?=5FB=5FNRF52840=5F1/mpconfigboard.mk=20rename=C2=A0:=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20ports/nrf/boards/holyiot=5Fnrf52840/pins.c=20?= =?UTF-8?q?->=20ports/nrf/boards/ADM=5FB=5FNRF52840=5F1/pins.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- .../nrf/boards/{holyiot_nrf52840 => ADM_B_NRF52840_1}/board.c | 0 .../{holyiot_nrf52840 => ADM_B_NRF52840_1}/mpconfigboard.h | 2 +- .../{holyiot_nrf52840 => ADM_B_NRF52840_1}/mpconfigboard.mk | 4 ++-- .../nrf/boards/{holyiot_nrf52840 => ADM_B_NRF52840_1}/pins.c | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename ports/nrf/boards/{holyiot_nrf52840 => ADM_B_NRF52840_1}/board.c (100%) rename ports/nrf/boards/{holyiot_nrf52840 => ADM_B_NRF52840_1}/mpconfigboard.h (95%) rename ports/nrf/boards/{holyiot_nrf52840 => ADM_B_NRF52840_1}/mpconfigboard.mk (55%) rename ports/nrf/boards/{holyiot_nrf52840 => ADM_B_NRF52840_1}/pins.c (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cada55aaa4..1a967046ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -162,6 +162,7 @@ jobs: board: - "8086_commander" - "TG-Watch02A" + - "ADM_B_NRF52840_1" - "aloriumtech_evo_m51" - "aramcon_badge_2019" - "arduino_mkr1300" @@ -214,7 +215,6 @@ jobs: - "hallowing_m0_express" - "hallowing_m4_express" - "hiibot_bluefi" - - "holyiot_nrf52840" - "ikigaisense_vita" - "imxrt1010_evk" - "imxrt1020_evk" diff --git a/ports/nrf/boards/holyiot_nrf52840/board.c b/ports/nrf/boards/ADM_B_NRF52840_1/board.c similarity index 100% rename from ports/nrf/boards/holyiot_nrf52840/board.c rename to ports/nrf/boards/ADM_B_NRF52840_1/board.c diff --git a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.h b/ports/nrf/boards/ADM_B_NRF52840_1/mpconfigboard.h similarity index 95% rename from ports/nrf/boards/holyiot_nrf52840/mpconfigboard.h rename to ports/nrf/boards/ADM_B_NRF52840_1/mpconfigboard.h index 3b64d3a629..575d09feb5 100644 --- a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.h +++ b/ports/nrf/boards/ADM_B_NRF52840_1/mpconfigboard.h @@ -27,7 +27,7 @@ #include "nrfx/hal/nrf_gpio.h" -#define MICROPY_HW_BOARD_NAME "Holyiot nRF52840" +#define MICROPY_HW_BOARD_NAME "AtelierDuMaker nRF52840 Breakout" #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_HW_LED_STATUS (&pin_P0_19) diff --git a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk b/ports/nrf/boards/ADM_B_NRF52840_1/mpconfigboard.mk similarity index 55% rename from ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk rename to ports/nrf/boards/ADM_B_NRF52840_1/mpconfigboard.mk index ead2059531..f3a2e830dd 100644 --- a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk +++ b/ports/nrf/boards/ADM_B_NRF52840_1/mpconfigboard.mk @@ -1,7 +1,7 @@ USB_VID = 0x239A USB_PID = 0x80A0 -USB_PRODUCT = "HOLYIOTNRF52840" -USB_MANUFACTURER = "Holyiot" +USB_PRODUCT = "ADM_B_NRF52840_1" +USB_MANUFACTURER = "AtelierDuMaker" MCU_CHIP = nrf52840 diff --git a/ports/nrf/boards/holyiot_nrf52840/pins.c b/ports/nrf/boards/ADM_B_NRF52840_1/pins.c similarity index 100% rename from ports/nrf/boards/holyiot_nrf52840/pins.c rename to ports/nrf/boards/ADM_B_NRF52840_1/pins.c From 3dcee5be803a4d6bd9f05ecb13608467dc2e3a55 Mon Sep 17 00:00:00 2001 From: Gaetan Date: Wed, 28 Oct 2020 22:38:13 +0100 Subject: [PATCH 044/251] Fix: .github/workflows/build.yml --- .github/workflows/build.yml | 49 ++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a967046ca..2f61b60415 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: - name: CircuitPython version run: | git describe --dirty --tags - echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)" + echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags) - name: Set up Python 3.8 uses: actions/setup-python@v1 with: @@ -36,7 +36,7 @@ jobs: - name: Install deps run: | sudo apt-get install -y eatmydata - sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 + sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli - name: Versions run: | @@ -73,17 +73,26 @@ jobs: with: name: stubs path: circuitpython-stubs* - - name: Docs + - name: Test Documentation Build (HTML) run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html - uses: actions/upload-artifact@v2 with: name: docs path: _build/html + - name: Test Documentation Build (LaTeX/PDF) + run: | + make latexpdf + - uses: actions/upload-artifact@v2 + with: + name: docs + path: _build/latex - name: Translations run: make check-translate - name: New boards check run: python3 -u ci_new_boards_check.py working-directory: tools + - name: Duplicate USB VID/PID Check + run: python3 -u -m tools.ci_check_duplicate_usb_vid_pid - name: Build mpy-cross.static-raspbian run: make -C mpy-cross -j2 -f Makefile.static-raspbian - uses: actions/upload-artifact@v2 @@ -122,8 +131,8 @@ jobs: run: echo "$GITHUB_CONTEXT" - name: Install dependencies run: | - brew install gettext awscli - echo "::set-env name=PATH::/usr/local/opt/gettext/bin:$PATH" + brew install gettext + echo >>$GITHUB_PATH /usr/local/opt/gettext/bin - name: Versions run: | gcc --version @@ -137,7 +146,7 @@ jobs: - name: CircuitPython version run: | git describe --dirty --tags - echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)" + echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags) - name: Build mpy-cross run: make -C mpy-cross -j2 - uses: actions/upload-artifact@v2 @@ -161,8 +170,8 @@ jobs: matrix: board: - "8086_commander" - - "TG-Watch02A" - "ADM_B_NRF52840_1" + - "TG-Watch02A" - "aloriumtech_evo_m51" - "aramcon_badge_2019" - "arduino_mkr1300" @@ -171,7 +180,8 @@ jobs: - "arduino_nano_33_iot" - "arduino_zero" - "bast_pro_mini_m0" - - "bdmicro_vina_m0" + - "bdmicro_vina_d21" + - "bdmicro_vina_d51" - "bless_dev_board_multi_sensor" - "blm_badge" - "capablerobot_usbhub" @@ -189,6 +199,8 @@ jobs: - "datum_imu" - "datum_light" - "datum_weather" + - "dynossat_edu_eps" + - "dynossat_edu_obc" - "electronut_labs_blip" - "electronut_labs_papyr" - "escornabot_makech" @@ -202,6 +214,7 @@ jobs: - "feather_m0_rfm69" - "feather_m0_rfm9x" - "feather_m0_supersized" + - "feather_m4_can" - "feather_m4_express" - "feather_m7_1011" - "feather_mimxrt1011" @@ -228,11 +241,13 @@ jobs: - "makerdiary_nrf52840_m2_devkit" - "makerdiary_nrf52840_mdk" - "makerdiary_nrf52840_mdk_usb_dongle" + - "matrixportal_m4" - "meowbit_v121" - "meowmeow" - "metro_m0_express" - "metro_m4_airlift_lite" - "metro_m4_express" + - "metro_m7_1011" - "metro_nrf52840_express" - "mini_sam_m4" - "monster_m4sk" @@ -254,6 +269,7 @@ jobs: - "pca10100" - "pewpew10" - "pewpew_m4" + - "picoplanet" - "pirkey_m0" - "pitaya_go" - "pyb_nano_v2" @@ -267,6 +283,8 @@ jobs: - "pyportal" - "pyportal_titano" - "pyruler" + - "qtpy_m0" + - "qtpy_m0_haxpress" - "raytac_mdbt50q-db-40" - "robohatmm1_m4" - "sam32" @@ -401,9 +419,17 @@ jobs: fail-fast: false matrix: board: + - "adafruit_metro_esp32s2" + - "electroniccats_bastwifi" + - "espressif_kaluga_1" - "espressif_saola_1_wroom" - "espressif_saola_1_wrover" + - "microdev_micro_s2" + - "muselab_nanoesp32_s2" + - "targett_module_clip_wroom" + - "targett_module_clip_wrover" - "unexpectedmaker_feathers2" + - "unexpectedmaker_feathers2_prerelease" steps: - name: Set up Python 3.8 @@ -423,6 +449,11 @@ jobs: with: path: ${{ github.workspace }}/.idf_tools key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20200801 + - name: Clone IDF submodules + run: | + (cd $IDF_PATH && git submodule update --init) + env: + IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf - name: Install IDF tools run: | $IDF_PATH/tools/idf_tools.py --non-interactive install required @@ -473,4 +504,4 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) + if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) \ No newline at end of file From 34ce8d8642d43397627e6001b221039d7190db5b Mon Sep 17 00:00:00 2001 From: Noel Gaetan Date: Wed, 28 Oct 2020 22:43:54 +0100 Subject: [PATCH 045/251] Update build.yml --- .github/workflows/build.yml | 47 +++++++------------------------------ 1 file changed, 8 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f61b60415..6619cbdf23 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: - name: CircuitPython version run: | git describe --dirty --tags - echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags) + echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)" - name: Set up Python 3.8 uses: actions/setup-python@v1 with: @@ -36,7 +36,7 @@ jobs: - name: Install deps run: | sudo apt-get install -y eatmydata - sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra + sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli - name: Versions run: | @@ -73,26 +73,17 @@ jobs: with: name: stubs path: circuitpython-stubs* - - name: Test Documentation Build (HTML) + - name: Docs run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html - uses: actions/upload-artifact@v2 with: name: docs path: _build/html - - name: Test Documentation Build (LaTeX/PDF) - run: | - make latexpdf - - uses: actions/upload-artifact@v2 - with: - name: docs - path: _build/latex - name: Translations run: make check-translate - name: New boards check run: python3 -u ci_new_boards_check.py working-directory: tools - - name: Duplicate USB VID/PID Check - run: python3 -u -m tools.ci_check_duplicate_usb_vid_pid - name: Build mpy-cross.static-raspbian run: make -C mpy-cross -j2 -f Makefile.static-raspbian - uses: actions/upload-artifact@v2 @@ -131,8 +122,8 @@ jobs: run: echo "$GITHUB_CONTEXT" - name: Install dependencies run: | - brew install gettext - echo >>$GITHUB_PATH /usr/local/opt/gettext/bin + brew install gettext awscli + echo "::set-env name=PATH::/usr/local/opt/gettext/bin:$PATH" - name: Versions run: | gcc --version @@ -146,7 +137,7 @@ jobs: - name: CircuitPython version run: | git describe --dirty --tags - echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags) + echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)" - name: Build mpy-cross run: make -C mpy-cross -j2 - uses: actions/upload-artifact@v2 @@ -180,8 +171,7 @@ jobs: - "arduino_nano_33_iot" - "arduino_zero" - "bast_pro_mini_m0" - - "bdmicro_vina_d21" - - "bdmicro_vina_d51" + - "bdmicro_vina_m0" - "bless_dev_board_multi_sensor" - "blm_badge" - "capablerobot_usbhub" @@ -199,8 +189,6 @@ jobs: - "datum_imu" - "datum_light" - "datum_weather" - - "dynossat_edu_eps" - - "dynossat_edu_obc" - "electronut_labs_blip" - "electronut_labs_papyr" - "escornabot_makech" @@ -214,7 +202,6 @@ jobs: - "feather_m0_rfm69" - "feather_m0_rfm9x" - "feather_m0_supersized" - - "feather_m4_can" - "feather_m4_express" - "feather_m7_1011" - "feather_mimxrt1011" @@ -241,13 +228,11 @@ jobs: - "makerdiary_nrf52840_m2_devkit" - "makerdiary_nrf52840_mdk" - "makerdiary_nrf52840_mdk_usb_dongle" - - "matrixportal_m4" - "meowbit_v121" - "meowmeow" - "metro_m0_express" - "metro_m4_airlift_lite" - "metro_m4_express" - - "metro_m7_1011" - "metro_nrf52840_express" - "mini_sam_m4" - "monster_m4sk" @@ -269,7 +254,6 @@ jobs: - "pca10100" - "pewpew10" - "pewpew_m4" - - "picoplanet" - "pirkey_m0" - "pitaya_go" - "pyb_nano_v2" @@ -283,8 +267,6 @@ jobs: - "pyportal" - "pyportal_titano" - "pyruler" - - "qtpy_m0" - - "qtpy_m0_haxpress" - "raytac_mdbt50q-db-40" - "robohatmm1_m4" - "sam32" @@ -419,17 +401,9 @@ jobs: fail-fast: false matrix: board: - - "adafruit_metro_esp32s2" - - "electroniccats_bastwifi" - - "espressif_kaluga_1" - "espressif_saola_1_wroom" - "espressif_saola_1_wrover" - - "microdev_micro_s2" - - "muselab_nanoesp32_s2" - - "targett_module_clip_wroom" - - "targett_module_clip_wrover" - "unexpectedmaker_feathers2" - - "unexpectedmaker_feathers2_prerelease" steps: - name: Set up Python 3.8 @@ -449,11 +423,6 @@ jobs: with: path: ${{ github.workspace }}/.idf_tools key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20200801 - - name: Clone IDF submodules - run: | - (cd $IDF_PATH && git submodule update --init) - env: - IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf - name: Install IDF tools run: | $IDF_PATH/tools/idf_tools.py --non-interactive install required @@ -504,4 +473,4 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) \ No newline at end of file + if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) From cbad75a7d2c2b997a7663f7793fe36cac82a9deb Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Wed, 28 Oct 2020 15:40:36 +0000 Subject: [PATCH 046/251] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (844 of 844 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 8696d7509a..7ad85e0b78 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-21 20:13-0500\n" -"PO-Revision-Date: 2020-10-27 21:01+0000\n" +"PO-Revision-Date: 2020-10-28 21:45+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -298,7 +298,7 @@ msgstr "O tipo do endereço está fora do alcance" #: ports/esp32s2/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" -msgstr "" +msgstr "Todos os periféricos CAN estão em uso" #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -426,7 +426,7 @@ msgstr "" #: ports/esp32s2/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" -msgstr "" +msgstr "O Baudrate não é suportado pelo periférico" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c @@ -2932,7 +2932,7 @@ msgstr "o long int não é suportado nesta compilação" #: ports/esp32s2/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" -msgstr "" +msgstr "o loopback + o modo silencioso não é suportado pelo periférico" #: py/parse.c msgid "malformed f-string" @@ -3555,12 +3555,12 @@ msgstr "a tupla/lista está com tamanho incorreto" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" -msgstr "" +msgstr "o twai_driver_install retornou um erro esp-idf #%d" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" -msgstr "" +msgstr "o twai_start retornou um erro esp-idf #%d" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c From a28755d53df963ad70cae62e526a3cb2f147851f Mon Sep 17 00:00:00 2001 From: hexthat Date: Wed, 28 Oct 2020 06:14:24 +0000 Subject: [PATCH 047/251] Translated using Weblate (Chinese (Pinyin)) Currently translated at 100.0% (844 of 844 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9b32993eb0..4cc86400d9 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-21 20:13-0500\n" -"PO-Revision-Date: 2020-10-22 20:48+0000\n" +"PO-Revision-Date: 2020-10-28 21:45+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -15,7 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.3.1\n" +"X-Generator: Weblate 4.3.2-dev\n" #: main.c msgid "" @@ -296,7 +296,7 @@ msgstr "Dìzhǐ lèixíng chāochū fànwéi" #: ports/esp32s2/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" -msgstr "" +msgstr "suǒ yǒu CAN wài shè dōu zài shǐ yòng zhōng" #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -422,7 +422,7 @@ msgstr "" #: ports/esp32s2/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" -msgstr "" +msgstr "wài shè bù zhī chí de bō tè lā tè" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c @@ -2895,7 +2895,7 @@ msgstr "cǐ bǎnběn bù zhīchí zhǎng zhěngshù" #: ports/esp32s2/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" -msgstr "" +msgstr "Wài shè bù zhī chí huán huí + jìng yīn mó shì" #: py/parse.c msgid "malformed f-string" @@ -2933,11 +2933,11 @@ msgstr "chāochū zuìdà dìguī shēndù" #: extmod/ulab/code/approx/approx.c msgid "maxiter must be > 0" -msgstr "" +msgstr "maxiter bì xū > 0" #: extmod/ulab/code/approx/approx.c msgid "maxiter should be > 0" -msgstr "" +msgstr "maxiter yìng wéi > 0" #: py/runtime.c #, c-format @@ -3377,7 +3377,7 @@ 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 "" +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)" @@ -3511,12 +3511,12 @@ msgstr "yuán zǔ/lièbiǎo chángdù cuòwù" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" -msgstr "" +msgstr "twai_driver_install fǎn huí esp-idf cuò wù #%d" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" -msgstr "" +msgstr "twai_start fǎn huí esp -idf cuò wù #%d" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c From e83be19d0f43d406c0968eb3903972cf127efb8d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 28 Oct 2020 17:48:12 -0500 Subject: [PATCH 048/251] actions: Fix location of stubs upload --- .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 0792d36a01..5092e48323 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -117,7 +117,7 @@ jobs: [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-amd64-linux-${{ env.CP_VERSION }} --no-progress --region us-east-1 [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static.exe s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-x64-windows-${{ env.CP_VERSION }}.exe --no-progress --region us-east-1 zip -9 circuitpython-stubs.CP_VERSION }}.zip stubs - [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/mpy-cross/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 + [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From 25bad660c6cfc0c697ad02da18d9b9e8c1d9053e Mon Sep 17 00:00:00 2001 From: lady ada Date: Wed, 28 Oct 2020 19:23:18 -0400 Subject: [PATCH 049/251] add light sensor, move batt monitor --- ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c index 2cf3d24029..65bc3fb53b 100644 --- a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c +++ b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c @@ -18,8 +18,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_BUTTON_C), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_BUTTON_D), MP_ROM_PTR(&pin_GPIO11) }, - { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, - { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_LIGHT), 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) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO34) }, From 59b9ca409cc6d1835567f866f9a96c04bc78d2c3 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 28 Oct 2020 20:33:10 -0400 Subject: [PATCH 050/251] matrixportal ESP TX and RX pins were swapped --- ports/atmel-samd/boards/matrixportal_m4/pins.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/matrixportal_m4/pins.c b/ports/atmel-samd/boards/matrixportal_m4/pins.c index 34865597b6..1f9956d9ec 100644 --- a/ports/atmel-samd/boards/matrixportal_m4/pins.c +++ b/ports/atmel-samd/boards/matrixportal_m4/pins.c @@ -16,8 +16,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY), MP_ROM_PTR(&pin_PA22) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_PA21) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RTS), MP_ROM_PTR(&pin_PA18) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PA12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PA13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PA13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PA12) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_PB30) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_PB31) }, From 7fd73c7d39399042ad6ed3bfe5b1c64da05c964e Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 28 Oct 2020 18:08:31 -0700 Subject: [PATCH 051/251] Initial UDP work. Need to test --- ports/esp32s2/common-hal/socketpool/Socket.c | 63 +++++++++- .../common-hal/socketpool/SocketPool.c | 7 +- shared-bindings/socketpool/Socket.c | 118 ++++++++---------- shared-bindings/socketpool/Socket.h | 4 + 4 files changed, 120 insertions(+), 72 deletions(-) diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index 0a994c604e..7f031521f7 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -121,16 +121,77 @@ mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, return received; } +mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t* self, + const char* host, size_t hostlen, uint8_t port, const uint8_t* buf, mp_uint_t len) { + + struct sockaddr_in dest_addr; + dest_addr.sin_addr.s_addr = inet_addr(HOST_IP_ADDR); + dest_addr.sin_family = AF_INET; + dest_addr.sin_port = htons(port); + + + const struct addrinfo hints = { + .ai_family = AF_INET, + .ai_socktype = SOCK_STREAM, + }; + struct addrinfo *res; + int err = getaddrinfo(host, NULL, &hints, &res); + if (err != 0 || res == NULL) { + return mp_const_none; + } + + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcast-align" + struct in_addr *addr = &((struct sockaddr_in *)res->ai_addr)->sin_addr; + #pragma GCC diagnostic pop + char ip_str[IP4ADDR_STRLEN_MAX]; + inet_ntoa_r(*addr, ip_str, IP4ADDR_STRLEN_MAX); + mp_obj_t ip_obj = mp_obj_new_str(ip_str, strlen(ip_str)); + freeaddrinfo(res); + + + + int err = lwip_sendto(self->num, buf, len, 0 /* flags */, + (struct sockaddr *)&dest_addr, sizeof(dest_addr)); +} + +mp_uint_t common_hal_socketpool_socket_recvfrom_into(socketpool_socket_obj_t* self, + const uint8_t* buf, mp_uint_t len, uint8_t* ip, uint8_t port) { + + const struct addrinfo hints = { + .ai_family = AF_INET, + .ai_socktype = SOCK_STREAM, + }; + struct addrinfo *res; + int err = getaddrinfo(host, NULL, &hints, &res); + if (err != 0 || res == NULL) { + return mp_const_none; + } + + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcast-align" + struct in_addr *addr = &((struct sockaddr_in *)res->ai_addr)->sin_addr; + #pragma GCC diagnostic pop + char ip_str[IP4ADDR_STRLEN_MAX]; + inet_ntoa_r(*addr, ip_str, IP4ADDR_STRLEN_MAX); + mp_obj_t ip_obj = mp_obj_new_str(ip_str, strlen(ip_str)); + freeaddrinfo(res); +} + void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self) { self->connected = false; if (self->tcp != NULL) { esp_tls_conn_destroy(self->tcp); self->tcp = NULL; } + if (self->num >= 0) { + lwip_shutdown(self->num, 0); + lwip_close(self->num); + } } bool common_hal_socketpool_socket_get_closed(socketpool_socket_obj_t* self) { - return self->tcp == NULL; + return self->tcp == NULL && self->num < 0; } diff --git a/ports/esp32s2/common-hal/socketpool/SocketPool.c b/ports/esp32s2/common-hal/socketpool/SocketPool.c index 1d4d04b034..3bec5f337f 100644 --- a/ports/esp32s2/common-hal/socketpool/SocketPool.c +++ b/ports/esp32s2/common-hal/socketpool/SocketPool.c @@ -61,15 +61,14 @@ socketpool_socket_obj_t* common_hal_socketpool_socket(socketpool_socketpool_obj_ socket_type = SOCK_RAW; } - if (socket_type == SOCK_DGRAM || socket_type == SOCK_RAW || - addr_family == AF_INET6 || ipproto == IPPROTO_IPV6) { - mp_raise_NotImplementedError(translate("Only IPv4 SOCK_STREAM sockets supported")); + if (addr_family == AF_INET6 || ipproto == IPPROTO_IPV6) { + mp_raise_NotImplementedError(translate("Only IPv4 sockets supported")); } int socknum = -1; esp_tls_t* tcp_handle = NULL; if (socket_type == SOCK_DGRAM || socket_type == SOCK_RAW) { - // socknum = lwip_socket(addr_family, socket_type, ipproto); + socknum = lwip_socket(addr_family, socket_type, ipproto); } else { tcp_handle = esp_tls_init(); diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index e7b31842d2..2e369d442b 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -274,79 +274,63 @@ STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket_recv_into_obj, 2, 3, socketpool_socket_recv_into); -// //| def sendto(self, bytes: ReadableBuffer, address: tuple) -> int: -// //| """Send some bytes to a specific address. -// //| Suits sockets of type SOCK_DGRAM -// //| -// //| :param ~bytes bytes: some bytes to send -// //| :param ~tuple address: tuple of (remote_address, remote_port)""" -// //| ... -// //| +//| def sendto(self, bytes: ReadableBuffer, address: tuple) -> int: +//| """Send some bytes to a specific address. +//| Suits sockets of type SOCK_DGRAM +//| +//| :param ~bytes bytes: some bytes to send +//| :param ~tuple address: tuple of (remote_address, remote_port)""" +//| ... +//| -// STATIC mp_obj_t socketpool_socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_in) { -// // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t socketpool_socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_in) { + socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); -// // // get the data -// // mp_buffer_info_t bufinfo; -// // mp_get_buffer_raise(data_in, &bufinfo, MP_BUFFER_READ); + // get the data + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(data_in, &bufinfo, MP_BUFFER_READ); -// // // get address -// // uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; -// // mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); + mp_obj_t *addr_items; + mp_obj_get_array_fixed_n(addr_in, 2, &addr_items); -// // // check if we need to select a NIC -// // socket_select_nic(self, ip); + size_t hostlen; + const char* host = mp_obj_str_get_data(addr_items[0], &hostlen); + mp_int_t port = mp_obj_get_int(addr_items[1]); -// // // call the NIC to sendto -// // int _errno; -// // mp_int_t ret = self->nic_type->sendto(self, bufinfo.buf, bufinfo.len, ip, port, &_errno); -// // if (ret == -1) { -// // mp_raise_OSError(_errno); -// // } -// mp_int_t ret = 0; + mp_int_t ret = common_hal_socketpool_socket_sendto(self, host, hostlen, port, bufinfo.buf, bufinfo.len); + if (!ok) { + mp_raise_OSError(0); + } -// return mp_obj_new_int(ret); -// } -// STATIC MP_DEFINE_CONST_FUN_OBJ_3(socketpool_socket_sendto_obj, socketpool_socket_sendto); + return mp_obj_new_int_from_uint(ret); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_3(socketpool_socket_sendto_obj, socketpool_socket_sendto); -// //| def recvfrom(self, bufsize: int) -> Tuple[bytes, tuple]: -// //| """Reads some bytes from the connected remote address. -// //| Suits sockets of type SOCK_STREAM -// //| -// //| Returns a tuple containing -// //| * a bytes() of length <= bufsize -// //| * a remote_address, which is a tuple of ip address and port number -// //| -// //| :param ~int bufsize: maximum number of bytes to receive""" -// //| ... -// //| +//| def recvfrom_into(self, buffer) -> Tuple[int, tuple]: +//| """Reads some bytes from a remote address. +//| +//| Returns a tuple containing +//| * the number of bytes received into the given buffer +//| * a remote_address, which is a tuple of ip address and port number +//| +//| :param object buffer: buffer to read into""" +//| ... +//| +STATIC mp_obj_t socketpool_socket_recvfrom_into(mp_obj_t self_in, mp_obj_t data_in) { + socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(data_in, &bufinfo, MP_BUFFER_WRITE); -// STATIC mp_obj_t socketpool_socket_recvfrom_into(mp_obj_t self_in, mp_obj_t len_in) { -// // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); -// // if (self->nic == MP_OBJ_NULL) { -// // // not connected -// // mp_raise_OSError(MP_ENOTCONN); -// // } -// // vstr_t vstr; -// // vstr_init_len(&vstr, mp_obj_get_int(len_in)); -// // byte ip[4]; -// // mp_uint_t port; -// // int _errno; -// // mp_int_t ret = self->nic_type->recvfrom(self, (byte*)vstr.buf, vstr.len, ip, &port, &_errno); -// // if (ret == -1) { -// // mp_raise_OSError(_errno); -// // } -// mp_obj_t tuple[2]; -// // if (ret == 0) { -// // tuple[0] = mp_const_empty_bytes; -// // } else { -// // vstr.len = ret; -// // tuple[0] = mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); -// // } -// // tuple[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); -// return mp_obj_new_tuple(2, tuple); -// } -// STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_recvfrom_into_obj, socketpool_socket_recvfrom_into); + byte ip[4]; + mp_uint_t port; + mp_int_t ret = common_hal_socketpool_socket_recvfrom_into(self, + (byte*)bufinfo.buf, len, ip, &port); + mp_obj_t tuple_contents[2]; + tuple_contents[0] = mp_obj_new_int_from_uint(ret); + tuple_contents[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); + return mp_obj_new_tuple(2, tuple); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_recvfrom_into_obj, socketpool_socket_recvfrom_into); // //| def setsockopt(self, level: int, optname: int, value: int) -> None: // //| """Sets socket options""" @@ -449,8 +433,8 @@ STATIC const mp_rom_map_elem_t socketpool_socket_locals_dict_table[] = { // { MP_ROM_QSTR(MP_QSTR_accept), MP_ROM_PTR(&socketpool_socket_accept_obj) }, { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&socketpool_socket_connect_obj) }, { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&socketpool_socket_send_obj) }, - // { MP_ROM_QSTR(MP_QSTR_sendto), MP_ROM_PTR(&socketpool_socket_sendto_obj) }, - // { MP_ROM_QSTR(MP_QSTR_recvfrom_into), MP_ROM_PTR(&socketpool_socket_recvfrom_into_obj) }, + { MP_ROM_QSTR(MP_QSTR_sendto), MP_ROM_PTR(&socketpool_socket_sendto_obj) }, + { MP_ROM_QSTR(MP_QSTR_recvfrom_into), MP_ROM_PTR(&socketpool_socket_recvfrom_into_obj) }, { MP_ROM_QSTR(MP_QSTR_recv_into), MP_ROM_PTR(&socketpool_socket_recv_into_obj) }, // { MP_ROM_QSTR(MP_QSTR_setsockopt), MP_ROM_PTR(&socketpool_socket_setsockopt_obj) }, { MP_ROM_QSTR(MP_QSTR_settimeout), MP_ROM_PTR(&socketpool_socket_settimeout_obj) }, diff --git a/shared-bindings/socketpool/Socket.h b/shared-bindings/socketpool/Socket.h index f0be95c925..72a4c9e3c3 100644 --- a/shared-bindings/socketpool/Socket.h +++ b/shared-bindings/socketpool/Socket.h @@ -35,6 +35,10 @@ void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t* self, mp_u bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const char* host, size_t hostlen, mp_int_t port); mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len); mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len); +mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t* self, + const uint8_t* host, size_t hostlen, uint8_t port, const uint8_t* buf, mp_uint_t len); +mp_uint_t common_hal_socketpool_socket_recvfrom_into(socketpool_socket_obj_t* self, + const uint8_t* buf, mp_uint_t len, uint8_t* ip, uint8_t port); void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self); bool common_hal_socketpool_socket_get_closed(socketpool_socket_obj_t* self); bool common_hal_socketpool_socket_get_connected(socketpool_socket_obj_t* self); From ad166ca479f405a9cb43fae9fe7b082d2e6ba19f Mon Sep 17 00:00:00 2001 From: sw23 Date: Thu, 29 Oct 2020 20:15:34 -0400 Subject: [PATCH 052/251] Fixing make stub warnings and mypy issuesmak --- shared-bindings/canio/CAN.c | 8 ++++---- shared-bindings/canio/Listener.c | 2 +- shared-bindings/canio/Match.c | 2 +- shared-bindings/canio/Message.c | 2 +- shared-bindings/canio/RemoteTransmissionRequest.c | 2 +- shared-bindings/displayio/Bitmap.c | 4 ++-- shared-bindings/displayio/Display.c | 2 +- shared-bindings/socketpool/Socket.c | 2 +- shared-bindings/socketpool/SocketPool.c | 2 +- shared-bindings/ssl/SSLContext.c | 2 +- shared-bindings/wifi/Radio.c | 4 ++-- tools/extract_pyi.py | 9 ++++++++- 12 files changed, 24 insertions(+), 17 deletions(-) diff --git a/shared-bindings/canio/CAN.c b/shared-bindings/canio/CAN.c index 4982a97b9d..13066764e3 100644 --- a/shared-bindings/canio/CAN.c +++ b/shared-bindings/canio/CAN.c @@ -49,7 +49,7 @@ //| loopback: bool = False, //| silent: bool = False, //| auto_restart: bool = False, -//| ): +//| ) -> None: //| """A common shared-bus protocol. The rx and tx pins are generally //| connected to a transceiver which controls the H and L pins on a //| shared bus. @@ -171,7 +171,7 @@ STATIC const mp_obj_property_t canio_can_receive_error_count_obj = { (mp_obj_t)mp_const_none}, }; -//| state: State +//| state: BusState //| """The current state of the bus. (read-only)""" STATIC mp_obj_t canio_can_state_get(mp_obj_t self_in) { canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -291,7 +291,7 @@ STATIC const mp_obj_property_t canio_can_loopback_obj = { }; -//| def send(message: Union[RemoteTransmissionRequest, Message]) -> None: +//| def send(self, message: Union[RemoteTransmissionRequest, Message]) -> None: //| """Send a message on the bus with the given data and id. //| If the message could not be sent due to a full fifo or a bus error condition, RuntimeError is raised. //| """ @@ -352,7 +352,7 @@ STATIC mp_obj_t canio_can_enter(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_can_enter_obj, canio_can_enter); -//| def __exit__(self, unused1, unused2, unused3) -> None: +//| def __exit__(self, unused1: Optional[Type[BaseException]], unused2: Optional[BaseException], unused3: Optional[TracebackType]) -> None: //| """Calls deinit()""" //| ... STATIC mp_obj_t canio_can_exit(size_t num_args, const mp_obj_t args[]) { diff --git a/shared-bindings/canio/Listener.c b/shared-bindings/canio/Listener.c index 93552af814..8a39f0f2ae 100644 --- a/shared-bindings/canio/Listener.c +++ b/shared-bindings/canio/Listener.c @@ -123,7 +123,7 @@ STATIC mp_obj_t canio_listener_enter(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_enter_obj, canio_listener_enter); -//| def __exit__(self, unused1, unused2, unused3) -> None: +//| def __exit__(self, unused1: Optional[Type[BaseException]], unused2: Optional[BaseException], unused3: Optional[TracebackType]) -> None: //| """Calls deinit()""" //| ... STATIC mp_obj_t canio_listener_exit(size_t num_args, const mp_obj_t args[]) { diff --git a/shared-bindings/canio/Match.c b/shared-bindings/canio/Match.c index 3fbc1773e8..6039631fad 100644 --- a/shared-bindings/canio/Match.c +++ b/shared-bindings/canio/Match.c @@ -33,7 +33,7 @@ //| """Describe CAN bus messages to match""" //| //| -//| def __init__(self, id: int, *, mask: Optional[int] = None, extended: bool = False): +//| def __init__(self, id: int, *, mask: Optional[int] = None, extended: bool = False) -> None: //| """Construct a Match with the given properties. //| //| If mask is not None, then the filter is for any id which matches all diff --git a/shared-bindings/canio/Message.c b/shared-bindings/canio/Message.c index e47e997c70..04fa8fc6c2 100644 --- a/shared-bindings/canio/Message.c +++ b/shared-bindings/canio/Message.c @@ -31,7 +31,7 @@ #include "py/runtime.h" //| class Message: -//| def __init__(self, id: int, data: bytes, *, extended: bool = False): +//| def __init__(self, id: int, data: bytes, *, extended: bool = False) -> None: //| """Construct a Message to send on a CAN bus. //| //| :param int id: The numeric ID of the message diff --git a/shared-bindings/canio/RemoteTransmissionRequest.c b/shared-bindings/canio/RemoteTransmissionRequest.c index d762787b18..fcd2590340 100644 --- a/shared-bindings/canio/RemoteTransmissionRequest.c +++ b/shared-bindings/canio/RemoteTransmissionRequest.c @@ -31,7 +31,7 @@ #include "py/runtime.h" //| class RemoteTransmissionRequest: -//| def __init__(self, id: int, length: int, *, extended: bool = False): +//| def __init__(self, id: int, length: int, *, extended: bool = False) -> None: //| """Construct a RemoteTransmissionRequest to send on a CAN bus. //| //| :param int id: The numeric ID of the requested message diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 5a2fc785f8..b9f06fe143 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -172,7 +172,7 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val return mp_const_none; } -//| def blit(self, x: int, y: int, source_bitmap: bitmap, *, x1: int, y1: int, x2: int, y2: int, skip_index: int) -> None: +//| def blit(self, x: int, y: int, source_bitmap: Bitmap, *, x1: int, y1: int, x2: int, y2: int, skip_index: int) -> None: //| """Inserts the source_bitmap region defined by rectangular boundaries //| (x1,y1) and (x2,y2) into the bitmap at the specified (x,y) location. //| @@ -274,7 +274,7 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_blit_obj, 4, displayio_bitmap_obj_blit); // `displayio_bitmap_obj_blit` requires at least 4 arguments -//| def fill(self, value: Any) -> None: +//| def fill(self, value: int) -> None: //| """Fills the bitmap with the supplied palette index value.""" //| ... //| diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index e78a893b01..1ed59f2331 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -39,7 +39,7 @@ #include "shared-module/displayio/__init__.h" #include "supervisor/shared/translate.h" -//| _DisplayBus = Union[FourWire, ParallelBus, I2CDisplay] +//| _DisplayBus = Union['FourWire', 'ParallelBus', 'I2CDisplay'] //| """:py:class:`FourWire`, :py:class:`ParallelBus` or :py:class:`I2CDisplay`""" //| diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index e7b31842d2..362e4d7e86 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -161,7 +161,7 @@ STATIC mp_obj_t socketpool_socket_close(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(socketpool_socket_close_obj, socketpool_socket_close); -//| def connect(self, address: tuple) -> None: +//| def connect(self, address: Tuple[str, int]) -> None: //| """Connect a socket to a remote address //| //| :param ~tuple address: tuple of (remote_address, remote_port)""" diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 527cf7e984..b737b5fc2d 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -82,7 +82,7 @@ STATIC mp_obj_t socketpool_socketpool_socket(size_t n_args, const mp_obj_t *pos_ } MP_DEFINE_CONST_FUN_OBJ_KW(socketpool_socketpool_socket_obj, 1, socketpool_socketpool_socket); -//| def getaddrinfo(host: str, port: int, family: int = 0, type: int = 0, proto: int = 0, flags: int = 0) -> tuple: +//| def getaddrinfo(host: str, port: int, family: int = 0, type: int = 0, proto: int = 0, flags: int = 0) -> Tuple[int, int, int, str, Tuple[str, int]]: //| """Gets the address information for a hostname and port //| //| Returns the appropriate family, socket type, socket protocol and diff --git a/shared-bindings/ssl/SSLContext.c b/shared-bindings/ssl/SSLContext.c index d2c236d3bf..9d4df72619 100644 --- a/shared-bindings/ssl/SSLContext.c +++ b/shared-bindings/ssl/SSLContext.c @@ -51,7 +51,7 @@ STATIC mp_obj_t ssl_sslcontext_make_new(const mp_obj_type_t *type, size_t n_args return MP_OBJ_FROM_PTR(s); } -//| def wrap_socket(sock: socketpool.Socket, *, server_side: bool = False, server_hostname: str = None) -> socketpool.Socket: +//| def wrap_socket(sock: socketpool.Socket, *, server_side: bool = False, server_hostname: Optional[str] = None) -> socketpool.Socket: //| """Wraps the socket into a socket-compatible class that handles SSL negotiation. //| The socket must be of type SOCK_STREAM.""" //| ... diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index a274c437e0..a56ca5aaa6 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -79,7 +79,7 @@ const mp_obj_property_t wifi_radio_mac_address_obj = { }; -//| def start_scanning_networks(self, *, start_channel=1, stop_channel=11) -> Iterable[Network]: +//| def start_scanning_networks(self, *, start_channel: int = 1, stop_channel: int = 11) -> Iterable[Network]: //| """Scans for available wifi networks over the given channel range. Make sure the channels are allowed in your country.""" //| ... //| @@ -283,7 +283,7 @@ const mp_obj_property_t wifi_radio_ap_info_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| def ping(self, ip, *, timeout: float = 0.5) -> float: +//| def ping(self, ip: wifi.Radio, *, timeout: float = 0.5) -> float: //| """Ping an IP to test connectivity. Returns echo time in seconds. //| Returns None when it times out.""" //| ... diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 651216e11a..b7ce584a1e 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -17,7 +17,8 @@ import black IMPORTS_IGNORE = frozenset({'int', 'float', 'bool', 'str', 'bytes', 'tuple', 'list', 'set', 'dict', 'bytearray', 'slice', 'file', 'buffer', 'range', 'array', 'struct_time'}) -IMPORTS_TYPING = frozenset({'Any', 'Optional', 'Union', 'Tuple', 'List', 'Sequence', 'NamedTuple', 'Iterable', 'Iterator', 'Callable', 'AnyStr', 'overload'}) +IMPORTS_TYPING = frozenset({'Any', 'Optional', 'Union', 'Tuple', 'List', 'Sequence', 'NamedTuple', 'Iterable', 'Iterator', 'Callable', 'AnyStr', 'overload', 'Type'}) +IMPORTS_TYPES = frozenset({'TracebackType'}) CPY_TYPING = frozenset({'ReadableBuffer', 'WriteableBuffer', 'AudioSample', 'FrameBuffer'}) @@ -63,6 +64,7 @@ def find_stub_issues(tree): def extract_imports(tree): modules = set() typing = set() + types = set() cpy_typing = set() def collect_annotations(anno_tree): @@ -74,6 +76,8 @@ def extract_imports(tree): continue elif node.id in IMPORTS_TYPING: typing.add(node.id) + elif node.id in IMPORTS_TYPES: + types.add(node.id) elif node.id in CPY_TYPING: cpy_typing.add(node.id) elif isinstance(node, ast.Attribute): @@ -94,6 +98,7 @@ def extract_imports(tree): return { "modules": sorted(modules), "typing": sorted(typing), + "types": sorted(types), "cpy_typing": sorted(cpy_typing), } @@ -181,6 +186,8 @@ def convert_folder(top_level, stub_directory): # Add import statements imports = extract_imports(tree) import_lines = ["from __future__ import annotations"] + if imports["types"]: + import_lines.append("from types import " + ", ".join(imports["types"])) if imports["typing"]: import_lines.append("from typing import " + ", ".join(imports["typing"])) if imports["cpy_typing"]: From 9f3a1fe27b9f29771b87a4d5eb1914075d2b1e3a Mon Sep 17 00:00:00 2001 From: sw23 Date: Fri, 30 Oct 2020 01:29:58 -0400 Subject: [PATCH 053/251] Fixing stub for wifi_radio_ping --- shared-bindings/wifi/Radio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index a56ca5aaa6..e81e8793c4 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -283,7 +283,7 @@ const mp_obj_property_t wifi_radio_ap_info_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| def ping(self, ip: wifi.Radio, *, timeout: float = 0.5) -> float: +//| def ping(self, ip: ipaddress.IPv4Address, *, timeout: Optional[float] = 0.5) -> float: //| """Ping an IP to test connectivity. Returns echo time in seconds. //| Returns None when it times out.""" //| ... From 6a63d20a5d2e7184bfc5747b465818fb7eee6b49 Mon Sep 17 00:00:00 2001 From: sw23 Date: Fri, 30 Oct 2020 18:56:40 -0400 Subject: [PATCH 054/251] Fixing remaining stub mypy issues + run check-stubs to CI --- .github/workflows/build.yml | 2 +- shared-bindings/ipaddress/IPv4Address.c | 2 +- shared-bindings/socketpool/SocketPool.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64d43f4d98..8039883e34 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,7 +68,7 @@ jobs: run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float working-directory: tests - name: Stubs - run: make stubs -j2 + run: make check-stubs -j2 - uses: actions/upload-artifact@v2 with: name: stubs diff --git a/shared-bindings/ipaddress/IPv4Address.c b/shared-bindings/ipaddress/IPv4Address.c index b2a10158ae..e027f32d65 100644 --- a/shared-bindings/ipaddress/IPv4Address.c +++ b/shared-bindings/ipaddress/IPv4Address.c @@ -126,7 +126,7 @@ const mp_obj_property_t ipaddress_ipv4address_version_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def __eq__(self, other: IPv4Address) -> bool: +//| def __eq__(self, other: object) -> bool: //| """Two Address objects are equal if their addresses and address types are equal.""" //| ... //| diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index b737b5fc2d..0cead525f8 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -58,7 +58,7 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t } -//| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> None: +//| def socket(self, family: int, type: int, proto: int) -> socketpool.Socket: //| """Create a new socket //| //| :param ~int family: AF_INET or AF_INET6 From 8e72b68e3de90f87261ce289dd7d3a28815cfd0b Mon Sep 17 00:00:00 2001 From: sw23 Date: Fri, 30 Oct 2020 19:16:26 -0400 Subject: [PATCH 055/251] Adding mypy to dep list and clarifying Stubs stage name --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8039883e34..07db88963b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: run: | sudo apt-get install -y eatmydata sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra - pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli + pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli mypy - name: Versions run: | gcc --version @@ -67,7 +67,7 @@ jobs: - name: mpy Tests run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float working-directory: tests - - name: Stubs + - name: Build and Validate Stubs run: make check-stubs -j2 - uses: actions/upload-artifact@v2 with: From 345d84ffde527b16f50c203f7b6a718886be34f6 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 30 Oct 2020 22:16:12 -0400 Subject: [PATCH 056/251] improve USB CDC disconnect/reconnect checking --- supervisor/serial.h | 1 - supervisor/shared/serial.c | 6 +++--- supervisor/shared/usb/usb.c | 3 --- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/supervisor/serial.h b/supervisor/serial.h index 9c2d44737a..066886303e 100644 --- a/supervisor/serial.h +++ b/supervisor/serial.h @@ -47,5 +47,4 @@ char serial_read(void); bool serial_bytes_available(void); bool serial_connected(void); -extern volatile bool _serial_connected; #endif // MICROPY_INCLUDED_SUPERVISOR_SERIAL_H diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index 91e90671d2..7383cc2282 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -47,8 +47,6 @@ busio_uart_obj_t debug_uart; byte buf_array[64]; #endif -volatile bool _serial_connected; - void serial_early_init(void) { #if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX) debug_uart.base.type = &busio_uart_type; @@ -71,7 +69,9 @@ bool serial_connected(void) { #if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX) return true; #else - return _serial_connected; + // True if DTR is asserted, and the USB connection is up. + // tud_cdc_get_line_state(): bit 0 is DTR, bit 1 is RTS + return (tud_cdc_get_line_state() & 1) && tud_ready(); #endif } diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index 89fbf56f37..93d3436e9d 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -116,7 +116,6 @@ void tud_umount_cb(void) { // remote_wakeup_en : if host allows us to perform remote wakeup // USB Specs: Within 7ms, device must draw an average current less than 2.5 mA from bus void tud_suspend_cb(bool remote_wakeup_en) { - _serial_connected = false; } // Invoked when usb bus is resumed @@ -128,8 +127,6 @@ void tud_resume_cb(void) { void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) { (void) itf; // interface ID, not used - _serial_connected = dtr; - // DTR = false is counted as disconnected if ( !dtr ) { From 1f179b331750fbe05ccb4caff44e985234c9ee71 Mon Sep 17 00:00:00 2001 From: sw23 Date: Fri, 30 Oct 2020 23:19:27 -0400 Subject: [PATCH 057/251] Adding socket and socketpool class attributes --- shared-bindings/socket/__init__.c | 15 ++++++++------- shared-bindings/socketpool/SocketPool.c | 11 +++++++++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 38840da5ea..2969b37149 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -49,7 +49,14 @@ STATIC const mp_obj_type_t socket_type; //| class socket: //| -//| def __init__(self, family: int, type: int, proto: int) -> None: +//| AF_INET = 2 +//| AF_INET6 = 10 +//| SOCK_STREAM = 1 +//| SOCK_DGRAM = 2 +//| SOCK_RAW = 3 +//| IPPROTO_TCP = 6 +//| +//| def __init__(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> None: //| """Create a new socket //| //| :param int family: AF_INET or AF_INET6 @@ -57,12 +64,6 @@ STATIC const mp_obj_type_t socket_type; //| :param int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)""" //| ... //| -//| AF_INET: int -//| AF_INET6: int -//| SOCK_STREAM: int -//| SOCK_DGRAM: int -//| SOCK_RAW: int -//| STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 0, 4, false); diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 0cead525f8..2234f359ef 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -57,8 +57,14 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(s); } - -//| def socket(self, family: int, type: int, proto: int) -> socketpool.Socket: +//| AF_INET = 0 +//| AF_INET6 = 1 +//| SOCK_STREAM = 0 +//| SOCK_DGRAM = 1 +//| SOCK_RAW = 2 +//| IPPROTO_TCP = 6 +//| +//| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> socketpool.Socket: //| """Create a new socket //| //| :param ~int family: AF_INET or AF_INET6 @@ -66,6 +72,7 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t //| :param ~int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)""" //| ... //| + STATIC mp_obj_t socketpool_socketpool_socket(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 0, 5, false); From a7616808e951b52e2ced08a7a279a224490ae404 Mon Sep 17 00:00:00 2001 From: "ITACA Innovation S.R.L" <40298126+ITACAInnovation@users.noreply.github.com> Date: Sat, 31 Oct 2020 10:12:49 +0100 Subject: [PATCH 058/251] Updated pinout --- ports/atmel-samd/boards/uchip/pins.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/ports/atmel-samd/boards/uchip/pins.c b/ports/atmel-samd/boards/uchip/pins.c index 856a220742..cfb6432336 100644 --- a/ports/atmel-samd/boards/uchip/pins.c +++ b/ports/atmel-samd/boards/uchip/pins.c @@ -1,14 +1,15 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA10) }, @@ -19,8 +20,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA23) }, - { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA31) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA30) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA03) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, From 9a8484b853116e6f95f50da6d3bc66323d55ca9f Mon Sep 17 00:00:00 2001 From: "ITACA Innovation S.R.L" <40298126+ITACAInnovation@users.noreply.github.com> Date: Sat, 31 Oct 2020 11:06:56 +0100 Subject: [PATCH 059/251] Update mpconfigboard.h Removed ignore PA30 PA31 in order to allow using them as pinout --- ports/atmel-samd/boards/uchip/mpconfigboard.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.h b/ports/atmel-samd/boards/uchip/mpconfigboard.h index 1877a41ef9..5d6af4b782 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.h +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.h @@ -16,8 +16,6 @@ #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 From 80ad300cad64a7da77d9292dbe5d2b81e458d5dc Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 31 Oct 2020 11:58:28 -0500 Subject: [PATCH 060/251] workflows: Fix typo that broke builds while trying to upload stubs --- .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 64d43f4d98..00db4f8cde 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,7 +116,7 @@ jobs: [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static-raspbian s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-raspbian-${{ env.CP_VERSION }} --no-progress --region us-east-1 [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-amd64-linux-${{ env.CP_VERSION }} --no-progress --region us-east-1 [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static.exe s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-x64-windows-${{ env.CP_VERSION }}.exe --no-progress --region us-east-1 - zip -9 circuitpython-stubs.CP_VERSION }}.zip stubs + zip -9 circuitpython-stubs.${{ env.CP_VERSION }}.zip stubs [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 0c30a26c9bcdfe537262d4ad3ea62b7eaba0c7b8 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 31 Oct 2020 13:19:13 -0400 Subject: [PATCH 061/251] Update .github/workflows/build.yml --- .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 00db4f8cde..36bf136d4d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,7 +116,7 @@ jobs: [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static-raspbian s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-raspbian-${{ env.CP_VERSION }} --no-progress --region us-east-1 [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-amd64-linux-${{ env.CP_VERSION }} --no-progress --region us-east-1 [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static.exe s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-x64-windows-${{ env.CP_VERSION }}.exe --no-progress --region us-east-1 - zip -9 circuitpython-stubs.${{ env.CP_VERSION }}.zip stubs + zip -9 circuitpython-stubs.zip stubs [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 073dc8751c92d943897db9e68b617fe7ba358f00 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 31 Oct 2020 14:50:13 -0400 Subject: [PATCH 062/251] Use correct stubs directory name The stubs directory is called `circuitpython-stubs`, not `stubs`. --- .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 36bf136d4d..514fa82da2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,7 +116,7 @@ jobs: [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static-raspbian s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-raspbian-${{ env.CP_VERSION }} --no-progress --region us-east-1 [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-amd64-linux-${{ env.CP_VERSION }} --no-progress --region us-east-1 [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static.exe s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-x64-windows-${{ env.CP_VERSION }}.exe --no-progress --region us-east-1 - zip -9 circuitpython-stubs.zip stubs + zip -9 circuitpython-stubs.zip circuitpython-stubs [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 3845db4bb98dbfa0b35b11baaa5d62f9f4266dea Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 31 Oct 2020 20:13:51 -0500 Subject: [PATCH 063/251] Update build.yml Need to request zip to recurse, because it is not the default --- .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 514fa82da2..b6c80558eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,7 +116,7 @@ jobs: [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static-raspbian s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-raspbian-${{ env.CP_VERSION }} --no-progress --region us-east-1 [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-amd64-linux-${{ env.CP_VERSION }} --no-progress --region us-east-1 [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static.exe s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-x64-windows-${{ env.CP_VERSION }}.exe --no-progress --region us-east-1 - zip -9 circuitpython-stubs.zip circuitpython-stubs + zip -9r circuitpython-stubs.zip circuitpython-stubs [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 1762a36438f7b54536186ab4d3bb11ef77553168 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Sun, 1 Nov 2020 05:46:13 -0500 Subject: [PATCH 064/251] restore analogio to feather_m0_rfm9x/rfm69 builds --- ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index c33ab07400..d746cdf811 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -12,7 +12,7 @@ CIRCUITPY_FULL_BUILD = 0 # A number of modules are removed for RFM69 to make room for frozen libraries. # Many I/O functions are not available. -CIRCUITPY_ANALOGIO = 0 +CIRCUITPY_ANALOGIO = 1 CIRCUITPY_PULSEIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 1 CIRCUITPY_ROTARYIO = 0 diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index 49b0ef5e36..d373346889 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -13,7 +13,7 @@ CIRCUITPY_FULL_BUILD = 0 # A number of modules are removed for RFM9x to make room for frozen libraries. # Many I/O functions are not available. -CIRCUITPY_ANALOGIO = 0 +CIRCUITPY_ANALOGIO = 1 CIRCUITPY_PULSEIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 1 CIRCUITPY_ROTARYIO = 0 From 4438050f794edea5c6a3f919964908800dd6b522 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sun, 1 Nov 2020 18:00:07 +0530 Subject: [PATCH 065/251] Add pcnt handler --- locale/circuitpython.pot | 9 ++- ports/esp32s2/Makefile | 1 + ports/esp32s2/common-hal/countio/Counter.c | 70 ++++++++++++---------- ports/esp32s2/common-hal/countio/Counter.h | 31 +++++++++- ports/esp32s2/pcnt_handler.c | 67 +++++++++++++++++++++ ports/esp32s2/pcnt_handler.h | 35 +++++++++++ 6 files changed, 177 insertions(+), 36 deletions(-) create mode 100644 ports/esp32s2/pcnt_handler.c create mode 100644 ports/esp32s2/pcnt_handler.h diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 16c3dd973a..1336ab25cd 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-01 11:11+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1109,7 +1109,8 @@ msgid "Invalid phase" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" @@ -1271,6 +1272,10 @@ msgstr "" msgid "No MOSI Pin" msgstr "" +#: ports/esp32s2/pcnt_handler.c +msgid "No PCNT unit free" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 8d891edd02..6dbbf58d4d 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -173,6 +173,7 @@ SRC_C += \ background.c \ fatfs_port.c \ mphalport.c \ + pcnt_handler.c \ bindings/espidf/__init__.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ diff --git a/ports/esp32s2/common-hal/countio/Counter.c b/ports/esp32s2/common-hal/countio/Counter.c index 6a76a163d7..4357624733 100644 --- a/ports/esp32s2/common-hal/countio/Counter.c +++ b/ports/esp32s2/common-hal/countio/Counter.c @@ -1,67 +1,75 @@ +/* + * 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/countio/Counter.h" +#include "common-hal/microcontroller/Pin.h" -#include "py/runtime.h" -#include "supervisor/shared/translate.h" +void common_hal_countio_counter_construct(countio_counter_obj_t* self, + const mcu_pin_obj_t* pin) { + claim_pin(pin); -#include "driver/pcnt.h" - -static void pcnt_init(countio_counter_obj_t* self) { - int unit = PCNT_UNIT_0; // Prepare configuration for the PCNT unit pcnt_config_t pcnt_config = { // Set PCNT input signal and control GPIOs - .pulse_gpio_num = self->pin->number, + .pulse_gpio_num = pin->number, .ctrl_gpio_num = PCNT_PIN_NOT_USED, .channel = PCNT_CHANNEL_0, - .unit = unit, // What to do on the positive / negative edge of pulse input? .pos_mode = PCNT_COUNT_INC, // Count up on the positive edge .neg_mode = PCNT_COUNT_DIS, // Keep the counter value on the negative edge }; // Initialize PCNT unit - pcnt_unit_config(&pcnt_config); + pcnt_handler_init(&pcnt_config); - // Configure and enable the input filter - pcnt_set_filter_value(unit, 100); - pcnt_filter_enable(unit); - - // Initialize PCNT's counter - pcnt_counter_pause(unit); - pcnt_counter_clear(unit); - - // Everything is set up, now go to counting - pcnt_counter_resume(unit); -} - -void common_hal_countio_counter_construct(countio_counter_obj_t* self, - const mcu_pin_obj_t* pin) { - claim_pin(pin); - self->pin = pin; - pcnt_init(self); + self->pin = pin->number; + self->unit = pcnt_config.unit; } bool common_hal_countio_counter_deinited(countio_counter_obj_t* self) { - return self->pin == NULL; + return self->unit == PCNT_UNIT_MAX; } void common_hal_countio_counter_deinit(countio_counter_obj_t* self) { if (common_hal_countio_counter_deinited(self)) { return; } - reset_pin_number(self->pin->number); - self->pin = NULL; + reset_pin_number(self->pin); + pcnt_handler_deinit(&self->unit); } mp_int_t common_hal_countio_counter_get_count(countio_counter_obj_t* self) { int16_t count; - pcnt_get_counter_value(PCNT_UNIT_0, &count); + pcnt_get_counter_value(self->unit, &count); return count+self->count; } void common_hal_countio_counter_set_count(countio_counter_obj_t* self, mp_int_t new_count) { self->count = new_count; - pcnt_counter_clear(PCNT_UNIT_0); + pcnt_counter_clear(self->unit); } void common_hal_countio_counter_reset(countio_counter_obj_t* self) { diff --git a/ports/esp32s2/common-hal/countio/Counter.h b/ports/esp32s2/common-hal/countio/Counter.h index 3406f9daaf..63d1eb98b2 100644 --- a/ports/esp32s2/common-hal/countio/Counter.h +++ b/ports/esp32s2/common-hal/countio/Counter.h @@ -1,15 +1,40 @@ +/* + * 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_COUNTIO_COUNTER_H #define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNTER_H -#include "common-hal/microcontroller/Pin.h" - #include "py/obj.h" +#include "pcnt_handler.h" typedef struct { mp_obj_base_t base; - const mcu_pin_obj_t * pin; + uint8_t pin; mp_int_t count; + pcnt_unit_t unit; } countio_counter_obj_t; #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNT_H diff --git a/ports/esp32s2/pcnt_handler.c b/ports/esp32s2/pcnt_handler.c new file mode 100644 index 0000000000..56fb0f21c8 --- /dev/null +++ b/ports/esp32s2/pcnt_handler.c @@ -0,0 +1,67 @@ +/* + * 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 "pcnt_handler.h" + +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#define PCNT_UNIT_ACTIVE 1 +#define PCNT_UNIT_INACTIVE 0 + +static uint8_t pcnt_state[4]; + +void pcnt_handler_init(pcnt_config_t* pcnt_config) { + // Look for available pcnt unit + for (uint8_t i = 0; i<=3; i++) { + if (pcnt_state[i] == PCNT_UNIT_INACTIVE) { + pcnt_config->unit = (pcnt_unit_t)i; + pcnt_state[i] = PCNT_UNIT_ACTIVE; + break; + } else if (i == 3) { + mp_raise_RuntimeError(translate("No PCNT unit free")); + } + } + + // Initialize PCNT unit + pcnt_unit_config(pcnt_config); + + // Configure and enable the input filter + pcnt_set_filter_value(pcnt_config->unit, 100); + pcnt_filter_enable(pcnt_config->unit); + + // Initialize PCNT's counter + pcnt_counter_pause(pcnt_config->unit); + pcnt_counter_clear(pcnt_config->unit); + + // Everything is set up, now go to counting + pcnt_counter_resume(pcnt_config->unit); +} + +void pcnt_handler_deinit(pcnt_unit_t* unit) { + pcnt_state[*unit] = PCNT_UNIT_INACTIVE; + *unit = PCNT_UNIT_MAX; +} diff --git a/ports/esp32s2/pcnt_handler.h b/ports/esp32s2/pcnt_handler.h new file mode 100644 index 0000000000..4bdaee1b87 --- /dev/null +++ b/ports/esp32s2/pcnt_handler.h @@ -0,0 +1,35 @@ +/* + * 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_PCNT_HANDLER_H +#define MICROPY_INCLUDED_ESP32S2_PCNT_HANDLER_H + +#include "driver/pcnt.h" + +extern void pcnt_handler_init(pcnt_config_t* pcnt_config); +extern void pcnt_handler_deinit(pcnt_unit_t* unit); + +#endif // MICROPY_INCLUDED_ESP32S2_PCNT_HANDLER_H From 856a6d4558d594e690a9e39ba841ef086c37ed9f Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Sat, 31 Oct 2020 15:51:35 +0000 Subject: [PATCH 066/251] Translated using Weblate (Spanish) Currently translated at 99.2% (838 of 844 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/es.po b/locale/es.po index 348af34067..a750c80554 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-21 20:13-0500\n" -"PO-Revision-Date: 2020-10-27 21:01+0000\n" -"Last-Translator: Adolfo Jayme Barrientos \n" +"PO-Revision-Date: 2020-11-01 16:26+0000\n" +"Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" @@ -297,7 +297,7 @@ msgstr "Tipo de dirección fuera de rango" #: ports/esp32s2/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" -msgstr "" +msgstr "Todos los periféricos CAN están en uso" #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -427,7 +427,7 @@ msgstr "" #: ports/esp32s2/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" -msgstr "" +msgstr "El periférico no maneja el Baudrate" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c From 7a07e8fa32de376c2f523b6c7d13e1b473198423 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Fri, 30 Oct 2020 21:04:56 +0000 Subject: [PATCH 067/251] Translated using Weblate (Swedish) Currently translated at 100.0% (844 of 844 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 53ed60acae..65cd9f6f1f 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-10-21 20:13-0500\n" -"PO-Revision-Date: 2020-10-26 02:36+0000\n" +"PO-Revision-Date: 2020-11-01 16:26+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -294,7 +294,7 @@ msgstr "Adresstyp utanför intervallet" #: ports/esp32s2/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" -msgstr "" +msgstr "All I2C-kringutrustning används" #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -420,7 +420,7 @@ msgstr "" #: ports/esp32s2/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" -msgstr "" +msgstr "Baudrate stöds inte av kringutrustning" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c @@ -2905,7 +2905,7 @@ msgstr "long int stöds inte i denna build" #: ports/esp32s2/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" -msgstr "" +msgstr "loopback + tyst läge stöds inte av kringutrustning" #: py/parse.c msgid "malformed f-string" @@ -2943,11 +2943,11 @@ msgstr "maximal rekursionsdjup överskriden" #: extmod/ulab/code/approx/approx.c msgid "maxiter must be > 0" -msgstr "" +msgstr "maxiter måste vara > 0" #: extmod/ulab/code/approx/approx.c msgid "maxiter should be > 0" -msgstr "" +msgstr "maxiter bör vara > 0" #: py/runtime.c #, c-format @@ -3388,7 +3388,7 @@ msgstr "argumentet sort måste vara en ndarray" #: extmod/ulab/code/numerical/numerical.c msgid "sorted axis can't be longer than 65535" -msgstr "" +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)" @@ -3522,12 +3522,12 @@ msgstr "tupel/lista har fel längd" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" -msgstr "" +msgstr "twai_driver_install returnerade esp-idf-fel #%d" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" -msgstr "" +msgstr "twai_start returnerade esp-idf-fel #%d" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c From 72b829dff02cb9b8ebe6e2b47354f06650dbe864 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 1 Nov 2020 14:52:03 -0500 Subject: [PATCH 068/251] add binascii to most builds --- ports/atmel-samd/mpconfigport.h | 1 + py/circuitpy_mpconfig.h | 10 ++++++++++ py/objmodule.c | 7 ++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index f7ccff4da2..ed10da9b9d 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -47,6 +47,7 @@ // MICROPY_PY_UJSON depends on MICROPY_PY_IO #define MICROPY_PY_IO (0) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (0) +#define MICROPY_PY_UBINASCII (0) #define MICROPY_PY_UJSON (0) #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0) #define MICROPY_PY_UERRNO_LIST \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 1e01bd9c5e..08efabddb5 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -197,6 +197,9 @@ typedef long mp_off_t; #ifndef MICROPY_PY_COLLECTIONS_ORDEREDDICT #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (CIRCUITPY_FULL_BUILD) #endif +#ifndef MICROPY_PY_UBINASCII +#define MICROPY_PY_UBINASCII (CIRCUITPY_FULL_BUILD) +#endif // Opposite setting is deliberate. #define MICROPY_PY_UERRNO_ERRORCODE (!CIRCUITPY_FULL_BUILD) #ifndef MICROPY_PY_URE @@ -699,6 +702,12 @@ extern const struct _mp_obj_module_t ustack_module; #endif // These modules are not yet in shared-bindings, but we prefer the non-uxxx names. +#if MICROPY_PY_UBINASCII +#define BINASCII_MODULE { MP_ROM_QSTR(MP_QSTR_binascii), MP_ROM_PTR(&mp_module_ubinascii) }, +#else +#define BINASCII_MODULE +#endif + #if MICROPY_PY_UERRNO #define ERRNO_MODULE { MP_ROM_QSTR(MP_QSTR_errno), MP_ROM_PTR(&mp_module_uerrno) }, #else @@ -770,6 +779,7 @@ extern const struct _mp_obj_module_t wifi_module; AUDIOMIXER_MODULE \ AUDIOMP3_MODULE \ AUDIOPWMIO_MODULE \ + BINASCII_MODULE \ BITBANGIO_MODULE \ BLEIO_MODULE \ BOARD_MODULE \ diff --git a/py/objmodule.c b/py/objmodule.c index 757aece046..90796c5357 100644 --- a/py/objmodule.c +++ b/py/objmodule.c @@ -239,7 +239,12 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = { { MP_ROM_QSTR(MP_QSTR_hashlib), MP_ROM_PTR(&mp_module_uhashlib) }, #endif #if MICROPY_PY_UBINASCII - { MP_ROM_QSTR(MP_QSTR_binascii), MP_ROM_PTR(&mp_module_ubinascii) }, +#if CIRCUITPY +// CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here. +// TODO: move to shared-bindings/ +#else + { MP_ROM_QSTR(MP_QSTR_ubinascii), MP_ROM_PTR(&mp_module_ubinascii) }, +#endif #endif #if MICROPY_PY_URANDOM { MP_ROM_QSTR(MP_QSTR_urandom), MP_ROM_PTR(&mp_module_urandom) }, From 4e52757f2653b16b91856df7575ec503c02c5d22 Mon Sep 17 00:00:00 2001 From: "ITACA Innovation S.R.L" <40298126+ITACAInnovation@users.noreply.github.com> Date: Sun, 1 Nov 2020 22:22:55 +0100 Subject: [PATCH 069/251] Update pins.c Added LED, BOOST_EN and VEXT_SELECT pins. --- ports/atmel-samd/boards/uchip/pins.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/atmel-samd/boards/uchip/pins.c b/ports/atmel-samd/boards/uchip/pins.c index cfb6432336..2d7eeebe11 100644 --- a/ports/atmel-samd/boards/uchip/pins.c +++ b/ports/atmel-samd/boards/uchip/pins.c @@ -1,6 +1,9 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_LED_BUILTIN), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_BOOST_EN), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_VEXT_SELECT), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA08) }, From 041c2a9f6174996a7c841e4ff7a1e158958c9745 Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Mon, 2 Nov 2020 08:35:25 -0500 Subject: [PATCH 070/251] .../boards/bdmicro_vina_d51: PAD updates for better resource flexibility. --- .../boards/bdmicro_vina_d51/mpconfigboard.h | 10 +- .../atmel-samd/boards/bdmicro_vina_d51/pins.c | 118 ++++++++++-------- 2 files changed, 68 insertions(+), 60 deletions(-) diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h index 6bc9bb7063..8b015df05e 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h @@ -12,14 +12,14 @@ #define BOARD_HAS_CRYSTAL 1 -#define DEFAULT_I2C_BUS_SDA (&pin_PB02) -#define DEFAULT_I2C_BUS_SCL (&pin_PB03) +#define DEFAULT_I2C_BUS_SCL (&pin_PA16) +#define DEFAULT_I2C_BUS_SDA (&pin_PA17) +#define DEFAULT_UART_BUS_RX (&pin_PB20) +#define DEFAULT_UART_BUS_TX (&pin_PB21) #define DEFAULT_SPI_BUS_MISO (&pin_PB23) -#define DEFAULT_UART_BUS_TX (&pin_PB24) -#define DEFAULT_UART_BUS_RX (&pin_PB25) #define DEFAULT_SPI_BUS_MOSI (&pin_PC27) #define DEFAULT_SPI_BUS_SCK (&pin_PC28) -#define MICROPY_HW_LED_STATUS (&pin_PA15) +#define MICROPY_HW_LED_STATUS (&pin_PA23) #define MICROPY_HW_LED_RX (&pin_PC05) #define MICROPY_HW_LED_TX (&pin_PC06) diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c b/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c index 931e0328fc..8eeab8a9a5 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c @@ -1,64 +1,70 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PC00) }, - { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PC01) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PC10) }, - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PC11) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB15) }, - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PC20) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PC21) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA12) }, - { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB31) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA16) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB31) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PC16) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PC17) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PC18) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PC19) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PC20) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PC21) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB18) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PB19) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PC12) }, { MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_ESP01_EN), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_ESP01_EN), MP_ROM_PTR(&pin_PC15) }, + { MP_ROM_QSTR(MP_QSTR_E5), MP_ROM_PTR(&pin_PC15) }, { MP_ROM_QSTR(MP_QSTR_ESP01_GPIO0), MP_ROM_PTR(&pin_PA18) }, - { MP_ROM_QSTR(MP_QSTR_UART3_RTS), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_E3), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_ESP01_GPIO2), MP_ROM_PTR(&pin_PA19) }, - { MP_ROM_QSTR(MP_QSTR_UART3_CTS), MP_ROM_PTR(&pin_PA19) }, - { MP_ROM_QSTR(MP_QSTR_ESP01_RESET), MP_ROM_PTR(&pin_PC02) }, - { MP_ROM_QSTR(MP_QSTR_ESP01_RX), MP_ROM_PTR(&pin_PB21) }, - { MP_ROM_QSTR(MP_QSTR_UART3_RX), MP_ROM_PTR(&pin_PB21) }, - { MP_ROM_QSTR(MP_QSTR_ESP01_TX), MP_ROM_PTR(&pin_PB20) }, - { MP_ROM_QSTR(MP_QSTR_UART3_TX), MP_ROM_PTR(&pin_PB20) }, - { MP_ROM_QSTR(MP_QSTR_I2C_SCL), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_I2C_SDA), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_E4), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_ESP01_RESET), MP_ROM_PTR(&pin_PC14) }, + { MP_ROM_QSTR(MP_QSTR_E6), MP_ROM_PTR(&pin_PC14) }, + { MP_ROM_QSTR(MP_QSTR_ESP01_RX), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_UART3_RX), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_I2C3_SCL), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_E2), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_ESP01_TX), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_UART3_TX), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_I2C3_SDA), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_E1), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_I2C1_SCL), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_I2C1_SDA), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_I2S_FS_0), MP_ROM_PTR(&pin_PA20) }, - { MP_ROM_QSTR(MP_QSTR_I2S_FS_1), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_I2S_MCK_0), MP_ROM_PTR(&pin_PB17) }, - { MP_ROM_QSTR(MP_QSTR_I2S_MCK_1), MP_ROM_PTR(&pin_PB13) }, { MP_ROM_QSTR(MP_QSTR_I2S_SCK_0), MP_ROM_PTR(&pin_PB16) }, - { MP_ROM_QSTR(MP_QSTR_I2S_SCK_1), MP_ROM_PTR(&pin_PB12) }, { MP_ROM_QSTR(MP_QSTR_I2S_SDI), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_I2S_SDO), MP_ROM_PTR(&pin_PA21) }, - { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_LED_STATUS), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_PB18) }, - { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_PB19) }, + { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_LED_STATUS), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_PB14) }, { MP_ROM_QSTR(MP_QSTR_LED_RX), MP_ROM_PTR(&pin_PC05) }, { MP_ROM_QSTR(MP_QSTR_LED_TX), MP_ROM_PTR(&pin_PC06) }, - { MP_ROM_QSTR(MP_QSTR_RS485_RE), MP_ROM_PTR(&pin_PC15) }, - { MP_ROM_QSTR(MP_QSTR_RS485_RX), MP_ROM_PTR(&pin_PC13) }, - { MP_ROM_QSTR(MP_QSTR_RS485_TE), MP_ROM_PTR(&pin_PC14) }, - { MP_ROM_QSTR(MP_QSTR_RS485_TX), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_RS485_RE), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_RS485_RX), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_RS485_TE), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_RS485_TX), MP_ROM_PTR(&pin_PB02) }, { MP_ROM_QSTR(MP_QSTR_SPI_MISO), MP_ROM_PTR(&pin_PB23) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB23) }, { MP_ROM_QSTR(MP_QSTR_SPI_MOSI), MP_ROM_PTR(&pin_PC27) }, @@ -67,14 +73,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PC28) }, { MP_ROM_QSTR(MP_QSTR_SPI_SS), MP_ROM_PTR(&pin_PB22) }, { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_PB22) }, - { MP_ROM_QSTR(MP_QSTR_UART1_CTS), MP_ROM_PTR(&pin_PC19) }, - { MP_ROM_QSTR(MP_QSTR_UART1_RTS), MP_ROM_PTR(&pin_PC18) }, - { MP_ROM_QSTR(MP_QSTR_UART1_RX), MP_ROM_PTR(&pin_PC17) }, - { MP_ROM_QSTR(MP_QSTR_UART1_TX), MP_ROM_PTR(&pin_PC16) }, - { MP_ROM_QSTR(MP_QSTR_UART2_RX), MP_ROM_PTR(&pin_PB25) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB25) }, - { MP_ROM_QSTR(MP_QSTR_UART2_TX), MP_ROM_PTR(&pin_PB24) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB24) }, + { MP_ROM_QSTR(MP_QSTR_UART1_CTS), MP_ROM_PTR(&pin_PC25) }, + { MP_ROM_QSTR(MP_QSTR_UART1_RTS), MP_ROM_PTR(&pin_PC24) }, + { MP_ROM_QSTR(MP_QSTR_UART1_RX), MP_ROM_PTR(&pin_PB24) }, + { MP_ROM_QSTR(MP_QSTR_UART1_TX), MP_ROM_PTR(&pin_PB25) }, + { MP_ROM_QSTR(MP_QSTR_UART2_RX), MP_ROM_PTR(&pin_PB20) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB20) }, + { MP_ROM_QSTR(MP_QSTR_I2C2_SCL), MP_ROM_PTR(&pin_PB20) }, + { MP_ROM_QSTR(MP_QSTR_UART2_TX), MP_ROM_PTR(&pin_PB21) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB21) }, + { MP_ROM_QSTR(MP_QSTR_I2C2_SDA), MP_ROM_PTR(&pin_PB21) }, { 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) }, From 1f7a3f0dfab05ab9551f0e1ecff9f45805897837 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 2 Nov 2020 15:28:30 -0500 Subject: [PATCH 071/251] Rev C Feather M4 CAN pin changes --- ports/atmel-samd/boards/feather_m4_can/pins.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/boards/feather_m4_can/pins.c b/ports/atmel-samd/boards/feather_m4_can/pins.c index 2b67709f87..0150473301 100644 --- a/ports/atmel-samd/boards/feather_m4_can/pins.c +++ b/ports/atmel-samd/boards/feather_m4_can/pins.c @@ -36,6 +36,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA14) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA18) }, @@ -45,14 +46,17 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA23) }, - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PB00) }, + + { MP_ROM_QSTR(MP_QSTR_BOOST_ENABLE), MP_ROM_PTR(&pin_PB13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_PB15) }, { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_PB14) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_STANDBY), MP_ROM_PTR(&pin_PB13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_STANDBY), MP_ROM_PTR(&pin_PB12) }, { 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 23afe08b6f81b70e2f24c609e6c43b0682aaf30b Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 2 Nov 2020 17:15:19 -0500 Subject: [PATCH 072/251] Add GPIO reset to end of neopixel-write --- ports/esp32s2/common-hal/neopixel_write/__init__.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/esp32s2/common-hal/neopixel_write/__init__.c b/ports/esp32s2/common-hal/neopixel_write/__init__.c index 553cb79f83..63d50bf14a 100644 --- a/ports/esp32s2/common-hal/neopixel_write/__init__.c +++ b/ports/esp32s2/common-hal/neopixel_write/__init__.c @@ -125,4 +125,6 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout // Free channel again esp32s2_peripherals_free_rmt(config.channel); + // Swap pin back to GPIO mode + gpio_set_direction(digitalinout->pin->number, GPIO_MODE_OUTPUT); } From 6c61a53e0fc7a2b56156551a7da07e8734e00a33 Mon Sep 17 00:00:00 2001 From: lady ada Date: Mon, 2 Nov 2020 18:38:23 -0500 Subject: [PATCH 073/251] io naming for gpio (credit to @kattni) --- .../boards/adafruit_metro_esp32s2/pins.c | 70 ++++++++++++------- 1 file changed, 45 insertions(+), 25 deletions(-) diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c b/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c index 08d2b2a1a3..a7fc8b2d7c 100644 --- a/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c +++ b/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c @@ -2,41 +2,61 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO1) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO2) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO3) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO4) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO5) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO5) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO6) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO6) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO7) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO8) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO9) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO10) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO11) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO13) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO14) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO15) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO16) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO21) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO42) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO1) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO2) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO3) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO4) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_GPIO33) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO33),MP_ROM_PTR(&pin_GPIO33) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_GPIO34) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO34),MP_ROM_PTR(&pin_GPIO34) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_GPIO35) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO35),MP_ROM_PTR(&pin_GPIO35) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_GPIO37) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO37),MP_ROM_PTR(&pin_GPIO37) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO42) }, { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, { MP_OBJ_NEW_QSTR(MP_QSTR_DEBUG_RX), MP_ROM_PTR(&pin_GPIO38) }, { MP_OBJ_NEW_QSTR(MP_QSTR_DEBUG_TX), MP_ROM_PTR(&pin_GPIO37) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_GPIO35) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_GPIO37) }, - { 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) }, From 18838e390a71366ccaa1aaeda8964e65d70fc43f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 29 Oct 2020 19:38:25 -0700 Subject: [PATCH 074/251] reduce connection footprint and fix recv --- ports/esp32s2/common-hal/socketpool/Socket.c | 22 ++++++------- .../esp32s2/esp-idf-config/sdkconfig.defaults | 33 ++++++++++++------- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index 0a994c604e..750415dc7b 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -79,15 +79,15 @@ mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len) { size_t received = 0; - ssize_t last_read = 1; + int status = 0; uint64_t start_ticks = supervisor_ticks_ms64(); int sockfd; esp_err_t err = esp_tls_get_conn_sockfd(self->tcp, &sockfd); if (err != ESP_OK) { mp_raise_OSError(MP_EBADF); } - while (received < len && - last_read > 0 && + while (received == 0 && + status >= 0 && (self->timeout_ms == 0 || supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) && !mp_hal_is_interrupted()) { RUN_BACKGROUND_TASKS; @@ -95,27 +95,25 @@ mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, if (available == 0) { // This reads the raw socket buffer and is used for non-TLS connections // and between encrypted TLS blocks. - int status = lwip_ioctl(sockfd, FIONREAD, &available); - if (status < 0) { - last_read = status; - break; - } + status = lwip_ioctl(sockfd, FIONREAD, &available); } size_t remaining = len - received; if (available > remaining) { available = remaining; } if (available > 0) { - last_read = esp_tls_conn_read(self->tcp, (void*) buf + received, available); - received += last_read; + status = esp_tls_conn_read(self->tcp, (void*) buf + received, available); + if (status > 0) { + received += status; + } } } - if (last_read == 0) { + if (received == 0) { // socket closed common_hal_socketpool_socket_close(self); } - if (last_read < 0) { + if (status < 0) { mp_raise_BrokenPipeError(); } return received; diff --git a/ports/esp32s2/esp-idf-config/sdkconfig.defaults b/ports/esp32s2/esp-idf-config/sdkconfig.defaults index 4094367e0c..37b33fc69e 100644 --- a/ports/esp32s2/esp-idf-config/sdkconfig.defaults +++ b/ports/esp32s2/esp-idf-config/sdkconfig.defaults @@ -135,6 +135,7 @@ CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y # CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set # CONFIG_COMPILER_WARN_WRITE_STRINGS is not set # CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set +# CONFIG_COMPILER_DUMP_RTL_FILES is not set # end of Compiler options # @@ -332,12 +333,13 @@ CONFIG_ESP_TIMER_IMPL_SYSTIMER=y # # Wi-Fi # -CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 -CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 +CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=16 +CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 @@ -439,7 +441,7 @@ CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y # CONFIG_LWIP_L2_TO_L3_COPY is not set # CONFIG_LWIP_IRAM_OPTIMIZATION is not set CONFIG_LWIP_TIMERS_ONDEMAND=y -CONFIG_LWIP_MAX_SOCKETS=10 +CONFIG_LWIP_MAX_SOCKETS=4 # CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set # CONFIG_LWIP_SO_LINGER is not set CONFIG_LWIP_SO_REUSE=y @@ -459,6 +461,9 @@ CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y # CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set +# +# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set + # # DHCP server # @@ -474,15 +479,15 @@ CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 # # TCP # -CONFIG_LWIP_MAX_ACTIVE_TCP=16 -CONFIG_LWIP_MAX_LISTENING_TCP=16 +CONFIG_LWIP_MAX_ACTIVE_TCP=4 +CONFIG_LWIP_MAX_LISTENING_TCP=4 CONFIG_LWIP_TCP_MAXRTX=12 CONFIG_LWIP_TCP_SYNMAXRTX=6 CONFIG_LWIP_TCP_MSS=1440 CONFIG_LWIP_TCP_TMR_INTERVAL=250 CONFIG_LWIP_TCP_MSL=60000 -CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 -CONFIG_LWIP_TCP_WND_DEFAULT=5744 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=2880 +CONFIG_LWIP_TCP_WND_DEFAULT=2880 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_QUEUE_OOSEQ=y # CONFIG_LWIP_TCP_SACK_OUT is not set @@ -505,6 +510,8 @@ CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF # CONFIG_LWIP_PPP_SUPPORT is not set +CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 +CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 # CONFIG_LWIP_SLIP_SUPPORT is not set # @@ -552,8 +559,10 @@ CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y # CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 -CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 -# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048 +CONFIG_MBEDTLS_DYNAMIC_BUFFER=y +CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y +CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y # CONFIG_MBEDTLS_DEBUG is not set # @@ -824,8 +833,8 @@ CONFIG_TCP_MAXRTX=12 CONFIG_TCP_SYNMAXRTX=6 CONFIG_TCP_MSS=1440 CONFIG_TCP_MSL=60000 -CONFIG_TCP_SND_BUF_DEFAULT=5744 -CONFIG_TCP_WND_DEFAULT=5744 +CONFIG_TCP_SND_BUF_DEFAULT=2880 +CONFIG_TCP_WND_DEFAULT=2880 CONFIG_TCP_RECVMBOX_SIZE=6 CONFIG_TCP_QUEUE_OOSEQ=y # CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set From 88fcf4ef7e001e547ed94747df5d22b6736c881c Mon Sep 17 00:00:00 2001 From: sw23 Date: Mon, 2 Nov 2020 19:59:07 -0500 Subject: [PATCH 075/251] Removing implementation-specific values for socket/socketpool class attributes --- shared-bindings/socket/__init__.c | 12 ++++++------ shared-bindings/socketpool/SocketPool.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 2969b37149..799bf28afa 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -49,12 +49,12 @@ STATIC const mp_obj_type_t socket_type; //| class socket: //| -//| AF_INET = 2 -//| AF_INET6 = 10 -//| SOCK_STREAM = 1 -//| SOCK_DGRAM = 2 -//| SOCK_RAW = 3 -//| IPPROTO_TCP = 6 +//| AF_INET: int +//| AF_INET6: int +//| SOCK_STREAM: int +//| SOCK_DGRAM: int +//| SOCK_RAW: int +//| IPPROTO_TCP: int //| //| def __init__(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> None: //| """Create a new socket diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 2234f359ef..73eeed2652 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -57,12 +57,12 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(s); } -//| AF_INET = 0 -//| AF_INET6 = 1 -//| SOCK_STREAM = 0 -//| SOCK_DGRAM = 1 -//| SOCK_RAW = 2 -//| IPPROTO_TCP = 6 +//| AF_INET: int +//| AF_INET6: int +//| SOCK_STREAM: int +//| SOCK_DGRAM: int +//| SOCK_RAW: int +//| IPPROTO_TCP: int //| //| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> socketpool.Socket: //| """Create a new socket From 7441344c6f29d9dbf7f8cedef55f394c42916963 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 2 Nov 2020 17:22:24 -0800 Subject: [PATCH 076/251] Add new config options to default --- ports/esp32s2/esp-idf-config/sdkconfig.defaults | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ports/esp32s2/esp-idf-config/sdkconfig.defaults b/ports/esp32s2/esp-idf-config/sdkconfig.defaults index 37b33fc69e..025b05caa6 100644 --- a/ports/esp32s2/esp-idf-config/sdkconfig.defaults +++ b/ports/esp32s2/esp-idf-config/sdkconfig.defaults @@ -264,6 +264,11 @@ CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y # CONFIG_PM_ENABLE is not set # end of Power Management +# +# ADC-Calibration +# +# end of ADC-Calibration + # # Common ESP-related # @@ -403,6 +408,7 @@ CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 # CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set +# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set CONFIG_FREERTOS_DEBUG_OCDAWARE=y # end of FreeRTOS @@ -715,6 +721,7 @@ CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 +# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set # # Auto-detect flash chips From c4521287e39abf92f1833a25f950aa5bd8e4857c Mon Sep 17 00:00:00 2001 From: lady ada Date: Mon, 2 Nov 2020 23:22:53 -0500 Subject: [PATCH 077/251] add rx/tx default uart names --- ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c b/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c index a7fc8b2d7c..dbd6cfef8d 100644 --- a/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c +++ b/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c @@ -19,8 +19,12 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO4) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO5) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO6) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, From 4055c5ac61f824f7f2cfd72e670037af2f601427 Mon Sep 17 00:00:00 2001 From: Ed Hagerty Date: Tue, 3 Nov 2020 17:14:58 +0000 Subject: [PATCH 078/251] Update README.md --- ports/esp32s2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/README.md b/ports/esp32s2/README.md index f3e678de85..0738d520e7 100644 --- a/ports/esp32s2/README.md +++ b/ports/esp32s2/README.md @@ -30,7 +30,7 @@ Connect these pins using a [USB adapter](https://www.adafruit.com/product/4090) ## Building and flashing ## -Before building or flashing the ESP32-S2, you must [install the esp-idf](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/get-started/index.html). This must be re-done ever time the esp-idf is updated, but not every time you build. Run `cd ports/esp32s2` from `circuitpython/` to move to the esp32s2 port root, and run: +Before building or flashing the ESP32-S2, you must [install the esp-idf](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/get-started/index.html). This must be re-done every time the esp-idf is updated, but not every time you build. Run `cd ports/esp32s2` from `circuitpython/` to move to the esp32s2 port root, and run: ``` ./esp-idf/install.sh From ca935c0dafba767f8eae681664972d0f6a0c5507 Mon Sep 17 00:00:00 2001 From: "ITACA Innovation S.R.L" <40298126+ITACAInnovation@users.noreply.github.com> Date: Tue, 3 Nov 2020 21:22:19 +0100 Subject: [PATCH 079/251] Update pins.c Changed builtin to standard --- ports/atmel-samd/boards/uchip/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/uchip/pins.c b/ports/atmel-samd/boards/uchip/pins.c index 2d7eeebe11..de5508110d 100644 --- a/ports/atmel-samd/boards/uchip/pins.c +++ b/ports/atmel-samd/boards/uchip/pins.c @@ -1,7 +1,7 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_LED_BUILTIN), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_BOOST_EN), MP_ROM_PTR(&pin_PA14) }, { MP_ROM_QSTR(MP_QSTR_VEXT_SELECT), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA06) }, From fe6bfde590fc325c984c679825024241afd23a5f Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 4 Nov 2020 21:20:24 +0530 Subject: [PATCH 080/251] move pcnt handler --- locale/circuitpython.pot | 10 +++++----- ports/esp32s2/Makefile | 2 +- ports/esp32s2/{ => peripherals}/pcnt_handler.c | 2 +- ports/esp32s2/{ => peripherals}/pcnt_handler.h | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) rename ports/esp32s2/{ => peripherals}/pcnt_handler.c (96%) rename ports/esp32s2/{ => peripherals}/pcnt_handler.h (88%) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 1336ab25cd..b4445abfbf 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-01 11:11+0530\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -296,6 +296,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1272,10 +1276,6 @@ msgstr "" msgid "No MOSI Pin" msgstr "" -#: ports/esp32s2/pcnt_handler.c -msgid "No PCNT unit free" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 6dbbf58d4d..56f0d46a31 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -173,7 +173,6 @@ SRC_C += \ background.c \ fatfs_port.c \ mphalport.c \ - pcnt_handler.c \ bindings/espidf/__init__.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ @@ -189,6 +188,7 @@ SRC_C += \ lib/utils/pyexec.c \ lib/utils/stdout_helpers.c \ lib/utils/sys_stdio_mphal.c \ + peripherals/pcnt_handler.c \ peripherals/pins.c \ peripherals/rmt.c \ supervisor/shared/memory.c diff --git a/ports/esp32s2/pcnt_handler.c b/ports/esp32s2/peripherals/pcnt_handler.c similarity index 96% rename from ports/esp32s2/pcnt_handler.c rename to ports/esp32s2/peripherals/pcnt_handler.c index 56fb0f21c8..5a0cc9a7c2 100644 --- a/ports/esp32s2/pcnt_handler.c +++ b/ports/esp32s2/peripherals/pcnt_handler.c @@ -42,7 +42,7 @@ void pcnt_handler_init(pcnt_config_t* pcnt_config) { pcnt_state[i] = PCNT_UNIT_ACTIVE; break; } else if (i == 3) { - mp_raise_RuntimeError(translate("No PCNT unit free")); + mp_raise_RuntimeError(translate("All PCNT units in use")); } } diff --git a/ports/esp32s2/pcnt_handler.h b/ports/esp32s2/peripherals/pcnt_handler.h similarity index 88% rename from ports/esp32s2/pcnt_handler.h rename to ports/esp32s2/peripherals/pcnt_handler.h index 4bdaee1b87..f44ee1f830 100644 --- a/ports/esp32s2/pcnt_handler.h +++ b/ports/esp32s2/peripherals/pcnt_handler.h @@ -24,12 +24,12 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_PCNT_HANDLER_H -#define MICROPY_INCLUDED_ESP32S2_PCNT_HANDLER_H +#ifndef MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PCNT_HANDLER_H +#define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PCNT_HANDLER_H #include "driver/pcnt.h" extern void pcnt_handler_init(pcnt_config_t* pcnt_config); extern void pcnt_handler_deinit(pcnt_unit_t* unit); -#endif // MICROPY_INCLUDED_ESP32S2_PCNT_HANDLER_H +#endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PCNT_HANDLER_H From 92cd599ea31482b5462438334ef36ae3cfd9dba8 Mon Sep 17 00:00:00 2001 From: cyz Date: Thu, 5 Nov 2020 09:14:53 +0800 Subject: [PATCH 081/251] Modify the pins of the hiibot_bluefi. --- ports/nrf/boards/hiibot_bluefi/pins.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/nrf/boards/hiibot_bluefi/pins.c b/ports/nrf/boards/hiibot_bluefi/pins.c index 340ea948cf..bce4ee52dd 100644 --- a/ports/nrf/boards/hiibot_bluefi/pins.c +++ b/ports/nrf/boards/hiibot_bluefi/pins.c @@ -109,10 +109,10 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_P0_27) }, { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_P0_27) }, - { MP_ROM_QSTR(MP_QSTR_P27), MP_ROM_PTR(&pin_P1_14) }, - { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_P1_14) }, - { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_P1_14) }, - { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_P1_14) }, + { MP_ROM_QSTR(MP_QSTR_P27), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_P1_13) }, + //{ MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_P1_13) }, // P28~P33/D28~D33 connecte into QSPI FlashROM (W25Q16JV_IQ) From d8ef9a127b4914f7d9b50131c15e653aef94cb8f Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 5 Nov 2020 10:10:39 +0530 Subject: [PATCH 082/251] rename pcnt_handler to pcnt --- ports/esp32s2/Makefile | 2 +- ports/esp32s2/common-hal/countio/Counter.c | 5 +++-- ports/esp32s2/common-hal/countio/Counter.h | 2 +- ports/esp32s2/peripherals/{pcnt_handler.c => pcnt.c} | 6 +++--- ports/esp32s2/peripherals/{pcnt_handler.h => pcnt.h} | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) rename ports/esp32s2/peripherals/{pcnt_handler.c => pcnt.c} (94%) rename ports/esp32s2/peripherals/{pcnt_handler.h => pcnt.h} (92%) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 56f0d46a31..55d6e91d44 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -188,7 +188,7 @@ SRC_C += \ lib/utils/pyexec.c \ lib/utils/stdout_helpers.c \ lib/utils/sys_stdio_mphal.c \ - peripherals/pcnt_handler.c \ + peripherals/pcnt.c \ peripherals/pins.c \ peripherals/rmt.c \ supervisor/shared/memory.c diff --git a/ports/esp32s2/common-hal/countio/Counter.c b/ports/esp32s2/common-hal/countio/Counter.c index 4357624733..81f9f7ad2a 100644 --- a/ports/esp32s2/common-hal/countio/Counter.c +++ b/ports/esp32s2/common-hal/countio/Counter.c @@ -42,7 +42,8 @@ void common_hal_countio_counter_construct(countio_counter_obj_t* self, .neg_mode = PCNT_COUNT_DIS, // Keep the counter value on the negative edge }; // Initialize PCNT unit - pcnt_handler_init(&pcnt_config); + // This also sets pcnt_config.unit + peripherals_pcnt_init(&pcnt_config); self->pin = pin->number; self->unit = pcnt_config.unit; @@ -57,7 +58,7 @@ void common_hal_countio_counter_deinit(countio_counter_obj_t* self) { return; } reset_pin_number(self->pin); - pcnt_handler_deinit(&self->unit); + peripherals_pcnt_deinit(&self->unit); } mp_int_t common_hal_countio_counter_get_count(countio_counter_obj_t* self) { diff --git a/ports/esp32s2/common-hal/countio/Counter.h b/ports/esp32s2/common-hal/countio/Counter.h index 63d1eb98b2..20fe5b83e6 100644 --- a/ports/esp32s2/common-hal/countio/Counter.h +++ b/ports/esp32s2/common-hal/countio/Counter.h @@ -28,7 +28,7 @@ #define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNTER_H #include "py/obj.h" -#include "pcnt_handler.h" +#include "peripherals/pcnt.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/peripherals/pcnt_handler.c b/ports/esp32s2/peripherals/pcnt.c similarity index 94% rename from ports/esp32s2/peripherals/pcnt_handler.c rename to ports/esp32s2/peripherals/pcnt.c index 5a0cc9a7c2..e7eb32c1d1 100644 --- a/ports/esp32s2/peripherals/pcnt_handler.c +++ b/ports/esp32s2/peripherals/pcnt.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "pcnt_handler.h" +#include "peripherals/pcnt.h" #include "py/runtime.h" #include "supervisor/shared/translate.h" @@ -34,7 +34,7 @@ static uint8_t pcnt_state[4]; -void pcnt_handler_init(pcnt_config_t* pcnt_config) { +void peripherals_pcnt_init(pcnt_config_t* pcnt_config) { // Look for available pcnt unit for (uint8_t i = 0; i<=3; i++) { if (pcnt_state[i] == PCNT_UNIT_INACTIVE) { @@ -61,7 +61,7 @@ void pcnt_handler_init(pcnt_config_t* pcnt_config) { pcnt_counter_resume(pcnt_config->unit); } -void pcnt_handler_deinit(pcnt_unit_t* unit) { +void peripherals_pcnt_deinit(pcnt_unit_t* unit) { pcnt_state[*unit] = PCNT_UNIT_INACTIVE; *unit = PCNT_UNIT_MAX; } diff --git a/ports/esp32s2/peripherals/pcnt_handler.h b/ports/esp32s2/peripherals/pcnt.h similarity index 92% rename from ports/esp32s2/peripherals/pcnt_handler.h rename to ports/esp32s2/peripherals/pcnt.h index f44ee1f830..64072501cb 100644 --- a/ports/esp32s2/peripherals/pcnt_handler.h +++ b/ports/esp32s2/peripherals/pcnt.h @@ -29,7 +29,7 @@ #include "driver/pcnt.h" -extern void pcnt_handler_init(pcnt_config_t* pcnt_config); -extern void pcnt_handler_deinit(pcnt_unit_t* unit); +extern void peripherals_pcnt_init(pcnt_config_t* pcnt_config); +extern void peripherals_pcnt_deinit(pcnt_unit_t* unit); #endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PCNT_HANDLER_H From c2aa54ae661612e68768e10b76fd942af036ecda Mon Sep 17 00:00:00 2001 From: root Date: Thu, 5 Nov 2020 11:10:40 -0600 Subject: [PATCH 083/251] Check for Ctrl-C during sleeps --- ports/esp32s2/supervisor/port.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 0b9c03f747..2aa01cb152 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -203,7 +203,16 @@ void port_sleep_until_interrupt(void) { if (sleep_time_duration == 0) { return; } - vTaskDelayUntil(&sleep_time_set, sleep_time_duration); + // Need to run in a loop in order to check if CTRL-C was received + TickType_t start_ticks = 0; + while (sleep_time_duration > start_ticks ) { + vTaskDelayUntil(&sleep_time_set, 1); + if ( mp_hal_is_interrupted() ) { + mp_handle_pending(); + } + start_ticks = start_ticks + 1; + } + } From ac8a0faa0d64fd07af65a798c7e1fc5ce4e39df2 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Fri, 6 Nov 2020 01:42:20 +0530 Subject: [PATCH 084/251] update peripherals_pcnt_init() --- ports/esp32s2/common-hal/countio/Counter.c | 14 +++++++++---- ports/esp32s2/peripherals/pcnt.c | 23 +++++++++++----------- ports/esp32s2/peripherals/pcnt.h | 2 +- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/ports/esp32s2/common-hal/countio/Counter.c b/ports/esp32s2/common-hal/countio/Counter.c index 81f9f7ad2a..fe52d93add 100644 --- a/ports/esp32s2/common-hal/countio/Counter.c +++ b/ports/esp32s2/common-hal/countio/Counter.c @@ -27,12 +27,15 @@ #include "common-hal/countio/Counter.h" #include "common-hal/microcontroller/Pin.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + void common_hal_countio_counter_construct(countio_counter_obj_t* self, const mcu_pin_obj_t* pin) { claim_pin(pin); // Prepare configuration for the PCNT unit - pcnt_config_t pcnt_config = { + 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, @@ -41,12 +44,15 @@ void common_hal_countio_counter_construct(countio_counter_obj_t* self, .pos_mode = PCNT_COUNT_INC, // Count up on the positive edge .neg_mode = PCNT_COUNT_DIS, // Keep the counter value on the negative edge }; + // Initialize PCNT unit - // This also sets pcnt_config.unit - peripherals_pcnt_init(&pcnt_config); + const int8_t unit = peripherals_pcnt_init(pcnt_config); + if (unit == -1) { + mp_raise_RuntimeError(translate("All PCNT units in use")); + } self->pin = pin->number; - self->unit = pcnt_config.unit; + self->unit = (pcnt_unit_t)unit; } bool common_hal_countio_counter_deinited(countio_counter_obj_t* self) { diff --git a/ports/esp32s2/peripherals/pcnt.c b/ports/esp32s2/peripherals/pcnt.c index e7eb32c1d1..555a0ec1d3 100644 --- a/ports/esp32s2/peripherals/pcnt.c +++ b/ports/esp32s2/peripherals/pcnt.c @@ -26,39 +26,38 @@ #include "peripherals/pcnt.h" -#include "py/runtime.h" -#include "supervisor/shared/translate.h" - #define PCNT_UNIT_ACTIVE 1 #define PCNT_UNIT_INACTIVE 0 static uint8_t pcnt_state[4]; -void peripherals_pcnt_init(pcnt_config_t* pcnt_config) { +int peripherals_pcnt_init(pcnt_config_t pcnt_config) { // Look for available pcnt unit for (uint8_t i = 0; i<=3; i++) { if (pcnt_state[i] == PCNT_UNIT_INACTIVE) { - pcnt_config->unit = (pcnt_unit_t)i; + pcnt_config.unit = (pcnt_unit_t)i; pcnt_state[i] = PCNT_UNIT_ACTIVE; break; } else if (i == 3) { - mp_raise_RuntimeError(translate("All PCNT units in use")); + return -1; } } // Initialize PCNT unit - pcnt_unit_config(pcnt_config); + pcnt_unit_config(&pcnt_config); // Configure and enable the input filter - pcnt_set_filter_value(pcnt_config->unit, 100); - pcnt_filter_enable(pcnt_config->unit); + pcnt_set_filter_value(pcnt_config.unit, 100); + pcnt_filter_enable(pcnt_config.unit); // Initialize PCNT's counter - pcnt_counter_pause(pcnt_config->unit); - pcnt_counter_clear(pcnt_config->unit); + pcnt_counter_pause(pcnt_config.unit); + pcnt_counter_clear(pcnt_config.unit); // Everything is set up, now go to counting - pcnt_counter_resume(pcnt_config->unit); + pcnt_counter_resume(pcnt_config.unit); + + return pcnt_config.unit; } void peripherals_pcnt_deinit(pcnt_unit_t* unit) { diff --git a/ports/esp32s2/peripherals/pcnt.h b/ports/esp32s2/peripherals/pcnt.h index 64072501cb..abed80fd0c 100644 --- a/ports/esp32s2/peripherals/pcnt.h +++ b/ports/esp32s2/peripherals/pcnt.h @@ -29,7 +29,7 @@ #include "driver/pcnt.h" -extern void peripherals_pcnt_init(pcnt_config_t* pcnt_config); +extern int peripherals_pcnt_init(pcnt_config_t pcnt_config); extern void peripherals_pcnt_deinit(pcnt_unit_t* unit); #endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PCNT_HANDLER_H From da04efbf2ed205d73de4f0082017ed15c3f59896 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Thu, 5 Nov 2020 14:25:45 -0600 Subject: [PATCH 085/251] Fix missing include in port.c --- ports/esp32s2/supervisor/port.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 2aa01cb152..5cd6204405 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -30,6 +30,7 @@ #include "supervisor/port.h" #include "boards/board.h" #include "modules/module.h" +#include "py/runtime.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" From 8ce852e6523a51b419a28642732d5ad3813bdb88 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Wed, 4 Nov 2020 20:02:37 +0000 Subject: [PATCH 086/251] Translated using Weblate (Swedish) Currently translated at 100.0% (844 of 844 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 65cd9f6f1f..9182a99430 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-10-21 20:13-0500\n" -"PO-Revision-Date: 2020-11-01 16:26+0000\n" +"PO-Revision-Date: 2020-11-05 20:26+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.3.2-dev\n" +"X-Generator: Weblate 4.3.2\n" #: main.c msgid "" @@ -415,8 +415,8 @@ msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" msgstr "" -"Autoladdning är på. Spara bara filer via USB för att köra dem eller ange " -"REPL för att inaktivera.\n" +"Autoladdning är på. Spara filer via USB för att köra dem eller ange REPL för " +"att inaktivera.\n" #: ports/esp32s2/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" @@ -2220,7 +2220,7 @@ msgstr "kan bara ha upp till 4 parametrar att Xtensa assembly" #: py/persistentcode.c msgid "can only save bytecode" -msgstr "kan bara spara bytekod" +msgstr "kan bara spara bytecode" #: py/objtype.c msgid "can't add special method to already-subclassed class" From d948e6570f32b08de71b5d088ab445d2de3a7661 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 5 Nov 2020 21:27:21 -0600 Subject: [PATCH 087/251] Changes to handle Ctrl-C during sleep --- ports/esp32s2/supervisor/port.c | 32 ++++++++++++++------------------ ports/esp32s2/supervisor/usb.c | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 2aa01cb152..46de636276 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -30,6 +30,7 @@ #include "supervisor/port.h" #include "boards/board.h" #include "modules/module.h" +#include "py/runtime.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" @@ -54,6 +55,7 @@ uint32_t* heap; uint32_t heap_size; +extern TaskHandle_t xTaskToNotify; STATIC esp_timer_handle_t _tick_timer; @@ -188,34 +190,28 @@ void port_disable_tick(void) { esp_timer_stop(_tick_timer); } -TickType_t sleep_time_set; TickType_t sleep_time_duration; +uint32_t NotifyValue = 0; +BaseType_t notify_wait = 0; + void port_interrupt_after_ticks(uint32_t ticks) { - sleep_time_set = xTaskGetTickCount(); - sleep_time_duration = ticks / portTICK_PERIOD_MS; - // esp_sleep_enable_timer_wakeup(uint64_t time_in_us) + sleep_time_duration = (ticks * 100)/1024; + xTaskToNotify = xTaskGetCurrentTaskHandle(); } void port_sleep_until_interrupt(void) { - // FreeRTOS delay here maybe. - // Light sleep shuts down BLE and wifi. - // esp_light_sleep_start() + if (sleep_time_duration == 0) { return; } - // Need to run in a loop in order to check if CTRL-C was received - TickType_t start_ticks = 0; - while (sleep_time_duration > start_ticks ) { - vTaskDelayUntil(&sleep_time_set, 1); - if ( mp_hal_is_interrupted() ) { - mp_handle_pending(); - } - start_ticks = start_ticks + 1; - } - + notify_wait = xTaskNotifyWait(0x01,0x01,&NotifyValue, + sleep_time_duration ); + if (NotifyValue == 1) { + xTaskToNotify = NULL; + mp_handle_pending(); + } } - // Wrap main in app_main that the IDF expects. extern void main(void); void app_main(void) { diff --git a/ports/esp32s2/supervisor/usb.c b/ports/esp32s2/supervisor/usb.c index 1ad6af0470..86186d36b8 100644 --- a/ports/esp32s2/supervisor/usb.c +++ b/ports/esp32s2/supervisor/usb.c @@ -52,6 +52,8 @@ StackType_t usb_device_stack[USBD_STACK_SIZE]; StaticTask_t usb_device_taskdef; +TaskHandle_t xTaskToNotify = NULL; + // USB Device Driver task // This top level thread process all usb events and invoke callbacks void usb_device_task(void* param) @@ -114,3 +116,21 @@ void init_usb_hardware(void) { usb_device_stack, &usb_device_taskdef); } +/** + * Callback invoked when received an "wanted" char. + * @param itf Interface index (for multiple cdc interfaces) + * @param wanted_char The wanted char (set previously) + */ +void tud_cdc_rx_wanted_cb(uint8_t itf, char wanted_char) +{ + (void) itf; // not used + // Workaround for using lib/utils/interrupt_char.c + // Compare mp_interrupt_char with wanted_char and ignore if not matched + if (mp_interrupt_char == wanted_char) { + tud_cdc_read_flush(); // flush read fifo + mp_keyboard_interrupt(); + if (xTaskToNotify != NULL) { + xTaskNotifyGive(xTaskToNotify); + } + } +} From 93193f2f0b843fc8c052edecd362a1cdd7b30d5d Mon Sep 17 00:00:00 2001 From: sporeball Date: Fri, 6 Nov 2020 19:49:49 +0000 Subject: [PATCH 088/251] Translated using Weblate (Japanese) Currently translated at 71.8% (606 of 844 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ja/ --- locale/ja.po | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/locale/ja.po b/locale/ja.po index ae7e51ba6b..c9a85c1a23 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -8,15 +8,15 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-21 20:13-0500\n" -"PO-Revision-Date: 2020-09-25 18:20+0000\n" -"Last-Translator: Taku Fukada \n" +"PO-Revision-Date: 2020-11-06 20:29+0000\n" +"Last-Translator: sporeball \n" "Language-Team: none\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.3-dev\n" +"X-Generator: Weblate 4.3.2\n" #: main.c msgid "" @@ -162,12 +162,12 @@ msgstr "'%s' にはラベルが必要" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a register" -msgstr "" +msgstr "'%s'にはレジスタが必要" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects a special register" -msgstr "" +msgstr "'%s'には特別レジスタが必要" #: py/emitinlinethumb.c #, c-format @@ -192,7 +192,7 @@ msgstr "" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects {r0, r1, ...}" -msgstr "" +msgstr "'%s'には{r0, r1, ...}が必要" #: py/emitinlinextensa.c #, c-format @@ -246,7 +246,7 @@ msgstr "'data'には整数の引数が必要" #: py/compile.c msgid "'label' requires 1 argument" -msgstr "" +msgstr "'label'には1つの引数が必要" #: py/compile.c msgid "'return' outside function" @@ -296,7 +296,7 @@ msgstr "address_typeが範囲外" #: ports/esp32s2/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" -msgstr "" +msgstr "全てのCAN周辺機器が使用中" #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -821,19 +821,19 @@ msgstr "%qが必要" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c msgid "Expected a Characteristic" -msgstr "" +msgstr "Characteristicが必要" #: shared-bindings/_bleio/Adapter.c msgid "Expected a DigitalInOut" -msgstr "" +msgstr "DigitalInOutが必要" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" -msgstr "" +msgstr "Serviceが必要" #: shared-bindings/_bleio/Adapter.c msgid "Expected a UART" -msgstr "" +msgstr "UARTが必要" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -842,7 +842,7 @@ msgstr "UUIDが必要" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" -msgstr "" +msgstr "Addressが必要" #: shared-module/_pixelbuf/PixelBuf.c #, c-format @@ -886,7 +886,7 @@ msgstr "%dバイトのRXバッファの確保に失敗" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" -msgstr "" +msgstr "Wi-Fiのメモリの確保に失敗" #: ports/esp32s2/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" @@ -1052,7 +1052,7 @@ msgstr "不正なBMPファイル" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "不正なBSSID" #: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c @@ -1103,7 +1103,7 @@ msgstr "フォーマットチャンクのサイズが不正" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "" +msgstr "不正な周波数" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" @@ -1338,11 +1338,11 @@ msgstr "long integerに対応していません" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" -msgstr "" +msgstr "使えるチャネルがもうありません" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more timers available" -msgstr "" +msgstr "使えるタイマーがもうありません" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." @@ -1658,7 +1658,7 @@ msgstr "" #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" -msgstr "" +msgstr "サイズは対応していません" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." From cb159569c23f71704b1787f8d6cabacedccca958 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Fri, 6 Nov 2020 21:29:26 +0100 Subject: [PATCH 089/251] 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 | 9 +++++++-- locale/cs.po | 9 +++++++-- locale/de_DE.po | 9 +++++++-- locale/el.po | 9 +++++++-- locale/es.po | 9 +++++++-- locale/fil.po | 9 +++++++-- locale/fr.po | 9 +++++++-- locale/hi.po | 9 +++++++-- locale/it_IT.po | 9 +++++++-- locale/ja.po | 9 +++++++-- locale/ko.po | 9 +++++++-- locale/nl.po | 9 +++++++-- locale/pl.po | 9 +++++++-- locale/pt_BR.po | 9 +++++++-- locale/sv.po | 9 +++++++-- locale/zh_Latn_pinyin.po | 9 +++++++-- 16 files changed, 112 insertions(+), 32 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 7debab27ac..3e47dc9a18 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -300,6 +300,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Semua perangkat I2C sedang digunakan" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1130,7 +1134,8 @@ msgid "Invalid phase" msgstr "Fase tidak valid" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pin tidak valid" diff --git a/locale/cs.po b/locale/cs.po index e4f677d8e2..428d6d1fe6 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -300,6 +300,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1113,7 +1117,8 @@ msgid "Invalid phase" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 141a5e8c03..059d726cab 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -299,6 +299,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1130,7 +1134,8 @@ msgid "Invalid phase" msgstr "Ungültige Phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Ungültiger Pin" diff --git a/locale/el.po b/locale/el.po index cc6da670cd..327f4dbe0f 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -295,6 +295,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1108,7 +1112,8 @@ msgid "Invalid phase" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" diff --git a/locale/es.po b/locale/es.po index a750c80554..95d6a92ff5 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-11-01 16:26+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -303,6 +303,10 @@ msgstr "Todos los periféricos CAN están en uso" msgid "All I2C peripherals are in use" msgstr "Todos los periféricos I2C están siendo usados" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1131,7 +1135,8 @@ msgid "Invalid phase" msgstr "Fase inválida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pin inválido" diff --git a/locale/fil.po b/locale/fil.po index 7bc33dba3e..ce3b5616a3 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -297,6 +297,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1123,7 +1127,8 @@ msgid "Invalid phase" msgstr "Mali ang phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Mali ang pin" diff --git a/locale/fr.po b/locale/fr.po index 920e22cb0c..94ca1f21cf 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-10-22 20:48+0000\n" "Last-Translator: Antonin ENFRUN \n" "Language: fr\n" @@ -304,6 +304,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Tous les périphériques I2C sont utilisés" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1136,7 +1140,8 @@ msgid "Invalid phase" msgstr "Phase invalide" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Broche invalide" diff --git a/locale/hi.po b/locale/hi.po index 4966ad8e80..d87a1eb9ce 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -295,6 +295,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1108,7 +1112,8 @@ msgid "Invalid phase" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 82840c8523..657c581cef 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -296,6 +296,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1125,7 +1129,8 @@ msgid "Invalid phase" msgstr "Fase non valida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pin non valido" diff --git a/locale/ja.po b/locale/ja.po index c9a85c1a23..7004c49f30 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-11-06 20:29+0000\n" "Last-Translator: sporeball \n" "Language-Team: none\n" @@ -302,6 +302,10 @@ msgstr "全てのCAN周辺機器が使用中" msgid "All I2C peripherals are in use" msgstr "全てのI2C周辺機器が使用中" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1123,7 +1127,8 @@ msgid "Invalid phase" msgstr "不正なphase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "不正なピン" diff --git a/locale/ko.po b/locale/ko.po index 858a036c83..4b302f3b9f 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -298,6 +298,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "사용중인 모든 I2C주변 기기" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1113,7 +1117,8 @@ msgid "Invalid phase" msgstr "단계가 잘못되었습니다" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "핀이 잘못되었습니다" diff --git a/locale/nl.po b/locale/nl.po index bf05abb721..6851e6ef32 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-10-27 16:47+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -300,6 +300,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Alle I2C peripherals zijn in gebruik" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1125,7 +1129,8 @@ msgid "Invalid phase" msgstr "Ongeldige fase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Ongeldige pin" diff --git a/locale/pl.po b/locale/pl.po index 1dbb0ba12b..54ef4d9185 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-09-29 01:39+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -302,6 +302,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Wszystkie peryferia I2C w użyciu" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1123,7 +1127,8 @@ msgid "Invalid phase" msgstr "Zła faza" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Zła nóżka" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 7ad85e0b78..ac5c7a6678 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-10-28 21:45+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -304,6 +304,10 @@ msgstr "Todos os periféricos CAN estão em uso" msgid "All I2C peripherals are in use" msgstr "Todos os periféricos I2C estão em uso" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1134,7 +1138,8 @@ msgid "Invalid phase" msgstr "Fase Inválida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pino inválido" diff --git a/locale/sv.po b/locale/sv.po index 9182a99430..d9639aff6e 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-11-05 20:26+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -300,6 +300,10 @@ msgstr "All I2C-kringutrustning används" msgid "All I2C peripherals are in use" msgstr "All I2C-kringutrustning används" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1123,7 +1127,8 @@ msgid "Invalid phase" msgstr "Ogiltig fas" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Ogiltig pinne" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 4cc86400d9..c1853a73a5 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-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-10-28 21:45+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -302,6 +302,10 @@ msgstr "suǒ yǒu CAN wài shè dōu zài shǐ yòng zhōng" msgid "All I2C peripherals are in use" msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1121,7 +1125,8 @@ msgid "Invalid phase" msgstr "Jiēduàn wúxiào" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Wúxiào de yǐn jiǎo" From b2e83952c026485866a7b5a830d85850b09abb38 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 6 Nov 2020 15:27:16 -0800 Subject: [PATCH 090/251] Rebrand EInk Portal to MagTag --- .../{adafruit_esp32s2_eink_portal => adafruit_magtag}/board.c | 0 .../mpconfigboard.h | 2 +- .../mpconfigboard.mk | 2 +- .../{adafruit_esp32s2_eink_portal => adafruit_magtag}/pins.c | 0 .../{adafruit_esp32s2_eink_portal => adafruit_magtag}/sdkconfig | 0 5 files changed, 2 insertions(+), 2 deletions(-) rename ports/esp32s2/boards/{adafruit_esp32s2_eink_portal => adafruit_magtag}/board.c (100%) rename ports/esp32s2/boards/{adafruit_esp32s2_eink_portal => adafruit_magtag}/mpconfigboard.h (97%) rename ports/esp32s2/boards/{adafruit_esp32s2_eink_portal => adafruit_magtag}/mpconfigboard.mk (92%) rename ports/esp32s2/boards/{adafruit_esp32s2_eink_portal => adafruit_magtag}/pins.c (100%) rename ports/esp32s2/boards/{adafruit_esp32s2_eink_portal => adafruit_magtag}/sdkconfig (100%) diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/board.c b/ports/esp32s2/boards/adafruit_magtag/board.c similarity index 100% rename from ports/esp32s2/boards/adafruit_esp32s2_eink_portal/board.c rename to ports/esp32s2/boards/adafruit_magtag/board.c diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.h b/ports/esp32s2/boards/adafruit_magtag/mpconfigboard.h similarity index 97% rename from ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.h rename to ports/esp32s2/boards/adafruit_magtag/mpconfigboard.h index 5a17a0cad1..be376e5a94 100644 --- a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.h +++ b/ports/esp32s2/boards/adafruit_magtag/mpconfigboard.h @@ -26,7 +26,7 @@ //Micropython setup -#define MICROPY_HW_BOARD_NAME "EInk Portal" +#define MICROPY_HW_BOARD_NAME "MagTag" #define MICROPY_HW_MCU_NAME "ESP32S2" #define MICROPY_HW_NEOPIXEL (&pin_GPIO1) diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.mk b/ports/esp32s2/boards/adafruit_magtag/mpconfigboard.mk similarity index 92% rename from ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.mk rename to ports/esp32s2/boards/adafruit_magtag/mpconfigboard.mk index 31aff57da4..0a141cbe3e 100644 --- a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.mk +++ b/ports/esp32s2/boards/adafruit_magtag/mpconfigboard.mk @@ -1,6 +1,6 @@ USB_VID = 0x239A USB_PID = 0x80E6 -USB_PRODUCT = "EInk Portal" +USB_PRODUCT = "MagTag" USB_MANUFACTURER = "Adafruit" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c b/ports/esp32s2/boards/adafruit_magtag/pins.c similarity index 100% rename from ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c rename to ports/esp32s2/boards/adafruit_magtag/pins.c diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/sdkconfig b/ports/esp32s2/boards/adafruit_magtag/sdkconfig similarity index 100% rename from ports/esp32s2/boards/adafruit_esp32s2_eink_portal/sdkconfig rename to ports/esp32s2/boards/adafruit_magtag/sdkconfig From 9ef23e8659d4ee58e3158c63f690108b411015a1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 6 Nov 2020 15:29:58 -0800 Subject: [PATCH 091/251] Fix build board list --- .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 404d2ea2e5..a2e9e92aba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -421,7 +421,7 @@ jobs: fail-fast: false matrix: board: - - "adafruit_esp32s2_eink_portal" + - "adafruit_magtag" - "adafruit_metro_esp32s2" - "electroniccats_bastwifi" - "espressif_kaluga_1" From 55e0e2c4ba7dfa1d3e2ba84a4af3b4f132ae1a23 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sun, 8 Nov 2020 11:12:32 +0530 Subject: [PATCH 092/251] Update rotaryio implementation --- .../common-hal/rotaryio/IncrementalEncoder.c | 79 ++++++------------- .../common-hal/rotaryio/IncrementalEncoder.h | 9 +-- 2 files changed, 29 insertions(+), 59 deletions(-) diff --git a/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c index bbff363740..25529ac723 100644 --- a/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * 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 @@ -25,29 +25,22 @@ */ #include "common-hal/rotaryio/IncrementalEncoder.h" +#include "common-hal/microcontroller/Pin.h" #include "py/runtime.h" #include "supervisor/shared/translate.h" -#include "driver/pcnt.h" +void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencoder_obj_t* self, + const mcu_pin_obj_t* pin_a, const mcu_pin_obj_t* pin_b) { + claim_pin(pin_a); + claim_pin(pin_b); -static void pcnt_reset(int unit) { - // Initialize PCNT's counter - pcnt_counter_pause(unit); - pcnt_counter_clear(unit); - - // Everything is set up, now go to counting - pcnt_counter_resume(unit); -} - -static void pcnt_init(int unit, rotaryio_incrementalencoder_obj_t* self) { // Prepare configuration for the PCNT unit - pcnt_config_t pcnt_config = { + const pcnt_config_t pcnt_config = { // Set PCNT input signal and control GPIOs - .pulse_gpio_num = self->pin_a->number, - .ctrl_gpio_num = self->pin_b->number, + .pulse_gpio_num = pin_a->number, + .ctrl_gpio_num = pin_b->number, .channel = PCNT_CHANNEL_0, - .unit = unit, // What to do on the positive / negative edge of pulse input? .pos_mode = PCNT_COUNT_DEC, // Count up on the positive edge .neg_mode = PCNT_COUNT_INC, // Keep the counter value on the negative edge @@ -55,61 +48,39 @@ static void pcnt_init(int unit, rotaryio_incrementalencoder_obj_t* self) { .lctrl_mode = PCNT_MODE_REVERSE, // Reverse counting direction if low .hctrl_mode = PCNT_MODE_KEEP, // Keep the primary counter mode if high }; - // Initialize PCNT unit - pcnt_unit_config(&pcnt_config); - // Configure channel 1 - pcnt_config.pulse_gpio_num = self->pin_b->number; - pcnt_config.ctrl_gpio_num = self->pin_a->number; - pcnt_config.channel = PCNT_CHANNEL_1; - pcnt_config.pos_mode = PCNT_COUNT_INC; - pcnt_config.neg_mode = PCNT_COUNT_DEC; - pcnt_unit_config(&pcnt_config); + // Initialize PCNT unit + const int8_t unit = peripherals_pcnt_init(pcnt_config); + if (unit == -1) { + mp_raise_RuntimeError(translate("All PCNT units in use")); + } - // Configure and enable the input filter - pcnt_set_filter_value(unit, 100); - pcnt_filter_enable(unit); - - pcnt_reset(unit); -} - -void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencoder_obj_t* self, - const mcu_pin_obj_t* pin_a, const mcu_pin_obj_t* pin_b) { - claim_pin(pin_a); - claim_pin(pin_b); - - self->pin_a = pin_a; - self->pin_b = pin_b; - - self->position = 0; - - pcnt_init(PCNT_UNIT_0, self); + self->pin_a = pin_a->number; + self->pin_b = pin_b->number; + self->unit = (pcnt_unit_t)unit; } bool common_hal_rotaryio_incrementalencoder_deinited(rotaryio_incrementalencoder_obj_t* self) { - return self->pin_a == NULL; + return self->unit == PCNT_UNIT_MAX; } void common_hal_rotaryio_incrementalencoder_deinit(rotaryio_incrementalencoder_obj_t* self) { if (common_hal_rotaryio_incrementalencoder_deinited(self)) { return; } - - reset_pin_number(self->pin_a->number); - self->pin_a = NULL; - - reset_pin_number(self->pin_b->number); - self->pin_b = NULL; + reset_pin_number(self->pin_a); + reset_pin_number(self->pin_b); + peripherals_pcnt_deinit(&self->unit); } mp_int_t common_hal_rotaryio_incrementalencoder_get_position(rotaryio_incrementalencoder_obj_t* self) { - int16_t count = 0; - pcnt_get_counter_value(PCNT_UNIT_0, &count); - return self->position+count; + int16_t count; + pcnt_get_counter_value(self->unit, &count); + return (count/2)+self->position; } void common_hal_rotaryio_incrementalencoder_set_position(rotaryio_incrementalencoder_obj_t* self, mp_int_t new_position) { self->position = new_position; - pcnt_reset(PCNT_UNIT_0); + pcnt_counter_clear(self->unit); } diff --git a/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h index 0cc2830fb7..8a717b7b5d 100644 --- a/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h +++ b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * 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 @@ -27,15 +27,14 @@ #ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H #define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H -#include "common-hal/microcontroller/Pin.h" - #include "py/obj.h" +#include "peripherals/pcnt.h" typedef struct { mp_obj_base_t base; - const mcu_pin_obj_t * pin_a; - const mcu_pin_obj_t * pin_b; + uint8_t pin_a, pin_b; mp_int_t position; + pcnt_unit_t unit; } rotaryio_incrementalencoder_obj_t; #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H From 7ba2c5772ccbe48c5c52d62493f9c899a1d0963a Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sun, 8 Nov 2020 11:18:05 +0530 Subject: [PATCH 093/251] Update license --- ports/esp32s2/common-hal/touchio/TouchIn.c | 2 +- ports/esp32s2/common-hal/touchio/TouchIn.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.c b/ports/esp32s2/common-hal/touchio/TouchIn.c index 3e3e4b5511..b44234775e 100644 --- a/ports/esp32s2/common-hal/touchio/TouchIn.c +++ b/ports/esp32s2/common-hal/touchio/TouchIn.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * 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 diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.h b/ports/esp32s2/common-hal/touchio/TouchIn.h index 585bb37bf1..91de209316 100644 --- a/ports/esp32s2/common-hal/touchio/TouchIn.h +++ b/ports/esp32s2/common-hal/touchio/TouchIn.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Scott Shawcroft + * 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 From 5505a3649fe56738321e2138aa918d05d63da6b4 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Sat, 7 Nov 2020 10:04:39 +0000 Subject: [PATCH 094/251] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (845 of 845 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index ac5c7a6678..99f090dbd2 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-04 21:18+0530\n" -"PO-Revision-Date: 2020-10-28 21:45+0000\n" +"PO-Revision-Date: 2020-11-08 10:26+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.3.2-dev\n" +"X-Generator: Weblate 4.3.2\n" #: main.c msgid "" @@ -306,7 +306,7 @@ msgstr "Todos os periféricos I2C estão em uso" #: ports/esp32s2/peripherals/pcnt_handler.c msgid "All PCNT units in use" -msgstr "" +msgstr "Todas as unidades PCNT estão em uso" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c From 9adb77a2d0179f89c7402451f6b25be74629ffbd Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sun, 8 Nov 2020 19:28:46 -0600 Subject: [PATCH 095/251] set moved true when unhiding tilegrid --- shared-module/displayio/TileGrid.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c index e3642107f8..e8050a5397 100644 --- a/shared-module/displayio/TileGrid.c +++ b/shared-module/displayio/TileGrid.c @@ -83,10 +83,16 @@ bool common_hal_displayio_tilegrid_get_hidden(displayio_tilegrid_t* self) { void common_hal_displayio_tilegrid_set_hidden(displayio_tilegrid_t* self, bool hidden) { self->hidden = hidden; + if(!hidden){ + self->moved = true; + } } void displayio_tilegrid_set_hidden_by_parent(displayio_tilegrid_t *self, bool hidden) { self->hidden_by_parent = hidden; + if(!hidden){ + self->moved = true; + } } bool displayio_tilegrid_get_previous_area(displayio_tilegrid_t *self, displayio_area_t* area) { From 0ff20cdd85d742c2668b044474b2ddc29546fc9c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 9 Nov 2020 08:27:20 -0600 Subject: [PATCH 096/251] RGBMatrix: Detect invalid bit_depth selection Closes: #3650 --- shared-bindings/rgbmatrix/RGBMatrix.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index 753c1c9203..5f5ea4fae7 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -197,6 +197,11 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n uint8_t clock_pin = validate_pin(args[ARG_clock_pin].u_obj); uint8_t latch_pin = validate_pin(args[ARG_latch_pin].u_obj); uint8_t output_enable_pin = validate_pin(args[ARG_output_enable_pin].u_obj); + int bit_depth = args[ARG_bit_depth].u_int; + + if (bit_depth <= 0 || bit_depth > 6) { + mp_raise_ValueError_varg(translate("Bit depth must be from 1 to 6 inclusive, not %d"), bit_depth); + } validate_pins(MP_QSTR_rgb_pins, rgb_pins, MP_ARRAY_SIZE(self->rgb_pins), args[ARG_rgb_list].u_obj, &rgb_count); validate_pins(MP_QSTR_addr_pins, addr_pins, MP_ARRAY_SIZE(self->addr_pins), args[ARG_addr_list].u_obj, &addr_count); @@ -229,7 +234,7 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n common_hal_rgbmatrix_rgbmatrix_construct(self, args[ARG_width].u_int, - args[ARG_bit_depth].u_int, + bit_depth, rgb_count, rgb_pins, addr_count, addr_pins, clock_pin, latch_pin, output_enable_pin, From 5554c27600291786c5f09b1671ef5e29eae22619 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 9 Nov 2020 09:49:43 -0600 Subject: [PATCH 097/251] make translate --- locale/circuitpython.pot | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index a5581e7fa7..3fb2f0719b 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-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-11-09 09:49-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -416,6 +416,11 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "" @@ -2863,14 +2868,6 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "" -#: extmod/ulab/code/approx/approx.c -msgid "maxiter must be > 0" -msgstr "" - -#: extmod/ulab/code/approx/approx.c -msgid "maxiter should be > 0" -msgstr "" - #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3303,10 +3300,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 "" From d1f15d314bd630b073c70c093053c16ac34131bb Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 9 Nov 2020 15:03:22 -0800 Subject: [PATCH 098/251] Rename to include display details --- .github/workflows/build.yml | 2 +- .../{adafruit_magtag => adafruit_magtag_2.9_grayscale}/board.c | 0 .../mpconfigboard.h | 0 .../mpconfigboard.mk | 0 .../{adafruit_magtag => adafruit_magtag_2.9_grayscale}/pins.c | 0 .../sdkconfig | 0 6 files changed, 1 insertion(+), 1 deletion(-) rename ports/esp32s2/boards/{adafruit_magtag => adafruit_magtag_2.9_grayscale}/board.c (100%) rename ports/esp32s2/boards/{adafruit_magtag => adafruit_magtag_2.9_grayscale}/mpconfigboard.h (100%) rename ports/esp32s2/boards/{adafruit_magtag => adafruit_magtag_2.9_grayscale}/mpconfigboard.mk (100%) rename ports/esp32s2/boards/{adafruit_magtag => adafruit_magtag_2.9_grayscale}/pins.c (100%) rename ports/esp32s2/boards/{adafruit_magtag => adafruit_magtag_2.9_grayscale}/sdkconfig (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a2e9e92aba..c83f37e6ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -421,7 +421,7 @@ jobs: fail-fast: false matrix: board: - - "adafruit_magtag" + - "adafruit_magtag_2.9_grayscale" - "adafruit_metro_esp32s2" - "electroniccats_bastwifi" - "espressif_kaluga_1" diff --git a/ports/esp32s2/boards/adafruit_magtag/board.c b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/board.c similarity index 100% rename from ports/esp32s2/boards/adafruit_magtag/board.c rename to ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/board.c diff --git a/ports/esp32s2/boards/adafruit_magtag/mpconfigboard.h b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/adafruit_magtag/mpconfigboard.h rename to ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h diff --git a/ports/esp32s2/boards/adafruit_magtag/mpconfigboard.mk b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/adafruit_magtag/mpconfigboard.mk rename to ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk diff --git a/ports/esp32s2/boards/adafruit_magtag/pins.c b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c similarity index 100% rename from ports/esp32s2/boards/adafruit_magtag/pins.c rename to ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c diff --git a/ports/esp32s2/boards/adafruit_magtag/sdkconfig b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/sdkconfig similarity index 100% rename from ports/esp32s2/boards/adafruit_magtag/sdkconfig rename to ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/sdkconfig From 46c9b28dd880d4e2e2764ab67f64356b175f5f98 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 9 Nov 2020 18:14:31 -0600 Subject: [PATCH 099/251] use full_change instead of moved --- shared-module/displayio/TileGrid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c index e8050a5397..19ea10e552 100644 --- a/shared-module/displayio/TileGrid.c +++ b/shared-module/displayio/TileGrid.c @@ -84,14 +84,14 @@ bool common_hal_displayio_tilegrid_get_hidden(displayio_tilegrid_t* self) { void common_hal_displayio_tilegrid_set_hidden(displayio_tilegrid_t* self, bool hidden) { self->hidden = hidden; if(!hidden){ - self->moved = true; + self->full_change = true; } } void displayio_tilegrid_set_hidden_by_parent(displayio_tilegrid_t *self, bool hidden) { self->hidden_by_parent = hidden; if(!hidden){ - self->moved = true; + self->full_change = true; } } From 6c59836c5db03744d7dbef01c2323989d13ef02a Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Tue, 10 Nov 2020 16:32:46 +0530 Subject: [PATCH 100/251] watchdog implementation for esp32s2 --- locale/circuitpython.pot | 15 +++- .../common-hal/microcontroller/__init__.c | 11 +++ .../common-hal/watchdog/WatchDogMode.c | 1 + .../common-hal/watchdog/WatchDogTimer.c | 86 +++++++++++++++++++ .../common-hal/watchdog/WatchDogTimer.h | 44 ++++++++++ ports/esp32s2/common-hal/watchdog/__init__.c | 1 + ports/esp32s2/mpconfigport.mk | 1 + 7 files changed, 157 insertions(+), 2 deletions(-) create mode 100644 ports/esp32s2/common-hal/watchdog/WatchDogMode.c create mode 100644 ports/esp32s2/common-hal/watchdog/WatchDogTimer.c create mode 100644 ports/esp32s2/common-hal/watchdog/WatchDogTimer.h create mode 100644 ports/esp32s2/common-hal/watchdog/__init__.c diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index b4445abfbf..7a39e9a327 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-10 15: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 "" @@ -992,6 +993,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking 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 @@ -3416,6 +3422,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "" @@ -3599,6 +3606,10 @@ msgstr "" msgid "vectors must have same lengths" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" diff --git a/ports/esp32s2/common-hal/microcontroller/__init__.c b/ports/esp32s2/common-hal/microcontroller/__init__.c index 6b2e18673d..e5cfc7eef0 100644 --- a/ports/esp32s2/common-hal/microcontroller/__init__.c +++ b/ports/esp32s2/common-hal/microcontroller/__init__.c @@ -85,6 +85,17 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }, }; +#if CIRCUITPY_WATCHDOG +// The singleton watchdog.WatchDogTimer object. +watchdog_watchdogtimer_obj_t common_hal_mcu_watchdogtimer_obj = { + .base = { + .type = &watchdog_watchdogtimer_type, + }, + .timeout = 0.0f, + .mode = WATCHDOGMODE_NONE, +}; +#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/watchdog/WatchDogMode.c b/ports/esp32s2/common-hal/watchdog/WatchDogMode.c new file mode 100644 index 0000000000..fc4e0e008c --- /dev/null +++ b/ports/esp32s2/common-hal/watchdog/WatchDogMode.c @@ -0,0 +1 @@ +// No watchdog module functions. diff --git a/ports/esp32s2/common-hal/watchdog/WatchDogTimer.c b/ports/esp32s2/common-hal/watchdog/WatchDogTimer.c new file mode 100644 index 0000000000..59b9dafcf0 --- /dev/null +++ b/ports/esp32s2/common-hal/watchdog/WatchDogTimer.c @@ -0,0 +1,86 @@ +/* + * 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 "py/runtime.h" +#include "common-hal/watchdog/WatchDogTimer.h" + +#include "shared-bindings/microcontroller/__init__.h" + +#include "esp_task_wdt.h" + +void esp_task_wdt_isr_user_handler(void) { + +} + +void common_hal_watchdog_feed(watchdog_watchdogtimer_obj_t *self) { + if (esp_task_wdt_reset() != ESP_OK) { + mp_raise_RuntimeError(translate("watchdog not initialized")); + } +} + +void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self) { + if (esp_task_wdt_deinit() == ESP_OK) { + self->mode = WATCHDOGMODE_NONE; + } +} + +void watchdog_reset(void) { + common_hal_watchdog_deinit(&common_hal_mcu_watchdogtimer_obj); +} + +static void wdt_config(watchdog_watchdogtimer_obj_t *self) { + // enable panic hanler in WATCHDOGMODE_RESET mode + // initialize Task Watchdog Timer (TWDT) + if (esp_task_wdt_init((uint32_t)self->timeout, (self->mode == WATCHDOGMODE_RESET)) != ESP_OK) { + mp_raise_RuntimeError(translate("Initialization failed due to lack of memory")); + } + esp_task_wdt_add(NULL); +} + +mp_float_t common_hal_watchdog_get_timeout(watchdog_watchdogtimer_obj_t *self) { + return self->timeout; +} + +void common_hal_watchdog_set_timeout(watchdog_watchdogtimer_obj_t *self, mp_float_t new_timeout) { + if ((uint64_t)new_timeout > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + if ((uint32_t)self->timeout != (uint32_t)new_timeout) { + self->timeout = new_timeout; + wdt_config(self); + } +} + +watchdog_watchdogmode_t common_hal_watchdog_get_mode(watchdog_watchdogtimer_obj_t *self) { + return self->mode; +} + +void common_hal_watchdog_set_mode(watchdog_watchdogtimer_obj_t *self, watchdog_watchdogmode_t new_mode) { + if (self->mode != new_mode) { + self->mode = new_mode; + wdt_config(self); + } +} diff --git a/ports/esp32s2/common-hal/watchdog/WatchDogTimer.h b/ports/esp32s2/common-hal/watchdog/WatchDogTimer.h new file mode 100644 index 0000000000..05e0e954d2 --- /dev/null +++ b/ports/esp32s2/common-hal/watchdog/WatchDogTimer.h @@ -0,0 +1,44 @@ +/* + * 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_WATCHDOG_WATCHDOGTIMER_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H + +#include "py/obj.h" +#include "shared-bindings/watchdog/WatchDogMode.h" +#include "shared-bindings/watchdog/WatchDogTimer.h" + +struct _watchdog_watchdogtimer_obj_t { + mp_obj_base_t base; + mp_float_t timeout; + watchdog_watchdogmode_t mode; +}; + +// This needs to be called in order to disable the watchdog if it's set to +// "RAISE". If set to "RESET", then the watchdog cannot be reset. +void watchdog_reset(void); + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H diff --git a/ports/esp32s2/common-hal/watchdog/__init__.c b/ports/esp32s2/common-hal/watchdog/__init__.c new file mode 100644 index 0000000000..fc4e0e008c --- /dev/null +++ b/ports/esp32s2/common-hal/watchdog/__init__.c @@ -0,0 +1 @@ +// No watchdog module functions. diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 4579b95ab6..335d2caf72 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -25,6 +25,7 @@ CIRCUITPY_NVM = 0 # We don't have enough endpoints to include MIDI. CIRCUITPY_USB_MIDI = 0 CIRCUITPY_WIFI = 1 +CIRCUITPY_WATCHDOG ?= 1 CIRCUITPY_ESPIDF = 1 ifndef CIRCUITPY_TOUCHIO_USE_NATIVE From b293aa7e0961f907ff49c28e3a169112cd1d0b3e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 10 Nov 2020 09:12:16 -0600 Subject: [PATCH 101/251] protomatter: Update to upstream tag 1.0.10 Among other things this fixes a problem with blanking the display and Closes #3664. --- lib/protomatter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protomatter b/lib/protomatter index de6b7704c5..902c16f491 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit de6b7704c530d886ad8dfa0fa1864764d86117ee +Subproject commit 902c16f49197a8baf5e71ec924a812a86e733a74 From 2d8ebfcf633a0e744e49fe14cc0025d8d7d348fc Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 10 Nov 2020 10:41:10 -0600 Subject: [PATCH 102/251] esp32s2: Correct port_stack_get_top() Closes #3649 --- ports/esp32s2/supervisor/port.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 0b9c03f747..a25bcce00a 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -148,7 +148,18 @@ uint32_t *port_stack_get_limit(void) { } uint32_t *port_stack_get_top(void) { - return port_stack_get_limit() + CONFIG_ESP_MAIN_TASK_STACK_SIZE / (sizeof(uint32_t) / sizeof(StackType_t)); + // The sizeof-arithmetic is so that the pointer arithmetic is done on units + // of uint32_t instead of units of StackType_t. StackType_t is an alias + // for a byte sized type. + // + // The main stack is bigger than CONFIG_ESP_MAIN_TASK_STACK_SIZE -- an + // "extra" size is added to it (TASK_EXTRA_STACK_SIZE). This total size is + // available as ESP_TASK_MAIN_STACK. Presumably TASK_EXTRA_STACK_SIZE is + // additional stack that can be used by the esp-idf runtime. But what's + // important for us is that some very outermost stack frames, such as + // pyexec_friendly_repl, could lie inside the "extra" area and be invisible + // to the garbage collector. + return port_stack_get_limit() + ESP_TASK_MAIN_STACK / (sizeof(uint32_t) / sizeof(StackType_t)); } supervisor_allocation _fixed_stack; From 44425b8d94d25709cb874b35f74a31da95bbfa38 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 10 Nov 2020 11:32:59 -0600 Subject: [PATCH 103/251] Requested review changes made --- ports/esp32s2/supervisor/port.c | 13 ++++++------- ports/esp32s2/supervisor/usb.c | 8 +++++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 46de636276..4b9a4f7eff 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -55,8 +55,7 @@ uint32_t* heap; uint32_t heap_size; -extern TaskHandle_t xTaskToNotify; - +extern TaskHandle_t sleeping_circuitpython_task; STATIC esp_timer_handle_t _tick_timer; extern void esp_restart(void) NORETURN; @@ -191,23 +190,23 @@ void port_disable_tick(void) { } TickType_t sleep_time_duration; -uint32_t NotifyValue = 0; -BaseType_t notify_wait = 0; void port_interrupt_after_ticks(uint32_t ticks) { sleep_time_duration = (ticks * 100)/1024; - xTaskToNotify = xTaskGetCurrentTaskHandle(); + sleeping_circuitpython_task = xTaskGetCurrentTaskHandle(); } void port_sleep_until_interrupt(void) { + uint32_t NotifyValue = 0; + if (sleep_time_duration == 0) { return; } - notify_wait = xTaskNotifyWait(0x01,0x01,&NotifyValue, + xTaskNotifyWait(0x01,0x01,&NotifyValue, sleep_time_duration ); if (NotifyValue == 1) { - xTaskToNotify = NULL; + sleeping_circuitpython_task = NULL; mp_handle_pending(); } } diff --git a/ports/esp32s2/supervisor/usb.c b/ports/esp32s2/supervisor/usb.c index 86186d36b8..2bfcdfb125 100644 --- a/ports/esp32s2/supervisor/usb.c +++ b/ports/esp32s2/supervisor/usb.c @@ -52,7 +52,7 @@ StackType_t usb_device_stack[USBD_STACK_SIZE]; StaticTask_t usb_device_taskdef; -TaskHandle_t xTaskToNotify = NULL; +TaskHandle_t sleeping_circuitpython_task = NULL; // USB Device Driver task // This top level thread process all usb events and invoke callbacks @@ -129,8 +129,10 @@ void tud_cdc_rx_wanted_cb(uint8_t itf, char wanted_char) if (mp_interrupt_char == wanted_char) { tud_cdc_read_flush(); // flush read fifo mp_keyboard_interrupt(); - if (xTaskToNotify != NULL) { - xTaskNotifyGive(xTaskToNotify); + // CircuitPython's VM is run in a separate FreeRTOS task from TinyUSB. + // So, we must notify the other task when a CTRL-C is received. + if (sleeping_circuitpython_task != NULL) { + xTaskNotifyGive(sleeping_circuitpython_task); } } } From fe7ed999393e369243319c48453cc2f7add3e7f0 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 10 Nov 2020 12:45:39 -0600 Subject: [PATCH 104/251] Split out extern declare to ports/esp32s2/supervisor/esp_port.h --- ports/esp32s2/supervisor/esp_port.h | 35 +++++++++++++++++++++++++++++ ports/esp32s2/supervisor/port.c | 3 ++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 ports/esp32s2/supervisor/esp_port.h diff --git a/ports/esp32s2/supervisor/esp_port.h b/ports/esp32s2/supervisor/esp_port.h new file mode 100644 index 0000000000..1164666cda --- /dev/null +++ b/ports/esp32s2/supervisor/esp_port.h @@ -0,0 +1,35 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_SUPERVISOR_PORT_H +#define MICROPY_INCLUDED_ESP32S2_SUPERVISOR_PORT_H + +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" + +extern TaskHandle_t sleeping_circuitpython_task; + +#endif // MICROPY_INCLUDED_ESP32S2_SUPERVISOR_PORT_H diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 4b9a4f7eff..0ac2236d31 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -31,6 +31,7 @@ #include "boards/board.h" #include "modules/module.h" #include "py/runtime.h" +#include "supervisor/esp_port.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" @@ -55,7 +56,7 @@ uint32_t* heap; uint32_t heap_size; -extern TaskHandle_t sleeping_circuitpython_task; + STATIC esp_timer_handle_t _tick_timer; extern void esp_restart(void) NORETURN; From 10e8b8cf456b36b6e1e1582601a3fc437727cec5 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 11 Nov 2020 00:24:01 +0530 Subject: [PATCH 105/251] move port specific check --- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 3 +++ shared-bindings/watchdog/WatchDogTimer.c | 7 +------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index bec0ac4732..539b43e762 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -93,6 +93,9 @@ void common_hal_watchdog_feed(watchdog_watchdogtimer_obj_t *self) { } void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self) { + if (self->mode == WATCHDOGMODE_RESET) { + mp_raise_NotImplementedError(translate("WatchDogTimer cannot be deinitialized once mode is set to RESET")); + } if (timer) { timer_free(); } diff --git a/shared-bindings/watchdog/WatchDogTimer.c b/shared-bindings/watchdog/WatchDogTimer.c index 09219f7109..575021a219 100644 --- a/shared-bindings/watchdog/WatchDogTimer.c +++ b/shared-bindings/watchdog/WatchDogTimer.c @@ -66,6 +66,7 @@ STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in) { if (current_mode == WATCHDOGMODE_NONE) { mp_raise_ValueError(translate("WatchDogTimer is not currently running")); } + common_hal_watchdog_feed(self); return mp_const_none; } @@ -78,12 +79,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watch //| STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - watchdog_watchdogmode_t current_mode = common_hal_watchdog_get_mode(self); - - if (current_mode == WATCHDOGMODE_RESET) { - mp_raise_NotImplementedError(translate("WatchDogTimer cannot be deinitialized once mode is set to RESET")); - } - common_hal_watchdog_deinit(self); return mp_const_none; } From 1192eebcdf3fbfa383a868d3a349535858e3e0e3 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Tue, 10 Nov 2020 14:12:44 -0600 Subject: [PATCH 106/251] adding spi and i2c to board for um feather s2 --- .../boards/unexpectedmaker_feathers2/mpconfigboard.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h index 5a885f29ce..b320fdc8de 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h @@ -37,3 +37,10 @@ // #define MICROPY_HW_APA102_MOSI (&pin_GPIO40) // #define MICROPY_HW_APA102_SCK (&pin_GPIO45) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO9) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) \ No newline at end of file From b8f83643b532cfbd76b93f8a88dcf599f6e43c68 Mon Sep 17 00:00:00 2001 From: Szymon Jakubiak Date: Tue, 10 Nov 2020 20:52:38 +0000 Subject: [PATCH 107/251] Translated using Weblate (Polish) Currently translated at 70.7% (598 of 845 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pl/ --- locale/pl.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/pl.po b/locale/pl.po index 54ef4d9185..e3081544c0 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-04 21:18+0530\n" -"PO-Revision-Date: 2020-09-29 01:39+0000\n" -"Last-Translator: Maciej Stankiewicz \n" +"PO-Revision-Date: 2020-11-10 20:52+0000\n" +"Last-Translator: Szymon Jakubiak \n" "Language-Team: pl\n" "Language: pl\n" "MIME-Version: 1.0\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.3-dev\n" +"X-Generator: Weblate 4.4-dev\n" #: main.c msgid "" @@ -76,7 +76,7 @@ msgstr "%q poza zakresem" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "" +msgstr "%q indeksy muszą być liczbami typu int, a nie %q" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -104,7 +104,7 @@ msgstr "%q poza zakresem" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" -msgstr "" +msgstr "%q nieprawidłowy pin" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" From b9294818da33853088957d913ef497db92584c18 Mon Sep 17 00:00:00 2001 From: Maciej Stankiewicz Date: Tue, 10 Nov 2020 20:50:02 +0000 Subject: [PATCH 108/251] Translated using Weblate (Polish) Currently translated at 70.7% (598 of 845 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pl/ --- locale/pl.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/pl.po b/locale/pl.po index e3081544c0..ae532a73f3 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -8,7 +8,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-11-10 20:52+0000\n" -"Last-Translator: Szymon Jakubiak \n" +"Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" "Language: pl\n" "MIME-Version: 1.0\n" @@ -1206,7 +1206,7 @@ msgstr "" #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer musi dziedziczyć z Group albo TileGrid" +msgstr "Layer musi dziedziczyć z Group albo TileGrid." #: py/objslice.c msgid "Length must be an int" From a1276be482e46c08f4ad189f9c22ee724d9d82de Mon Sep 17 00:00:00 2001 From: Maciej Stankiewicz Date: Tue, 10 Nov 2020 21:06:44 +0000 Subject: [PATCH 109/251] Translated using Weblate (Polish) Currently translated at 71.5% (605 of 845 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pl/ --- locale/pl.po | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/locale/pl.po b/locale/pl.po index ae532a73f3..fbae676954 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-04 21:18+0530\n" -"PO-Revision-Date: 2020-11-10 20:52+0000\n" +"PO-Revision-Date: 2020-11-10 21:10+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" "Language: pl\n" @@ -104,7 +104,7 @@ msgstr "%q poza zakresem" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" -msgstr "%q nieprawidłowy pin" +msgstr "nieprawidłowy pin %q" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -254,7 +254,7 @@ msgstr "'return' poza funkcją" #: py/compile.c msgid "'yield from' inside async function" -msgstr "" +msgstr "'yield from' wewnątrz funkcji asynchronicznej" #: py/compile.c msgid "'yield' outside function" @@ -283,7 +283,7 @@ msgstr "Kanał przerwań sprzętowych w użyciu" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "ADC2 jest używany przez WiFi" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format @@ -1033,7 +1033,7 @@ msgstr "Błąd wewnętrzny #%d" #: shared-bindings/sdioio/SDCard.c msgid "Invalid %q" -msgstr "" +msgstr "Nieprawidłowe %q" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1107,7 +1107,7 @@ msgstr "Zła wielkość fragmentu formatu" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "" +msgstr "Nieprawidłowa częstotliwość" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" @@ -1344,7 +1344,7 @@ msgstr "" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" -msgstr "" +msgstr "Brak dostępnych kanałów" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more timers available" @@ -1436,7 +1436,7 @@ msgstr "" #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" -msgstr "" +msgstr "W danym momencie przezroczysty może być tylko jeden kolor" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" @@ -1505,7 +1505,7 @@ msgstr "Oraz moduły w systemie plików\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "Wielokąt musi mieć co najmniej 3 punkty" #: ports/esp32s2/common-hal/pulseio/PulseOut.c msgid "" From 8373146c56707102626e6d51d98bd87cdd43ba27 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Tue, 10 Nov 2020 15:29:17 -0600 Subject: [PATCH 110/251] newline end of file --- ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h index b320fdc8de..ec49fcadf1 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h @@ -43,4 +43,4 @@ #define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) #define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) -#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) \ No newline at end of file +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) From 9da99675b162742c0ecbd0995ce35e62204be3b1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 10 Nov 2020 16:44:09 -0800 Subject: [PATCH 111/251] Correct display sequence format docs --- shared-bindings/displayio/Display.c | 22 ++++++++++++---------- shared-bindings/displayio/EPaperDisplay.c | 11 ++++++----- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 1ed59f2331..8d1a888fe7 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -58,24 +58,26 @@ //| r"""Create a Display object on the given display bus (`FourWire`, `ParallelBus` or `I2CDisplay`). //| //| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a -//| command byte followed by a byte to determine the parameter count and if a delay is need after. -//| When the top bit of the second byte is 1, the next byte will be the delay time in milliseconds. -//| The remaining 7 bits are the parameter count excluding any delay byte. The third through final -//| bytes are the remaining command parameters. The next byte will begin a new command definition. -//| Here is a portion of ILI9341 init code: +//| command byte followed by a byte to determine the parameter count and delay. When the top bit +//| of the second byte is 1 (0x80), a delay will occur after the command parameters are sent. +//| The remaining 7 bits are the parameter count excluding any delay byte. The bytes following +//| are the parameters. When the delay bit is set, a single byte after the parameters specifies +//| the delay duration in milliseconds. The value 0xff will lead to an extra long 500 ms delay +//| instead of 255 ms. The next byte will begin a new command definition. +//| Here is an example: //| //| .. code-block:: python //| //| init_sequence = (b"\xe1\x0f\x00\x0E\x14\x03\x11\x07\x31\xC1\x48\x08\x0F\x0C\x31\x36\x0F" # Set Gamma //| b"\x11\x80\x78"# Exit Sleep then delay 0x78 (120ms) -//| b"\x29\x80\x78"# Display on then delay 0x78 (120ms) +//| b"\x29\x81\xaa\x78"# Display on then delay 0x78 (120ms) //| ) //| display = displayio.Display(display_bus, init_sequence, width=320, height=240) //| -//| The first command is 0xe1 with 15 (0xf) parameters following. The second and third are 0x11 and -//| 0x29 respectively with delays (0x80) of 120ms (0x78) and no parameters. Multiple byte literals -//| (b"") are merged together on load. The parens are needed to allow byte literals on subsequent -//| lines. +//| The first command is 0xe1 with 15 (0xf) parameters following. The second is 0x11 with 0 +//| parameters and a 120ms (0x78) delay. The third command is 0x29 with one parameter 0xaa and a +//| 120ms delay (0x78). Multiple byte literals (b"") are merged together on load. The parens +//| are needed to allow byte literals on subsequent lines. //| //| The initialization sequence should always leave the display memory access inline with the scan //| of the display to minimize tearing artifacts. diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index e0326d9c82..8518e37143 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -65,11 +65,12 @@ //| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every -//| command begins with a command byte followed by a byte to determine the parameter count and if -//| a delay is need after. When the top bit of the second byte is 1, the next byte will be the -//| delay time in milliseconds. The remaining 7 bits are the parameter count excluding any delay -//| byte. The third through final bytes are the remaining command parameters. The next byte will -//| begin a new command definition. +//| command begins with a command byte followed by a byte to determine the parameter count and +//| delay. When the top bit of the second byte is 1 (0x80), a delay will occur after the command +//| parameters are sent. The remaining 7 bits are the parameter count excluding any delay +//| byte. The bytes following are the parameters. When the delay bit is set, a single byte after +//| the parameters specifies the delay duration in milliseconds. The value 0xff will lead to an +//| extra long 500 ms delay instead of 255 ms. The next byte will begin a new command definition. //| //| :param display_bus: The bus that the display is connected to //| :type _DisplayBus: displayio.FourWire or displayio.ParallelBus From f9842566d8c5fe88cda2e153f1beb897aaca993a Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 11 Nov 2020 10:22:48 +0530 Subject: [PATCH 112/251] Add default pin definitions --- .../boards/microdev_micro_s2/mpconfigboard.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h index b87b5dfa08..272ab20fa5 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +++ b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h @@ -25,7 +25,6 @@ */ //Micropython setup - #define MICROPY_HW_BOARD_NAME "microS2" #define MICROPY_HW_MCU_NAME "ESP32S2" @@ -33,8 +32,20 @@ #define MICROPY_HW_BUTTON (&pin_GPIO0) #define MICROPY_HW_NEOPIXEL (&pin_GPIO33) +// Default bus pins +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO1) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) + +#define DEFAULT_UART_BUS_TX (&pin_GPIO43) +#define DEFAULT_UART_BUS_RX (&pin_GPIO44) + #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) +// Explanation of how a user got into safe mode. #define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") #define AUTORESET_DELAY_MS 500 From 118ca7cff44bc3aa50e57915e691e1b8c2f4e563 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Wed, 11 Nov 2020 06:56:57 -0600 Subject: [PATCH 113/251] adding default uart pins --- ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h index ec49fcadf1..b68a31b9e5 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h @@ -44,3 +44,6 @@ #define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) #define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) #define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO44) +#define DEFAULT_UART_BUS_TX (&pin_GPIO43) 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 114/251] 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 9817672df7905a63ac168afd1792a46196864209 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 11 Nov 2020 14:06:34 -0500 Subject: [PATCH 115/251] make translate on 6.0.x --- locale/circuitpython.pot | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3fb2f0719b..931ae6a423 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-09 09:49-0600\n" +"POT-Creation-Date: 2020-11-11 14:06-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2868,6 +2868,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3300,6 +3308,10 @@ 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 "" From 53e9c7b3bc0b1162028789445c2e430c06507a50 Mon Sep 17 00:00:00 2001 From: Maciej Stankiewicz Date: Tue, 10 Nov 2020 21:19:44 +0000 Subject: [PATCH 116/251] Translated using Weblate (Polish) Currently translated at 72.1% (610 of 845 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pl/ --- locale/pl.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locale/pl.po b/locale/pl.po index fbae676954..1b0b41fdf3 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-04 21:18+0530\n" -"PO-Revision-Date: 2020-11-10 21:10+0000\n" +"PO-Revision-Date: 2020-11-11 19:13+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" "Language: pl\n" @@ -1817,7 +1817,7 @@ msgstr "" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" -msgstr "" +msgstr "Błąd zapisu UART" #: shared-module/usb_hid/Device.c msgid "USB Busy" @@ -2014,7 +2014,7 @@ msgstr "__init__() powinien zwracać None" #: py/objtype.c msgid "__init__() should return None, not '%q'" -msgstr "" +msgstr "__init__() powinno zwrócić None, a nie '%q'" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -3057,11 +3057,11 @@ msgstr "nie dość argumentów przy formatowaniu" #: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" -msgstr "" +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 "" +msgstr "liczba punktów musi wynosić co najmniej 2" #: py/obj.c msgid "object '%q' is not a tuple or list" @@ -3374,7 +3374,7 @@ msgstr "" #: shared-bindings/displayio/Bitmap.c msgid "source palette too large" -msgstr "" +msgstr "źródłowa paleta jest zbyt duża" #: py/objstr.c msgid "start/end indices" From c96a86bd8a23cf5d238fabc83790d48b39fccd2c Mon Sep 17 00:00:00 2001 From: hexthat Date: Wed, 11 Nov 2020 08:03:23 +0000 Subject: [PATCH 117/251] Translated using Weblate (Chinese (Pinyin)) Currently translated at 100.0% (845 of 845 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index c1853a73a5..4d45f65bd7 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-04 21:18+0530\n" -"PO-Revision-Date: 2020-10-28 21:45+0000\n" +"PO-Revision-Date: 2020-11-11 19:13+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -15,7 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.3.2-dev\n" +"X-Generator: Weblate 4.4-dev\n" #: main.c msgid "" @@ -304,7 +304,7 @@ msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng" #: ports/esp32s2/peripherals/pcnt_handler.c msgid "All PCNT units in use" -msgstr "" +msgstr "suǒ yǒu zhèng zài shǐ yòng zhōng de PCNT dān yuán" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c From ff411802374d4a77b0bc76da0e4fa31076c0182e Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 12 Nov 2020 16:30:30 +0530 Subject: [PATCH 118/251] pcnt reset on reload --- ports/esp32s2/peripherals/pcnt.c | 18 ++++++++++-------- ports/esp32s2/peripherals/pcnt.h | 1 + ports/esp32s2/supervisor/port.c | 5 +++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ports/esp32s2/peripherals/pcnt.c b/ports/esp32s2/peripherals/pcnt.c index 555a0ec1d3..dd24569bef 100644 --- a/ports/esp32s2/peripherals/pcnt.c +++ b/ports/esp32s2/peripherals/pcnt.c @@ -29,14 +29,20 @@ #define PCNT_UNIT_ACTIVE 1 #define PCNT_UNIT_INACTIVE 0 -static uint8_t pcnt_state[4]; +static uint8_t pcnt_unit_state[4]; + +void peripherals_pcnt_reset(void) { + for (uint8_t i = 0; i<=3; i++) { + pcnt_unit_state[i] = PCNT_UNIT_INACTIVE; + } +} int peripherals_pcnt_init(pcnt_config_t pcnt_config) { // Look for available pcnt unit for (uint8_t i = 0; i<=3; i++) { - if (pcnt_state[i] == PCNT_UNIT_INACTIVE) { + if (pcnt_unit_state[i] == PCNT_UNIT_INACTIVE) { pcnt_config.unit = (pcnt_unit_t)i; - pcnt_state[i] = PCNT_UNIT_ACTIVE; + pcnt_unit_state[i] = PCNT_UNIT_ACTIVE; break; } else if (i == 3) { return -1; @@ -46,10 +52,6 @@ int peripherals_pcnt_init(pcnt_config_t pcnt_config) { // Initialize PCNT unit pcnt_unit_config(&pcnt_config); - // Configure and enable the input filter - pcnt_set_filter_value(pcnt_config.unit, 100); - pcnt_filter_enable(pcnt_config.unit); - // Initialize PCNT's counter pcnt_counter_pause(pcnt_config.unit); pcnt_counter_clear(pcnt_config.unit); @@ -61,6 +63,6 @@ int peripherals_pcnt_init(pcnt_config_t pcnt_config) { } void peripherals_pcnt_deinit(pcnt_unit_t* unit) { - pcnt_state[*unit] = PCNT_UNIT_INACTIVE; + pcnt_unit_state[*unit] = PCNT_UNIT_INACTIVE; *unit = PCNT_UNIT_MAX; } diff --git a/ports/esp32s2/peripherals/pcnt.h b/ports/esp32s2/peripherals/pcnt.h index abed80fd0c..4fce13f4d6 100644 --- a/ports/esp32s2/peripherals/pcnt.h +++ b/ports/esp32s2/peripherals/pcnt.h @@ -31,5 +31,6 @@ extern int peripherals_pcnt_init(pcnt_config_t pcnt_config); extern void peripherals_pcnt_deinit(pcnt_unit_t* unit); +extern void peripherals_pcnt_reset(void); #endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PCNT_HANDLER_H diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 3ea1fafbb8..ef032c4a76 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -49,6 +49,7 @@ #include "shared-bindings/rtc/__init__.h" #include "peripherals/rmt.h" +#include "peripherals/pcnt.h" #include "components/heap/include/esp_heap_caps.h" #include "components/soc/soc/esp32s2/include/soc/cache_memory.h" @@ -117,6 +118,10 @@ void reset_port(void) { uart_reset(); #endif +#if defined(CIRCUITPY_COUNTIO) || defined(CIRCUITPY_ROTARYIO) + peripherals_pcnt_reset(); +#endif + #if CIRCUITPY_RTC rtc_reset(); #endif From 9774736a50577fe9ae1426d95fc3bea5751411fc Mon Sep 17 00:00:00 2001 From: Enrique Casado Date: Thu, 12 Nov 2020 12:30:34 +0100 Subject: [PATCH 119/251] Rename pins to make them the same as the Arduino core --- .../boards/dynossat_edu_eps/mpconfigboard.mk | 3 ++- ports/atmel-samd/boards/dynossat_edu_eps/pins.c | 17 ++++++++++++----- ports/atmel-samd/boards/dynossat_edu_obc/pins.c | 4 ++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk b/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk index 3c0cc07bea..61fafe8e9d 100644 --- a/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk +++ b/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk @@ -15,8 +15,9 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_COUNTIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_I2CPERIPHERAL = 1 CIRCUITPY_VECTORIO = 0 +CIRCUITPY_TOUCHIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/dynossat_edu_eps/pins.c b/ports/atmel-samd/boards/dynossat_edu_eps/pins.c index a910311d4a..f960e6bb0e 100644 --- a/ports/atmel-samd/boards/dynossat_edu_eps/pins.c +++ b/ports/atmel-samd/boards/dynossat_edu_eps/pins.c @@ -4,17 +4,17 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_PA30) }, - { MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_PA31) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_PA30) }, + { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_PA31) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_OVTEMP), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_SAT_RESET), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_SAT_PWR_ENABLE), MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_INT_IMU_OBC), MP_ROM_PTR(&pin_PA19) }, @@ -22,10 +22,17 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_PWRMON_SDA), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_PWRMON_SCL), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_PWRMON_ALERT), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_V_3V3_MEAS), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_V_5V_MEAS), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_FLASH_SCK), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_FLASH_MOSI), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_FLASH_MISO), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_FLASH_CS), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, - { MP_ROM_QSTR(MP_QSTR_I2C_MONITOR), 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) }, }; diff --git a/ports/atmel-samd/boards/dynossat_edu_obc/pins.c b/ports/atmel-samd/boards/dynossat_edu_obc/pins.c index a560360f7d..8cc58d92c0 100644 --- a/ports/atmel-samd/boards/dynossat_edu_obc/pins.c +++ b/ports/atmel-samd/boards/dynossat_edu_obc/pins.c @@ -26,12 +26,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB07) }, { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PB06) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB30) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PB00) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_PA30) }, { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_PA31) }, { MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PB22) }, { MP_ROM_QSTR(MP_QSTR_INT_IMU), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_SAT_POWER), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_OVTEMP), MP_ROM_PTR(&pin_PB00) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA08) }, { 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 aa68b172232f6c817d0f2d3888abd38ada966a36 Mon Sep 17 00:00:00 2001 From: Enrique Casado Date: Thu, 12 Nov 2020 13:26:26 +0100 Subject: [PATCH 120/251] Freed some more space --- ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk b/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk index 61fafe8e9d..6d2c1379df 100644 --- a/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk +++ b/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk @@ -12,12 +12,15 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "GD25Q32C" LONGINT_IMPL = MPZ +CIRCUITPY_FULLBUILD = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 1 CIRCUITPY_VECTORIO = 0 +CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_ROTARYIO = 0 CFLAGS_INLINE_LIMIT = 60 From f4b10879fbe6e8efb6ba62219f93fff84c383c1b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 12 Nov 2020 11:48:01 -0800 Subject: [PATCH 121/251] Change creation date back. --- locale/circuitpython.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 931ae6a423..60d05888fc 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-11 14:06-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" From 2f2fe10e12ba61e3a7f5b1548d89c7d294ce2d22 Mon Sep 17 00:00:00 2001 From: sporeball Date: Wed, 11 Nov 2020 23:14:48 +0000 Subject: [PATCH 122/251] Translated using Weblate (Japanese) Currently translated at 71.8% (607 of 845 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ja/ --- locale/ja.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/ja.po b/locale/ja.po index 7004c49f30..4432095553 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-04 21:18+0530\n" -"PO-Revision-Date: 2020-11-06 20:29+0000\n" +"PO-Revision-Date: 2020-11-12 22:51+0000\n" "Last-Translator: sporeball \n" "Language-Team: none\n" "Language: ja\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.3.2\n" +"X-Generator: Weblate 4.4-dev\n" #: main.c msgid "" @@ -2786,7 +2786,7 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "invalid hostname" -msgstr "" +msgstr "不正なホスト名" #: extmod/modussl_axtls.c msgid "invalid key" From 1145fcaf3efa0ac073ae29e902a8dd5d48a1530d Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 12 Nov 2020 23:52:01 +0100 Subject: [PATCH 123/251] 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 | 5 +++++ locale/cs.po | 5 +++++ locale/de_DE.po | 5 +++++ locale/el.po | 5 +++++ locale/es.po | 5 +++++ locale/fil.po | 5 +++++ locale/fr.po | 5 +++++ locale/hi.po | 5 +++++ locale/it_IT.po | 5 +++++ locale/ja.po | 5 +++++ locale/ko.po | 5 +++++ locale/nl.po | 5 +++++ locale/pl.po | 5 +++++ locale/pt_BR.po | 5 +++++ locale/sv.po | 5 +++++ locale/zh_Latn_pinyin.po | 5 +++++ 16 files changed, 80 insertions(+) diff --git a/locale/ID.po b/locale/ID.po index 3e47dc9a18..90e416b3b9 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -435,6 +435,11 @@ msgstr "Di bawah frame rate minimum" msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock dan word harus memiliki kesamaan pada clock unit" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Kedalaman bit harus kelipatan 8." diff --git a/locale/cs.po b/locale/cs.po index 428d6d1fe6..f02d31e4dd 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -433,6 +433,11 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 059d726cab..c2cb265508 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -436,6 +436,11 @@ msgstr "Unterhalb der minimalen Frame Rate" msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock und word select müssen eine clock unit teilen" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bit depth muss ein Vielfaches von 8 sein." diff --git a/locale/el.po b/locale/el.po index 327f4dbe0f..4d7bff1930 100644 --- a/locale/el.po +++ b/locale/el.po @@ -428,6 +428,11 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "" diff --git a/locale/es.po b/locale/es.po index 95d6a92ff5..ed7431eb7c 100644 --- a/locale/es.po +++ b/locale/es.po @@ -442,6 +442,11 @@ msgstr "Por debajo de taza mínima de refrescamiento" msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock y word select deben compartir una unidad de reloj" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bits depth debe ser múltiplo de 8." diff --git a/locale/fil.po b/locale/fil.po index ce3b5616a3..93f41a88eb 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -433,6 +433,11 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "Ang bit clock at word select dapat makibahagi sa isang clock unit" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bit depth ay dapat multiple ng 8." diff --git a/locale/fr.po b/locale/fr.po index 94ca1f21cf..ff15b527e6 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -442,6 +442,11 @@ msgstr "Inférieur à la fréquence d'images minimale" msgid "Bit clock and word select must share a clock unit" msgstr "'bit clock' et 'word select' doivent partager une horloge" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "La profondeur de bit doit être un multiple de 8." diff --git a/locale/hi.po b/locale/hi.po index d87a1eb9ce..aea2b3f0c4 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -428,6 +428,11 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 657c581cef..603cf9fd08 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -433,6 +433,11 @@ msgid "Bit clock and word select must share a clock unit" msgstr "" "Clock di bit e selezione parola devono condividere la stessa unità di clock" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "La profondità di bit deve essere multipla di 8." diff --git a/locale/ja.po b/locale/ja.po index 4432095553..80486dc210 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -437,6 +437,11 @@ msgstr "最低のフレームレート未満" msgid "Bit clock and word select must share a clock unit" msgstr "bit clockとword selectはクロックユニットを共有しなければなりません" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "ビット深度は8の倍数でなければなりません" diff --git a/locale/ko.po b/locale/ko.po index 4b302f3b9f..c9215fb85e 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -433,6 +433,11 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 6851e6ef32..cfe2193bba 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -435,6 +435,11 @@ msgstr "Onder de minimum frame rate" msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock en word select moeten een clock eenheid delen" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bit diepte moet een meervoud van 8 zijn." diff --git a/locale/pl.po b/locale/pl.po index 1b0b41fdf3..623acd4c56 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -437,6 +437,11 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "Zegar bitowy i wybór słowa muszą współdzielić jednostkę zegara" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Głębia musi być wielokrotnością 8." diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 99f090dbd2..67b3dc8a7d 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -443,6 +443,11 @@ msgstr "" "O clock de bits e a seleção de palavras devem compartilhar uma unidade de " "clock" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "A profundidade de bits deve ser o múltiplo de 8." diff --git a/locale/sv.po b/locale/sv.po index d9639aff6e..be7eb08946 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -435,6 +435,11 @@ msgstr "Under minsta bildfrekvens" msgid "Bit clock and word select must share a clock unit" msgstr "Bitklocka och ordval måste dela en klockenhet" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bitdjup måste vara multipel av 8." diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 4d45f65bd7..4ac1c3e1ee 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -437,6 +437,11 @@ msgstr "Dī yú zuìdī zhèng sùlǜ" msgid "Bit clock and word select must share a clock unit" msgstr "Bǐtè shízhōng hé dānzì xuǎnzé bìxū gòngxiǎng shízhōng dānwèi" +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bǐtè shēndù bìxū shì 8 bèi yǐshàng." From 0f7081781e8a45da513b371978a354ea8734cc31 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 12 Nov 2020 20:40:09 -0600 Subject: [PATCH 124/251] esp32s2: wifi: fix several debug-build errors Closes #3688 With this change, I don't get the ESP_ERROR_CHECK failed repeatedly running code that imports wifi. (I'm not getting a successful connection but that's probably my own fault, such as a secrets problem) --- ports/esp32s2/common-hal/wifi/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index 833ef0623f..2eb3719b4d 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -143,8 +143,8 @@ void wifi_reset(void) { radio->handler_instance_got_ip)); ESP_ERROR_CHECK(esp_wifi_deinit()); esp_netif_destroy(radio->netif); + ESP_ERROR_CHECK(esp_event_loop_delete_default()); radio->netif = NULL; - ESP_ERROR_CHECK(esp_netif_deinit()); } void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t* esp_ip_address) { From 8d4296f96430795936a22769da35732e5342b25c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 10 Nov 2020 18:02:16 -0800 Subject: [PATCH 125/251] Add board.DISPLAY to MagTag. Fix luma computation * Initialize the EPaper display on the MagTag at start. * Tweak the display send to take a const buffer. * Correct Luma math * Multiply the blue component, not add. * Add all of the components together before dividing. This reduces the impact of truncated division. --- .../adafruit_magtag_2.9_grayscale/board.c | 122 ++++++++++++++++++ .../adafruit_magtag_2.9_grayscale/pins.c | 4 + .../common-hal/displayio/ParallelBus.c | 3 +- shared-bindings/displayio/EPaperDisplay.h | 2 +- shared-bindings/displayio/FourWire.h | 3 +- shared-bindings/displayio/I2CDisplay.h | 3 +- shared-bindings/displayio/ParallelBus.h | 3 +- shared-bindings/displayio/__init__.h | 3 +- shared-module/displayio/ColorConverter.c | 2 +- shared-module/displayio/EPaperDisplay.c | 14 +- shared-module/displayio/EPaperDisplay.h | 4 +- shared-module/displayio/FourWire.c | 3 +- shared-module/displayio/I2CDisplay.c | 3 +- 13 files changed, 152 insertions(+), 17 deletions(-) diff --git a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/board.c b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/board.c index 9f708874bf..ecd44e423c 100644 --- a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/board.c +++ b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/board.c @@ -26,7 +26,83 @@ #include "boards/board.h" #include "mpconfigboard.h" +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/displayio/FourWire.h" #include "shared-bindings/microcontroller/Pin.h" +#include "shared-module/displayio/__init__.h" +#include "supervisor/shared/board.h" + +#define DELAY 0x80 + +// This is an ILO373 control chip. The display is a 2.9" grayscale EInk. + +const uint8_t display_start_sequence[] = { + 0x01, 5, 0x03, 0x00, 0x2b, 0x2b, 0x13, // power setting + 0x06, 3, 0x17, 0x17, 0x17, // booster soft start + 0x04, DELAY, 200, // power on and wait 200 ms + 0x00, 1, 0x7f, // panel setting + 0x50, 1, 0x97, // CDI setting + 0x30, 1, 0x3c, // PLL set to 50 Hx (M = 7, N = 4) + 0x61, 3, 0x80, 0x01, 0x28, // Resolution + 0x82, DELAY | 1, 0x12, 50, // VCM DC and delay 50ms + + // Look up tables for voltage sequence for pixel transition + // Common voltage + 0x20, 0x2a, + 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, + 0x60, 0x14, 0x14, 0x00, 0x00, 0x01, + 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x13, 0x0a, 0x01, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + // White to white + 0x21, 0x2a, + 0x40, 0x0a, 0x00, 0x00, 0x00, 0x01, + 0x90, 0x14, 0x14, 0x00, 0x00, 0x01, + 0x10, 0x14, 0x0a, 0x00, 0x00, 0x01, + 0xa0, 0x13, 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + // Black to white + 0x22, 0x2a, + 0x40, 0x0a, 0x00, 0x00, 0x00, 0x01, + 0x90, 0x14, 0x14, 0x00, 0x00, 0x01, + 0x00, 0x14, 0x0a, 0x00, 0x00, 0x01, + 0x99, 0x0c, 0x01, 0x03, 0x04, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + // White to black + 0x23, 0x2a, + 0x40, 0x0a, 0x00, 0x00, 0x00, 0x01, + 0x90, 0x14, 0x14, 0x00, 0x00, 0x01, + 0x00, 0x14, 0x0a, 0x00, 0x00, 0x01, + 0x99, 0x0b, 0x04, 0x04, 0x01, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + // Black to black + 0x24, 0x2a, + 0x80, 0x0a, 0x00, 0x00, 0x00, 0x01, + 0x90, 0x14, 0x14, 0x00, 0x00, 0x01, + 0x20, 0x14, 0x0a, 0x00, 0x00, 0x01, + 0x50, 0x13, 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +const uint8_t display_stop_sequence[] = { + 0x50, 0x01, 0x17, // CDI Setting + 0x82, 0x01, 0x00, // VCM DC to -0.1V + 0x02, 0x00 // Power off +}; void board_init(void) { // USB @@ -36,6 +112,52 @@ void board_init(void) { // Debug UART common_hal_never_reset_pin(&pin_GPIO43); common_hal_never_reset_pin(&pin_GPIO44); + + busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; + common_hal_busio_spi_construct(spi, &pin_GPIO36, &pin_GPIO35, NULL); + common_hal_busio_spi_never_reset(spi); + + displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + common_hal_displayio_fourwire_construct(bus, + spi, + &pin_GPIO7, // EPD_DC Command or data + &pin_GPIO8, // EPD_CS Chip select + &pin_GPIO6, // EPD_RST Reset + 4000000, // Baudrate + 0, // Polarity + 0); // Phase + + displayio_epaperdisplay_obj_t* display = &displays[0].epaper_display; + display->base.type = &displayio_epaperdisplay_type; + common_hal_displayio_epaperdisplay_construct( + display, + bus, + display_start_sequence, sizeof(display_start_sequence), + display_stop_sequence, sizeof(display_stop_sequence), + 296, // width + 128, // height + 160, // ram_width + 296, // ram_height + 0, // colstart + 0, // rowstart + 270, // rotation + NO_COMMAND, // set_column_window_command + NO_COMMAND, // set_row_window_command + NO_COMMAND, // set_current_column_command + NO_COMMAND, // set_current_row_command + 0x10, // write_black_ram_command + false, // black_bits_inverted + 0x13, // write_color_ram_command + false, // color_bits_inverted + 0x000000, // highlight_color + 0x12, // refresh_display_command + 1.0, // refresh_time + &pin_GPIO5, // busy_pin + false, // busy_state + 5.0, // seconds_per_frame + false, // always_toggle_chip_select + true); // grayscale } bool board_requests_safe_mode(void) { 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 65bc3fb53b..40c9e91e4d 100644 --- a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c +++ b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c @@ -1,5 +1,7 @@ #include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" + STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, { MP_ROM_QSTR(MP_QSTR_AD1), MP_ROM_PTR(&pin_GPIO18) }, @@ -37,5 +39,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_DISPLAY), MP_ROM_PTR(&displays[0].epaper_display)} }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/esp32s2/common-hal/displayio/ParallelBus.c b/ports/esp32s2/common-hal/displayio/ParallelBus.c index 314b72ff73..d0c98f3611 100644 --- a/ports/esp32s2/common-hal/displayio/ParallelBus.c +++ b/ports/esp32s2/common-hal/displayio/ParallelBus.c @@ -57,7 +57,8 @@ bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { return false; } -void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length) { +void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, + display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) { } diff --git a/shared-bindings/displayio/EPaperDisplay.h b/shared-bindings/displayio/EPaperDisplay.h index 352de899a9..9a2d93bac0 100644 --- a/shared-bindings/displayio/EPaperDisplay.h +++ b/shared-bindings/displayio/EPaperDisplay.h @@ -39,7 +39,7 @@ extern const mp_obj_type_t displayio_epaperdisplay_type; #define NO_COMMAND 0x100 void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* self, - mp_obj_t bus, uint8_t* start_sequence, uint16_t start_sequence_len, uint8_t* stop_sequence, uint16_t stop_sequence_len, + mp_obj_t bus, const uint8_t* start_sequence, uint16_t start_sequence_len, const uint8_t* stop_sequence, uint16_t stop_sequence_len, uint16_t width, uint16_t height, uint16_t ram_width, uint16_t ram_height, int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t set_column_window_command, uint16_t set_row_window_command, uint16_t set_current_column_command, uint16_t set_current_row_command, diff --git a/shared-bindings/displayio/FourWire.h b/shared-bindings/displayio/FourWire.h index ac186d2c3e..6f6b528e72 100644 --- a/shared-bindings/displayio/FourWire.h +++ b/shared-bindings/displayio/FourWire.h @@ -48,7 +48,8 @@ bool common_hal_displayio_fourwire_bus_free(mp_obj_t self); bool common_hal_displayio_fourwire_begin_transaction(mp_obj_t self); -void common_hal_displayio_fourwire_send(mp_obj_t self, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length); +void common_hal_displayio_fourwire_send(mp_obj_t self, display_byte_type_t byte_type, + display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length); void common_hal_displayio_fourwire_end_transaction(mp_obj_t self); diff --git a/shared-bindings/displayio/I2CDisplay.h b/shared-bindings/displayio/I2CDisplay.h index bae53c4914..37520202e4 100644 --- a/shared-bindings/displayio/I2CDisplay.h +++ b/shared-bindings/displayio/I2CDisplay.h @@ -44,7 +44,8 @@ bool common_hal_displayio_i2cdisplay_bus_free(mp_obj_t self); bool common_hal_displayio_i2cdisplay_begin_transaction(mp_obj_t self); -void common_hal_displayio_i2cdisplay_send(mp_obj_t self, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length); +void common_hal_displayio_i2cdisplay_send(mp_obj_t self, display_byte_type_t byte_type, + display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length); void common_hal_displayio_i2cdisplay_end_transaction(mp_obj_t self); diff --git a/shared-bindings/displayio/ParallelBus.h b/shared-bindings/displayio/ParallelBus.h index be2aef7d44..1e74e3a0ac 100644 --- a/shared-bindings/displayio/ParallelBus.h +++ b/shared-bindings/displayio/ParallelBus.h @@ -46,7 +46,8 @@ bool common_hal_displayio_parallelbus_bus_free(mp_obj_t self); bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t self); -void common_hal_displayio_parallelbus_send(mp_obj_t self, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length); +void common_hal_displayio_parallelbus_send(mp_obj_t self, display_byte_type_t byte_type, + display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length); void common_hal_displayio_parallelbus_end_transaction(mp_obj_t self); diff --git a/shared-bindings/displayio/__init__.h b/shared-bindings/displayio/__init__.h index a7748d029a..4fc666c598 100644 --- a/shared-bindings/displayio/__init__.h +++ b/shared-bindings/displayio/__init__.h @@ -42,7 +42,8 @@ typedef enum { typedef bool (*display_bus_bus_reset)(mp_obj_t bus); typedef bool (*display_bus_bus_free)(mp_obj_t bus); typedef bool (*display_bus_begin_transaction)(mp_obj_t bus); -typedef void (*display_bus_send)(mp_obj_t bus, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length); +typedef void (*display_bus_send)(mp_obj_t bus, display_byte_type_t byte_type, + display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length); typedef void (*display_bus_end_transaction)(mp_obj_t bus); void common_hal_displayio_release_displays(void); diff --git a/shared-module/displayio/ColorConverter.c b/shared-module/displayio/ColorConverter.c index 03ec99ceb1..80558d037a 100644 --- a/shared-module/displayio/ColorConverter.c +++ b/shared-module/displayio/ColorConverter.c @@ -55,7 +55,7 @@ uint8_t displayio_colorconverter_compute_luma(uint32_t color_rgb888) { uint32_t r8 = (color_rgb888 >> 16); uint32_t g8 = (color_rgb888 >> 8) & 0xff; uint32_t b8 = color_rgb888 & 0xff; - return (r8 * 19) / 255 + (g8 * 182) / 255 + (b8 + 54) / 255; + return (r8 * 19 + g8 * 182 + b8 * 54) / 255; } uint8_t displayio_colorconverter_compute_chroma(uint32_t color_rgb888) { diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 514b99a13b..acca92ac15 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -43,7 +43,8 @@ #include void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* self, - mp_obj_t bus, uint8_t* start_sequence, uint16_t start_sequence_len, uint8_t* stop_sequence, uint16_t stop_sequence_len, + mp_obj_t bus, const uint8_t* start_sequence, uint16_t start_sequence_len, + const uint8_t* stop_sequence, uint16_t stop_sequence_len, uint16_t width, uint16_t height, uint16_t ram_width, uint16_t ram_height, int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t set_column_window_command, uint16_t set_row_window_command, @@ -133,14 +134,15 @@ STATIC void wait_for_busy(displayio_epaperdisplay_obj_t* self) { } } -STATIC void send_command_sequence(displayio_epaperdisplay_obj_t* self, bool should_wait_for_busy, uint8_t* sequence, uint32_t sequence_len) { +STATIC void send_command_sequence(displayio_epaperdisplay_obj_t* self, + bool should_wait_for_busy, const uint8_t* sequence, uint32_t sequence_len) { uint32_t i = 0; while (i < sequence_len) { - uint8_t *cmd = sequence + i; + const uint8_t *cmd = sequence + i; uint8_t data_size = *(cmd + 1); bool delay = (data_size & DELAY) != 0; data_size &= ~DELAY; - uint8_t *data = cmd + 2; + const uint8_t *data = cmd + 2; displayio_display_core_begin_transaction(&self->core); self->core.send(self->core.bus, DISPLAY_COMMAND, self->chip_select, cmd, 1); self->core.send(self->core.bus, DISPLAY_DATA, self->chip_select, data, data_size); @@ -375,8 +377,8 @@ void release_epaperdisplay(displayio_epaperdisplay_obj_t* self) { void displayio_epaperdisplay_collect_ptrs(displayio_epaperdisplay_obj_t* self) { displayio_display_core_collect_ptrs(&self->core); - gc_collect_ptr(self->start_sequence); - gc_collect_ptr(self->stop_sequence); + gc_collect_ptr((void *) self->start_sequence); + gc_collect_ptr((void *) self->stop_sequence); } bool maybe_refresh_epaperdisplay(void) { diff --git a/shared-module/displayio/EPaperDisplay.h b/shared-module/displayio/EPaperDisplay.h index 4103fe5fce..d0668ff444 100644 --- a/shared-module/displayio/EPaperDisplay.h +++ b/shared-module/displayio/EPaperDisplay.h @@ -38,9 +38,9 @@ typedef struct { displayio_display_core_t core; digitalio_digitalinout_obj_t busy; uint32_t milliseconds_per_frame; - uint8_t* start_sequence; + const uint8_t* start_sequence; uint32_t start_sequence_len; - uint8_t* stop_sequence; + const uint8_t* stop_sequence; uint32_t stop_sequence_len; uint16_t refresh_time; uint16_t set_column_window_command; diff --git a/shared-module/displayio/FourWire.c b/shared-module/displayio/FourWire.c index 8c56d7ab60..06f8a84e35 100644 --- a/shared-module/displayio/FourWire.c +++ b/shared-module/displayio/FourWire.c @@ -113,7 +113,8 @@ bool common_hal_displayio_fourwire_begin_transaction(mp_obj_t obj) { return true; } -void common_hal_displayio_fourwire_send(mp_obj_t obj, display_byte_type_t data_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length) { +void common_hal_displayio_fourwire_send(mp_obj_t obj, display_byte_type_t data_type, + display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) { displayio_fourwire_obj_t* self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->command, data_type == DISPLAY_DATA); if (chip_select == CHIP_SELECT_TOGGLE_EVERY_BYTE) { diff --git a/shared-module/displayio/I2CDisplay.c b/shared-module/displayio/I2CDisplay.c index 5bd03dcd65..cc811e83d7 100644 --- a/shared-module/displayio/I2CDisplay.c +++ b/shared-module/displayio/I2CDisplay.c @@ -103,7 +103,8 @@ bool common_hal_displayio_i2cdisplay_begin_transaction(mp_obj_t obj) { return common_hal_busio_i2c_try_lock(self->bus); } -void common_hal_displayio_i2cdisplay_send(mp_obj_t obj, display_byte_type_t data_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length) { +void common_hal_displayio_i2cdisplay_send(mp_obj_t obj, display_byte_type_t data_type, + display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) { displayio_i2cdisplay_obj_t* self = MP_OBJ_TO_PTR(obj); if (data_type == DISPLAY_COMMAND) { uint8_t command_bytes[2 * data_length]; From 78ccac930fbcb3dddd3a1a79809a2ec371d34c6a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 11 Nov 2020 16:53:45 -0800 Subject: [PATCH 126/251] Add .busy property to EPaperDisplay --- shared-bindings/displayio/EPaperDisplay.c | 18 ++++++++++++++++++ shared-bindings/displayio/EPaperDisplay.h | 1 + shared-module/displayio/EPaperDisplay.c | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 8518e37143..ebff640085 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -245,6 +245,23 @@ const mp_obj_property_t displayio_epaperdisplay_time_to_refresh_obj = { (mp_obj_t)&mp_const_none_obj}, }; +//| busy: bool +//| """True when the display is refreshing. This uses the ``busy_pin`` when available or the +//| ``refresh_time`` otherwise.""" +//| +STATIC mp_obj_t displayio_epaperdisplay_obj_get_busy(mp_obj_t self_in) { + displayio_epaperdisplay_obj_t *self = native_display(self_in); + return mp_obj_new_bool(common_hal_displayio_epaperdisplay_get_busy(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_busy_obj, displayio_epaperdisplay_obj_get_busy); + +const mp_obj_property_t displayio_epaperdisplay_busy_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&displayio_epaperdisplay_get_busy_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + //| width: int //| """Gets the width of the display in pixels""" //| @@ -301,6 +318,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_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) }, }; STATIC MP_DEFINE_CONST_DICT(displayio_epaperdisplay_locals_dict, displayio_epaperdisplay_locals_dict_table); diff --git a/shared-bindings/displayio/EPaperDisplay.h b/shared-bindings/displayio/EPaperDisplay.h index 9a2d93bac0..f785203a41 100644 --- a/shared-bindings/displayio/EPaperDisplay.h +++ b/shared-bindings/displayio/EPaperDisplay.h @@ -52,6 +52,7 @@ bool common_hal_displayio_epaperdisplay_show(displayio_epaperdisplay_obj_t* self // Returns time in milliseconds. uint32_t common_hal_displayio_epaperdisplay_get_time_to_refresh(displayio_epaperdisplay_obj_t* self); +bool common_hal_displayio_epaperdisplay_get_busy(displayio_epaperdisplay_obj_t* self); 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); diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index acca92ac15..1b285b4b1d 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -360,6 +360,11 @@ void displayio_epaperdisplay_background(displayio_epaperdisplay_obj_t* self) { } } +bool common_hal_displayio_epaperdisplay_get_busy(displayio_epaperdisplay_obj_t* self) { + displayio_epaperdisplay_background(self); + return self->refreshing; +} + void release_epaperdisplay(displayio_epaperdisplay_obj_t* self) { if (self->refreshing) { wait_for_busy(self); From 68eb809fbf5cafdabb20c090b98aefb1628e3552 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 12 Nov 2020 12:39:31 -0800 Subject: [PATCH 127/251] Update parallel bus signatures --- ports/atmel-samd/common-hal/displayio/ParallelBus.c | 3 ++- ports/mimxrt10xx/common-hal/displayio/ParallelBus.c | 3 ++- ports/nrf/common-hal/displayio/ParallelBus.c | 3 ++- ports/stm/common-hal/displayio/ParallelBus.c | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/common-hal/displayio/ParallelBus.c b/ports/atmel-samd/common-hal/displayio/ParallelBus.c index 405c08c64a..f10dd2993b 100644 --- a/ports/atmel-samd/common-hal/displayio/ParallelBus.c +++ b/ports/atmel-samd/common-hal/displayio/ParallelBus.c @@ -129,7 +129,8 @@ bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { return true; } -void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length) { +void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, + display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) { displayio_parallelbus_obj_t* self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->command, byte_type == DISPLAY_DATA); uint32_t* clear_write = (uint32_t*) &self->write_group->OUTCLR.reg; diff --git a/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c b/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c index 87a72d0f33..0fdf4413b6 100644 --- a/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +++ b/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c @@ -57,7 +57,8 @@ bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { return false; } -void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length) { +void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, + display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) { } diff --git a/ports/nrf/common-hal/displayio/ParallelBus.c b/ports/nrf/common-hal/displayio/ParallelBus.c index f13e03163f..31ee1f48e4 100644 --- a/ports/nrf/common-hal/displayio/ParallelBus.c +++ b/ports/nrf/common-hal/displayio/ParallelBus.c @@ -141,7 +141,8 @@ bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { } // This ignores chip_select behaviour because data is clocked in by the write line toggling. -void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length) { +void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, + display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) { displayio_parallelbus_obj_t* self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->command, byte_type == DISPLAY_DATA); uint32_t* clear_write = (uint32_t*) &self->write_group->OUTCLR; diff --git a/ports/stm/common-hal/displayio/ParallelBus.c b/ports/stm/common-hal/displayio/ParallelBus.c index 314b72ff73..fd07d38af4 100644 --- a/ports/stm/common-hal/displayio/ParallelBus.c +++ b/ports/stm/common-hal/displayio/ParallelBus.c @@ -57,7 +57,8 @@ bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { return false; } -void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length) { +void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, + display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) { } From bda3267432aee57e704a20308b724369cceeb6ca Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 13 Nov 2020 18:33:02 -0800 Subject: [PATCH 128/251] Save flash space * No weak link for modules. It only impacts _os and _time and is already disabled for non-full builds. * Turn off PA00 and PA01 because they are the crystal on the Metro M0 Express. * Change ejected default to false to move it to BSS. It is set on USB connection anyway. * Set sinc_filter to const. Doesn't help flash but keeps it out of RAM. --- ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h | 4 ++++ ports/atmel-samd/common-hal/audiobusio/PDMIn.c | 2 +- py/circuitpy_mpconfig.h | 2 +- supervisor/shared/usb/usb_msc_flash.c | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h index 04565feb40..d48c596ace 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h @@ -33,6 +33,10 @@ #define DEFAULT_UART_BUS_RX (&pin_PA11) #define DEFAULT_UART_BUS_TX (&pin_PA10) +// These pins are connected to the external crystal. +#define IGNORE_PIN_PA00 1 +#define IGNORE_PIN_PA01 1 + // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index 21474ab3b1..3c9ec05c25 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -326,7 +326,7 @@ static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, // higher sample rate than specified. Then after the audio is // recorded, a more expensive filter non-real-time filter could be // used to down-sample and low-pass. -uint16_t sinc_filter [OVERSAMPLING] = { +const uint16_t sinc_filter [OVERSAMPLING] = { 0, 2, 9, 21, 39, 63, 94, 132, 179, 236, 302, 379, 467, 565, 674, 792, 920, 1055, 1196, 1341, 1487, 1633, 1776, 1913, diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 08efabddb5..85e152670a 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -186,7 +186,7 @@ typedef long mp_off_t; #define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_BUILTINS_POW3 (CIRCUITPY_FULL_BUILD) #define MICROPY_COMP_FSTRING_LITERAL (MICROPY_CPYTHON_COMPAT) -#define MICROPY_MODULE_WEAK_LINKS (CIRCUITPY_FULL_BUILD) +#define MICROPY_MODULE_WEAK_LINKS (0) #define MICROPY_PY_ALL_SPECIAL_METHODS (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_BUILTINS_COMPLEX (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_BUILTINS_FROZENSET (CIRCUITPY_FULL_BUILD) diff --git a/supervisor/shared/usb/usb_msc_flash.c b/supervisor/shared/usb/usb_msc_flash.c index 7532b6aead..b39f60dcd2 100644 --- a/supervisor/shared/usb/usb_msc_flash.c +++ b/supervisor/shared/usb/usb_msc_flash.c @@ -39,7 +39,7 @@ #define MSC_FLASH_BLOCK_SIZE 512 -static bool ejected[1] = {true}; +static bool ejected[1] = {false}; void usb_msc_mount(void) { // Reset the ejection tracking every time we're plugged into USB. This allows for us to battery From 146adca060d7abc76149c88c7cdd2d401f799efa Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sat, 14 Nov 2020 11:41:14 +0530 Subject: [PATCH 129/251] Add watchdog mode raise --- ports/esp32s2/common-hal/watchdog/WatchDogTimer.c | 9 ++++++++- ports/esp32s2/common-hal/watchdog/WatchDogTimer.h | 3 +-- ports/esp32s2/supervisor/port.c | 5 +++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ports/esp32s2/common-hal/watchdog/WatchDogTimer.c b/ports/esp32s2/common-hal/watchdog/WatchDogTimer.c index 59b9dafcf0..b51a391b7f 100644 --- a/ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +++ b/ports/esp32s2/common-hal/watchdog/WatchDogTimer.c @@ -27,12 +27,19 @@ #include "py/runtime.h" #include "common-hal/watchdog/WatchDogTimer.h" +#include "shared-bindings/watchdog/__init__.h" #include "shared-bindings/microcontroller/__init__.h" #include "esp_task_wdt.h" void esp_task_wdt_isr_user_handler(void) { - + mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&mp_watchdog_timeout_exception)); + MP_STATE_VM(mp_pending_exception) = &mp_watchdog_timeout_exception; +#if MICROPY_ENABLE_SCHEDULER + if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) { + MP_STATE_VM(sched_state) = MP_SCHED_PENDING; + } +#endif } void common_hal_watchdog_feed(watchdog_watchdogtimer_obj_t *self) { diff --git a/ports/esp32s2/common-hal/watchdog/WatchDogTimer.h b/ports/esp32s2/common-hal/watchdog/WatchDogTimer.h index 05e0e954d2..04d9aeee6c 100644 --- a/ports/esp32s2/common-hal/watchdog/WatchDogTimer.h +++ b/ports/esp32s2/common-hal/watchdog/WatchDogTimer.h @@ -37,8 +37,7 @@ struct _watchdog_watchdogtimer_obj_t { watchdog_watchdogmode_t mode; }; -// This needs to be called in order to disable the watchdog if it's set to -// "RAISE". If set to "RESET", then the watchdog cannot be reset. +// This needs to be called in order to disable the watchdog void watchdog_reset(void); #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 0b9c03f747..1b6f5ef7cb 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -41,6 +41,7 @@ #include "common-hal/busio/UART.h" #include "common-hal/pulseio/PulseIn.h" #include "common-hal/pwmio/PWMOut.h" +#include "common-hal/watchdog/WatchDogTimer.h" #include "common-hal/wifi/__init__.h" #include "supervisor/memory.h" #include "supervisor/shared/tick.h" @@ -119,6 +120,10 @@ void reset_port(void) { rtc_reset(); #endif +#if CIRCUITPY_WATCHDOG + watchdog_reset(); +#endif + #if CIRCUITPY_WIFI wifi_reset(); #endif From 231e3d362dae1988d5103b1042957ae793599d8b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 14 Nov 2020 10:16:39 -0600 Subject: [PATCH 130/251] esp32s2: Update esp-idf submodule to include fix for #3424 This re-points the submodule to my personal fork of esp-idf. Users may need to `git submodule sync` in their existing trees when this change occurs. Adds just the following commit in esp-idf: > esp_crt_bundle: Allow verify_callback to correct BADCERT_BAD_MD --- .gitmodules | 2 +- ports/esp32s2/esp-idf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index f66ce8aafa..aaa66caf71 100644 --- a/.gitmodules +++ b/.gitmodules @@ -152,4 +152,4 @@ url = https://github.com/adafruit/Adafruit_CircuitPython_RFM69.git [submodule "ports/esp32s2/esp-idf"] path = ports/esp32s2/esp-idf - url = https://github.com/espressif/esp-idf.git + url = https://github.com/jepler/esp-idf.git diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 8bc19ba893..d06744f5ef 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 8bc19ba893e5544d571a753d82b44a84799b94b1 +Subproject commit d06744f5efc382c61cbad8758107cec308feef09 From 6c3c076cc110d935f0f8406de81007563994e553 Mon Sep 17 00:00:00 2001 From: RubenD Date: Fri, 13 Nov 2020 23:49:31 +0000 Subject: [PATCH 131/251] Translated using Weblate (Spanish) Currently translated at 99.2% (840 of 846 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/es.po b/locale/es.po index ed7431eb7c..c5e2ad75f0 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,15 +8,15 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-04 21:18+0530\n" -"PO-Revision-Date: 2020-11-01 16:26+0000\n" -"Last-Translator: Alvaro Figueroa \n" +"PO-Revision-Date: 2020-11-15 16:28+0000\n" +"Last-Translator: RubenD \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.3.2-dev\n" +"X-Generator: Weblate 4.4-dev\n" #: main.c msgid "" @@ -305,7 +305,7 @@ msgstr "Todos los periféricos I2C están siendo usados" #: ports/esp32s2/peripherals/pcnt_handler.c msgid "All PCNT units in use" -msgstr "" +msgstr "Todas las unidades PCNT en uso" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c @@ -445,7 +445,7 @@ msgstr "Bit clock y word select deben compartir una unidad de reloj" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" +msgstr "Bit depth tiene que ser de 1 a 6 inclusivo, no %d" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." From 76d60ba95bb79e0a553fd6f9dcb5cb25806ada2f Mon Sep 17 00:00:00 2001 From: Antonin ENFRUN Date: Fri, 13 Nov 2020 07:56:16 +0000 Subject: [PATCH 132/251] Translated using Weblate (French) Currently translated at 100.0% (846 of 846 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index ff15b527e6..5d4ca75d5c 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-04 21:18+0530\n" -"PO-Revision-Date: 2020-10-22 20:48+0000\n" +"PO-Revision-Date: 2020-11-15 16:28+0000\n" "Last-Translator: Antonin ENFRUN \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.3.1\n" +"X-Generator: Weblate 4.4-dev\n" #: main.c msgid "" @@ -298,7 +298,7 @@ msgstr "Type d'adresse hors plage" #: ports/esp32s2/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" -msgstr "" +msgstr "Tous les périphériques CAN sont utilisés" #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -306,7 +306,7 @@ msgstr "Tous les périphériques I2C sont utilisés" #: ports/esp32s2/peripherals/pcnt_handler.c msgid "All PCNT units in use" -msgstr "" +msgstr "Toutes les unités PCNT sont utilisées" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c @@ -431,7 +431,7 @@ msgstr "" #: ports/esp32s2/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" -msgstr "" +msgstr "Baudrate non prise en charge par le périphérique" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c @@ -445,7 +445,7 @@ msgstr "'bit clock' et 'word select' doivent partager une horloge" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" +msgstr "Bit depth doit être compris entre 1 et 6 inclus, et non %d" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." @@ -2953,7 +2953,7 @@ msgstr "entiers longs non supportés dans cette build" #: ports/esp32s2/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" -msgstr "" +msgstr "loopback + silent mode non pris en charge par le périphérique" #: py/parse.c msgid "malformed f-string" @@ -2991,11 +2991,11 @@ msgstr "profondeur maximale de récursivité dépassée" #: extmod/ulab/code/approx/approx.c msgid "maxiter must be > 0" -msgstr "" +msgstr "maxiter doit être > 0" #: extmod/ulab/code/approx/approx.c msgid "maxiter should be > 0" -msgstr "" +msgstr "maxiter devrait être > 0" #: py/runtime.c #, c-format @@ -3440,7 +3440,7 @@ 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 "" +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)" @@ -3575,12 +3575,12 @@ msgstr "tuple/liste a une mauvaise longueur" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" -msgstr "" +msgstr "twai_driver_install a renvoyé l'erreur esp-idf #%d" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" -msgstr "" +msgstr "twai_start a renvoyé l'erreur esp-idf #%d" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c From 8218eb2ddf92d979b16391a9a5400ab8a5ce2e67 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Fri, 13 Nov 2020 19:51:22 +0000 Subject: [PATCH 133/251] Translated using Weblate (Swedish) Currently translated at 100.0% (846 of 846 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index be7eb08946..1a603e4961 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-04 21:18+0530\n" -"PO-Revision-Date: 2020-11-05 20:26+0000\n" +"PO-Revision-Date: 2020-11-15 16:28+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.3.2\n" +"X-Generator: Weblate 4.4-dev\n" #: main.c msgid "" @@ -302,7 +302,7 @@ msgstr "All I2C-kringutrustning används" #: ports/esp32s2/peripherals/pcnt_handler.c msgid "All PCNT units in use" -msgstr "" +msgstr "Alla PCNT-enheter används" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c @@ -438,7 +438,7 @@ msgstr "Bitklocka och ordval måste dela en klockenhet" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" +msgstr "Bitdjup måste vara inom 1 till 6, inte %d" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." From 64725190f47fbe3d2b4e54b0e58c485949878a89 Mon Sep 17 00:00:00 2001 From: hexthat Date: Sat, 14 Nov 2020 15:43:32 +0000 Subject: [PATCH 134/251] Translated using Weblate (Chinese (Pinyin)) Currently translated at 100.0% (846 of 846 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 4ac1c3e1ee..2731ec4f5e 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-04 21:18+0530\n" -"PO-Revision-Date: 2020-11-11 19:13+0000\n" +"PO-Revision-Date: 2020-11-15 16:28+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -440,7 +440,7 @@ msgstr "Bǐtè shízhōng hé dānzì xuǎnzé bìxū gòngxiǎng shízhōng dā #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" +msgstr "wèi shēn dù bì xū bāo hán 1 dào 6, ér bù shì %d" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." 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 135/251] 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 d4ab00f734203d358299508c01378d97ddf9d40f Mon Sep 17 00:00:00 2001 From: BennyE Date: Mon, 16 Nov 2020 00:31:06 +0100 Subject: [PATCH 136/251] Set station mode early to avoid SoftAP on startup --- 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 275bae31af..1945da207b 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -72,6 +72,8 @@ void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) { return; } if (!self->started && enabled) { + // esp_wifi_start() would default to soft-AP, thus setting it to station + ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); ESP_ERROR_CHECK(esp_wifi_start()); self->started = true; return; 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 137/251] 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 138/251] 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 0cd951fb73198f5c3dd03ea0463382edac0d3d4d Mon Sep 17 00:00:00 2001 From: root Date: Mon, 16 Nov 2020 10:36:05 -0600 Subject: [PATCH 139/251] Prevent exceptions from accumulating in REPL --- py/obj.c | 1 + 1 file changed, 1 insertion(+) diff --git a/py/obj.c b/py/obj.c index 9dc0cf4749..315e816e0b 100644 --- a/py/obj.c +++ b/py/obj.c @@ -125,6 +125,7 @@ void mp_obj_print_exception(const mp_print_t *print, mp_obj_t exc) { mp_printf(print, decompressed_block, block); } } + mp_obj_exception_clear_traceback(exc); } } mp_obj_print_helper(print, exc, PRINT_EXC); 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 140/251] 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 141/251] 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 9c4b6c34b8cfacdc86074df261a4eac0fc23b129 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 16 Nov 2020 16:03:29 -0600 Subject: [PATCH 142/251] see what happens if workflows move to ubuntu 20.04 --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c83f37e6ed..bd0dea5cf8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ on: jobs: test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: Dump GitHub context env: @@ -165,7 +165,7 @@ jobs: build-arm: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 needs: test strategy: fail-fast: false @@ -368,7 +368,7 @@ jobs: if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) build-riscv: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 needs: test strategy: fail-fast: false From 3b27810a3ab6c15d0612b986e6f6086aecccdbcb Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 17 Nov 2020 00:02:02 +0100 Subject: [PATCH 143/251] 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 | 15 +++++++++++++-- locale/cs.po | 15 +++++++++++++-- locale/de_DE.po | 15 +++++++++++++-- locale/el.po | 15 +++++++++++++-- locale/es.po | 15 +++++++++++++-- locale/fil.po | 15 +++++++++++++-- locale/fr.po | 15 +++++++++++++-- locale/hi.po | 15 +++++++++++++-- locale/it_IT.po | 15 +++++++++++++-- locale/ja.po | 15 +++++++++++++-- locale/ko.po | 15 +++++++++++++-- locale/nl.po | 15 +++++++++++++-- locale/pl.po | 15 +++++++++++++-- locale/pt_BR.po | 15 +++++++++++++-- locale/sv.po | 15 +++++++++++++-- locale/zh_Latn_pinyin.po | 15 +++++++++++++-- 16 files changed, 208 insertions(+), 32 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 90e416b3b9..d6672b1e40 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -300,7 +300,8 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Semua perangkat I2C sedang digunakan" -#: 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 "" @@ -1018,6 +1019,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Ukuran penyangga salah" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -3254,6 +3259,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 @@ -3469,6 +3475,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "" @@ -3653,6 +3660,10 @@ msgstr "" msgid "vectors must have same lengths" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index f02d31e4dd..bde3a20b87 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -300,7 +300,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 "" @@ -1001,6 +1002,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -3210,6 +3215,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 @@ -3425,6 +3431,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "" @@ -3608,6 +3615,10 @@ msgstr "" msgid "vectors must have same lengths" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index c2cb265508..dabc486595 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -299,7 +299,8 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" -#: 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 "" @@ -1018,6 +1019,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Inkorrekte Puffergröße" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -3293,6 +3298,7 @@ msgstr "pow() drittes Argument darf nicht 0 sein" msgid "pow() with 3 arguments requires integers" msgstr "pow () mit 3 Argumenten erfordert Integer" +#: 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 @@ -3511,6 +3517,7 @@ msgstr "threshold muss im Intervall 0-65536 liegen" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() nimmt eine 9-Sequenz an" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "Das Zeitlimit hat den maximal zulässigen Wert überschritten" @@ -3698,6 +3705,10 @@ msgstr "value_count muss größer als 0 sein" msgid "vectors must have same lengths" msgstr "Vektoren müssen die selbe Länge haben" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" diff --git a/locale/el.po b/locale/el.po index 4d7bff1930..0d35c20ceb 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -295,7 +295,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 "" @@ -996,6 +997,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -3205,6 +3210,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 @@ -3420,6 +3426,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "" @@ -3603,6 +3610,10 @@ msgstr "" msgid "vectors must have same lengths" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" diff --git a/locale/es.po b/locale/es.po index c5e2ad75f0..bdb4b68a5d 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: 2020-11-15 16:28+0000\n" "Last-Translator: RubenD \n" "Language-Team: \n" @@ -303,7 +303,8 @@ msgstr "Todos los periféricos CAN están en uso" msgid "All I2C peripherals are in use" msgstr "Todos los periféricos I2C están siendo usados" -#: 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 "Todas las unidades PCNT en uso" @@ -1019,6 +1020,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Tamaño incorrecto del buffer" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "La entrada está durando mucho tiempo" @@ -3281,6 +3286,7 @@ msgstr "el 3er argumento de pow() no puede ser 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argumentos requiere enteros" +#: ports/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 @@ -3498,6 +3504,7 @@ msgstr "limite debe ser en el rango 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() toma un sequencio 9" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "" @@ -3682,6 +3689,10 @@ msgstr "value_count debe ser > 0" msgid "vectors must have same lengths" msgstr "los vectores deben tener el mismo tamaño" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "el tiempo de espera del perro guardián debe ser mayor a 0" diff --git a/locale/fil.po b/locale/fil.po index 93f41a88eb..c74e13c6c8 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -297,7 +297,8 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" -#: 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 "" @@ -1011,6 +1012,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -3256,6 +3261,7 @@ msgstr "pow() 3rd argument ay hindi maaring 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() na may 3 argumento kailangan ng integers" +#: ports/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 @@ -3474,6 +3480,7 @@ msgstr "ang threshold ay dapat sa range 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kumukuha ng 9-sequence" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "" @@ -3658,6 +3665,10 @@ msgstr "" msgid "vectors must have same lengths" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 5d4ca75d5c..a15bbb8d50 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-04 21:18+0530\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" "Language: fr\n" @@ -304,7 +304,8 @@ msgstr "Tous les périphériques CAN sont utilisés" msgid "All I2C peripherals are in use" msgstr "Tous les périphériques I2C sont utilisés" -#: 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 "Toutes les unités PCNT sont utilisées" @@ -1024,6 +1025,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Taille de tampon incorrecte" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "L'entrée prend trop de temps" @@ -3305,6 +3310,7 @@ msgstr "le 3e argument de pow() ne peut être 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() avec 3 arguments nécessite des entiers" +#: ports/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 @@ -3523,6 +3529,7 @@ msgstr "le seuil doit être dans la gamme 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() prend une séquence de longueur 9" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "le délai d'expiration a dépassé la valeur maximale prise en charge" @@ -3706,6 +3713,10 @@ msgstr "'value_count' doit être > 0" msgid "vectors must have same lengths" msgstr "les vecteurs doivent avoir la même longueur" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "watchdog timeout doit être supérieur à 0" diff --git a/locale/hi.po b/locale/hi.po index aea2b3f0c4..6c49e1f01f 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -295,7 +295,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 "" @@ -996,6 +997,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -3205,6 +3210,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 @@ -3420,6 +3426,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "" @@ -3603,6 +3610,10 @@ msgstr "" msgid "vectors must have same lengths" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 603cf9fd08..fc0f016752 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -296,7 +296,8 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" -#: 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 "" @@ -1011,6 +1012,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -3263,6 +3268,7 @@ msgstr "il terzo argomento di pow() non può essere 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argomenti richiede interi" +#: ports/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 @@ -3481,6 +3487,7 @@ msgstr "la soglia deve essere nell'intervallo 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "" @@ -3665,6 +3672,10 @@ msgstr "" msgid "vectors must have same lengths" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 80486dc210..f3dfc6c900 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: 2020-11-12 22:51+0000\n" "Last-Translator: sporeball \n" "Language-Team: none\n" @@ -302,7 +302,8 @@ msgstr "全てのCAN周辺機器が使用中" msgid "All I2C peripherals are in use" msgstr "全てのI2C周辺機器が使用中" -#: 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 "" @@ -1011,6 +1012,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "バッファサイズが正しくありません" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -3237,6 +3242,7 @@ msgstr "pow()の3つ目の引数は0にできません" msgid "pow() with 3 arguments requires integers" msgstr "pow()の第3引数には整数が必要" +#: 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 @@ -3453,6 +3459,7 @@ msgstr "threshouldは0から65536まで" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time()は9要素のシーケンスを受け取ります" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "タイムアウト長は対応する最大値を超えています" @@ -3636,6 +3643,10 @@ msgstr "value_countは0より大きくなければなりません" msgid "vectors must have same lengths" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "watchdogのtimeoutは0以上でなければなりません" diff --git a/locale/ko.po b/locale/ko.po index c9215fb85e..bfa49ab70c 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -298,7 +298,8 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "사용중인 모든 I2C주변 기기" -#: 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 "" @@ -1001,6 +1002,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -3211,6 +3216,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 @@ -3426,6 +3432,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "" @@ -3609,6 +3616,10 @@ msgstr "" msgid "vectors must have same lengths" msgstr "" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index cfe2193bba..7625cdb26b 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: 2020-10-27 16:47+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -300,7 +300,8 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Alle I2C peripherals zijn in gebruik" -#: 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 "" @@ -1013,6 +1014,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Incorrecte buffer grootte" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "Invoer duurt te lang" @@ -3270,6 +3275,7 @@ msgstr "derde argument van pow() mag geen 0 zijn" msgid "pow() with 3 arguments requires integers" msgstr "pow() met 3 argumenten vereist integers" +#: 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 @@ -3487,6 +3493,7 @@ msgstr "drempelwaarde moet in het bereik 0-65536 liggen" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() accepteert een 9-rij" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "time-outduur is groter dan de ondersteunde maximale waarde" @@ -3670,6 +3677,10 @@ msgstr "value_count moet groter dan 0 zijn" msgid "vectors must have same lengths" msgstr "vectoren moeten van gelijke lengte zijn" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "watchdog time-out moet groter zijn dan 0" diff --git a/locale/pl.po b/locale/pl.po index 623acd4c56..f04887e682 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: 2020-11-11 19:13+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -302,7 +302,8 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Wszystkie peryferia I2C w użyciu" -#: 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 "" @@ -1011,6 +1012,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Niewłaściwa wielkość bufora" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -3229,6 +3234,7 @@ msgstr "trzeci argument pow() nie może być 0" msgid "pow() with 3 arguments requires integers" msgstr "trzyargumentowe pow() wymaga liczb całkowitych" +#: 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 @@ -3445,6 +3451,7 @@ msgstr "threshold musi być w zakresie 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() wymaga 9-elementowej sekwencji" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "" @@ -3628,6 +3635,10 @@ msgstr "value_count musi być > 0" msgid "vectors must have same lengths" msgstr "wektory muszą mieć identyczną długość" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 67b3dc8a7d..4918689795 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: 2020-11-08 10:26+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -304,7 +304,8 @@ msgstr "Todos os periféricos CAN estão em uso" msgid "All I2C peripherals are in use" msgstr "Todos os periféricos I2C estão em uso" -#: 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 "Todas as unidades PCNT estão em uso" @@ -1022,6 +1023,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "O tamanho do buffer está incorreto" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "A entrada está demorando demais" @@ -3296,6 +3301,7 @@ msgstr "O terceiro argumento pow() não pode ser 0" msgid "pow() with 3 arguments requires integers" msgstr "o pow() com 3 argumentos requer números inteiros" +#: ports/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 @@ -3513,6 +3519,7 @@ msgstr "Limite deve estar no alcance de 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() leva uma sequência com 9" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "a duração do tempo limite excedeu o valor máximo suportado" @@ -3696,6 +3703,10 @@ msgstr "o value_count deve ser > 0" msgid "vectors must have same lengths" msgstr "os vetores devem ter os mesmos comprimentos" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "o tempo limite do watchdog deve ser maior que 0" diff --git a/locale/sv.po b/locale/sv.po index 1a603e4961..55e6368ae5 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: 2020-11-15 16:28+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -300,7 +300,8 @@ msgstr "All I2C-kringutrustning används" msgid "All I2C peripherals are in use" msgstr "All I2C-kringutrustning används" -#: 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 "Alla PCNT-enheter används" @@ -1011,6 +1012,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Fel buffertstorlek" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "Indata tar för lång tid" @@ -3263,6 +3268,7 @@ msgstr "pow() 3: e argument kan inte vara 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() med 3 argument kräver heltal" +#: ports/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 @@ -3480,6 +3486,7 @@ msgstr "tröskelvärdet måste ligga i intervallet 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kräver en 9-sekvens" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "timeout-längd överskred det maximala värde som stöds" @@ -3663,6 +3670,10 @@ msgstr "value_count måste vara > 0" msgid "vectors must have same lengths" msgstr "vektorer måste ha samma längd" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "watchdog timeout måste vara större än 0" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 2731ec4f5e..dd44aab939 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-04 21:18+0530\n" +"POT-Creation-Date: 2020-11-10 15:30+0530\n" "PO-Revision-Date: 2020-11-15 16:28+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -302,7 +302,8 @@ msgstr "suǒ yǒu CAN wài shè dōu zài shǐ yòng zhōng" msgid "All I2C peripherals are in use" msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng" -#: 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 "suǒ yǒu zhèng zài shǐ yòng zhōng de PCNT dān yuán" @@ -1009,6 +1010,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "Shūrù shíjiānguò zhǎng" @@ -3252,6 +3257,7 @@ msgstr "pow() 3 cān shǔ bùnéng wéi 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" +#: ports/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 @@ -3469,6 +3475,7 @@ msgstr "yùzhí bìxū zài fànwéi 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() xūyào 9 xùliè" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" msgstr "chāoshí shíjiān chāoguò zuìdà zhīchí zhí" @@ -3652,6 +3659,10 @@ msgstr "zhí jìshù bìxū wèi > 0" msgid "vectors must have same lengths" msgstr "xiàngliàng bìxū jùyǒu xiāngtóng de chángdù" +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "kān mén gǒu chāoshí bìxū dàyú 0" From 119e9d38202cb26f7f04d1050263e27e1083865a Mon Sep 17 00:00:00 2001 From: jgillick Date: Mon, 16 Nov 2020 23:50:00 -0800 Subject: [PATCH 144/251] 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 7750b4d6712b410bd8ccc498e571297b4628884a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 17 Nov 2020 07:37:07 -0600 Subject: [PATCH 145/251] actions: Disable pagination of 'aws' commands An anticipatory workaround for https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-output-pager --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd0dea5cf8..9c3c87b586 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,6 +119,7 @@ jobs: zip -9r circuitpython-stubs.zip circuitpython-stubs [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 env: + AWS_PAGER: '' AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) @@ -159,6 +160,7 @@ jobs: run: | [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-catalina-${{ env.CP_VERSION }} --no-progress --region us-east-1 env: + AWS_PAGER: '' AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) @@ -363,6 +365,7 @@ jobs: - name: Upload to S3 run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1" env: + AWS_PAGER: '' AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) @@ -411,6 +414,7 @@ jobs: - name: Upload to S3 run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1" env: + AWS_PAGER: '' AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) @@ -505,6 +509,7 @@ jobs: - name: Upload to S3 run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1" env: + AWS_PAGER: '' AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) From a0d305042c335d55176a8f6951572b1a1b7629ba Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 17 Nov 2020 09:01:50 -0600 Subject: [PATCH 146/251] fix ubuntu-latest stragglers --- .github/workflows/build.yml | 2 +- .github/workflows/create_website_pr.yml | 2 +- .github/workflows/pre-commit.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c3c87b586..f3e728a05c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -419,7 +419,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) build-xtensa: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 needs: test strategy: fail-fast: false diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index 71959ffdcd..c8aca30e4a 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -10,7 +10,7 @@ on: jobs: website: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Dump GitHub context env: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index eac9bfe096..8caf56d268 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -11,7 +11,7 @@ on: jobs: pre-commit: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 - uses: actions/setup-python@v1 From 0bbdf05936c1b36bee6ef4f9f81bd3b9ea40fbc6 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 13 Nov 2020 13:12:07 -0500 Subject: [PATCH 147/251] Implement recvfrom_into and sendto for UDP --- ports/esp32s2/Makefile | 1 + ports/esp32s2/common-hal/socketpool/Socket.c | 86 ++++++++++---------- shared-bindings/socketpool/Socket.c | 8 +- shared-bindings/socketpool/Socket.h | 4 +- 4 files changed, 52 insertions(+), 47 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 55d6e91d44..a2e6cb73d9 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 \ + lib/netutils/netutils.c \ peripherals/pcnt.c \ peripherals/pins.c \ peripherals/rmt.c \ diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index de9e6ad31b..937d199f21 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -32,6 +32,11 @@ #include "py/runtime.h" #include "supervisor/shared/tick.h" +#include "components/lwip/lwip/src/include/lwip/err.h" +#include "components/lwip/lwip/src/include/lwip/sockets.h" +#include "components/lwip/lwip/src/include/lwip/sys.h" +#include "components/lwip/lwip/src/include/lwip/netdb.h" + void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t* self, mp_uint_t timeout_ms) { self->timeout_ms = timeout_ms; } @@ -122,58 +127,55 @@ mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t* self, const char* host, size_t hostlen, uint8_t port, const uint8_t* buf, mp_uint_t len) { + // Get the IP address string + const struct addrinfo hints = { + .ai_family = AF_INET, + .ai_socktype = SOCK_STREAM, + }; + struct addrinfo *result; + int error = lwip_getaddrinfo(host, NULL, &hints, &result); + if (error != 0 || result == NULL) { + return 0; + } + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcast-align" + struct in_addr *addr = &((struct sockaddr_in *)result->ai_addr)->sin_addr; + #pragma GCC diagnostic pop + char ip_str[IP4ADDR_STRLEN_MAX]; + inet_ntoa_r(*addr, ip_str, IP4ADDR_STRLEN_MAX); + freeaddrinfo(result); + + // Set parameters struct sockaddr_in dest_addr; - dest_addr.sin_addr.s_addr = inet_addr(HOST_IP_ADDR); + dest_addr.sin_addr.s_addr = inet_addr((const char *)ip_str); dest_addr.sin_family = AF_INET; dest_addr.sin_port = htons(port); - - const struct addrinfo hints = { - .ai_family = AF_INET, - .ai_socktype = SOCK_STREAM, - }; - struct addrinfo *res; - int err = getaddrinfo(host, NULL, &hints, &res); - if (err != 0 || res == NULL) { - return mp_const_none; + int bytes_sent = lwip_sendto(self->num, buf, len, 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr)); + if (bytes_sent < 0) { + mp_raise_BrokenPipeError(); + return 0; } - - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wcast-align" - struct in_addr *addr = &((struct sockaddr_in *)res->ai_addr)->sin_addr; - #pragma GCC diagnostic pop - char ip_str[IP4ADDR_STRLEN_MAX]; - inet_ntoa_r(*addr, ip_str, IP4ADDR_STRLEN_MAX); - mp_obj_t ip_obj = mp_obj_new_str(ip_str, strlen(ip_str)); - freeaddrinfo(res); - - - - int err = lwip_sendto(self->num, buf, len, 0 /* flags */, - (struct sockaddr *)&dest_addr, sizeof(dest_addr)); + return bytes_sent; } mp_uint_t common_hal_socketpool_socket_recvfrom_into(socketpool_socket_obj_t* self, - const uint8_t* buf, mp_uint_t len, uint8_t* ip, uint8_t port) { + uint8_t* buf, mp_uint_t len, uint8_t* ip, uint *port) { - const struct addrinfo hints = { - .ai_family = AF_INET, - .ai_socktype = SOCK_STREAM, - }; - struct addrinfo *res; - int err = getaddrinfo(host, NULL, &hints, &res); - if (err != 0 || res == NULL) { - return mp_const_none; + struct sockaddr_in source_addr; + socklen_t socklen = sizeof(source_addr); + int bytes_received = lwip_recvfrom(self->num, buf, len - 1, 0, (struct sockaddr *)&source_addr, &socklen); + + memcpy((void *)ip, (void*)&source_addr.sin_addr.s_addr, sizeof source_addr.sin_addr.s_addr); + *port = source_addr.sin_port; + + if (bytes_received < 0) { + mp_raise_BrokenPipeError(); + return 0; + } else { + buf[bytes_received] = 0; // Null-terminate whatever we received + return bytes_received; } - - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wcast-align" - struct in_addr *addr = &((struct sockaddr_in *)res->ai_addr)->sin_addr; - #pragma GCC diagnostic pop - char ip_str[IP4ADDR_STRLEN_MAX]; - inet_ntoa_r(*addr, ip_str, IP4ADDR_STRLEN_MAX); - mp_obj_t ip_obj = mp_obj_new_str(ip_str, strlen(ip_str)); - freeaddrinfo(res); } void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self) { diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index 591b7d8bbd..99e2c8fccb 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -36,6 +36,8 @@ #include "py/runtime.h" #include "py/mperrno.h" +#include "lib/netutils/netutils.h" + //| class Socket: //| """TCP, UDP and RAW socket. Cannot be created directly. Instead, call //| `SocketPool.socket()`. @@ -298,7 +300,7 @@ STATIC mp_obj_t socketpool_socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_ mp_int_t port = mp_obj_get_int(addr_items[1]); mp_int_t ret = common_hal_socketpool_socket_sendto(self, host, hostlen, port, bufinfo.buf, bufinfo.len); - if (!ok) { + if (!ret) { mp_raise_OSError(0); } @@ -324,11 +326,11 @@ STATIC mp_obj_t socketpool_socket_recvfrom_into(mp_obj_t self_in, mp_obj_t data_ byte ip[4]; mp_uint_t port; mp_int_t ret = common_hal_socketpool_socket_recvfrom_into(self, - (byte*)bufinfo.buf, len, ip, &port); + (byte*)bufinfo.buf, bufinfo.len, ip, &port); mp_obj_t tuple_contents[2]; tuple_contents[0] = mp_obj_new_int_from_uint(ret); tuple_contents[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); - return mp_obj_new_tuple(2, tuple); + return mp_obj_new_tuple(2, tuple_contents); } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_recvfrom_into_obj, socketpool_socket_recvfrom_into); diff --git a/shared-bindings/socketpool/Socket.h b/shared-bindings/socketpool/Socket.h index 72a4c9e3c3..54fbe59b28 100644 --- a/shared-bindings/socketpool/Socket.h +++ b/shared-bindings/socketpool/Socket.h @@ -36,9 +36,9 @@ bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const c mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len); mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len); mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t* self, - const uint8_t* host, size_t hostlen, uint8_t port, const uint8_t* buf, mp_uint_t len); + const char* host, size_t hostlen, uint8_t port, const uint8_t* buf, mp_uint_t len); mp_uint_t common_hal_socketpool_socket_recvfrom_into(socketpool_socket_obj_t* self, - const uint8_t* buf, mp_uint_t len, uint8_t* ip, uint8_t port); + uint8_t* buf, mp_uint_t len, uint8_t* ip, uint *port); void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self); bool common_hal_socketpool_socket_get_closed(socketpool_socket_obj_t* self); bool common_hal_socketpool_socket_get_connected(socketpool_socket_obj_t* self); From 1bc770c3dc308b91184e8cab52f6f4cabdda99fc Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 17 Nov 2020 17:31:54 -0600 Subject: [PATCH 148/251] esp32s2: PulseIn: Fix supervisor tick enabling Before, there were two problems: * Even if a pulsein was never constructed, supervisor_disable_tick would occur during restart. This could cancel out a supervisor_enable_tick from someplace else, with unexpected results. * If two or more pulseins were constructed, each one would enable ticks, but only the last one deinited (or the reset routine) would disable, leaving ticks running indefinitely. In my testing, it seemed that this led to the board sometimes stopping when it should have auto-reloaded. --- ports/esp32s2/common-hal/pulseio/PulseIn.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/common-hal/pulseio/PulseIn.c b/ports/esp32s2/common-hal/pulseio/PulseIn.c index f7429ec12c..9feeea1479 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseIn.c +++ b/ports/esp32s2/common-hal/pulseio/PulseIn.c @@ -77,7 +77,9 @@ void pulsein_reset(void) { for (size_t i = 0; i < RMT_CHANNEL_MAX; i++) { handles[i] = NULL; } - supervisor_disable_tick(); + if (refcount != 0) { + supervisor_disable_tick(); + } refcount = 0; } @@ -122,8 +124,10 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu // start RMT RX, and enable ticks so the core doesn't turn off. rmt_rx_start(channel, true); - supervisor_enable_tick(); refcount++; + if (refcount == 1) { + supervisor_enable_tick(); + } } bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t* self) { From 9206925bf8d2e3d8220b59200ee50c3e4c8a64d2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 17 Nov 2020 17:45:12 -0600 Subject: [PATCH 149/251] esp32s2: port_get_raw_ticks: Use a more efficient, monotonic routine While trying to debug #3572, I noticed that I would frequently break in the midst of gettimeofday and that the routine get_adjusted_boot_time had to take and release locks. Furthermore, we don't want "adjusted" boot time, which could go forwards or backwards depending on the adjustment (such as setting the clock used by gettimeofday() to the network time) --- ports/esp32s2/supervisor/port.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 47d0c7f463..876ad739d6 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -191,14 +191,14 @@ uint32_t port_get_saved_word(void) { } uint64_t port_get_raw_ticks(uint8_t* subticks) { - struct timeval tv_now; - gettimeofday(&tv_now, NULL); - // convert usec back to ticks - uint64_t all_subticks = (uint64_t)(tv_now.tv_usec * 2) / 71; + // Convert microseconds to subticks of 1/32768 seconds + // 32768/1000000 = 64/15625 in lowest terms + // this arithmetic overflows after 570 years + int64_t all_subticks = esp_timer_get_time() * 512 / 15625; if (subticks != NULL) { *subticks = all_subticks % 32; } - return (uint64_t)tv_now.tv_sec * 1024L + all_subticks / 32; + return all_subticks / 32; } // Enable 1/1024 second tick. From 8ae7b996278f379b6d40b2d3cf9729b5be53abd9 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Mon, 16 Nov 2020 23:32:22 +0000 Subject: [PATCH 150/251] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (848 of 848 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 4918689795..4cf204ae81 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-10 15:30+0530\n" -"PO-Revision-Date: 2020-11-08 10:26+0000\n" +"PO-Revision-Date: 2020-11-18 00:28+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.3.2\n" +"X-Generator: Weblate 4.4-dev\n" #: main.c msgid "" @@ -447,7 +447,7 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" +msgstr "A profundidade dos bits deve ser de 1 até 6 inclusive, porém não %d" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." @@ -1025,7 +1025,7 @@ msgstr "O tamanho do buffer está incorreto" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" -msgstr "" +msgstr "A inicialização falhou devido à falta de memória" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" @@ -3705,7 +3705,7 @@ msgstr "os vetores devem ter os mesmos comprimentos" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" -msgstr "" +msgstr "o watchdog não foi inicializado" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" 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 151/251] 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 152/251] 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 153/251] 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 154/251] 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 83d790ad8f7838d70269d0f0add6de1199198227 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 18 Nov 2020 17:45:42 -0600 Subject: [PATCH 155/251] esp32s2: don't delete the event loop .. it seems to make the esp-idf grumpy. --- ports/esp32s2/common-hal/wifi/__init__.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index 2eb3719b4d..1b244dd2ff 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -143,7 +143,6 @@ void wifi_reset(void) { radio->handler_instance_got_ip)); ESP_ERROR_CHECK(esp_wifi_deinit()); esp_netif_destroy(radio->netif); - ESP_ERROR_CHECK(esp_event_loop_delete_default()); radio->netif = NULL; } From f61f8f999b5eeb8a545f5cea13b30ac5b3aeb04a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 18 Nov 2020 18:06:31 -0600 Subject: [PATCH 156/251] 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 2463a6d6ac3fb53fa471c77bc585c8ef350d2b96 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 18 Nov 2020 16:28:21 -0800 Subject: [PATCH 157/251] Fix Palette grayscale for EInk. It needs to do the bitmasking that was only added to ColorConverter in #3611 --- shared-module/displayio/Palette.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared-module/displayio/Palette.c b/shared-module/displayio/Palette.c index facb1fa732..ba5ff665c9 100644 --- a/shared-module/displayio/Palette.c +++ b/shared-module/displayio/Palette.c @@ -83,7 +83,8 @@ bool displayio_palette_get_color(displayio_palette_t *self, const _displayio_col uint8_t pixel_hue = self->colors[palette_index].hue; displayio_colorconverter_compute_tricolor(colorspace, pixel_hue, luma, color); } else if (colorspace->grayscale) { - *color = self->colors[palette_index].luma >> (8 - colorspace->depth); + size_t bitmask = (1 << colorspace->depth) - 1; + *color = (self->colors[palette_index].luma >> colorspace->grayscale_bit) & bitmask; } else { uint16_t packed = self->colors[palette_index].rgb565; if (colorspace->reverse_bytes_in_word) { From 081aec44290cdacc2a28cf8b5c01d34c3d681d93 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 18 Nov 2020 16:39:34 -0800 Subject: [PATCH 158/251] 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 b98835a1d787f3d1e20eb29bf65ca8cf41d9abf0 Mon Sep 17 00:00:00 2001 From: hexthat Date: Wed, 18 Nov 2020 01:12:46 +0000 Subject: [PATCH 159/251] Translated using Weblate (Chinese (Pinyin)) Currently translated at 100.0% (848 of 848 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index dd44aab939..e94ae8173f 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: circuitpython-cn\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-19 01:28+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -1012,7 +1012,7 @@ msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" -msgstr "" +msgstr "yóu yú nèi cún bù zú, chū shǐ huà shī bài" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" @@ -3661,7 +3661,7 @@ msgstr "xiàngliàng bìxū jùyǒu xiāngtóng de chángdù" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" -msgstr "" +msgstr "wèi chū shǐ huà jiān shì qì" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" From b9bec87f2930787cb1d2f3baea8284985a0062d5 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 18 Nov 2020 17:38:06 -0800 Subject: [PATCH 160/251] Update build board info. * Don't add full urls because they are too large. * Remove the unstable version when it starts with the current version. --- tools/build_board_info.py | 135 +++++++++++++++++++------------------- 1 file changed, 69 insertions(+), 66 deletions(-) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index f83282ea9d..ce9d45fe2f 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -19,20 +19,24 @@ import shared_bindings_matrix sys.path.append("adabot") import adabot.github_requests as github -SUPPORTED_PORTS = ["atmel-samd", "cxd56", "esp32s2", "litex", "mimxrt10xx", "nrf", "stm"] +SUPPORTED_PORTS = [ + "atmel-samd", + "cxd56", + "esp32s2", + "litex", + "mimxrt10xx", + "nrf", + "stm", +] -BIN = ('bin',) -UF2 = ('uf2',) -BIN_UF2 = ('bin', 'uf2') -HEX = ('hex',) -HEX_UF2 = ('hex', 'uf2') -SPK = ('spk',) -DFU = ('dfu',) -BIN_DFU = ('bin', 'dfu') - -# Example: -# https://downloads.circuitpython.org/bin/trinket_m0/en_US/adafruit-circuitpython-trinket_m0-en_US-5.0.0-rc.0.uf2 -DOWNLOAD_BASE_URL = "https://downloads.circuitpython.org/bin" +BIN = ("bin",) +UF2 = ("uf2",) +BIN_UF2 = ("bin", "uf2") +HEX = ("hex",) +HEX_UF2 = ("hex", "uf2") +SPK = ("spk",) +DFU = ("dfu",) +BIN_DFU = ("bin", "dfu") # Default extensions extension_by_port = { @@ -42,7 +46,7 @@ extension_by_port = { "cxd56": SPK, "mimxrt10xx": HEX_UF2, "litex": DFU, - "esp32s2": BIN_UF2 + "esp32s2": BIN_UF2, } # Per board overrides @@ -57,26 +61,28 @@ extension_by_board = { "feather_m0_rfm69": BIN_UF2, "feather_m0_rfm9x": BIN_UF2, "uchip": BIN_UF2, - # nRF52840 dev kits that may not have UF2 bootloaders, "makerdiary_nrf52840_mdk": HEX, "makerdiary_nrf52840_mdk_usb_dongle": HEX_UF2, "pca10056": BIN_UF2, "pca10059": BIN_UF2, "electronut_labs_blip": HEX, - # stm32 - "meowbit_v121": UF2 + "meowbit_v121": UF2, } aliases_by_board = { - "circuitplayground_express": ["circuitplayground_express_4h", "circuitplayground_express_digikey_pycon2019"], + "circuitplayground_express": [ + "circuitplayground_express_4h", + "circuitplayground_express_digikey_pycon2019", + ], "pybadge": ["edgebadge"], "pyportal": ["pyportal_pynt"], "gemma_m0": ["gemma_m0_pycon2018"], - "pewpew10": ["pewpew13"] + "pewpew10": ["pewpew13"], } + def get_languages(): languages = [] for f in os.scandir("../locale"): @@ -84,6 +90,7 @@ def get_languages(): languages.append(f.name[:-3]) return languages + def get_board_mapping(): boards = {} for port in SUPPORTED_PORTS: @@ -95,23 +102,30 @@ def get_board_mapping(): extensions = extension_by_port[port] extensions = extension_by_board.get(board_path.name, extensions) aliases = aliases_by_board.get(board_path.name, []) - boards[board_id] = {"port": port, - "extensions": extensions, - "download_count": 0, - "aliases": aliases} + boards[board_id] = { + "port": port, + "extensions": extensions, + "download_count": 0, + "aliases": aliases, + } for alias in aliases: - boards[alias] = {"port": port, - "extensions": extensions, - "download_count": 0, - "alias": True, - "aliases": []} + boards[alias] = { + "port": port, + "extensions": extensions, + "download_count": 0, + "alias": True, + "aliases": [], + } return boards + def get_version_info(): version = None sha = git("rev-parse", "--short", "HEAD").stdout.decode("utf-8") try: - version = git("describe", "--tags", "--exact-match").stdout.decode("utf-8").strip() + version = ( + git("describe", "--tags", "--exact-match").stdout.decode("utf-8").strip() + ) except sh.ErrorReturnCode_128: # No exact match pass @@ -120,10 +134,11 @@ def get_version_info(): sha = os.environ["GITHUB_SHA"] if not version: - version="{}-{}".format(date.today().strftime("%Y%m%d"), sha[:7]) + version = "{}-{}".format(date.today().strftime("%Y%m%d"), sha[:7]) return sha, version + def get_current_info(): response = github.get("/repos/adafruit/circuitpython-org/git/refs/heads/master") if not response.ok: @@ -131,7 +146,9 @@ def get_current_info(): raise RuntimeError("cannot get master sha") commit_sha = response.json()["object"]["sha"] - response = github.get("/repos/adafruit/circuitpython-org/contents/_data/files.json?ref=" + commit_sha) + response = github.get( + "/repos/adafruit/circuitpython-org/contents/_data/files.json?ref=" + commit_sha + ) if not response.ok: print(response.text) raise RuntimeError("cannot get previous files.json") @@ -145,6 +162,7 @@ def get_current_info(): current_info[info["id"]] = info return git_info, current_info + def create_pr(changes, updated, git_info, user): commit_sha, original_blob_sha = git_info branch_name = "new_release_" + changes["new_release"] @@ -158,7 +176,7 @@ def create_pr(changes, updated, git_info, user): updated_list.append(info) updated = json.dumps(updated_list, sort_keys=True, indent=1).encode("utf-8") + b"\n" - #print(updated.decode("utf-8")) + # print(updated.decode("utf-8")) pr_title = "Automated website update for release {}".format(changes["new_release"]) boards = "" if changes["new_boards"]: @@ -167,16 +185,13 @@ def create_pr(changes, updated, git_info, user): if changes["new_languages"]: languages = "New languages:\n* " + "\n* ".join(changes["new_languages"]) message = "Automated website update for release {} by Blinka.\n\n{}\n\n{}\n".format( - changes["new_release"], - boards, - languages + changes["new_release"], boards, languages ) - create_branch = { - "ref": "refs/heads/" + branch_name, - "sha": commit_sha - } - response = github.post("/repos/{}/circuitpython-org/git/refs".format(user), json=create_branch) + create_branch = {"ref": "refs/heads/" + branch_name, "sha": commit_sha} + response = github.post( + "/repos/{}/circuitpython-org/git/refs".format(user), json=create_branch + ) if not response.ok and response.json()["message"] != "Reference already exists": print("unable to create branch") print(response.text) @@ -186,10 +201,13 @@ def create_pr(changes, updated, git_info, user): "message": message, "content": base64.b64encode(updated).decode("utf-8"), "sha": original_blob_sha, - "branch": branch_name + "branch": branch_name, } - response = github.put("/repos/{}/circuitpython-org/contents/_data/files.json".format(user), json=update_file) + response = github.put( + "/repos/{}/circuitpython-org/contents/_data/files.json".format(user), + json=update_file, + ) if not response.ok: print("unable to post new file") print(response.text) @@ -199,7 +217,7 @@ def create_pr(changes, updated, git_info, user): "head": user + ":" + branch_name, "base": "master", "body": message, - "maintainer_can_modify": True + "maintainer_can_modify": True, } response = github.post("/repos/adafruit/circuitpython-org/pulls", json=pr_info) if not response.ok: @@ -220,17 +238,14 @@ def print_active_user(): print("Not logged in") return None + def generate_download_info(): boards = {} errors = [] new_tag = os.environ["RELEASE_TAG"] - changes = { - "new_release": new_tag, - "new_boards": [], - "new_languages": [] - } + changes = {"new_release": new_tag, "new_boards": [], "new_languages": []} user = print_active_user() @@ -254,8 +269,9 @@ def generate_download_info(): info = current_info[board] for version in info["versions"]: previous_releases.add(version["version"]) - previous_languages.update(version["files"].keys()) - if version["stable"] == new_stable: + if version["stable"] == new_stable or ( + new_stable and version["version"].startswith(this_version) + ): info["versions"].remove(version) board_mapping = get_board_mapping() @@ -272,29 +288,15 @@ def generate_download_info(): alias_info = board_mapping[alias] if alias not in current_info: changes["new_boards"].append(alias) - current_info[alias] = {"downloads": 0, - "versions": []} + current_info[alias] = {"downloads": 0, "versions": []} new_version = { "stable": new_stable, "version": new_tag, "modules": support_matrix.get(alias, "[]"), - "files": {}, "languages": languages, - "extensions": board_info["extensions"] + "extensions": board_info["extensions"], } - for language in languages: - files = [] - new_version["files"][language] = files - for extension in board_info["extensions"]: - files.append( - "{base_url}/{alias}/{language}/adafruit-circuitpython-{alias}-{language}-{tag}.{extension}" - .format( - base_url=DOWNLOAD_BASE_URL, - tag=new_tag, - alias=alias, - language=language, - extension=extension)) current_info[alias]["downloads"] = alias_info["download_count"] current_info[alias]["versions"].append(new_version) @@ -305,6 +307,7 @@ def generate_download_info(): else: print("No new release to update") + if __name__ == "__main__": if "RELEASE_TAG" in os.environ and os.environ["RELEASE_TAG"]: generate_download_info() From 9a642fc0490c22b60460bcca8dec3b0b93344d81 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 18 Nov 2020 20:37:26 -0600 Subject: [PATCH 161/251] 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 162/251] 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 163/251] 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 76d4824728c6dc99d9bfed48a41933fa48c8bbf7 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Thu, 19 Nov 2020 15:04:52 +0100 Subject: [PATCH 164/251] spresense: Return fixed stack --- ports/cxd56/supervisor/port.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index 92d335cd59..086c2d198e 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -98,8 +98,12 @@ void reset_to_bootloader(void) { } } +supervisor_allocation _fixed_stack; + supervisor_allocation* port_fixed_stack(void) { - return NULL; + _fixed_stack.ptr = port_stack_get_limit(); + _fixed_stack.length = (port_stack_get_top() - port_stack_get_limit()) * sizeof(uint32_t); + return &_fixed_stack; } uint32_t *port_stack_get_limit(void) { From dd108b755dc2bb886df14c9fcfcd4f09be61f2d4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Nov 2020 11:36:02 -0600 Subject: [PATCH 165/251] esp32s2: initialize event loop ane netif only once deinitting these seems to cause problems. --- ports/esp32s2/common-hal/wifi/__init__.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index 1b244dd2ff..f53e68fc28 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -88,14 +88,17 @@ static void event_handler(void* arg, esp_event_base_t event_base, } } -static bool wifi_inited; +static bool wifi_inited, wifi_ever_inited; void common_hal_wifi_init(void) { wifi_inited = true; common_hal_wifi_radio_obj.base.type = &wifi_radio_type; - ESP_ERROR_CHECK(esp_netif_init()); - ESP_ERROR_CHECK(esp_event_loop_create_default()); + if (!wifi_ever_inited) { + ESP_ERROR_CHECK(esp_netif_init()); + ESP_ERROR_CHECK(esp_event_loop_create_default()); + } + wifi_ever_inited = true; wifi_radio_obj_t* self = &common_hal_wifi_radio_obj; self->netif = esp_netif_create_default_wifi_sta(); From 331aa6e59fd36b52afb4119068d0baa99c85ea3c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Nov 2020 11:43:18 -0600 Subject: [PATCH 166/251] 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 167/251] 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 168/251] 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 169/251] 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 170/251] 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 171/251] 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 172/251] 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 173/251] 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 174/251] 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 175/251] 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 176/251] 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 177/251] 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 178/251] 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 179/251] 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 180/251] 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 181/251] 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 182/251] 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 183/251] 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 184/251] 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 185/251] 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 186/251] 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 187/251] 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 188/251] 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 189/251] 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 190/251] 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 191/251] 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 192/251] 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 048ca2a57003d6f122db57dfc93513222380cff0 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sun, 22 Nov 2020 18:54:18 +0530 Subject: [PATCH 193/251] get multiple touchpad working --- ports/esp32s2/common-hal/touchio/TouchIn.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.c b/ports/esp32s2/common-hal/touchio/TouchIn.c index b44234775e..4589c46a79 100644 --- a/ports/esp32s2/common-hal/touchio/TouchIn.c +++ b/ports/esp32s2/common-hal/touchio/TouchIn.c @@ -25,10 +25,12 @@ */ #include "shared-bindings/touchio/TouchIn.h" -#include "py/runtime.h" +#include "py/runtime.h" #include "driver/touch_pad.h" +bool touch_inited = false; + static uint16_t get_raw_reading(touchio_touchin_obj_t *self) { uint32_t touch_value; touch_pad_read_raw_data((touch_pad_t)self->pin->touch_channel, &touch_value); @@ -45,11 +47,14 @@ void common_hal_touchio_touchin_construct(touchio_touchin_obj_t* self, } claim_pin(pin); - touch_pad_init(); - touch_pad_config((touch_pad_t)pin->touch_channel); + if (!touch_inited) { + touch_pad_init(); + touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER); + touch_pad_fsm_start(); + touch_inited = true; + } - touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER); - touch_pad_fsm_start(); + touch_pad_config((touch_pad_t)pin->touch_channel); // wait for "raw data" to reset mp_hal_delay_ms(10); @@ -79,8 +84,7 @@ void common_hal_touchio_touchin_deinit(touchio_touchin_obj_t* self) { } bool common_hal_touchio_touchin_get_value(touchio_touchin_obj_t *self) { - uint16_t reading = get_raw_reading(self); - return reading > self->threshold; + return get_raw_reading(self) > self->threshold; } uint16_t common_hal_touchio_touchin_get_raw_value(touchio_touchin_obj_t *self) { 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 194/251] 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 195/251] 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 196/251] 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 197/251] 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 198/251] 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 199/251] 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 200/251] 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 201/251] 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 202/251] 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 203/251] 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 204/251] 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 205/251] 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 206/251] 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 207/251] 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 208/251] 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 209/251] 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 210/251] 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 211/251] 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 212/251] 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 ba6e15b0700093933826c054ea44d45993751036 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 24 Nov 2020 11:32:18 -0500 Subject: [PATCH 213/251] Fix stubs --- shared-bindings/socketpool/Socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index 99e2c8fccb..0e6968d5f4 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -276,7 +276,7 @@ STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket_recv_into_obj, 2, 3, socketpool_socket_recv_into); -//| def sendto(self, bytes: ReadableBuffer, address: tuple) -> int: +//| def sendto(self, bytes: ReadableBuffer, address: Tuple[str, int]) -> int: //| """Send some bytes to a specific address. //| Suits sockets of type SOCK_DGRAM //| @@ -308,7 +308,7 @@ STATIC mp_obj_t socketpool_socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_ } STATIC MP_DEFINE_CONST_FUN_OBJ_3(socketpool_socket_sendto_obj, socketpool_socket_sendto); -//| def recvfrom_into(self, buffer) -> Tuple[int, tuple]: +//| def recvfrom_into(self, buffer: WriteableBuffer) -> Tuple[int, Tuple[str, int]]: //| """Reads some bytes from a remote address. //| //| Returns a tuple containing From 1031fe299254e0b46afa9d500fd298e2382f2183 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 24 Nov 2020 14:46:43 -0500 Subject: [PATCH 214/251] correct submodule --- ports/esp32s2/esp-idf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 8bc19ba893..d06744f5ef 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 8bc19ba893e5544d571a753d82b44a84799b94b1 +Subproject commit d06744f5efc382c61cbad8758107cec308feef09 From 0c5e0954dbf2c725cadf12260e56f51a967f9e50 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 24 Nov 2020 14:51:06 -0500 Subject: [PATCH 215/251] Add closed socket identification --- ports/esp32s2/common-hal/socketpool/Socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index 937d199f21..1e22193330 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -187,6 +187,7 @@ void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self) { if (self->num >= 0) { lwip_shutdown(self->num, 0); lwip_close(self->num); + self->num = -1; } } From e83c481f0fbf6d1ed052b7bba12163e80d64ad4a Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 24 Nov 2020 15:40:27 -0500 Subject: [PATCH 216/251] translations --- locale/circuitpython.pot | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index c184d69313..034fc2ab24 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -297,6 +297,7 @@ msgid "All I2C peripherals are in use" msgstr "" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "" @@ -333,6 +334,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1086,6 +1088,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" @@ -1412,14 +1415,14 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" From 59458a9013786f79c78a36ce5d6298f16fdd6a1a Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 24 Nov 2020 16:46:11 -0500 Subject: [PATCH 217/251] Add pin claiming to SPI construct --- ports/esp32s2/common-hal/busio/SPI.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 490419f34a..da738bbfdd 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -204,6 +204,14 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, // hal->dummy_bits = 0; // hal->addr = 0; + claim_pin(self->clock_pin); + if (self->MOSI_pin != NULL) { + claim_pin(self->MOSI_pin); + } + if (self->MISO_pin != NULL) { + claim_pin(self->MISO_pin); + } + hal->io_mode = SPI_LL_IO_MODE_NORMAL; common_hal_busio_spi_configure(self, 250000, 0, 0, 8); From 966e0b256c6b75fb6a4d8a4debceb9b5dbf902b2 Mon Sep 17 00:00:00 2001 From: Antonin ENFRUN Date: Tue, 24 Nov 2020 17:19:41 +0000 Subject: [PATCH 218/251] Translated using Weblate (French) Currently translated at 98.2% (848 of 863 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 17e6e905d1..87c79cde9a 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-23 10:10-0600\n" -"PO-Revision-Date: 2020-11-20 22:28+0000\n" -"Last-Translator: Noel Gaetan \n" +"PO-Revision-Date: 2020-11-24 22:45+0000\n" +"Last-Translator: Antonin ENFRUN \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -881,7 +881,7 @@ 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 "" +msgstr "FFT n'est implémenté que pour les tableaux linéaires" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" @@ -2116,7 +2116,7 @@ msgstr "L'argument argsort doit être un ndarray" #: extmod/ulab/code/numerical/numerical.c msgid "argsort is not implemented for flattened arrays" -msgstr "" +msgstr "argsort n'est pas mis en œuvre pour les tableaux aplatis" #: py/runtime.c msgid "argument has wrong type" @@ -2141,7 +2141,7 @@ msgstr "les arguments doivent être des ndarrays" #: extmod/ulab/code/ndarray.c msgid "array and index length must be equal" -msgstr "" +msgstr "la longueur du tableau et de l'index doit être égale" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2149,7 +2149,7 @@ msgstr "tableau/octets requis à droite" #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get (arg)min/(arg)max of empty sequence" -msgstr "" +msgstr "tentative d’obtenir (arg)min/(arg)max d'une séquence vide" #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" @@ -2161,15 +2161,15 @@ msgstr "attribut pas encore supporté" #: extmod/ulab/code/numerical/numerical.c msgid "axis is out of bounds" -msgstr "" +msgstr "axis est hors limites" #: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, or an integer" -msgstr "" +msgstr "axis doit être None ou un entier" #: extmod/ulab/code/numerical/numerical.c msgid "axis too long" -msgstr "" +msgstr "axis trop long" #: py/builtinevex.c msgid "bad compile mode" @@ -2485,7 +2485,7 @@ 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 "" +msgstr "cross est défini pour les tableaux 1D de longueur 3" #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" @@ -2528,7 +2528,7 @@ msgstr "l'argument diff doit être un ndarray" #: extmod/ulab/code/numerical/numerical.c msgid "differentiation order out of range" -msgstr "" +msgstr "differentiation order hors plage" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2649,7 +2649,7 @@ msgstr "le premier argument doit être une fonction" #: extmod/ulab/code/ulab_create.c msgid "first argument must be a tuple of ndarrays" -msgstr "" +msgstr "le premier argument doit être un tuple de ndarrays" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" @@ -2706,7 +2706,7 @@ msgstr "la fonction a le même signe aux extrémités de l’intervalle" #: extmod/ulab/code/ndarray.c msgid "function is defined for ndarrays only" -msgstr "" +msgstr "La fonction n'est définie que pour les ndarrays" #: py/argcheck.c #, c-format @@ -2803,7 +2803,7 @@ msgstr "l'assembleur doit être une fonction" #: extmod/ulab/code/ndarray.c msgid "input and output shapes are not compatible" -msgstr "" +msgstr "les formes d'entrée et de sortie ne sont pas compatibles" #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" @@ -2815,7 +2815,7 @@ 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 "" +msgstr "les tableaux d'entrée ne sont pas compatibles" #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" @@ -2831,11 +2831,11 @@ msgstr "la matrice d'entrée est singulière" #: extmod/ulab/code/user/user.c msgid "input must be a dense ndarray" -msgstr "" +msgstr "l'entrée doit être un tableau dense" #: extmod/ulab/code/ulab_create.c msgid "input must be a tensor of rank 2" -msgstr "" +msgstr "l'entrée doit être un tenseur de rang 2" #: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c msgid "input must be an ndarray" From 241d9207578cbab3584349cd37327efe9910f36c Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 24 Nov 2020 04:06:38 +0000 Subject: [PATCH 219/251] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (863 of 863 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 62 ++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index baa125f1d1..028dad31c1 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-23 10:10-0600\n" -"PO-Revision-Date: 2020-11-18 00:28+0000\n" +"PO-Revision-Date: 2020-11-24 22:45+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -878,7 +878,7 @@ msgstr "O FFT é definido apenas para ndarrays" #: extmod/ulab/code/fft/fft.c msgid "FFT is implemented for linear arrays only" -msgstr "" +msgstr "O FFT é implementado apenas para matrizes lineares" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" @@ -2114,7 +2114,7 @@ msgstr "O argumento argsort deve ser um ndarray" #: extmod/ulab/code/numerical/numerical.c msgid "argsort is not implemented for flattened arrays" -msgstr "" +msgstr "argsort não é implementado para matrizes achatadas" #: py/runtime.c msgid "argument has wrong type" @@ -2139,7 +2139,7 @@ msgstr "os argumentos devem ser ndarrays" #: extmod/ulab/code/ndarray.c msgid "array and index length must be equal" -msgstr "" +msgstr "a matriz e comprimento do índice devem ser iguais" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2147,7 +2147,7 @@ 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 "" +msgstr "tentativa de obter (arg)min/(arg)max da sequência vazia" #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" @@ -2159,15 +2159,15 @@ msgstr "atributos ainda não suportados" #: extmod/ulab/code/numerical/numerical.c msgid "axis is out of bounds" -msgstr "" +msgstr "o eixo está fora dos limites" #: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, or an integer" -msgstr "" +msgstr "eixo deve ser Nenhum ou um número inteiro" #: extmod/ulab/code/numerical/numerical.c msgid "axis too long" -msgstr "" +msgstr "o eixo é muito longo" #: py/builtinevex.c msgid "bad compile mode" @@ -2376,7 +2376,7 @@ msgstr "" #: extmod/ulab/code/ndarray_operators.c msgid "cannot cast output with casting rule" -msgstr "" +msgstr "não pode lançar a saída com a regra de fundição" #: py/objtype.c msgid "cannot create '%q' instances" @@ -2478,7 +2478,7 @@ 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 "" +msgstr "a cruz é definida para matrizes 1D de comprimento 3" #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" @@ -2522,7 +2522,7 @@ msgstr "O argumento diff deve ser um ndarray" #: extmod/ulab/code/numerical/numerical.c msgid "differentiation order out of range" -msgstr "" +msgstr "ordem de diferenciação fora do alcance" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2641,7 +2641,7 @@ 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 "" +msgstr "o primeiro argumento deve ser um tuple de ndarrays" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" @@ -2698,7 +2698,7 @@ msgstr "a função tem o mesmo sinal nas extremidades do intervalo" #: extmod/ulab/code/ndarray.c msgid "function is defined for ndarrays only" -msgstr "" +msgstr "A função é definida apenas para ndarrays" #: py/argcheck.c #, c-format @@ -2794,7 +2794,7 @@ msgstr "o assembler em linha deve ser uma função" #: extmod/ulab/code/ndarray.c msgid "input and output shapes are not compatible" -msgstr "" +msgstr "as formas de entrada e saída não são compatíveis" #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" @@ -2806,7 +2806,7 @@ 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 "" +msgstr "as matrizes da entrada não são compatíveis" #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" @@ -2822,19 +2822,19 @@ msgstr "a matriz da entrada é singular" #: extmod/ulab/code/user/user.c msgid "input must be a dense ndarray" -msgstr "" +msgstr "a entrada deve ser um ndarray denso" #: extmod/ulab/code/ulab_create.c msgid "input must be a tensor of rank 2" -msgstr "" +msgstr "a entrada dos dados deve ser um tensor de nível 2" #: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c msgid "input must be an ndarray" -msgstr "" +msgstr "a entrada deve ser um ndarray" #: extmod/ulab/code/filter/filter.c msgid "input must be one-dimensional" -msgstr "" +msgstr "a entrada deve ser unidimensional" #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" @@ -2850,7 +2850,7 @@ msgstr "os vetores da entrada devem ter o mesmo comprimento" #: extmod/ulab/code/poly/poly.c msgid "inputs are not iterable" -msgstr "" +msgstr "as entradas não são iteráveis" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" @@ -3025,7 +3025,7 @@ msgstr "max_length deve ser > 0" #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" -msgstr "" +msgstr "O número máximo de dimensões são 4" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3162,7 +3162,7 @@ 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 "" +msgstr "a norma é definida para matrizes 1D e 2D" #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" @@ -3230,7 +3230,7 @@ msgstr "sequência com comprimento ímpar" #: extmod/ulab/code/ulab_create.c msgid "offset is too large" -msgstr "" +msgstr "o offset é muito grande" #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" @@ -3257,11 +3257,11 @@ msgstr "os operandos não puderam ser transmitidos juntos" #: extmod/ulab/code/ndarray.c msgid "operation is implemented for 1D Boolean arrays only" -msgstr "" +msgstr "A operação é implementada apenas para matrizes booleanas 1D" #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented for flattened array" -msgstr "" +msgstr "a operação não é implementada para a matriz achatada" #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" @@ -3403,7 +3403,7 @@ 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 "" +msgstr "os resultados não podem ser lançados para um determinado tipo" #: py/compile.c msgid "return annotation must be an identifier" @@ -3425,7 +3425,7 @@ msgstr "rgb_pins[%d] não está na mesma porta que o clock" #: extmod/ulab/code/numerical/numerical.c msgid "roll argument must be an ndarray" -msgstr "" +msgstr "argumento de enrolar deve ser um ndarray" #: py/objstr.c msgid "rsplit(None,n)" @@ -3453,7 +3453,7 @@ msgstr "compilação de script não suportada" #: extmod/ulab/code/ndarray.c msgid "shape must be a tuple" -msgstr "" +msgstr "a forma deve ser uma tupla" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3602,7 +3602,7 @@ 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 "" +msgstr "os tobytes podem ser invocados apenas nas matrizes densas" #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" @@ -3781,11 +3781,11 @@ msgstr "a janela deve ser <= intervalo" #: extmod/ulab/code/numerical/numerical.c msgid "wrong axis index" -msgstr "" +msgstr "índice do eixo errado" #: extmod/ulab/code/ulab_create.c msgid "wrong axis specified" -msgstr "" +msgstr "um eixo errado foi definido" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" From ff7bab12aa0fb131b8056cd1b20b1e17bba8306a Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 24 Nov 2020 23:45:47 +0100 Subject: [PATCH 220/251] 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 | 6 +++++- locale/cs.po | 6 +++++- locale/de_DE.po | 6 +++++- locale/el.po | 6 +++++- locale/es.po | 6 +++++- locale/fil.po | 6 +++++- locale/fr.po | 6 +++++- locale/hi.po | 6 +++++- locale/it_IT.po | 6 +++++- locale/ja.po | 6 +++++- locale/ko.po | 6 +++++- locale/nl.po | 6 +++++- locale/pl.po | 6 +++++- locale/pt_BR.po | 6 +++++- locale/sv.po | 6 +++++- locale/zh_Latn_pinyin.po | 6 +++++- 16 files changed, 80 insertions(+), 16 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 782e846e99..cf23970d88 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -1283,6 +1283,10 @@ msgstr "Harus menyediakan pin MISO atau MOSI" msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "Harus menggunakan kelipatan 6 pin rgb, bukan %d" +#: ports/esp32s2/common-hal/nvm/ByteArray.c +msgid "NVS Error" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "Nama terlalu panjang" diff --git a/locale/cs.po b/locale/cs.po index 6eb69fb672..3249792e70 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -1266,6 +1266,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 "" diff --git a/locale/de_DE.po b/locale/de_DE.po index f103339109..3b6bc8e217 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -1285,6 +1285,10 @@ msgstr "Muss MISO- oder MOSI-Pin bereitstellen" msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "Muss ein Vielfaches von 6 RGB-Pins verwenden, nicht %d" +#: ports/esp32s2/common-hal/nvm/ByteArray.c +msgid "NVS Error" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "Name zu lang" diff --git a/locale/el.po b/locale/el.po index 85bf0ab44f..71f6e6102b 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -1261,6 +1261,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 "" diff --git a/locale/es.po b/locale/es.po index 538a2944e6..b0314ae198 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: 2020-11-15 16:28+0000\n" "Last-Translator: RubenD \n" "Language-Team: \n" @@ -1284,6 +1284,10 @@ msgstr "Debe proporcionar un pin MISO o MOSI" msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "Debe usar un múltiplo de 6 pines rgb, no %d" +#: ports/esp32s2/common-hal/nvm/ByteArray.c +msgid "NVS Error" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "Nombre muy largo" diff --git a/locale/fil.po b/locale/fil.po index 86178a9a14..50067c6d4f 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1276,6 +1276,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 "" diff --git a/locale/fr.po b/locale/fr.po index 87c79cde9a..359595c723 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: 2020-11-24 22:45+0000\n" "Last-Translator: Antonin ENFRUN \n" "Language: fr\n" @@ -1289,6 +1289,10 @@ msgstr "Doit fournir une broche MISO ou MOSI" msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "Doit utiliser un multiple de 6 broches RVB, pas %d" +#: ports/esp32s2/common-hal/nvm/ByteArray.c +msgid "NVS Error" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "Nom trop long" diff --git a/locale/hi.po b/locale/hi.po index 3b006f1989..de77cec46b 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -1261,6 +1261,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 "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 652bc56fd5..15c83cd53a 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -1280,6 +1280,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 "" diff --git a/locale/ja.po b/locale/ja.po index 26025c19e4..0132783026 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: 2020-11-12 22:51+0000\n" "Last-Translator: sporeball \n" "Language-Team: none\n" @@ -1276,6 +1276,10 @@ msgstr "MISOピンまたはMOSIピンが必要" msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "%d個でなく6の倍数個のrgbピンを使ってください" +#: ports/esp32s2/common-hal/nvm/ByteArray.c +msgid "NVS Error" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "名前が長すぎます" diff --git a/locale/ko.po b/locale/ko.po index a7967210d3..fc08bdeaac 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -1266,6 +1266,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 "" diff --git a/locale/nl.po b/locale/nl.po index f9847fd81f..ee7a3fd545 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: 2020-10-27 16:47+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -1278,6 +1278,10 @@ msgstr "MISO of MOSI moeten worden gegeven" msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "Een meervoud van 6 rgb pinnen moet worden gebruikt, niet %d" +#: ports/esp32s2/common-hal/nvm/ByteArray.c +msgid "NVS Error" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "Naam te lang" diff --git a/locale/pl.po b/locale/pl.po index 1873af488f..4d8c9d84cc 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: 2020-11-11 19:13+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -1277,6 +1277,10 @@ msgstr "Należy podać pin MISO lub MOSI" 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 "Za długa nazwa" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 028dad31c1..5d8ac39f3b 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: 2020-11-24 22:45+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -1287,6 +1287,10 @@ msgstr "Deve informar os pinos MISO ou MOSI" msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "Deve utilizar um múltiplo de 6 pinos rgb, não %d" +#: ports/esp32s2/common-hal/nvm/ByteArray.c +msgid "NVS Error" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "Nome muito longo" diff --git a/locale/sv.po b/locale/sv.po index 02847044fb..db05a557ae 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: 2020-11-20 22:28+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -1277,6 +1277,10 @@ msgstr "Måste ange MISO- eller MOSI-pinne" msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "Måste använda ett multipel av 6 rgb-pinnar, inte %d" +#: ports/esp32s2/common-hal/nvm/ByteArray.c +msgid "NVS Error" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "Name är för långt" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 134efec903..2f0673a7d0 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-23 10:10-0600\n" +"POT-Creation-Date: 2020-11-11 16:30+0530\n" "PO-Revision-Date: 2020-11-19 01:28+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1274,6 +1274,10 @@ msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo" msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "bì xū shǐ yòng 6 RGB yǐn jiǎo de bèi shù, ér bù shì %d" +#: ports/esp32s2/common-hal/nvm/ByteArray.c +msgid "NVS Error" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "Míngchēng tài zhǎng" From c451b22255706989f58cfd88be486e5117979a28 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 24 Nov 2020 10:26:47 -0600 Subject: [PATCH 221/251] 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) From 4ca50982b75678ad38c234202fbc1904df32cf57 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 24 Nov 2020 23:15:25 +0000 Subject: [PATCH 222/251] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (864 of 864 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 5d8ac39f3b..49ac502e29 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-11 16:30+0530\n" -"PO-Revision-Date: 2020-11-24 22:45+0000\n" +"PO-Revision-Date: 2020-11-24 23:22+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1289,7 +1289,7 @@ msgstr "Deve utilizar um múltiplo de 6 pinos rgb, não %d" #: ports/esp32s2/common-hal/nvm/ByteArray.c msgid "NVS Error" -msgstr "" +msgstr "Erro NVS" #: py/parse.c msgid "Name too long" From be44c16e253c7694930419974dc1dcdb5258fe23 Mon Sep 17 00:00:00 2001 From: Mitsuharu Aoyama Date: Tue, 24 Nov 2020 23:45:29 +0000 Subject: [PATCH 223/251] Translated using Weblate (Japanese) Currently translated at 69.0% (597 of 864 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ja/ --- locale/ja.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/ja.po b/locale/ja.po index 0132783026..d0322be773 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-11 16:30+0530\n" -"PO-Revision-Date: 2020-11-12 22:51+0000\n" -"Last-Translator: sporeball \n" +"PO-Revision-Date: 2020-11-25 01:11+0000\n" +"Last-Translator: Mitsuharu Aoyama \n" "Language-Team: none\n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -182,7 +182,7 @@ msgstr "" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects an integer" -msgstr "" +msgstr "'%s' には整数が必要" #: py/emitinlinethumb.c #, c-format From fc344bc818f8172ff36ee646459d7d060a51289a Mon Sep 17 00:00:00 2001 From: James Bowman Date: Tue, 24 Nov 2020 17:26:39 -0800 Subject: [PATCH 224/251] Fix opcode typo in VertexFormat() --- shared-module/_eve/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-module/_eve/__init__.c b/shared-module/_eve/__init__.c index 0f1e12d9fd..d95c777dc4 100644 --- a/shared-module/_eve/__init__.c +++ b/shared-module/_eve/__init__.c @@ -70,8 +70,8 @@ void common_hal__eve_Vertex2f(common_hal__eve_t *eve, mp_float_t x, mp_float_t y void common_hal__eve_VertexFormat(common_hal__eve_t *eve, uint32_t frac) { - C4(eve, ((27 << 24) | ((frac & 7)))); - eve->vscale = 1 << eve->vscale; + C4(eve, ((39 << 24) | ((frac & 7)))); + eve->vscale = 1 << frac; } From 4ac11c8d31311651b77d13bec0a765aa2439cfb2 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 24 Nov 2020 17:54:39 -0800 Subject: [PATCH 225/251] Update wifi.Radio.connect doc Now it includes bssid info. --- ports/esp32s2/common-hal/wifi/Radio.c | 4 ++-- shared-bindings/wifi/Radio.c | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index f7c431a56b..bc987bc1c9 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -138,9 +138,9 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t if (bssid_len > 0){ memcpy(&config->sta.bssid, bssid, bssid_len); config->sta.bssid[bssid_len] = 0; - config->sta.bssid_set = 1; + config->sta.bssid_set = true; } else { - config->sta.bssid_set = 0; + config->sta.bssid_set = false; } // 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 diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index e81e8793c4..991abd4f12 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -142,9 +142,25 @@ const mp_obj_property_t wifi_radio_hostname_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def connect(self, ssid: ReadableBuffer, password: ReadableBuffer = b"", *, channel: Optional[int] = 0, timeout: Optional[float] = None) -> bool: +//| def connect(self, +//| ssid: ReadableBuffer, +//| password: ReadableBuffer = b"", +//| *, +//| channel: Optional[int] = 0, +//| bssid: Optional[ReadableBuffer] = b"", +//| timeout: Optional[float] = None) -> bool: //| """Connects to the given ssid and waits for an ip address. Reconnections are handled -//| automatically once one connection succeeds.""" +//| automatically once one connection succeeds. +//| +//| By default, this will scan all channels and connect to the access point (AP) with the +//| given ``ssid`` and greatest signal strength (rssi). +//| +//| If ``channel`` is given, the scan will begin with the given channel and connect to +//| the first AP with the given ``ssid``. This can speed up the connection time +//| significantly because a full scan doesn't occur. +//| +//| If ``bssid`` is given, the scan will start at the first channel or the one given and +//| connect to the AP with the given ``bssid`` and ``ssid``.""" //| ... //| STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { From 9a692c3222013efdbcedea95cadf29c0379ca17c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 24 Nov 2020 18:14:22 -0800 Subject: [PATCH 226/251] Exit faster on recv when TLS connection closed When a TLS connection is closed by the server it usually sends a notice. We see this incoming byte with lwip_ioctl and try to read it. The read returns 0 but we keep trying anyway. Now, we quit trying when we get zero back. If the connection was still alive it'd either read a byte or delay until a byte could be read. --- ports/esp32s2/common-hal/socketpool/Socket.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index 750415dc7b..999d399902 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -103,6 +103,11 @@ mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, } if (available > 0) { status = esp_tls_conn_read(self->tcp, (void*) buf + received, available); + if (status == 0) { + // Reading zero when something is available indicates a closed + // connection. (The available bytes could have been TLS internal.) + break; + } if (status > 0) { received += status; } From ca1a85c47f333b640188713f868a364d60bc75d5 Mon Sep 17 00:00:00 2001 From: arturo182 Date: Wed, 25 Nov 2020 03:34:01 +0100 Subject: [PATCH 227/251] displayio: Fix ColorConverter make_* methods --- shared-bindings/displayio/ColorConverter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index 0e6e9bfd94..88d3a1ba8f 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -116,7 +116,7 @@ const mp_obj_property_t displayio_colorconverter_dither_obj = { STATIC mp_obj_t displayio_colorconverter_make_transparent(mp_obj_t self_in, mp_obj_t transparent_color_obj) { displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in); - mp_int_t transparent_color = mp_obj_get_int(&transparent_color); + mp_int_t transparent_color = mp_obj_get_int(transparent_color_obj); common_hal_displayio_colorconverter_make_transparent(self, transparent_color); return mp_const_none; } @@ -128,7 +128,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_make_transparent_obj, display STATIC mp_obj_t displayio_colorconverter_make_opaque(mp_obj_t self_in, mp_obj_t transparent_color_obj) { displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in); - mp_int_t transparent_color = mp_obj_get_int(&transparent_color); + mp_int_t transparent_color = mp_obj_get_int(transparent_color_obj); common_hal_displayio_colorconverter_make_opaque(self, transparent_color); return mp_const_none; } From 0d9a0235a29fdf82725606cc7a1362d55da003a7 Mon Sep 17 00:00:00 2001 From: arturo182 Date: Wed, 25 Nov 2020 03:48:50 +0100 Subject: [PATCH 228/251] Update the requests frozen library --- frozen/Adafruit_CircuitPython_Requests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen/Adafruit_CircuitPython_Requests b/frozen/Adafruit_CircuitPython_Requests index 43017e30a1..531e845152 160000 --- a/frozen/Adafruit_CircuitPython_Requests +++ b/frozen/Adafruit_CircuitPython_Requests @@ -1 +1 @@ -Subproject commit 43017e30a1e772b67ac68293a944e863c031e389 +Subproject commit 531e8451522e3bba3e571610e4ac70efcb0cae5a From a854da35d33f1bc1673b4de08b2efa9f4823b805 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 25 Nov 2020 12:14:56 -0500 Subject: [PATCH 229/251] Fix masking issue causing pin claim problems --- ports/esp32s2/common-hal/microcontroller/Pin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 3c2611efeb..394a19e695 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -96,7 +96,7 @@ void reset_all_pins(void) { } void claim_pin(const mcu_pin_obj_t* pin) { - in_use[pin->number / 32] |= (1 << pin->number % 32); + in_use[pin->number / 32] |= (1 << (pin->number % 32)); #ifdef MICROPY_HW_NEOPIXEL if (pin == MICROPY_HW_NEOPIXEL) { neopixel_in_use = true; @@ -116,7 +116,7 @@ bool pin_number_is_free(gpio_num_t pin_number) { #endif uint8_t offset = pin_number / 32; - uint8_t mask = 1 << pin_number % 32; + uint32_t mask = 1 << (pin_number % 32); return (never_reset_pins[offset] & mask) == 0 && (in_use[offset] & mask) == 0; } From 715b09bff29fd10c5d0de87ed3ae98a0a78df62d Mon Sep 17 00:00:00 2001 From: Daniel Bravo Darriba Date: Thu, 26 Nov 2020 00:00:11 +0000 Subject: [PATCH 230/251] Translated using Weblate (German) Currently translated at 85.8% (742 of 864 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/de/ --- locale/de_DE.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 3b6bc8e217..56bf286701 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -6,14 +6,14 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-11 16:30+0530\n" -"PO-Revision-Date: 2020-06-16 18:24+0000\n" -"Last-Translator: Andreas Buchen \n" +"PO-Revision-Date: 2020-11-26 03:11+0000\n" +"Last-Translator: Daniel Bravo Darriba \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.1.1-dev\n" +"X-Generator: Weblate 4.4-dev\n" #: main.c msgid "" @@ -57,7 +57,7 @@ msgstr "%d Adress-Pins und %d rgb-Pins zeigen eine Höhe von %d, nicht von %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" -msgstr "" +msgstr "%q Fehler: %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" From cb14a2a82477c771e0349fc155e4281bde7300aa Mon Sep 17 00:00:00 2001 From: Daniel Bravo Darriba Date: Wed, 25 Nov 2020 23:50:39 +0000 Subject: [PATCH 231/251] Translated using Weblate (Spanish) Currently translated at 100.0% (864 of 864 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 147 ++++++++++++++++++++++++++------------------------- 1 file changed, 74 insertions(+), 73 deletions(-) diff --git a/locale/es.po b/locale/es.po index b0314ae198..db3a630c84 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-11 16:30+0530\n" -"PO-Revision-Date: 2020-11-15 16:28+0000\n" -"Last-Translator: RubenD \n" +"PO-Revision-Date: 2020-11-26 03:11+0000\n" +"Last-Translator: Daniel Bravo Darriba \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" @@ -437,7 +437,7 @@ msgstr "El periférico no maneja el Baudrate" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "Por debajo de taza mínima de refrescamiento" +msgstr "Por debajo de la tasa mínima de refrescamiento" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -498,7 +498,7 @@ msgstr "El buffer es muy pequeño" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "La longitud del buffer %d es muy grande. Debe ser menor a %d" +msgstr "Longitud del buffer %d es demasiado grande. Tiene que ser menor a %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c @@ -520,7 +520,7 @@ msgstr "Buffer demasiado grande e incapaz de asignar" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "Búfer muy corto por %d bytes" +msgstr "Búffer muy corto por %d bytes" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -729,7 +729,7 @@ msgstr "No se puede definir la dirección" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" -msgstr "No se pudo iniciar el PWM" +msgstr "No se pudo iniciar PWM" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" @@ -746,7 +746,7 @@ msgstr "No se pudo asignar el primer buffer" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "No se pudo encontrar el búfer de entrada" +msgstr "No se pudo encontrar el buffer de entrada" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -876,7 +876,7 @@ msgstr "FFT se define solo para ndarrays" #: extmod/ulab/code/fft/fft.c msgid "FFT is implemented for linear arrays only" -msgstr "" +msgstr "FFT solo esta implementado para arrays lineales" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" @@ -936,7 +936,7 @@ msgstr "No se puede liberar el mutex, err 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "Error al escribir al flash interno." +msgstr "Error al escribir el flash interno." #: py/moduerrno.c msgid "File exists" @@ -975,7 +975,7 @@ msgstr "La función requiere lock" #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "El grupo ya está siendo utilizado" +msgstr "Grupo ya está siendo utilizado" #: shared-module/displayio/Group.c msgid "Group full" @@ -1001,7 +1001,7 @@ msgstr "Operación I/O en archivo cerrado" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" -msgstr "Error de inicio de I2C" +msgstr "I2C Error de inicio" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" @@ -1026,7 +1026,7 @@ msgstr "Tamaño incorrecto del buffer" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" -msgstr "" +msgstr "Inicializacion fallida por falta de memoria" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" @@ -1286,7 +1286,7 @@ msgstr "Debe usar un múltiplo de 6 pines rgb, no %d" #: ports/esp32s2/common-hal/nvm/ByteArray.c msgid "NVS Error" -msgstr "" +msgstr "Error NVS" #: py/parse.c msgid "Name too long" @@ -1401,7 +1401,7 @@ msgstr "No hay temporizador disponible" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." -msgstr "fallo de aserción de dispositivo Nordic Soft." +msgstr "Fallo de aserción de dispositivo Nordic Soft." #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" @@ -1497,7 +1497,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "ParallelBus no soportado aún" +msgstr "ParallelBus todavía no soportado" #: py/moduerrno.c msgid "Permission denied" @@ -1531,8 +1531,9 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" -"El pinout utiliza %d bytes por elemento, lo que consume más del ideal de %d " -"bytes. Si esto no se puede evitar, pase allow_inefficient=True al constructor" +"El pinout utiliza %d bytes por elemento, lo que consume más de los %d bytes " +"ideales. Si esto no se puede evitar, pase allow_inefficient=True al " +"constructor" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -1563,7 +1564,7 @@ msgstr "" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "El búfer de prefijo debe estar en el montículo" +msgstr "El prefijo del buffer debe estar en el heap" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." @@ -1576,7 +1577,7 @@ msgstr "Pull no se usa cuando la dirección es output." #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "Error de desinicializado del RNG" +msgstr "Error de desinicialización de RNG" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" @@ -1585,7 +1586,7 @@ msgstr "Error de inicialización de RNG" #: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" -msgstr "Se especifica inversión de RS485 sin estar en modo RS485" +msgstr "Se especifica inversión de RS485 si no está en modo RS485" #: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c #: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c @@ -1620,7 +1621,7 @@ msgstr "Objeto de solo-lectura" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" -msgstr "Actualizando demasiado pronto" +msgstr "Refresco demasiado pronto" #: shared-bindings/canio/RemoteTransmissionRequest.c msgid "RemoteTransmissionRequests limited to 8 bytes" @@ -1680,7 +1681,7 @@ msgstr "Frecuencia de muestreo demasiado alta. Debe ser menor a %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "Escaneo en progreso. Use stop_scan para detener." +msgstr "Escaneo en progreso. Usa stop_scan para detener." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" @@ -1720,7 +1721,7 @@ msgstr "SocketPool solo se puede usar con wifi.radio" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "Los búferes de fuente y destino deben ser del mismo tamaño" +msgstr "Los buffers de fuente y destino deben ser del mismo tamaño" #: extmod/modure.c msgid "Splitting with sub-captures" @@ -1751,7 +1752,7 @@ msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Please increase the stack size if you know how, or if not:" msgstr "" -"El montículo de CircuitPython se dañó porque la pila era demasiado pequeña.\n" +"El heap de CircuitPython se dañó porque la pila era demasiado pequeña.\n" "Aumente el tamaño de la pila si sabe cómo, o si no:" #: supervisor/shared/safe_mode.c @@ -1759,8 +1760,8 @@ msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode.\n" msgstr "" -"El módulo de `microcontroller` fue utilizado para bootear en modo seguro. " -"Presione reset para salir del modo seguro.\n" +"El módulo de `microcontroller` fue utilizado para arrancar en modo seguro. " +"Presiona reset para salir del modo seguro.\n" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" @@ -1772,10 +1773,10 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -"La alimentación de la microntroladora bajó. Asegúrate que tu fuente de " -"poder\n" -"pueda suplir suficiente energía para todo el circuito y presione reset " -"(luego de\n" +"La alimentación del microntrolador cayó. Asegúrate que tu fuente de " +"alimentación\n" +"pueda aportar suficiente energía para todo el circuito y presiona reset (" +"luego de\n" "expulsar CIRCUITPY)\n" #: shared-module/audiomixer/MixerVoice.c @@ -1954,7 +1955,7 @@ msgstr "Error de seguridad desconocido: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown soft device error: %04x" -msgstr "Error suave desconocido en dispositivo: %04x" +msgstr "Error leve desconocido en dispositivo: %04x" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format @@ -1967,7 +1968,7 @@ msgid "" "declined or ignored." msgstr "" "Problema no especificado. Puede ser que la señal de emparejamiento del otro " -"dispositivo fue declinada o ignorada." +"dispositivo fue denegada o ignorada." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c #: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c @@ -2057,7 +2058,7 @@ msgstr "La clave de WiFi debe ser entre 8 y 63 caracteres" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "Escrituras no admitidas en la característica" +msgstr "Escrituras no admitidas en Characteristic" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" @@ -2110,7 +2111,7 @@ msgstr "El argumento para argsort debe ser un ndarray" #: extmod/ulab/code/numerical/numerical.c msgid "argsort is not implemented for flattened arrays" -msgstr "" +msgstr "El argot no está implementado para arrays aplanados" #: py/runtime.c msgid "argument has wrong type" @@ -2135,7 +2136,7 @@ msgstr "argumentos deben ser ndarrays" #: extmod/ulab/code/ndarray.c msgid "array and index length must be equal" -msgstr "" +msgstr "Longitud del array e índice tienen que ser iguales" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2143,11 +2144,11 @@ 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 "" +msgstr "Intendo de obteber (arg)min/(arg)max de secuencia vacía" #: 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" +msgstr "intento de obtener argmin/argmax de una secuencia vacía" #: py/objstr.c msgid "attributes not supported yet" @@ -2155,15 +2156,15 @@ msgstr "atributos aún no soportados" #: extmod/ulab/code/numerical/numerical.c msgid "axis is out of bounds" -msgstr "" +msgstr "Eje está fuera de sus límites" #: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, or an integer" -msgstr "" +msgstr "Eje tiene que ser None, o un entero" #: extmod/ulab/code/numerical/numerical.c msgid "axis too long" -msgstr "" +msgstr "Eje demasiado largo" #: py/builtinevex.c msgid "bad compile mode" @@ -2373,7 +2374,7 @@ msgstr "" #: extmod/ulab/code/ndarray_operators.c msgid "cannot cast output with casting rule" -msgstr "" +msgstr "No se puede realizar cast de la salida sin una regla de cast" #: py/objtype.c msgid "cannot create '%q' instances" @@ -2409,7 +2410,7 @@ msgstr "El argumento de chr() no esta en el rango(256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" -msgstr "circle solo puede ser registrado con un pariente" +msgstr "circulo solo puede ser registrado con un pariente" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" @@ -2473,7 +2474,7 @@ 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 "" +msgstr "Cruce está definido para un array 1D de longitud 3" #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" @@ -2516,7 +2517,7 @@ msgstr "El argumento diff debe ser un ndarray" #: extmod/ulab/code/numerical/numerical.c msgid "differentiation order out of range" -msgstr "" +msgstr "Orden de diferenciación fuera de rango" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2635,11 +2636,11 @@ 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 "" +msgstr "Primer argumento tiene que ser una tupla de ndarrays" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "el primer argumento debe permitir iteración" +msgstr "el primer argumento debe ser un iterable" #: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" @@ -2659,7 +2660,7 @@ msgstr "el argumento invertido debe ser un ndarray" #: py/objint.c msgid "float too big" -msgstr "punto flotante muy grande" +msgstr "punto flotante demasiado grande" #: shared-bindings/_stage/Text.c msgid "font must be 2048 bytes long" @@ -2692,7 +2693,7 @@ msgstr "la función tiene el mismo signo a extremos del intervalo" #: extmod/ulab/code/ndarray.c msgid "function is defined for ndarrays only" -msgstr "" +msgstr "Función solo definida para ndarrays" #: py/argcheck.c #, c-format @@ -2788,7 +2789,7 @@ msgstr "ensamblador en línea debe ser una función" #: extmod/ulab/code/ndarray.c msgid "input and output shapes are not compatible" -msgstr "" +msgstr "Formas de entrada y salida no son compactibles" #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" @@ -2800,11 +2801,11 @@ 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 "" +msgstr "Arrays de entrada no son compactibles" #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" -msgstr "los datos de entrada deben permitir iteración" +msgstr "los datos de entrada deben ser iterables" #: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" @@ -2816,19 +2817,19 @@ msgstr "la matriz de entrada es singular" #: extmod/ulab/code/user/user.c msgid "input must be a dense ndarray" -msgstr "" +msgstr "Entrada tiene que ser un ndarray denso" #: extmod/ulab/code/ulab_create.c msgid "input must be a tensor of rank 2" -msgstr "" +msgstr "Entrada tiene que ser un tensor de rango 2" #: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c msgid "input must be an ndarray" -msgstr "" +msgstr "Entrada tiene que ser un ndarray" #: extmod/ulab/code/filter/filter.c msgid "input must be one-dimensional" -msgstr "" +msgstr "Entrada tiene que ser unidimensional" #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" @@ -2844,7 +2845,7 @@ msgstr "los vectores de entrada deben ser de igual tamaño" #: extmod/ulab/code/poly/poly.c msgid "inputs are not iterable" -msgstr "" +msgstr "Entradas no son iterables" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" @@ -2985,7 +2986,7 @@ msgstr "long int no soportado en esta compilación" #: ports/esp32s2/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" -msgstr "" +msgstr "Loopback + modo silencioso no están soportados por periférico" #: py/parse.c msgid "malformed f-string" @@ -3019,7 +3020,7 @@ msgstr "max_lenght debe ser > 0" #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" -msgstr "" +msgstr "Máximo número de dimensiones es 4" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3027,11 +3028,11 @@ msgstr "profundidad máxima de recursión excedida" #: extmod/ulab/code/approx/approx.c msgid "maxiter must be > 0" -msgstr "" +msgstr "maxiter tiene que ser > 0" #: extmod/ulab/code/approx/approx.c msgid "maxiter should be > 0" -msgstr "" +msgstr "maxiter debe ser > 0" #: py/runtime.c #, c-format @@ -3156,7 +3157,7 @@ msgstr "" #: extmod/ulab/code/linalg/linalg.c msgid "norm is defined for 1D and 2D arrays" -msgstr "" +msgstr "norma está definida para arrays 1D y 2D" #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" @@ -3225,7 +3226,7 @@ msgstr "string de longitud impar" #: extmod/ulab/code/ulab_create.c msgid "offset is too large" -msgstr "" +msgstr "offset es demasiado grande" #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" @@ -3251,11 +3252,11 @@ msgstr "los operandos no se pueden transmitir juntos" #: extmod/ulab/code/ndarray.c msgid "operation is implemented for 1D Boolean arrays only" -msgstr "" +msgstr "operación solo está implementada para arrays booleanos de 1D" #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented for flattened array" -msgstr "" +msgstr "operación no está implementada para arrays aplanados" #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" @@ -3393,7 +3394,7 @@ 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 "" +msgstr "resultados no pueden aplicar cast a un tipo específico" #: py/compile.c msgid "return annotation must be an identifier" @@ -3415,7 +3416,7 @@ msgstr "rgb_pins[%d] no está en el mismo puerto que el reloj" #: extmod/ulab/code/numerical/numerical.c msgid "roll argument must be an ndarray" -msgstr "" +msgstr "Argumento enrolado tiene que ser un ndarray" #: py/objstr.c msgid "rsplit(None,n)" @@ -3443,7 +3444,7 @@ msgstr "script de compilación no soportado" #: extmod/ulab/code/ndarray.c msgid "shape must be a tuple" -msgstr "" +msgstr "forma tiene que ser una tupla" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3593,7 +3594,7 @@ msgstr "timestamp fuera de rango para plataform time_t" #: extmod/ulab/code/ndarray.c msgid "tobytes can be invoked for dense arrays only" -msgstr "" +msgstr "tobytes solo pueden ser invocados por arrays densos" #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" @@ -3623,12 +3624,12 @@ msgstr "tupla/lista tiene una longitud incorrecta" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" -msgstr "" +msgstr "twai_driver_install devolvió esp-idf error #%d" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" -msgstr "" +msgstr "twai_start devolvió esp-idf error #%d" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -3756,7 +3757,7 @@ msgstr "los vectores deben tener el mismo tamaño" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" -msgstr "" +msgstr "watchdog no inicializado" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" @@ -3772,11 +3773,11 @@ msgstr "la ventana debe ser <= intervalo" #: extmod/ulab/code/numerical/numerical.c msgid "wrong axis index" -msgstr "" +msgstr "indice de eje erróneo" #: extmod/ulab/code/ulab_create.c msgid "wrong axis specified" -msgstr "" +msgstr "eje especificado erróneo" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" From 9c779c7ab79212c19e5533f8d096242fe282e980 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 26 Nov 2020 04:11:29 +0100 Subject: [PATCH 232/251] 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 | 13 ++++++++----- locale/cs.po | 13 ++++++++----- locale/de_DE.po | 13 ++++++++----- locale/el.po | 13 ++++++++----- locale/es.po | 20 +++++++++++++------- locale/fil.po | 13 ++++++++----- locale/fr.po | 16 +++++++++++----- locale/hi.po | 13 ++++++++----- locale/it_IT.po | 13 ++++++++----- locale/ja.po | 13 ++++++++----- locale/ko.po | 13 ++++++++----- locale/nl.po | 16 +++++++++++----- locale/pl.po | 13 ++++++++----- locale/pt_BR.po | 16 +++++++++++----- locale/sv.po | 16 +++++++++++----- locale/zh_Latn_pinyin.po | 16 +++++++++++----- 16 files changed, 148 insertions(+), 82 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index cf23970d88..6073b6a462 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -301,6 +301,7 @@ msgid "All I2C peripherals are in use" msgstr "Semua perangkat I2C sedang digunakan" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "" @@ -337,6 +338,7 @@ msgstr "Semua timer untuk pin ini sedang digunakan" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1107,6 +1109,7 @@ msgid "Invalid byteorder string" msgstr "String byteorder tidak valid" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "Periode penangkapan tidak valid. Kisaran yang valid: 1 - 500" @@ -1439,14 +1442,14 @@ msgstr "Parity ganjil tidak didukung" msgid "Only 8 or 16 bit mono with " msgstr "Hanya 8 atau 16 bit mono dengan " -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" diff --git a/locale/cs.po b/locale/cs.po index 3249792e70..a77a655a62 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -301,6 +301,7 @@ msgid "All I2C peripherals are in use" msgstr "" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "" @@ -337,6 +338,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1090,6 +1092,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" @@ -1420,14 +1423,14 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 56bf286701..7dd79d9151 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: 2020-11-26 03:11+0000\n" "Last-Translator: Daniel Bravo Darriba \n" "Language: de_DE\n" @@ -300,6 +300,7 @@ msgid "All I2C peripherals are in use" msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "" @@ -336,6 +337,7 @@ msgstr "Alle timer für diesen Pin werden bereits benutzt" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1107,6 +1109,7 @@ msgid "Invalid byteorder string" msgstr "Ungültige Byteorder String" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "Ungültiger Aufnahmezeitraum. Gültiger Bereich: 1 - 500" @@ -1441,14 +1444,14 @@ msgstr "Eine ungerade Parität wird nicht unterstützt" msgid "Only 8 or 16 bit mono with " msgstr "Nur 8 oder 16 bit mono mit " -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" diff --git a/locale/el.po b/locale/el.po index 71f6e6102b..8d6dad828e 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -296,6 +296,7 @@ msgid "All I2C peripherals are in use" msgstr "" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "" @@ -332,6 +333,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1085,6 +1087,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" @@ -1415,14 +1418,14 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" diff --git a/locale/es.po b/locale/es.po index db3a630c84..1a02843ed7 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: 2020-11-26 03:11+0000\n" "Last-Translator: Daniel Bravo Darriba \n" "Language-Team: \n" @@ -304,6 +304,7 @@ msgid "All I2C peripherals are in use" msgstr "Todos los periféricos I2C están siendo usados" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "Todas las unidades PCNT en uso" @@ -342,6 +343,7 @@ msgstr "Todos los timers para este pin están siendo utilizados" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1108,6 +1110,7 @@ msgid "Invalid byteorder string" msgstr "Cadena de byteorder inválida" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "Inválido periodo de captura. Rango válido: 1 - 500" @@ -1440,14 +1443,14 @@ msgstr "Paridad impar no soportada" msgid "Only 8 or 16 bit mono with " msgstr "Solo mono de 8 ó 16 bit con " -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "Solo hay capacidad para enchufes IPv4 SOCK_STREAM" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Solo hay capacidad para direcciones IPv4" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1775,8 +1778,8 @@ msgid "" msgstr "" "La alimentación del microntrolador cayó. Asegúrate que tu fuente de " "alimentación\n" -"pueda aportar suficiente energía para todo el circuito y presiona reset (" -"luego de\n" +"pueda aportar suficiente energía para todo el circuito y presiona reset " +"(luego de\n" "expulsar CIRCUITPY)\n" #: shared-module/audiomixer/MixerVoice.c @@ -3827,6 +3830,9 @@ msgstr "zi debe ser de tipo flotante" msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" +#~ msgid "Only IPv4 SOCK_STREAM sockets supported" +#~ msgstr "Solo hay capacidad para enchufes IPv4 SOCK_STREAM" + #~ msgid "arctan2 is implemented for scalars and ndarrays only" #~ msgstr "arctan2 se encuentra implementado solo para escalares y ndarrays" diff --git a/locale/fil.po b/locale/fil.po index 50067c6d4f..9178623a29 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -298,6 +298,7 @@ msgid "All I2C peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "" @@ -335,6 +336,7 @@ msgstr "Lahat ng timers para sa pin na ito ay ginagamit" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1100,6 +1102,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" @@ -1433,14 +1436,14 @@ msgstr "Odd na parity ay hindi supportado" msgid "Only 8 or 16 bit mono with " msgstr "Tanging 8 o 16 na bit mono na may " -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" diff --git a/locale/fr.po b/locale/fr.po index 359595c723..bb9b6ea98d 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: 2020-11-24 22:45+0000\n" "Last-Translator: Antonin ENFRUN \n" "Language: fr\n" @@ -305,6 +305,7 @@ msgid "All I2C peripherals are in use" msgstr "Tous les périphériques I2C sont utilisés" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "Toutes les unités PCNT sont utilisées" @@ -341,6 +342,7 @@ msgstr "Tous les timers pour cette broche sont utilisés" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1113,6 +1115,7 @@ msgid "Invalid byteorder string" msgstr "Chaîne d'octets non valide" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "Période de capture invalide. Gamme valide : 1 à 500" @@ -1445,14 +1448,14 @@ msgstr "Parité impaire non supportée" msgid "Only 8 or 16 bit mono with " msgstr "Uniquement 8 ou 16 bit mono avec " -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "Seules les sockets IPv4 SOCK_STREAM sont prises en charge" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Seules les adresses IPv4 sont prises en charge" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -3848,6 +3851,9 @@ msgstr "zi doit être de type float" msgid "zi must be of shape (n_section, 2)" msgstr "zi doit être de forme (n_section, 2)" +#~ msgid "Only IPv4 SOCK_STREAM sockets supported" +#~ msgstr "Seules les sockets IPv4 SOCK_STREAM sont prises en charge" + #~ msgid "arctan2 is implemented for scalars and ndarrays only" #~ msgstr "" #~ "arctan2 est implémenté uniquement pour les scalaires et les ndarrays" diff --git a/locale/hi.po b/locale/hi.po index de77cec46b..025664069d 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -296,6 +296,7 @@ msgid "All I2C peripherals are in use" msgstr "" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "" @@ -332,6 +333,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1085,6 +1087,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" @@ -1415,14 +1418,14 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 15c83cd53a..bb77d71cc3 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -297,6 +297,7 @@ msgid "All I2C peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "" @@ -334,6 +335,7 @@ msgstr "Tutti i timer per questo pin sono in uso" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1101,6 +1103,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "periodo di cattura invalido. Zona valida: 1 - 500" @@ -1438,14 +1441,14 @@ msgstr "operazione I2C non supportata" msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" diff --git a/locale/ja.po b/locale/ja.po index d0322be773..2076bbabfd 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: 2020-11-25 01:11+0000\n" "Last-Translator: Mitsuharu Aoyama \n" "Language-Team: none\n" @@ -303,6 +303,7 @@ msgid "All I2C peripherals are in use" msgstr "全てのI2C周辺機器が使用中" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "" @@ -339,6 +340,7 @@ msgstr "このピン用の全てのタイマが使用中" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1100,6 +1102,7 @@ msgid "Invalid byteorder string" msgstr "不正なバイトオーダー文字列" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "不正なキャプチャ周期。有効な周期は1-500" @@ -1432,14 +1435,14 @@ msgstr "奇数パリティには対応していません" msgid "Only 8 or 16 bit mono with " msgstr "8または16ビットの " -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" diff --git a/locale/ko.po b/locale/ko.po index fc08bdeaac..9e6cbb0c2a 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -299,6 +299,7 @@ msgid "All I2C peripherals are in use" msgstr "사용중인 모든 I2C주변 기기" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "" @@ -335,6 +336,7 @@ msgstr "핀의 모든 타이머가 사용 중입니다" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1090,6 +1092,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" @@ -1420,14 +1423,14 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" diff --git a/locale/nl.po b/locale/nl.po index ee7a3fd545..41a3ace76b 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: 2020-10-27 16:47+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -301,6 +301,7 @@ msgid "All I2C peripherals are in use" msgstr "Alle I2C peripherals zijn in gebruik" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "" @@ -337,6 +338,7 @@ msgstr "Alle timers voor deze pin zijn in gebruik" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1102,6 +1104,7 @@ msgid "Invalid byteorder string" msgstr "Ongeldige byteorder string" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "Ongeldige vastlegging periode. Geldig bereik: 1 - 500" @@ -1434,14 +1437,14 @@ msgstr "Oneven pariteit is niet ondersteund" msgid "Only 8 or 16 bit mono with " msgstr "Alleen 8 of 16 bit mono met " -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "Alleen IPv4 SOCK_STREAM sockets worden ondersteund" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Alleen IPv4 adressen worden ondersteund" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -3814,6 +3817,9 @@ 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 "Only IPv4 SOCK_STREAM sockets supported" +#~ msgstr "Alleen IPv4 SOCK_STREAM sockets worden ondersteund" + #~ msgid "arctan2 is implemented for scalars and ndarrays only" #~ msgstr "arctan2 is alleen geïmplementeerd voor scalars en ndarrays" diff --git a/locale/pl.po b/locale/pl.po index 4d8c9d84cc..5fbe727efa 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: 2020-11-11 19:13+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -303,6 +303,7 @@ msgid "All I2C peripherals are in use" msgstr "Wszystkie peryferia I2C w użyciu" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "" @@ -339,6 +340,7 @@ msgstr "Wszystkie timery tej nóżki w użyciu" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1100,6 +1102,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "Zły okres. Poprawny zakres to: 1 - 500" @@ -1431,14 +1434,14 @@ msgstr "Nieparzysta parzystość nie jest wspierana" msgid "Only 8 or 16 bit mono with " msgstr "Tylko 8 lub 16 bitów mono z " -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 49ac502e29..8f899a12c4 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: 2020-11-24 23:22+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -305,6 +305,7 @@ msgid "All I2C peripherals are in use" msgstr "Todos os periféricos I2C estão em uso" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "Todas as unidades PCNT estão em uso" @@ -341,6 +342,7 @@ msgstr "Todos os temporizadores para este pino estão em uso" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1111,6 +1113,7 @@ msgid "Invalid byteorder string" msgstr "A cadeia de bytes é inválida" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "O período de captura é inválido. O intervalo válido é: 1 - 500" @@ -1442,14 +1445,14 @@ msgstr "A paridade ímpar não é compatível" msgid "Only 8 or 16 bit mono with " msgstr "Apenas mono com 8 ou 16 bits com " -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "São suportados apenas soquetes IPv4 SOCK_STREAM" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Somente os endereços IPv4 são suportados" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -3839,6 +3842,9 @@ msgstr "zi deve ser de um tipo float" msgid "zi must be of shape (n_section, 2)" msgstr "zi deve estar na forma (n_section, 2)" +#~ msgid "Only IPv4 SOCK_STREAM sockets supported" +#~ msgstr "São suportados apenas soquetes IPv4 SOCK_STREAM" + #~ msgid "arctan2 is implemented for scalars and ndarrays only" #~ msgstr "O arctan2 está implementado apenas para escalares e ndarrays" diff --git a/locale/sv.po b/locale/sv.po index db05a557ae..66c1f345a2 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: 2020-11-20 22:28+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -301,6 +301,7 @@ msgid "All I2C peripherals are in use" msgstr "All I2C-kringutrustning används" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "Alla PCNT-enheter används" @@ -337,6 +338,7 @@ msgstr "Alla timers för denna pinne är i bruk" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1100,6 +1102,7 @@ msgid "Invalid byteorder string" msgstr "Ogiltig byteorder-sträng" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "Ogiltig inspelningsperiod. Giltigt intervall: 1 - 500" @@ -1433,14 +1436,14 @@ msgstr "Udda paritet stöds inte" msgid "Only 8 or 16 bit mono with " msgstr "Endast 8 eller 16 bitars mono med " -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "Endast IPv4 SOCK_STREAM sockets stöds" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Endast IPv4-adresser stöds" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -3807,6 +3810,9 @@ msgstr "zi måste vara av typ float" msgid "zi must be of shape (n_section, 2)" msgstr "zi måste vara i formen (n_section, 2)" +#~ msgid "Only IPv4 SOCK_STREAM sockets supported" +#~ msgstr "Endast IPv4 SOCK_STREAM sockets stöds" + #~ msgid "arctan2 is implemented for scalars and ndarrays only" #~ msgstr "arctan2 är enbart implementerad för scalar och ndarray" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 2f0673a7d0..7a08bc6e8c 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-11 16:30+0530\n" +"POT-Creation-Date: 2020-11-24 15:40-0500\n" "PO-Revision-Date: 2020-11-19 01:28+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -303,6 +303,7 @@ msgid "All I2C peripherals are in use" msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng" #: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" msgstr "suǒ yǒu zhèng zài shǐ yòng zhōng de PCNT dān yuán" @@ -339,6 +340,7 @@ msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/neopixel_write/__init__.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -1098,6 +1100,7 @@ msgid "Invalid byteorder string" msgstr "Wúxiào de zì jié shùnxù zìfú chuàn" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "Wúxiào de bǔhuò zhōuqí. Yǒuxiào fànwéi: 1-500" @@ -1429,14 +1432,14 @@ msgstr "Bù zhīchí jīshù" msgid "Only 8 or 16 bit mono with " msgstr "Zhǐyǒu 8 huò 16 wèi dānwèi " -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "Jǐn zhīchí IPv4 SOCK_STREAM tào jiē zì" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Jǐn zhīchí IPv4 dìzhǐ" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -3796,6 +3799,9 @@ msgstr "zi bìxū wèi fú diǎn xíng" msgid "zi must be of shape (n_section, 2)" msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" +#~ msgid "Only IPv4 SOCK_STREAM sockets supported" +#~ msgstr "Jǐn zhīchí IPv4 SOCK_STREAM tào jiē zì" + #~ msgid "arctan2 is implemented for scalars and ndarrays only" #~ msgstr "arctan2 jǐn zhēnduì biāoliàng hé ndarray shíxiàn" From 6af48bb24cc12a9547aef8d18d56acf8e0f5695d Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 26 Nov 2020 11:22:44 +0530 Subject: [PATCH 233/251] reset touchin on every vm run --- ports/esp32s2/common-hal/touchio/TouchIn.c | 8 +++++++- ports/esp32s2/supervisor/port.c | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.c b/ports/esp32s2/common-hal/touchio/TouchIn.c index 4589c46a79..b27cbcf86d 100644 --- a/ports/esp32s2/common-hal/touchio/TouchIn.c +++ b/ports/esp32s2/common-hal/touchio/TouchIn.c @@ -31,6 +31,13 @@ bool touch_inited = false; +void touchin_reset(void) { + if (touch_inited) { + touch_pad_deinit(); + touch_inited = false; + } +} + static uint16_t get_raw_reading(touchio_touchin_obj_t *self) { uint32_t touch_value; touch_pad_read_raw_data((touch_pad_t)self->pin->touch_channel, &touch_value); @@ -78,7 +85,6 @@ void common_hal_touchio_touchin_deinit(touchio_touchin_obj_t* self) { if (common_hal_touchio_touchin_deinited(self)) { return; } - touch_pad_deinit(); reset_pin_number(self->pin->touch_channel); self->pin = NULL; } diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 876ad739d6..e2defc5af3 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -43,6 +43,7 @@ #include "common-hal/busio/UART.h" #include "common-hal/pulseio/PulseIn.h" #include "common-hal/pwmio/PWMOut.h" +#include "common-hal/touchio/TouchIn.h" #include "common-hal/watchdog/WatchDogTimer.h" #include "common-hal/wifi/__init__.h" #include "supervisor/memory.h" @@ -127,6 +128,10 @@ void reset_port(void) { rtc_reset(); #endif +#if CIRCUITPY_TOUCHIO_USE_NATIVE + touchin_reset(); +#endif + #if CIRCUITPY_WATCHDOG watchdog_reset(); #endif From 3cde6c3fdc46e3641748d5be25c9ee03a2528a64 Mon Sep 17 00:00:00 2001 From: Ernie Hershey Date: Fri, 27 Nov 2020 12:07:49 -0500 Subject: [PATCH 234/251] README typos --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index d21e8d8d3c..19992d284b 100644 --- a/README.rst +++ b/README.rst @@ -114,14 +114,14 @@ Behavior finishes or is interrupted. After it is done running, the vm and hardware is reinitialized. **This means you cannot read state from** ``code.py`` **in the REPL anymore.** CircuitPython's goal for this - change includes reduce confusion about pins and memory being used. + change includes reducing confusion about pins and memory being used. - After ``code.py`` the REPL can be entered by pressing any key. It no longer shares state with ``code.py`` so it is a fresh vm. - Autoreload state will be maintained across reload. - Adds a safe mode that does not run user code after a hard crash or brown out. The hope is that this will make it easier to fix code that causes nasty crashes by making it available through mass storage - after the crash. A reset (the button) is needed after its fixed to + after the crash. A reset (the button) is needed after it's fixed to get back into normal mode. - RGB status LED indicating CircuitPython state, and errors through a sequence of colored flashes. - Re-runs ``code.py`` or other main file after file system writes over USB mass storage. (Disable with From 518328c71e5fc0c81218d7ee7dfbf9d0f3cb0ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Montiel=20Cardona?= Date: Thu, 26 Nov 2020 23:24:10 +0000 Subject: [PATCH 235/251] Translated using Weblate (Spanish) Currently translated at 100.0% (864 of 864 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/es.po b/locale/es.po index 1a02843ed7..6b0fde563c 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-24 15:40-0500\n" -"PO-Revision-Date: 2020-11-26 03:11+0000\n" -"Last-Translator: Daniel Bravo Darriba \n" +"PO-Revision-Date: 2020-11-27 18:34+0000\n" +"Last-Translator: Iván Montiel Cardona \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" @@ -1449,7 +1449,7 @@ msgstr "Solo hay capacidad para direcciones IPv4" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" -msgstr "" +msgstr "Solo se admiten sockets IPv4" #: shared-module/displayio/OnDiskBitmap.c #, c-format From 884028c7483e33ff10b8cffc9eceeac397dcae09 Mon Sep 17 00:00:00 2001 From: sporeball Date: Thu, 26 Nov 2020 18:20:45 +0000 Subject: [PATCH 236/251] Translated using Weblate (Japanese) Currently translated at 69.2% (598 of 864 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ja/ --- locale/ja.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/ja.po b/locale/ja.po index 2076bbabfd..bacf0df812 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-24 15:40-0500\n" -"PO-Revision-Date: 2020-11-25 01:11+0000\n" -"Last-Translator: Mitsuharu Aoyama \n" +"PO-Revision-Date: 2020-11-27 18:34+0000\n" +"Last-Translator: sporeball \n" "Language-Team: none\n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -3757,7 +3757,7 @@ msgstr "" #: shared-module/displayio/Shape.c msgid "x value out of bounds" -msgstr "" +msgstr "xが範囲外" #: shared-bindings/displayio/Shape.c msgid "y should be an int" From c7404a3ff89c738c002ec63448a58d56330dfcc3 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Sun, 11 Oct 2020 14:59:33 +0200 Subject: [PATCH 237/251] Add movable allocation system. This allows calls to `allocate_memory()` while the VM is running, it will then allocate from the GC heap (unless there is a suitable hole among the supervisor allocations), and when the VM exits and the GC heap is freed, the allocation will be moved to the bottom of the former GC heap and transformed into a proper supervisor allocation. Existing movable allocations will also be moved to defragment the supervisor heap and ensure that the next VM run gets as much memory as possible for the GC heap. By itself this breaks terminalio because it violates the assumption that supervisor_display_move_memory() still has access to an undisturbed heap to copy the tilegrid from. It will work in many cases, but if you're unlucky you will get garbled terminal contents after exiting from the vm run that created the display. This will be fixed in the following commit, which is separate to simplify review. --- main.c | 13 +- ports/atmel-samd/supervisor/port.c | 4 +- ports/cxd56/supervisor/port.c | 8 +- ports/esp32s2/supervisor/port.c | 8 +- ports/litex/supervisor/port.c | 4 +- ports/mimxrt10xx/supervisor/port.c | 7 +- ports/nrf/supervisor/port.c | 4 +- ports/stm/supervisor/port.c | 4 +- py/circuitpy_mpconfig.h | 4 + shared-module/rgbmatrix/RGBMatrix.c | 2 +- .../sharpdisplay/SharpMemoryFramebuffer.c | 2 +- shared-module/usb_midi/__init__.c | 2 +- supervisor/memory.h | 26 +- supervisor/port.h | 5 +- supervisor/shared/display.c | 4 +- .../shared/external_flash/external_flash.c | 2 +- supervisor/shared/memory.c | 279 +++++++++++++----- supervisor/shared/stack.c | 38 ++- supervisor/shared/stack.h | 6 +- 19 files changed, 284 insertions(+), 138 deletions(-) diff --git a/main.c b/main.c index 80b163f607..1389f524b6 100755 --- a/main.c +++ b/main.c @@ -123,15 +123,15 @@ void start_mp(supervisor_allocation* heap) { // to recover from limit hit. (Limit is measured in bytes.) mp_stack_ctrl_init(); - if (stack_alloc != NULL) { - mp_stack_set_limit(stack_alloc->length - 1024); + if (stack_get_bottom() != NULL) { + mp_stack_set_limit(stack_get_length() - 1024); } #if MICROPY_MAX_STACK_USAGE // _ezero (same as _ebss) is an int, so start 4 bytes above it. - if (stack_alloc != NULL) { - mp_stack_set_bottom(stack_alloc->ptr); + if (stack_get_bottom() != NULL) { + mp_stack_set_bottom(stack_get_bottom()); mp_stack_fill_with_sentinel(); } #endif @@ -148,7 +148,7 @@ void start_mp(supervisor_allocation* heap) { #endif #if MICROPY_ENABLE_GC - gc_init(heap->ptr, heap->ptr + heap->length / 4); + gc_init(heap->ptr, heap->ptr + get_allocation_length(heap) / 4); #endif mp_init(); mp_obj_list_init(mp_sys_path, 0); @@ -451,9 +451,6 @@ int __attribute__((used)) main(void) { // initialise the cpu and peripherals safe_mode_t safe_mode = port_init(); - // Init memory after the port in case the port needs to set aside memory. - memory_init(); - // Turn on LEDs init_status_leds(); rgb_led_status_init(); diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index d65d098257..fc1d1198e2 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -390,8 +390,8 @@ void reset_cpu(void) { reset(); } -supervisor_allocation* port_fixed_stack(void) { - return NULL; +bool port_has_fixed_stack(void) { + return false; } uint32_t *port_stack_get_limit(void) { diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index 086c2d198e..d69f357799 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -98,12 +98,8 @@ void reset_to_bootloader(void) { } } -supervisor_allocation _fixed_stack; - -supervisor_allocation* port_fixed_stack(void) { - _fixed_stack.ptr = port_stack_get_limit(); - _fixed_stack.length = (port_stack_get_top() - port_stack_get_limit()) * sizeof(uint32_t); - return &_fixed_stack; +bool port_has_fixed_stack(void) { + return true; } uint32_t *port_stack_get_limit(void) { diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index aff7dbda4d..264bdee974 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -193,12 +193,8 @@ uint32_t *port_stack_get_top(void) { return port_stack_get_limit() + ESP_TASK_MAIN_STACK / (sizeof(uint32_t) / sizeof(StackType_t)); } -supervisor_allocation _fixed_stack; - -supervisor_allocation* port_fixed_stack(void) { - _fixed_stack.ptr = port_stack_get_limit(); - _fixed_stack.length = (port_stack_get_top() - port_stack_get_limit()) * sizeof(uint32_t); - return &_fixed_stack; +bool port_has_fixed_stack(void) { + return true; } // Place the word to save just after our BSS section that gets blanked. diff --git a/ports/litex/supervisor/port.c b/ports/litex/supervisor/port.c index 02617b9af7..f5c362ea6e 100644 --- a/ports/litex/supervisor/port.c +++ b/ports/litex/supervisor/port.c @@ -98,8 +98,8 @@ void reset_cpu(void) { for(;;) {} } -supervisor_allocation* port_fixed_stack(void) { - return NULL; +bool port_has_fixed_stack(void) { + return false; } uint32_t *port_heap_get_bottom(void) { diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index e3fef373f8..1be2b10396 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -334,11 +334,8 @@ uint32_t *port_stack_get_top(void) { return &_ld_stack_top; } -supervisor_allocation _fixed_stack; -supervisor_allocation* port_fixed_stack(void) { - _fixed_stack.ptr = port_stack_get_limit(); - _fixed_stack.length = (port_stack_get_top() - port_stack_get_limit()) * sizeof(uint32_t); - return &_fixed_stack; +bool port_has_fixed_stack(void) { + return true; } uint32_t *port_heap_get_bottom(void) { diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 493de43e0f..5f1c9f1ba9 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -251,8 +251,8 @@ uint32_t *port_heap_get_top(void) { return port_stack_get_top(); } -supervisor_allocation* port_fixed_stack(void) { - return NULL; +bool port_has_fixed_stack(void) { + return false; } uint32_t *port_stack_get_limit(void) { diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index a8aab00ff2..dba1cf21ee 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -267,8 +267,8 @@ uint32_t *port_heap_get_top(void) { return &_ld_heap_end; } -supervisor_allocation* port_fixed_stack(void) { - return NULL; +bool port_has_fixed_stack(void) { + return false; } uint32_t *port_stack_get_limit(void) { diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 28fd4095c4..28fd6e9b00 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -858,6 +858,9 @@ extern const struct _mp_obj_module_t wifi_module; #include "supervisor/flash_root_pointers.h" +// From supervisor/memory.c +struct _supervisor_allocation_node; + #define CIRCUITPY_COMMON_ROOT_POINTERS \ const char *readline_hist[8]; \ vstr_t *repl_line; \ @@ -869,6 +872,7 @@ extern const struct _mp_obj_module_t wifi_module; FLASH_ROOT_POINTERS \ MEMORYMONITOR_ROOT_POINTERS \ NETWORK_ROOT_POINTERS \ + struct _supervisor_allocation_node* first_embedded_allocation; \ void supervisor_run_background_tasks_if_tick(void); #define RUN_BACKGROUND_TASKS (supervisor_run_background_tasks_if_tick()) diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index 94c3eda27f..1f144aedb5 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -220,7 +220,7 @@ void *common_hal_rgbmatrix_allocator_impl(size_t sz) { if (gc_alloc_possible()) { return m_malloc_maybe(sz + sizeof(void*), true); } else { - supervisor_allocation *allocation = allocate_memory(align32_size(sz), false); + supervisor_allocation *allocation = allocate_memory(align32_size(sz), false, false); return allocation ? allocation->ptr : NULL; } } diff --git a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c index b199e98d63..aefb6b18de 100644 --- a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c +++ b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c @@ -40,7 +40,7 @@ #define SHARPMEM_BIT_VCOM_LSB (0x40) static void *hybrid_alloc(size_t sz) { - supervisor_allocation *allocation = allocate_memory(align32_size(sz), false); + supervisor_allocation *allocation = allocate_memory(align32_size(sz), false, false); if (allocation) { memset(allocation->ptr, 0, sz); return allocation->ptr; diff --git a/shared-module/usb_midi/__init__.c b/shared-module/usb_midi/__init__.c index 73a314b997..5afdd18213 100644 --- a/shared-module/usb_midi/__init__.c +++ b/shared-module/usb_midi/__init__.c @@ -45,7 +45,7 @@ void usb_midi_init(void) { uint16_t portout_size = align32_size(sizeof(usb_midi_portout_obj_t)); // For each embedded MIDI Jack in the descriptor we create a Port - usb_midi_allocation = allocate_memory(tuple_size + portin_size + portout_size, false); + usb_midi_allocation = allocate_memory(tuple_size + portin_size + portout_size, false, false); mp_obj_tuple_t *ports = (mp_obj_tuple_t *) usb_midi_allocation->ptr; ports->base.type = &mp_type_tuple; diff --git a/supervisor/memory.h b/supervisor/memory.h index f4359ca46e..4307e3f21d 100755 --- a/supervisor/memory.h +++ b/supervisor/memory.h @@ -33,23 +33,36 @@ #include #include +#include typedef struct { uint32_t* ptr; - uint32_t length; // in bytes } supervisor_allocation; -void memory_init(void); void free_memory(supervisor_allocation* allocation); + +// Find the allocation with the given ptr, NULL if not found. When called from the context of a +// supervisor_move_memory() callback, finds the allocation that had that ptr *before* the move, but +// the returned allocation already contains the ptr after the move. +// When called with NULL, may return either NULL or an unused allocation whose ptr is NULL (this is +// a feature used internally in allocate_memory to save code size). Passing the return value to +// free_memory() is a permissible no-op in either case. supervisor_allocation* allocation_from_ptr(void *ptr); + supervisor_allocation* allocate_remaining_memory(void); // Allocate a piece of a given length in bytes. If high_address is true then it should be allocated // at a lower address from the top of the stack. Otherwise, addresses will increase starting after -// statically allocated memory. -supervisor_allocation* allocate_memory(uint32_t length, bool high_address); +// statically allocated memory. If movable is false, memory will be taken from outside the GC heap +// and will stay stationary until freed. While the VM is running, this will fail unless a previous +// allocation of exactly matching length has recently been freed. If movable is true, memory will be +// taken from either outside or inside the GC heap, and when the VM exits, will be moved outside. +// The ptr of the returned supervisor_allocation will change at that point. If you need to be +// notified of that, add your own callback function at the designated place near the end of +// supervisor_move_memory(). +supervisor_allocation* allocate_memory(uint32_t length, bool high_address, bool movable); static inline uint16_t align32_size(uint16_t size) { if (size % 4 != 0) { @@ -58,7 +71,10 @@ static inline uint16_t align32_size(uint16_t size) { return size; } -// Called after the heap is freed in case the supervisor wants to save some values. +size_t get_allocation_length(supervisor_allocation* allocation); + +// Called after the GC heap is freed, transfers movable allocations from the GC heap to the +// supervisor heap and compacts the supervisor heap. void supervisor_move_memory(void); #endif // MICROPY_INCLUDED_SUPERVISOR_MEMORY_H diff --git a/supervisor/port.h b/supervisor/port.h index f5b3c15d14..5bc06bc4e1 100644 --- a/supervisor/port.h +++ b/supervisor/port.h @@ -61,7 +61,8 @@ uint32_t *port_stack_get_limit(void); // Get stack top address uint32_t *port_stack_get_top(void); -supervisor_allocation* port_fixed_stack(void); +// True if stack is not located inside heap (at the top) +bool port_has_fixed_stack(void); // Get heap bottom address uint32_t *port_heap_get_bottom(void); @@ -69,8 +70,6 @@ uint32_t *port_heap_get_bottom(void); // Get heap top address uint32_t *port_heap_get_top(void); -supervisor_allocation* port_fixed_heap(void); - // Save and retrieve a word from memory that is preserved over reset. Used for safe mode. void port_set_saved_word(uint32_t); uint32_t port_get_saved_word(void); diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index a9ae258842..de45e2672f 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -82,7 +82,7 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { uint16_t total_tiles = width_in_tiles * height_in_tiles; // First try to allocate outside the heap. This will fail when the VM is running. - tilegrid_tiles = allocate_memory(align32_size(total_tiles), false); + tilegrid_tiles = allocate_memory(align32_size(total_tiles), false, false); uint8_t* tiles; if (tilegrid_tiles == NULL) { tiles = m_malloc(total_tiles, true); @@ -133,7 +133,7 @@ void supervisor_display_move_memory(void) { grid->tiles == MP_STATE_VM(terminal_tilegrid_tiles)) { uint16_t total_tiles = grid->width_in_tiles * grid->height_in_tiles; - tilegrid_tiles = allocate_memory(align32_size(total_tiles), false); + tilegrid_tiles = allocate_memory(align32_size(total_tiles), false, false); if (tilegrid_tiles != NULL) { memcpy(tilegrid_tiles->ptr, grid->tiles, total_tiles); grid->tiles = (uint8_t*) tilegrid_tiles->ptr; diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 5bde7fd485..e2d767235e 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -338,7 +338,7 @@ static bool allocate_ram_cache(void) { uint32_t table_size = blocks_per_sector * pages_per_block * sizeof(uint32_t); // Attempt to allocate outside the heap first. - supervisor_cache = allocate_memory(table_size + SPI_FLASH_ERASE_SIZE, false); + supervisor_cache = allocate_memory(table_size + SPI_FLASH_ERASE_SIZE, false, false); if (supervisor_cache != NULL) { MP_STATE_VM(flash_ram_cache) = (uint8_t **) supervisor_cache->ptr; uint8_t* page_start = (uint8_t *) supervisor_cache->ptr + table_size; diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index 0f96ae2734..2be3b42d63 100755 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -27,78 +27,81 @@ #include "supervisor/memory.h" #include "supervisor/port.h" -#include +#include +#include "py/gc.h" #include "supervisor/shared/display.h" #define CIRCUITPY_SUPERVISOR_ALLOC_COUNT (12) -// Using a zero length to mark an unused allocation makes the code a bit shorter (but makes it -// impossible to support zero-length allocations). -#define FREE 0 - // The lowest two bits of a valid length are always zero, so we can use them to mark an allocation -// as freed by the client but not yet reclaimed into the FREE middle. +// as a hole (freed by the client but not yet reclaimed into the free middle) and as movable. +#define FLAGS 3 #define HOLE 1 +#define MOVABLE 2 static supervisor_allocation allocations[CIRCUITPY_SUPERVISOR_ALLOC_COUNT]; -// We use uint32_t* to ensure word (4 byte) alignment. -uint32_t* low_address; -uint32_t* high_address; +supervisor_allocation* old_allocations; -void memory_init(void) { - low_address = port_heap_get_bottom(); - high_address = port_heap_get_top(); -} +typedef struct _supervisor_allocation_node { + struct _supervisor_allocation_node* next; + size_t length; + // We use uint32_t to ensure word (4 byte) alignment. + uint32_t data[]; +} supervisor_allocation_node; + +supervisor_allocation_node* low_head; +supervisor_allocation_node* high_head; + +// Intermediate (void*) is to suppress -Wcast-align warning. Alignment will always be correct +// because this only reverses how (alloc)->ptr was obtained as &(node->data[0]). +#define ALLOCATION_NODE(alloc) ((supervisor_allocation_node*)(void*)((char*)((alloc)->ptr) - sizeof(supervisor_allocation_node))) void free_memory(supervisor_allocation* allocation) { - if (allocation == NULL) { + if (allocation == NULL || allocation->ptr == NULL) { return; } - int32_t index = 0; - bool found = false; - for (index = 0; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT; index++) { - found = allocation == &allocations[index]; - if (found) { - break; - } + supervisor_allocation_node* node = ALLOCATION_NODE(allocation); + if (node == low_head) { + do { + low_head = low_head->next; + } while (low_head != NULL && (low_head->length & HOLE)); } - if (!found) { - // Bad! - // TODO(tannewt): Add a way to escape into safe mode on error. + else if (node == high_head) { + do { + high_head = high_head->next; + } while (high_head != NULL && (high_head->length & HOLE)); } - if (allocation->ptr == high_address) { - high_address += allocation->length / 4; - allocation->length = FREE; - for (index++; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT; index++) { - if (!(allocations[index].length & HOLE)) { - break; + else { + // Check if it's in the list of embedded allocations. + supervisor_allocation_node** emb = &MP_STATE_VM(first_embedded_allocation); + while (*emb != NULL) { + if (*emb == node) { + // Found, remove it from the list. + *emb = node->next; + m_free(node +#if MICROPY_MALLOC_USES_ALLOCATED_SIZE + , sizeof(supervisor_allocation_node) + (node->length & ~FLAGS) +#endif + ); + goto done; } - // Division automatically shifts out the HOLE bit. - high_address += allocations[index].length / 4; - allocations[index].length = FREE; + emb = &((*emb)->next); } - } else if (allocation->ptr + allocation->length / 4 == low_address) { - low_address = allocation->ptr; - allocation->length = FREE; - for (index--; index >= 0; index--) { - if (!(allocations[index].length & HOLE)) { - break; - } - low_address -= allocations[index].length / 4; - allocations[index].length = FREE; - } - } else { - // Freed memory isn't in the middle so skip updating bounds. The memory will be added to the - // middle when the memory to the inside is freed. We still need its length, but setting - // only the lowest bit is nondestructive. - allocation->length |= HOLE; + // Else it must be within the low or high ranges and becomes a hole. + node->length = ((node->length & ~FLAGS) | HOLE); } +done: + allocation->ptr = NULL; } supervisor_allocation* allocation_from_ptr(void *ptr) { + // When called from the context of supervisor_move_memory() (old_allocations != NULL), search + // by old pointer to give clients a way of mapping from old to new pointer. But not if + // ptr == NULL, then the caller wants an allocation whose current ptr is NULL. + supervisor_allocation* list = (old_allocations && ptr) ? old_allocations : &allocations[0]; for (size_t index = 0; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT; index++) { - if (allocations[index].ptr == ptr) { + if (list[index].ptr == ptr) { return &allocations[index]; } } @@ -106,50 +109,172 @@ supervisor_allocation* allocation_from_ptr(void *ptr) { } supervisor_allocation* allocate_remaining_memory(void) { - if (low_address == high_address) { - return NULL; - } - return allocate_memory((high_address - low_address) * 4, false); + uint32_t* low_address = low_head ? low_head->data + low_head->length / 4 : port_heap_get_bottom(); + uint32_t* high_address = high_head ? (uint32_t*)high_head : port_heap_get_top(); + return allocate_memory((high_address - low_address) * 4 - sizeof(supervisor_allocation_node), false, false); } -supervisor_allocation* allocate_memory(uint32_t length, bool high) { +static supervisor_allocation_node* find_hole(supervisor_allocation_node* node, size_t length) { + for (; node != NULL; node = node->next) { + if (node->length == (length | HOLE)) { + break; + } + } + return node; +} + +static supervisor_allocation_node* allocate_memory_node(uint32_t length, bool high, bool movable) { + // supervisor_move_memory() currently does not support movable allocations on the high side, it + // must be extended first if this is ever needed. + assert(!(high && movable)); if (length == 0 || length % 4 != 0) { return NULL; } - uint8_t index = 0; - int8_t direction = 1; - if (high) { - index = CIRCUITPY_SUPERVISOR_ALLOC_COUNT - 1; - direction = -1; - } - supervisor_allocation* alloc; - for (; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT; index += direction) { - alloc = &allocations[index]; - if (alloc->length == FREE && (high_address - low_address) * 4 >= (int32_t) length) { - break; + // 1. Matching hole on the requested side? + supervisor_allocation_node* node = find_hole(high ? high_head : low_head, length); + if (!node) { + // 2. Enough free space in the middle? + uint32_t* low_address = low_head ? low_head->data + low_head->length / 4 : port_heap_get_bottom(); + uint32_t* high_address = high_head ? (uint32_t*)high_head : port_heap_get_top(); + if ((high_address - low_address) * 4 >= (int32_t)(sizeof(supervisor_allocation_node) + length)) { + if (high) { + high_address -= (sizeof(supervisor_allocation_node) + length) / 4; + node = (supervisor_allocation_node*)high_address; + node->next = high_head; + high_head = node; + } + else { + node = (supervisor_allocation_node*)low_address; + node->next = low_head; + low_head = node; + } } - // If a hole matches in length exactly, we can reuse it. - if (alloc->length == (length | HOLE)) { - alloc->length = length; - return alloc; + else { + // 3. Matching hole on the other side? + node = find_hole(high ? low_head : high_head, length); + if (!node) { + // 4. GC allocation? + if (movable && gc_alloc_possible()) { + node = m_malloc_maybe(sizeof(supervisor_allocation_node) + length, true); + if (node) { + node->next = MP_STATE_VM(first_embedded_allocation); + MP_STATE_VM(first_embedded_allocation) = node; + } + } + if (!node) { + // 5. Give up. + return NULL; + } + } } } - if (index >= CIRCUITPY_SUPERVISOR_ALLOC_COUNT) { + node->length = length; + if (movable) { + node->length |= MOVABLE; + } + return node; +} + +supervisor_allocation* allocate_memory(uint32_t length, bool high, bool movable) { + supervisor_allocation_node* node = allocate_memory_node(length, high, movable); + if (!node) { return NULL; } - if (high) { - high_address -= length / 4; - alloc->ptr = high_address; - } else { - alloc->ptr = low_address; - low_address += length / 4; + // Find the first free allocation. + supervisor_allocation* alloc = allocation_from_ptr(NULL); + if (!alloc) { + // We should free node again to avoid leaking, but something is wrong anyway if clients try + // to make more allocations than available, so don't bother. + return NULL; } - alloc->length = length; + alloc->ptr = &(node->data[0]); return alloc; } +size_t get_allocation_length(supervisor_allocation* allocation) { + return ALLOCATION_NODE(allocation)->length & ~FLAGS; +} + void supervisor_move_memory(void) { + // This must be called exactly after freeing the heap, so that the embedded allocations, if any, + // are now in the free region. + assert(MP_STATE_VM(first_embedded_allocation) == NULL || (low_head < MP_STATE_VM(first_embedded_allocation) && MP_STATE_VM(first_embedded_allocation) < high_head)); + + // Save the old pointers for allocation_from_ptr(). + supervisor_allocation old_allocations_array[CIRCUITPY_SUPERVISOR_ALLOC_COUNT]; + memcpy(old_allocations_array, allocations, sizeof(allocations)); + + // Compact the low side. Traverse the list repeatedly, finding movable allocations preceded by a + // hole and swapping them, until no more are found. This is not the most runtime-efficient way, + // but probably the shortest and simplest code. + bool acted; + do { + acted = false; + supervisor_allocation_node** nodep = &low_head; + while (*nodep != NULL && (*nodep)->next != NULL) { + if (((*nodep)->length & MOVABLE) && ((*nodep)->next->length & HOLE)) { + supervisor_allocation_node* oldnode = *nodep; + supervisor_allocation_node* start = oldnode->next; + supervisor_allocation* alloc = allocation_from_ptr(&(oldnode->data[0])); + assert(alloc != NULL); + alloc->ptr = &(start->data[0]); + oldnode->next = start->next; + size_t holelength = start->length; + size_t size = sizeof(supervisor_allocation_node) + (oldnode->length & ~FLAGS); + memmove(start, oldnode, size); + supervisor_allocation_node* newhole = (supervisor_allocation_node*)(void*)((char*)start + size); + newhole->next = start; + newhole->length = holelength; + *nodep = newhole; + acted = true; + } + nodep = &((*nodep)->next); + } + } while (acted); + // Any holes bubbled to the top can be absorbed into the free middle. + while (low_head != NULL && (low_head->length & HOLE)) { + low_head = low_head->next; + }; + + // Don't bother compacting the high side, there are no movable allocations and no holes there in + // current usage. + + // Promote the embedded allocations to top-level ones, compacting them at the beginning of the + // now free region (or possibly in matching holes). + // The linked list is unordered, but allocations must be processed in order to avoid risking + // overwriting each other. To that end, repeatedly find the lowest element of the list, remove + // it from the list, and process it. This ad-hoc selection sort results in substantially shorter + // code than using the qsort() function from the C library. + while (MP_STATE_VM(first_embedded_allocation)) { + // First element is first candidate. + supervisor_allocation_node** pminnode = &MP_STATE_VM(first_embedded_allocation); + // Iterate from second element (if any) on. + for (supervisor_allocation_node** pnode = &(MP_STATE_VM(first_embedded_allocation)->next); *pnode != NULL; pnode = &(*pnode)->next) { + if (*pnode < *pminnode) { + pminnode = pnode; + } + } + // Remove from list. + supervisor_allocation_node* node = *pminnode; + *pminnode = node->next; + // Process. + size_t length = (node->length & ~FLAGS); + supervisor_allocation* alloc = allocation_from_ptr(&(node->data[0])); + assert(alloc != NULL); + // This may overwrite the header of node if it happened to be there already, but not the + // data. + supervisor_allocation_node* new_node = allocate_memory_node(length, false, true); + // There must be enough free space. + assert(new_node != NULL); + memmove(&(new_node->data[0]), &(node->data[0]), length); + alloc->ptr = &(new_node->data[0]); + } + + // Notify clients that their movable allocations may have moved. + old_allocations = &old_allocations_array[0]; #if CIRCUITPY_DISPLAYIO supervisor_display_move_memory(); #endif + // Add calls to further clients here. + old_allocations = NULL; } diff --git a/supervisor/shared/stack.c b/supervisor/shared/stack.c index e7aa956b01..afea204010 100755 --- a/supervisor/shared/stack.c +++ b/supervisor/shared/stack.c @@ -34,36 +34,42 @@ extern uint32_t _estack; +// Requested size. static uint32_t next_stack_size = CIRCUITPY_DEFAULT_STACK_SIZE; static uint32_t current_stack_size = 0; -supervisor_allocation* stack_alloc = NULL; +// Actual location and size, may be larger than requested. +static uint32_t* stack_limit = NULL; +static size_t stack_length = 0; #define EXCEPTION_STACK_SIZE 1024 void allocate_stack(void) { - if (port_fixed_stack() != NULL) { - stack_alloc = port_fixed_stack(); - current_stack_size = stack_alloc->length; + if (port_has_fixed_stack()) { + stack_limit = port_stack_get_limit(); + stack_length = (port_stack_get_top() - stack_limit)*sizeof(uint32_t); + current_stack_size = stack_length; } else { mp_uint_t regs[10]; mp_uint_t sp = cpu_get_regs_and_sp(regs); mp_uint_t c_size = (uint32_t) port_stack_get_top() - sp; - stack_alloc = allocate_memory(c_size + next_stack_size + EXCEPTION_STACK_SIZE, true); + supervisor_allocation* stack_alloc = allocate_memory(c_size + next_stack_size + EXCEPTION_STACK_SIZE, true, false); if (stack_alloc == NULL) { - stack_alloc = allocate_memory(c_size + CIRCUITPY_DEFAULT_STACK_SIZE + EXCEPTION_STACK_SIZE, true); + stack_alloc = allocate_memory(c_size + CIRCUITPY_DEFAULT_STACK_SIZE + EXCEPTION_STACK_SIZE, true, false); current_stack_size = CIRCUITPY_DEFAULT_STACK_SIZE; } else { current_stack_size = next_stack_size; } + stack_limit = stack_alloc->ptr; + stack_length = get_allocation_length(stack_alloc); } - *stack_alloc->ptr = STACK_CANARY_VALUE; + *stack_limit = STACK_CANARY_VALUE; } inline bool stack_ok(void) { - return stack_alloc == NULL || *stack_alloc->ptr == STACK_CANARY_VALUE; + return stack_limit == NULL || *stack_limit == STACK_CANARY_VALUE; } inline void assert_heap_ok(void) { @@ -77,18 +83,26 @@ void stack_init(void) { } void stack_resize(void) { - if (stack_alloc == NULL) { + if (stack_limit == NULL) { return; } if (next_stack_size == current_stack_size) { - *stack_alloc->ptr = STACK_CANARY_VALUE; + *stack_limit = STACK_CANARY_VALUE; return; } - free_memory(stack_alloc); - stack_alloc = NULL; + free_memory(allocation_from_ptr(stack_limit)); + stack_limit = NULL; allocate_stack(); } +uint32_t* stack_get_bottom(void) { + return stack_limit; +} + +size_t stack_get_length(void) { + return stack_length; +} + void set_next_stack_size(uint32_t size) { next_stack_size = size; } diff --git a/supervisor/shared/stack.h b/supervisor/shared/stack.h index 7096f0b3ed..1c75de5f78 100755 --- a/supervisor/shared/stack.h +++ b/supervisor/shared/stack.h @@ -31,10 +31,12 @@ #include "supervisor/memory.h" -extern supervisor_allocation* stack_alloc; - void stack_init(void); void stack_resize(void); +// Actual stack location and size, may be larger than requested. +uint32_t* stack_get_bottom(void); +size_t stack_get_length(void); +// Next/current requested stack size. void set_next_stack_size(uint32_t size); uint32_t get_current_stack_size(void); bool stack_ok(void); From 2ba9805f845e000fa3299e95e93a063471751ecd Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Sun, 11 Oct 2020 20:39:19 +0200 Subject: [PATCH 238/251] Use movable allocation system for terminal tilegrid. Moving memory is now done by the infrastructure and neither necessary nor correct here anymore. --- py/circuitpy_mpconfig.h | 1 - supervisor/shared/display.c | 43 +++++++++++++++---------------------- 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 28fd6e9b00..34ea9b022f 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -867,7 +867,6 @@ struct _supervisor_allocation_node; mp_obj_t rtc_time_source; \ GAMEPAD_ROOT_POINTERS \ mp_obj_t pew_singleton; \ - mp_obj_t terminal_tilegrid_tiles; \ BOARD_UART_ROOT_POINTER \ FLASH_ROOT_POINTERS \ MEMORYMONITOR_ROOT_POINTERS \ diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index de45e2672f..9c9c66cd7f 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -81,19 +81,21 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { uint16_t total_tiles = width_in_tiles * height_in_tiles; - // First try to allocate outside the heap. This will fail when the VM is running. - tilegrid_tiles = allocate_memory(align32_size(total_tiles), false, false); - uint8_t* tiles; - if (tilegrid_tiles == NULL) { - tiles = m_malloc(total_tiles, true); - MP_STATE_VM(terminal_tilegrid_tiles) = tiles; - } else { - tiles = (uint8_t*) tilegrid_tiles->ptr; + // Reuse the previous allocation if possible + if (tilegrid_tiles) { + if (get_allocation_length(tilegrid_tiles) != align32_size(total_tiles)) { + free_memory(tilegrid_tiles); + tilegrid_tiles = NULL; + } } + if (!tilegrid_tiles) { + tilegrid_tiles = allocate_memory(align32_size(total_tiles), false, true); + if (!tilegrid_tiles) { + return; + } + } + uint8_t* tiles = (uint8_t*) tilegrid_tiles->ptr; - if (tiles == NULL) { - return; - } grid->y = tall ? blinka_bitmap.height : 0; grid->x = tall ? 0 : blinka_bitmap.width; grid->top_left_y = 0; @@ -120,7 +122,6 @@ void supervisor_stop_terminal(void) { if (tilegrid_tiles != NULL) { free_memory(tilegrid_tiles); tilegrid_tiles = NULL; - supervisor_terminal_text_grid.inline_tiles = false; supervisor_terminal_text_grid.tiles = NULL; } #endif @@ -128,20 +129,10 @@ void supervisor_stop_terminal(void) { void supervisor_display_move_memory(void) { #if CIRCUITPY_TERMINALIO - displayio_tilegrid_t* grid = &supervisor_terminal_text_grid; - if (MP_STATE_VM(terminal_tilegrid_tiles) != NULL && - grid->tiles == MP_STATE_VM(terminal_tilegrid_tiles)) { - uint16_t total_tiles = grid->width_in_tiles * grid->height_in_tiles; - - tilegrid_tiles = allocate_memory(align32_size(total_tiles), false, false); - if (tilegrid_tiles != NULL) { - memcpy(tilegrid_tiles->ptr, grid->tiles, total_tiles); - grid->tiles = (uint8_t*) tilegrid_tiles->ptr; - } else { - grid->tiles = NULL; - grid->inline_tiles = false; - } - MP_STATE_VM(terminal_tilegrid_tiles) = NULL; + if (tilegrid_tiles != NULL) { + supervisor_terminal_text_grid.tiles = (uint8_t*) tilegrid_tiles->ptr; + } else { + supervisor_terminal_text_grid.tiles = NULL; } #endif From ac91220361e402bbf6ebb741a9b6ea258a05da99 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Fri, 16 Oct 2020 23:08:29 +0200 Subject: [PATCH 239/251] Use movable allocation system for Sharp display framebuffer. Hybrid allocation is now part of the infrastructure. Moving memory contents would not be necessary because displayio can recreate them, but does not hurt. --- .../sharpdisplay/SharpMemoryFramebuffer.c | 57 +++++-------------- .../sharpdisplay/SharpMemoryFramebuffer.h | 1 - 2 files changed, 14 insertions(+), 44 deletions(-) diff --git a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c index aefb6b18de..4b92bd637a 100644 --- a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c +++ b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c @@ -34,32 +34,10 @@ #include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h" #include "supervisor/memory.h" -#include "supervisor/shared/safe_mode.h" #define SHARPMEM_BIT_WRITECMD_LSB (0x80) #define SHARPMEM_BIT_VCOM_LSB (0x40) -static void *hybrid_alloc(size_t sz) { - supervisor_allocation *allocation = allocate_memory(align32_size(sz), false, false); - if (allocation) { - memset(allocation->ptr, 0, sz); - return allocation->ptr; - } - if (gc_alloc_possible()) { - return m_malloc(sz, true); - } - reset_into_safe_mode(MEM_MANAGE); - return NULL; // unreached -} - -static inline void hybrid_free(void *ptr_in) { - supervisor_allocation *allocation = allocation_from_ptr(ptr_in); - - if (allocation) { - free_memory(allocation); - } -} - STATIC uint8_t bitrev(uint8_t n) { uint8_t r = 0; for(int i=0;i<8;i++) r |= ((n>>i) & 1)<<(7-i); @@ -102,9 +80,9 @@ void common_hal_sharpdisplay_framebuffer_reset(sharpdisplay_framebuffer_obj_t *s } void common_hal_sharpdisplay_framebuffer_reconstruct(sharpdisplay_framebuffer_obj_t *self) { - if (!allocation_from_ptr(self->bufinfo.buf)) { - self->bufinfo.buf = NULL; - } + // Look up the allocation by the old pointer and get the new pointer from it. + supervisor_allocation* alloc = allocation_from_ptr(self->bufinfo.buf); + self->bufinfo.buf = alloc ? alloc->ptr : NULL; } void common_hal_sharpdisplay_framebuffer_get_bufinfo(sharpdisplay_framebuffer_obj_t *self, mp_buffer_info_t *bufinfo) { @@ -112,7 +90,12 @@ void common_hal_sharpdisplay_framebuffer_get_bufinfo(sharpdisplay_framebuffer_ob int row_stride = common_hal_sharpdisplay_framebuffer_get_row_stride(self); int height = common_hal_sharpdisplay_framebuffer_get_height(self); self->bufinfo.len = row_stride * height + 2; - self->bufinfo.buf = hybrid_alloc(self->bufinfo.len); + supervisor_allocation* alloc = allocate_memory(align32_size(self->bufinfo.len), false, true); + if (alloc == NULL) { + m_malloc_fail(self->bufinfo.len); + } + self->bufinfo.buf = alloc->ptr; + memset(alloc->ptr, 0, self->bufinfo.len); uint8_t *data = self->bufinfo.buf; *data++ = SHARPMEM_BIT_WRITECMD_LSB; @@ -123,7 +106,9 @@ void common_hal_sharpdisplay_framebuffer_get_bufinfo(sharpdisplay_framebuffer_ob } self->full_refresh = true; } - *bufinfo = self->bufinfo; + if (bufinfo) { + *bufinfo = self->bufinfo; + } } void common_hal_sharpdisplay_framebuffer_deinit(sharpdisplay_framebuffer_obj_t *self) { @@ -137,7 +122,7 @@ void common_hal_sharpdisplay_framebuffer_deinit(sharpdisplay_framebuffer_obj_t * common_hal_reset_pin(self->chip_select.pin); - hybrid_free(self->bufinfo.buf); + free_memory(allocation_from_ptr(self->bufinfo.buf)); memset(self, 0, sizeof(*self)); } @@ -154,19 +139,7 @@ void common_hal_sharpdisplay_framebuffer_construct(sharpdisplay_framebuffer_obj_ self->height = height; self->baudrate = baudrate; - int row_stride = common_hal_sharpdisplay_framebuffer_get_row_stride(self); - self->bufinfo.len = row_stride * height + 2; - // re-use a supervisor allocation if possible - self->bufinfo.buf = hybrid_alloc(self->bufinfo.len); - - uint8_t *data = self->bufinfo.buf; - *data++ = SHARPMEM_BIT_WRITECMD_LSB; - - for(int y=0; yheight; y++) { - *data = bitrev(y+1); - data += row_stride; - } - self->full_refresh = true; + common_hal_sharpdisplay_framebuffer_get_bufinfo(self, NULL); } void common_hal_sharpdisplay_framebuffer_swapbuffers(sharpdisplay_framebuffer_obj_t *self, uint8_t *dirty_row_bitmask) { @@ -271,7 +244,5 @@ const framebuffer_p_t sharpdisplay_framebuffer_proto = { }; void common_hal_sharpdisplay_framebuffer_collect_ptrs(sharpdisplay_framebuffer_obj_t *self) { - gc_collect_ptr(self->framebuffer); gc_collect_ptr(self->bus); - gc_collect_ptr(self->bufinfo.buf); } diff --git a/shared-module/sharpdisplay/SharpMemoryFramebuffer.h b/shared-module/sharpdisplay/SharpMemoryFramebuffer.h index 8acacc94e1..08966a89c1 100644 --- a/shared-module/sharpdisplay/SharpMemoryFramebuffer.h +++ b/shared-module/sharpdisplay/SharpMemoryFramebuffer.h @@ -33,7 +33,6 @@ typedef struct { mp_obj_base_t base; - mp_obj_t framebuffer; busio_spi_obj_t* bus; busio_spi_obj_t inline_bus; digitalio_digitalinout_obj_t chip_select; From a4b84cf0e118f06cc3b563866d5c594b94b9b3fb Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Sat, 17 Oct 2020 13:49:10 +0200 Subject: [PATCH 240/251] Use movable allocation system for RGBMatrix allocations. Hybrid allocation is now part of the infrastructure. Moving memory contents would not be necessary because displayio can recreate them, but does not hurt. --- shared-module/rgbmatrix/RGBMatrix.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index 1f144aedb5..a09767b622 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -78,10 +78,10 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, // verify that the matrix is big enough mp_get_index(mp_obj_get_type(self->framebuffer), self->bufinfo.len, MP_OBJ_NEW_SMALL_INT(self->bufsize-1), false); } else { - _PM_free(self->bufinfo.buf); - _PM_free(self->protomatter.rgbPins); - _PM_free(self->protomatter.addr); - _PM_free(self->protomatter.screenData); + common_hal_rgbmatrix_free_impl(self->bufinfo.buf); + common_hal_rgbmatrix_free_impl(self->protomatter.rgbPins); + common_hal_rgbmatrix_free_impl(self->protomatter.addr); + common_hal_rgbmatrix_free_impl(self->protomatter.screenData); self->framebuffer = NULL; self->bufinfo.buf = common_hal_rgbmatrix_allocator_impl(self->bufsize); @@ -180,9 +180,6 @@ void common_hal_rgbmatrix_rgbmatrix_deinit(rgbmatrix_rgbmatrix_obj_t* self) { void rgbmatrix_rgbmatrix_collect_ptrs(rgbmatrix_rgbmatrix_obj_t* self) { gc_collect_ptr(self->framebuffer); - gc_collect_ptr(self->protomatter.rgbPins); - gc_collect_ptr(self->protomatter.addr); - gc_collect_ptr(self->protomatter.screenData); } void common_hal_rgbmatrix_rgbmatrix_set_paused(rgbmatrix_rgbmatrix_obj_t* self, bool paused) { @@ -217,18 +214,10 @@ int common_hal_rgbmatrix_rgbmatrix_get_height(rgbmatrix_rgbmatrix_obj_t* self) { } void *common_hal_rgbmatrix_allocator_impl(size_t sz) { - if (gc_alloc_possible()) { - return m_malloc_maybe(sz + sizeof(void*), true); - } else { - supervisor_allocation *allocation = allocate_memory(align32_size(sz), false, false); - return allocation ? allocation->ptr : NULL; - } + supervisor_allocation *allocation = allocate_memory(align32_size(sz), false, true); + return allocation ? allocation->ptr : NULL; } void common_hal_rgbmatrix_free_impl(void *ptr_in) { - supervisor_allocation *allocation = allocation_from_ptr(ptr_in); - - if (allocation) { - free_memory(allocation); - } + free_memory(allocation_from_ptr(ptr_in)); } From 7ca36d45a4ffe40c70814d62cb970007b7f40fee Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Fri, 23 Oct 2020 22:35:56 +0200 Subject: [PATCH 241/251] Fix align32_size(). It not only caused crashes with requests larger than 64K (can happen with RGBMatrix), but also generated a lot longer code than necessary. --- shared-module/usb_midi/__init__.c | 6 +++--- supervisor/memory.h | 7 ++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/shared-module/usb_midi/__init__.c b/shared-module/usb_midi/__init__.c index 5afdd18213..3fb3f836cd 100644 --- a/shared-module/usb_midi/__init__.c +++ b/shared-module/usb_midi/__init__.c @@ -40,9 +40,9 @@ supervisor_allocation* usb_midi_allocation; void usb_midi_init(void) { // TODO(tannewt): Make this dynamic. - uint16_t tuple_size = align32_size(sizeof(mp_obj_tuple_t) + sizeof(mp_obj_t*) * 2); - uint16_t portin_size = align32_size(sizeof(usb_midi_portin_obj_t)); - uint16_t portout_size = align32_size(sizeof(usb_midi_portout_obj_t)); + size_t tuple_size = align32_size(sizeof(mp_obj_tuple_t) + sizeof(mp_obj_t*) * 2); + size_t portin_size = align32_size(sizeof(usb_midi_portin_obj_t)); + size_t portout_size = align32_size(sizeof(usb_midi_portout_obj_t)); // For each embedded MIDI Jack in the descriptor we create a Port usb_midi_allocation = allocate_memory(tuple_size + portin_size + portout_size, false, false); diff --git a/supervisor/memory.h b/supervisor/memory.h index 4307e3f21d..0f820eac1c 100755 --- a/supervisor/memory.h +++ b/supervisor/memory.h @@ -64,11 +64,8 @@ supervisor_allocation* allocate_remaining_memory(void); // supervisor_move_memory(). supervisor_allocation* allocate_memory(uint32_t length, bool high_address, bool movable); -static inline uint16_t align32_size(uint16_t size) { - if (size % 4 != 0) { - return (size & 0xfffc) + 0x4; - } - return size; +static inline size_t align32_size(size_t size) { + return (size + 3) & ~3; } size_t get_allocation_length(supervisor_allocation* allocation); From 993a581f5e8c039b562bbacdf17615162d8a85f6 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Wed, 28 Oct 2020 21:50:28 +0100 Subject: [PATCH 242/251] Make CIRCUITPY_SUPERVISOR_ALLOC_COUNT dependent on enabled features. Avoids wasted memory and makes it easier to keep track of who needs how much for future additions. --- supervisor/shared/memory.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index 2be3b42d63..1760b9bd67 100755 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -32,7 +32,32 @@ #include "py/gc.h" #include "supervisor/shared/display.h" -#define CIRCUITPY_SUPERVISOR_ALLOC_COUNT (12) +enum { + CIRCUITPY_SUPERVISOR_ALLOC_COUNT = + // stack + heap + 2 +#ifdef EXTERNAL_FLASH_DEVICES + + 1 +#endif +#if CIRCUITPY_USB_MIDI + + 1 +#endif +#if CIRCUITPY_DISPLAYIO + #if CIRCUITPY_TERMINALIO + + 1 + #endif + + CIRCUITPY_DISPLAY_LIMIT * ( + // Maximum needs of one display: max(4 if RGBMATRIX, 1 if SHARPDISPLAY, 0) + #if CIRCUITPY_RGBMATRIX + 4 + #elif CIRCUITPY_SHARPDISPLAY + 1 + #else + 0 + #endif + ) +#endif +}; // The lowest two bits of a valid length are always zero, so we can use them to mark an allocation // as a hole (freed by the client but not yet reclaimed into the free middle) and as movable. From 848eb2813247edc555bbef34ff2505f12094ef4e Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 28 Nov 2020 14:52:56 -0500 Subject: [PATCH 243/251] esp-uart-pins --- ports/atmel-samd/boards/pybadge_airlift/pins.c | 4 +++- ports/atmel-samd/boards/pyportal/pins.c | 2 ++ ports/atmel-samd/boards/pyportal_titano/pins.c | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/pybadge_airlift/pins.c b/ports/atmel-samd/boards/pybadge_airlift/pins.c index d396502460..399c634413 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/pins.c +++ b/ports/atmel-samd/boards/pybadge_airlift/pins.c @@ -30,8 +30,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { {MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA22)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA23)}, - // UART + // ESP UART + {MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PB17)}, {MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB17)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PB16)}, {MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB16)}, // I2C diff --git a/ports/atmel-samd/boards/pyportal/pins.c b/ports/atmel-samd/boards/pyportal/pins.c index 14699a209d..36140427cb 100644 --- a/ports/atmel-samd/boards/pyportal/pins.c +++ b/ports/atmel-samd/boards/pyportal/pins.c @@ -61,7 +61,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { // UART { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PB12) }, { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PB13) }, // SPI { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_PA12) }, diff --git a/ports/atmel-samd/boards/pyportal_titano/pins.c b/ports/atmel-samd/boards/pyportal_titano/pins.c index 14699a209d..cf8dfbbb27 100644 --- a/ports/atmel-samd/boards/pyportal_titano/pins.c +++ b/ports/atmel-samd/boards/pyportal_titano/pins.c @@ -59,8 +59,11 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_PB17) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RTS), MP_ROM_PTR(&pin_PA15) }, - // UART + // ESP UART + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PB12) }, { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB12) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PB13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB13) }, // SPI From 9ecaa16eced40f3f56ba67737aed3f0950c5164f Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Sun, 29 Nov 2020 16:04:31 +0100 Subject: [PATCH 244/251] Unify redundant low/high_address computation to save a bit of code size. --- supervisor/shared/memory.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index 1760b9bd67..acace7f890 100755 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -134,9 +134,7 @@ supervisor_allocation* allocation_from_ptr(void *ptr) { } supervisor_allocation* allocate_remaining_memory(void) { - uint32_t* low_address = low_head ? low_head->data + low_head->length / 4 : port_heap_get_bottom(); - uint32_t* high_address = high_head ? (uint32_t*)high_head : port_heap_get_top(); - return allocate_memory((high_address - low_address) * 4 - sizeof(supervisor_allocation_node), false, false); + return allocate_memory((uint32_t)-1, false, false); } static supervisor_allocation_node* find_hole(supervisor_allocation_node* node, size_t length) { @@ -152,6 +150,12 @@ static supervisor_allocation_node* allocate_memory_node(uint32_t length, bool hi // supervisor_move_memory() currently does not support movable allocations on the high side, it // must be extended first if this is ever needed. assert(!(high && movable)); + uint32_t* low_address = low_head ? low_head->data + low_head->length / 4 : port_heap_get_bottom(); + uint32_t* high_address = high_head ? (uint32_t*)high_head : port_heap_get_top(); + // Special case for allocate_remaining_memory(), avoids computing low/high_address twice. + if (length == (uint32_t)-1) { + length = (high_address - low_address) * 4 - sizeof(supervisor_allocation_node); + } if (length == 0 || length % 4 != 0) { return NULL; } @@ -159,8 +163,6 @@ static supervisor_allocation_node* allocate_memory_node(uint32_t length, bool hi supervisor_allocation_node* node = find_hole(high ? high_head : low_head, length); if (!node) { // 2. Enough free space in the middle? - uint32_t* low_address = low_head ? low_head->data + low_head->length / 4 : port_heap_get_bottom(); - uint32_t* high_address = high_head ? (uint32_t*)high_head : port_heap_get_top(); if ((high_address - low_address) * 4 >= (int32_t)(sizeof(supervisor_allocation_node) + length)) { if (high) { high_address -= (sizeof(supervisor_allocation_node) + length) / 4; From 11ed6f86f02f61ace55951d2fff62a9d36cf3ac7 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Sun, 29 Nov 2020 16:27:36 +0100 Subject: [PATCH 245/251] Optimize out allocation moving code on boards that don't need it. When no features are enabled that use movable allocations, supervisor_move_memory() is not needed. --- supervisor/shared/memory.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index acace7f890..bc82804b70 100755 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -33,7 +33,7 @@ #include "supervisor/shared/display.h" enum { - CIRCUITPY_SUPERVISOR_ALLOC_COUNT = + CIRCUITPY_SUPERVISOR_IMMOVABLE_ALLOC_COUNT = // stack + heap 2 #ifdef EXTERNAL_FLASH_DEVICES @@ -42,6 +42,9 @@ enum { #if CIRCUITPY_USB_MIDI + 1 #endif + , + CIRCUITPY_SUPERVISOR_MOVABLE_ALLOC_COUNT = + 0 #if CIRCUITPY_DISPLAYIO #if CIRCUITPY_TERMINALIO + 1 @@ -57,6 +60,8 @@ enum { #endif ) #endif + , + CIRCUITPY_SUPERVISOR_ALLOC_COUNT = CIRCUITPY_SUPERVISOR_IMMOVABLE_ALLOC_COUNT + CIRCUITPY_SUPERVISOR_MOVABLE_ALLOC_COUNT }; // The lowest two bits of a valid length are always zero, so we can use them to mark an allocation @@ -147,6 +152,9 @@ static supervisor_allocation_node* find_hole(supervisor_allocation_node* node, s } static supervisor_allocation_node* allocate_memory_node(uint32_t length, bool high, bool movable) { + if (CIRCUITPY_SUPERVISOR_MOVABLE_ALLOC_COUNT == 0) { + assert(!movable); + } // supervisor_move_memory() currently does not support movable allocations on the high side, it // must be extended first if this is ever needed. assert(!(high && movable)); @@ -223,6 +231,11 @@ size_t get_allocation_length(supervisor_allocation* allocation) { } void supervisor_move_memory(void) { + // This whole function is not needed when there are no movable allocations, let it be optimized + // out. + if (CIRCUITPY_SUPERVISOR_MOVABLE_ALLOC_COUNT == 0) { + return; + } // This must be called exactly after freeing the heap, so that the embedded allocations, if any, // are now in the free region. assert(MP_STATE_VM(first_embedded_allocation) == NULL || (low_head < MP_STATE_VM(first_embedded_allocation) && MP_STATE_VM(first_embedded_allocation) < high_head)); From 9768951a2a42fd69f1f1adb0378a47e781d2fad7 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 28 Nov 2020 10:12:46 -0500 Subject: [PATCH 246/251] Disable complex arithmetic on SAMD21 builds to make space --- 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..bce89e0b99 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_PY_BUILTINS_COMPLEX (0) #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 28fd4095c4..fa7095c78d 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -188,7 +188,9 @@ typedef long mp_off_t; #define MICROPY_COMP_FSTRING_LITERAL (MICROPY_CPYTHON_COMPAT) #define MICROPY_MODULE_WEAK_LINKS (0) #define MICROPY_PY_ALL_SPECIAL_METHODS (CIRCUITPY_FULL_BUILD) +#ifndef MICROPY_PY_BUILTINS_COMPLEX #define MICROPY_PY_BUILTINS_COMPLEX (CIRCUITPY_FULL_BUILD) +#endif #define MICROPY_PY_BUILTINS_FROZENSET (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_BUILTINS_STR_CENTER (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_BUILTINS_STR_PARTITION (CIRCUITPY_FULL_BUILD) From dbfabddf58338c5442ee725c9c904d7960c03b1a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 30 Nov 2020 11:11:04 -0500 Subject: [PATCH 247/251] rename ESP TX and RX pins; remove support --- ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h | 3 --- ports/atmel-samd/boards/pybadge_airlift/pins.c | 9 ++------- ports/atmel-samd/boards/pyportal/mpconfigboard.h | 3 --- ports/atmel-samd/boards/pyportal/pins.c | 5 ----- ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h | 3 --- ports/atmel-samd/boards/pyportal_titano/pins.c | 6 ------ 6 files changed, 2 insertions(+), 27 deletions(-) diff --git a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h index c6ab4ed8e0..a37d7ceec4 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h +++ b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h @@ -23,9 +23,6 @@ #define DEFAULT_SPI_BUS_MOSI (&pin_PB23) #define DEFAULT_SPI_BUS_MISO (&pin_PB22) -#define DEFAULT_UART_BUS_RX (&pin_PB17) -#define DEFAULT_UART_BUS_TX (&pin_PB16) - // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/pybadge_airlift/pins.c b/ports/atmel-samd/boards/pybadge_airlift/pins.c index 399c634413..9ee579be14 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/pins.c +++ b/ports/atmel-samd/boards/pybadge_airlift/pins.c @@ -30,12 +30,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { {MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA22)}, {MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA23)}, - // ESP UART - {MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PB17)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB17)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PB16)}, - {MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB16)}, - // I2C {MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA12)}, {MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA13)}, @@ -60,6 +54,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { {MP_OBJ_NEW_QSTR(MP_QSTR_ESP_GPIO0), MP_ROM_PTR(&pin_PA31)}, {MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY), MP_ROM_PTR(&pin_PA00)}, {MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_PB12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PB16)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PB17)}, // TFT control pins {MP_OBJ_NEW_QSTR(MP_QSTR_TFT_LITE), MP_ROM_PTR(&pin_PA01)}, @@ -71,7 +67,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { {MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj)}, {MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj)}, - {MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj)}, {MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)}}; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/pyportal/mpconfigboard.h b/ports/atmel-samd/boards/pyportal/mpconfigboard.h index 2c4cf4f580..00c376ad90 100644 --- a/ports/atmel-samd/boards/pyportal/mpconfigboard.h +++ b/ports/atmel-samd/boards/pyportal/mpconfigboard.h @@ -24,9 +24,6 @@ #define DEFAULT_SPI_BUS_MOSI (&pin_PA12) #define DEFAULT_SPI_BUS_MISO (&pin_PA14) -#define DEFAULT_UART_BUS_RX (&pin_PB13) -#define DEFAULT_UART_BUS_TX (&pin_PB12) - // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/pyportal/pins.c b/ports/atmel-samd/boards/pyportal/pins.c index 36140427cb..461ee98da5 100644 --- a/ports/atmel-samd/boards/pyportal/pins.c +++ b/ports/atmel-samd/boards/pyportal/pins.c @@ -58,11 +58,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY), MP_ROM_PTR(&pin_PB16) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_PB17) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RTS), MP_ROM_PTR(&pin_PA15) }, - - // UART - { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB12) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PB12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PB13) }, // SPI @@ -80,7 +76,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) }, }; diff --git a/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h b/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h index 4d58b81839..a76f1db5c8 100644 --- a/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h +++ b/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h @@ -22,9 +22,6 @@ #define DEFAULT_SPI_BUS_MOSI (&pin_PA12) #define DEFAULT_SPI_BUS_MISO (&pin_PA14) -#define DEFAULT_UART_BUS_RX (&pin_PB13) -#define DEFAULT_UART_BUS_TX (&pin_PB12) - // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/pyportal_titano/pins.c b/ports/atmel-samd/boards/pyportal_titano/pins.c index cf8dfbbb27..461ee98da5 100644 --- a/ports/atmel-samd/boards/pyportal_titano/pins.c +++ b/ports/atmel-samd/boards/pyportal_titano/pins.c @@ -58,13 +58,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY), MP_ROM_PTR(&pin_PB16) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_PB17) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RTS), MP_ROM_PTR(&pin_PA15) }, - - // ESP UART { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PB12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PB13) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB13) }, // SPI { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_PA12) }, @@ -81,7 +76,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) }, }; From 5e5045ddf1ed0ca88fface94c17c7af123ee6ff4 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Sun, 29 Nov 2020 10:02:13 +0000 Subject: [PATCH 248/251] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (864 of 864 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 8f899a12c4..36b1317d7a 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-24 15:40-0500\n" -"PO-Revision-Date: 2020-11-24 23:22+0000\n" +"PO-Revision-Date: 2020-11-30 18:06+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1451,7 +1451,7 @@ msgstr "Somente os endereços IPv4 são suportados" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" -msgstr "" +msgstr "Apenas soquetes IPv4 são suportados" #: shared-module/displayio/OnDiskBitmap.c #, c-format From f65449027a037627cd639501a11d3a754abb0ddf Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Mon, 30 Nov 2020 14:49:04 +0000 Subject: [PATCH 249/251] Translated using Weblate (Swedish) Currently translated at 100.0% (864 of 864 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 66 ++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 66c1f345a2..47739e4aa1 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-24 15:40-0500\n" -"PO-Revision-Date: 2020-11-20 22:28+0000\n" +"PO-Revision-Date: 2020-11-30 18:06+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -871,7 +871,7 @@ msgstr "FFT är enbart definierade för ndarrays" #: extmod/ulab/code/fft/fft.c msgid "FFT is implemented for linear arrays only" -msgstr "" +msgstr "FTT är enbart implementerad för linjära matriser" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" @@ -1282,7 +1282,7 @@ msgstr "Måste använda ett multipel av 6 rgb-pinnar, inte %d" #: ports/esp32s2/common-hal/nvm/ByteArray.c msgid "NVS Error" -msgstr "" +msgstr "NVS-fel" #: py/parse.c msgid "Name too long" @@ -1442,7 +1442,7 @@ msgstr "Endast IPv4-adresser stöds" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" -msgstr "" +msgstr "Endast IPv4-socket stöds" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -2099,7 +2099,7 @@ msgstr "argumentet argsort måste vara en ndarray" #: extmod/ulab/code/numerical/numerical.c msgid "argsort is not implemented for flattened arrays" -msgstr "" +msgstr "argsort är inte implementerad för tillplattade matriser" #: py/runtime.c msgid "argument has wrong type" @@ -2124,7 +2124,7 @@ msgstr "argumenten måste vara ndarray" #: extmod/ulab/code/ndarray.c msgid "array and index length must be equal" -msgstr "" +msgstr "array och indexlängd måste vara lika" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2132,7 +2132,7 @@ 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 "" +msgstr "försök att läsa (arg)min/(arg)max av tom sekvens" #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" @@ -2144,15 +2144,15 @@ msgstr "attribut stöds inte än" #: extmod/ulab/code/numerical/numerical.c msgid "axis is out of bounds" -msgstr "" +msgstr "axis är utanför gränsen" #: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, or an integer" -msgstr "" +msgstr "axis måste vara None eller ett heltal" #: extmod/ulab/code/numerical/numerical.c msgid "axis too long" -msgstr "" +msgstr "axis för lång" #: py/builtinevex.c msgid "bad compile mode" @@ -2359,7 +2359,7 @@ msgstr "" #: extmod/ulab/code/ndarray_operators.c msgid "cannot cast output with casting rule" -msgstr "" +msgstr "kan inte casta utdata med regel" #: py/objtype.c msgid "cannot create '%q' instances" @@ -2459,7 +2459,7 @@ msgstr "kan inte avgöra SD-kortversion" #: extmod/ulab/code/numerical/numerical.c msgid "cross is defined for 1D arrays of length 3" -msgstr "" +msgstr "cross är definierad för 1D-matriser med längd 3" #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" @@ -2503,7 +2503,7 @@ msgstr "argumentet diff måste vara en ndarray" #: extmod/ulab/code/numerical/numerical.c msgid "differentiation order out of range" -msgstr "" +msgstr "differentieringsordning utanför intervallet" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2622,7 +2622,7 @@ 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 "" +msgstr "första argumentet måste vara en tupel av ndarray" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" @@ -2679,7 +2679,7 @@ msgstr "funktionen har samma teckenvärden vid slutet av intervall" #: extmod/ulab/code/ndarray.c msgid "function is defined for ndarrays only" -msgstr "" +msgstr "funktionen är enbart definierad för ndarray" #: py/argcheck.c #, c-format @@ -2775,7 +2775,7 @@ msgstr "inline assembler måste vara en funktion" #: extmod/ulab/code/ndarray.c msgid "input and output shapes are not compatible" -msgstr "" +msgstr "indata- och utdataformer är inte kompatibla" #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" @@ -2787,7 +2787,7 @@ msgstr "indataarraylängden måste vara en multipel av 2" #: extmod/ulab/code/ulab_create.c msgid "input arrays are not compatible" -msgstr "" +msgstr "indatamatriser är inte kompatibla" #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" @@ -2803,19 +2803,19 @@ msgstr "indatamatrisen är singulär" #: extmod/ulab/code/user/user.c msgid "input must be a dense ndarray" -msgstr "" +msgstr "indata måste vara en dense ndarray" #: extmod/ulab/code/ulab_create.c msgid "input must be a tensor of rank 2" -msgstr "" +msgstr "indata måste vara en tensor av rank 2" #: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c msgid "input must be an ndarray" -msgstr "" +msgstr "indata måste vara en ndarray" #: extmod/ulab/code/filter/filter.c msgid "input must be one-dimensional" -msgstr "" +msgstr "indata måste vara endimensionell" #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" @@ -2831,7 +2831,7 @@ msgstr "indatavektorer måste ha samma längd" #: extmod/ulab/code/poly/poly.c msgid "inputs are not iterable" -msgstr "" +msgstr "indata är inte iterbara" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" @@ -3006,7 +3006,7 @@ msgstr "max_length måste vara > 0" #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" -msgstr "" +msgstr "maximalt antal dimensioner är 4" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3141,7 +3141,7 @@ msgstr "icke nyckelord arg efter nyckelord arg" #: extmod/ulab/code/linalg/linalg.c msgid "norm is defined for 1D and 2D arrays" -msgstr "" +msgstr "norm är definierad för 1D- och 2D-matriser" #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" @@ -3209,7 +3209,7 @@ msgstr "sträng har udda längd" #: extmod/ulab/code/ulab_create.c msgid "offset is too large" -msgstr "" +msgstr "offset är för stor" #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" @@ -3235,11 +3235,11 @@ msgstr "operander kan inte sändas tillsammans" #: extmod/ulab/code/ndarray.c msgid "operation is implemented for 1D Boolean arrays only" -msgstr "" +msgstr "operationen är enbart implementerad för 1D Boolean-matriser" #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented for flattened array" -msgstr "" +msgstr "operationen inte implementeras för tillplattad matris" #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" @@ -3378,7 +3378,7 @@ 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 "" +msgstr "resultaten kan inte castas till angiven typ" #: py/compile.c msgid "return annotation must be an identifier" @@ -3400,7 +3400,7 @@ msgstr "rgb_pins[%d] är inte på samma port som en klocka" #: extmod/ulab/code/numerical/numerical.c msgid "roll argument must be an ndarray" -msgstr "" +msgstr "argumentet roll måste vara en ndarray" #: py/objstr.c msgid "rsplit(None,n)" @@ -3428,7 +3428,7 @@ msgstr "skriptkompilering stöds inte" #: extmod/ulab/code/ndarray.c msgid "shape must be a tuple" -msgstr "" +msgstr "shape måste vara en tuple" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3577,7 +3577,7 @@ 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 "" +msgstr "tobyte kan enbart anropas för täta matriser" #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" @@ -3756,11 +3756,11 @@ msgstr "window måste vara <= interval" #: extmod/ulab/code/numerical/numerical.c msgid "wrong axis index" -msgstr "" +msgstr "fel axelindex" #: extmod/ulab/code/ulab_create.c msgid "wrong axis specified" -msgstr "" +msgstr "fel axel angiven" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" From 205d135e1a6cebed18ff809a5676f5d667ad677d Mon Sep 17 00:00:00 2001 From: vkuthan Date: Sun, 29 Nov 2020 20:13:26 +0000 Subject: [PATCH 250/251] Translated using Weblate (Czech) Currently translated at 1.8% (16 of 864 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/cs/ --- locale/cs.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locale/cs.po b/locale/cs.po index a77a655a62..05b5942fc5 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -6,15 +6,15 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-24 15:40-0500\n" -"PO-Revision-Date: 2020-05-24 03:22+0000\n" -"Last-Translator: dronecz \n" +"PO-Revision-Date: 2020-11-30 18:06+0000\n" +"Last-Translator: vkuthan \n" "Language-Team: LANGUAGE \n" "Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -"X-Generator: Weblate 4.1-dev\n" +"X-Generator: Weblate 4.4-dev\n" #: main.c msgid "" @@ -74,7 +74,7 @@ msgstr "%q index je mimo rozsah" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "" +msgstr "%q indexy musí být celá čísla, ne %q" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -82,7 +82,7 @@ msgstr "Seznam %q musí být seznam" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q musí být >= 0" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -98,7 +98,7 @@ msgstr " %q musí být n-tice délky 2" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q je mimo rozsah" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" From d6f8a43f6cc755b90376a66b75818744fbe63320 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Mon, 30 Nov 2020 23:33:07 +0100 Subject: [PATCH 251/251] Eliminate goto. --- supervisor/shared/memory.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index bc82804b70..480c322b01 100755 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -105,23 +105,23 @@ void free_memory(supervisor_allocation* allocation) { else { // Check if it's in the list of embedded allocations. supervisor_allocation_node** emb = &MP_STATE_VM(first_embedded_allocation); - while (*emb != NULL) { - if (*emb == node) { - // Found, remove it from the list. - *emb = node->next; - m_free(node -#if MICROPY_MALLOC_USES_ALLOCATED_SIZE - , sizeof(supervisor_allocation_node) + (node->length & ~FLAGS) -#endif - ); - goto done; - } + while (*emb != NULL && *emb != node) { emb = &((*emb)->next); } - // Else it must be within the low or high ranges and becomes a hole. - node->length = ((node->length & ~FLAGS) | HOLE); + if (*emb != NULL) { + // Found, remove it from the list. + *emb = node->next; + m_free(node +#if MICROPY_MALLOC_USES_ALLOCATED_SIZE + , sizeof(supervisor_allocation_node) + (node->length & ~FLAGS) +#endif + ); + } + else { + // Else it must be within the low or high ranges and becomes a hole. + node->length = ((node->length & ~FLAGS) | HOLE); + } } -done: allocation->ptr = NULL; }