From 128b4a013b83b02953b1cfd7f246bdd30dab5f9a Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 28 Sep 2020 12:11:08 -0400 Subject: [PATCH 01/73] Add non-calibrated ADC --- locale/circuitpython.pot | 12 +- ports/esp32s2/Makefile | 51 ++++----- ports/esp32s2/common-hal/analogio/AnalogIn.c | 103 ++++++++++++++++++ ports/esp32s2/common-hal/analogio/AnalogIn.h | 50 +++++++++ ports/esp32s2/common-hal/analogio/AnalogOut.c | 60 ++++++++++ ports/esp32s2/common-hal/analogio/AnalogOut.h | 44 ++++++++ ports/esp32s2/common-hal/analogio/__init__.c | 1 + ports/esp32s2/mpconfigport.mk | 2 +- ports/esp32s2/peripherals/pins.c | 94 ++++++++-------- ports/esp32s2/peripherals/pins.h | 3 + 10 files changed, 342 insertions(+), 78 deletions(-) create mode 100644 ports/esp32s2/common-hal/analogio/AnalogIn.c create mode 100644 ports/esp32s2/common-hal/analogio/AnalogIn.h create mode 100644 ports/esp32s2/common-hal/analogio/AnalogOut.c create mode 100644 ports/esp32s2/common-hal/analogio/AnalogOut.h create mode 100644 ports/esp32s2/common-hal/analogio/__init__.c diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index c9114dd5c5..2d994b01db 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-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-25 18:14-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1167,14 +1167,10 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" @@ -1415,6 +1411,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 229a3bf3ab..013da7d899 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -73,30 +73,31 @@ INC += -I./peripherals INC += -I../../lib/mp-readline INC += -I../../lib/tinyusb/src INC += -I../../supervisor/shared/usb -INC += -Iesp-idf/components/freertos/include/freertos -INC += -Iesp-idf/components/freertos/xtensa/include -INC += -Iesp-idf/components/esp32s2/include -INC += -Iesp-idf/components/xtensa/esp32s2/include -INC += -Iesp-idf/components/esp_common/include -INC += -Iesp-idf/components/esp_event/include -INC += -Iesp-idf/components/esp_netif/include -INC += -Iesp-idf/components/esp_ringbuf/include -INC += -Iesp-idf/components/esp_rom/include -INC += -Iesp-idf/components/esp_wifi/include -INC += -Iesp-idf/components/xtensa/include -INC += -Iesp-idf/components/esp_timer/include -INC += -Iesp-idf/components/mbedtls/mbedtls/include -INC += -Iesp-idf/components/mbedtls/port/include/ -INC += -Iesp-idf/components/newlib/platform_include -INC += -Iesp-idf/components/lwip/lwip/src/include -INC += -Iesp-idf/components/lwip/port/esp32/include -INC += -Iesp-idf/components/lwip/include/apps/sntp -INC += -Iesp-idf/components/soc/include -INC += -Iesp-idf/components/soc/src/esp32s2/include -INC += -Iesp-idf/components/soc/soc/include -INC += -Iesp-idf/components/soc/soc/esp32s2/include -INC += -Iesp-idf/components/heap/include -INC += -Iesp-idf/components/esp_system/include +INC += -isystem esp-idf/components/freertos/include/freertos +INC += -isystem esp-idf/components/freertos/xtensa/include +INC += -isystem esp-idf/components/esp32s2/include +INC += -isystem esp-idf/components/driver/esp32s2/include +INC += -isystem esp-idf/components/xtensa/esp32s2/include +INC += -isystem esp-idf/components/esp_common/include +INC += -isystem esp-idf/components/esp_event/include +INC += -isystem esp-idf/components/esp_netif/include +INC += -isystem esp-idf/components/esp_ringbuf/include +INC += -isystem esp-idf/components/esp_rom/include +INC += -isystem esp-idf/components/esp_wifi/include +INC += -isystem esp-idf/components/xtensa/include +INC += -isystem esp-idf/components/esp_timer/include +INC += -isystem esp-idf/components/mbedtls/mbedtls/include +INC += -isystem esp-idf/components/mbedtls/port/include/ +INC += -isystem esp-idf/components/newlib/platform_include +INC += -isystem esp-idf/components/lwip/lwip/src/include +INC += -isystem esp-idf/components/lwip/port/esp32/include +INC += -isystem esp-idf/components/lwip/include/apps/sntp +INC += -isystem esp-idf/components/soc/include +INC += -isystem esp-idf/components/soc/src/esp32s2/include +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 += -I$(BUILD)/esp-idf/config CFLAGS += -DHAVE_CONFIG_H \ @@ -260,7 +261,7 @@ ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pth ESP_IDF_COMPONENTS_INCLUDE = driver freertos log soc -INC += $(foreach component, $(ESP_IDF_COMPONENTS_INCLUDE), -Iesp-idf/components/$(component)/include) +INC += $(foreach component, $(ESP_IDF_COMPONENTS_INCLUDE), -isystem esp-idf/components/$(component)/include) ESP_IDF_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/$(component)/lib$(component).a) ESP_IDF_WIFI_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_WIFI_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/$(component)/lib$(component).a) diff --git a/ports/esp32s2/common-hal/analogio/AnalogIn.c b/ports/esp32s2/common-hal/analogio/AnalogIn.c new file mode 100644 index 0000000000..1a15fc77cd --- /dev/null +++ b/ports/esp32s2/common-hal/analogio/AnalogIn.c @@ -0,0 +1,103 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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. + */ + +#include "common-hal/analogio/AnalogIn.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "driver/adc.h" +// TODO: Add when ESP-IDF is updated latest version +// #include "esp-idf/components/esp_adc_cal/include/esp_adc_cal.h" + +#include "shared-bindings/microcontroller/Pin.h" + +#define DEFAULT_VREF 1100 +#define NO_OF_SAMPLES 64 +#define ATTENUATION ADC_ATTEN_DB_11 +#define DATA_WIDTH ADC_WIDTH_BIT_13 + +void common_hal_analogio_analogin_construct(analogio_analogin_obj_t* self, + const mcu_pin_obj_t *pin) { + if (pin->adc_index == 0 || pin->adc_channel == ADC_CHANNEL_MAX) { + mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + } + common_hal_mcu_pin_claim(pin); + self->pin = pin; +} + +bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { + return self->pin == NULL; +} + +void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { + if (common_hal_analogio_analogin_deinited(self)) { + return; + } + reset_pin_number(self->pin->number); + self->pin = NULL; +} + +uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { + if (self->pin->adc_index == ADC_UNIT_1) { + adc1_config_width(DATA_WIDTH); + adc1_config_channel_atten((adc1_channel_t)self->pin->adc_channel, ATTENUATION); + } else if (self->pin->adc_index == ADC_UNIT_2) { + adc2_config_channel_atten((adc2_channel_t)self->pin->adc_channel, ATTENUATION); + } + + // TODO: esp_adc_cal is only available in the latest version of the esp-idf. Enable when we update. + // Automatically select calibration process depending on status of efuse + // esp_adc_cal_characteristics_t *adc_chars = calloc(1, sizeof(esp_adc_cal_characteristics_t)); + // esp_adc_cal_characterize(self->pin->adc_index, ATTENUATION, DATA_WIDTH, DEFAULT_VREF, adc_chars); + + uint32_t adc_reading = 0; + //Multisampling + for (int i = 0; i < NO_OF_SAMPLES; i++) { + if (self->pin->adc_index == ADC_UNIT_1) { + adc_reading += adc1_get_raw((adc1_channel_t)self->pin->adc_channel); + } else { + int raw; + esp_err_t r = adc2_get_raw((adc2_channel_t)self->pin->adc_channel, DATA_WIDTH, &raw); + if ( r != ESP_OK ) { + mp_raise_ValueError(translate("ADC2 is being used by WiFi")); + } + adc_reading += raw; + } + } + adc_reading /= NO_OF_SAMPLES; + + // This corrects non-linear regions of the ADC range with a LUT, so it's a better reading than raw + // Enable when ESP-IDF is updated + //uint32_t voltage = esp_adc_cal_raw_to_voltage(adc_reading, adc_chars); + //return voltage * ((1 << 16) - 1)/3300; + + return adc_reading; +} + +float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { + return 3.3f; +} diff --git a/ports/esp32s2/common-hal/analogio/AnalogIn.h b/ports/esp32s2/common-hal/analogio/AnalogIn.h new file mode 100644 index 0000000000..5ea4a913de --- /dev/null +++ b/ports/esp32s2/common-hal/analogio/AnalogIn.h @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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_COMMON_HAL_ANALOGIO_ANALOGIN_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGIN_H + +#include "common-hal/microcontroller/Pin.h" + +#include "esp-idf/components/soc/include/hal/adc_types.h" +#include "FreeRTOS.h" +#include "freertos/semphr.h" +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t * pin; +} analogio_analogin_obj_t; + +static inline uint8_t stm32_adc_units(uint8_t adc_packed) { + return adc_packed >> 5; +} + +static inline uint8_t stm32_adc_channel(uint8_t adc_packed) { + return adc_packed & 0x1f; +} + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGIN_H diff --git a/ports/esp32s2/common-hal/analogio/AnalogOut.c b/ports/esp32s2/common-hal/analogio/AnalogOut.c new file mode 100644 index 0000000000..d67dc6083f --- /dev/null +++ b/ports/esp32s2/common-hal/analogio/AnalogOut.c @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George + * 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. + */ + +#include +#include + +#include "py/mperrno.h" +#include "py/runtime.h" + +#include "shared-bindings/analogio/AnalogOut.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/translate.h" + +#include "common-hal/microcontroller/Pin.h" + +void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, + const mcu_pin_obj_t *pin) { + //mp_raise_ValueError(translate("No DAC on chip")); +} + +bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { + return true; +} + +void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { + +} + +void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self, + uint16_t value) { + +} + +void analogout_reset(void) { + +} diff --git a/ports/esp32s2/common-hal/analogio/AnalogOut.h b/ports/esp32s2/common-hal/analogio/AnalogOut.h new file mode 100644 index 0000000000..d5f29ffd74 --- /dev/null +++ b/ports/esp32s2/common-hal/analogio/AnalogOut.h @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * 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_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t * pin; + uint8_t channel; + uint8_t dac_index:1; +} analogio_analogout_obj_t; + +void analogout_reset(void); + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H diff --git a/ports/esp32s2/common-hal/analogio/__init__.c b/ports/esp32s2/common-hal/analogio/__init__.c new file mode 100644 index 0000000000..eea58c77d6 --- /dev/null +++ b/ports/esp32s2/common-hal/analogio/__init__.c @@ -0,0 +1 @@ +// No analogio module functions. diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index bbaabb1c3d..d68fe469dc 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -13,8 +13,8 @@ USB_SERIAL_NUMBER_LENGTH = 12 LONGINT_IMPL = MPZ # These modules are implemented in ports//common-hal: +# CIRCUITPY_ANALOGIO = 0 CIRCUITPY_FULL_BUILD = 1 -CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_COUNTIO = 0 diff --git a/ports/esp32s2/peripherals/pins.c b/ports/esp32s2/peripherals/pins.c index 34fd6483eb..2c8b61c627 100755 --- a/ports/esp32s2/peripherals/pins.c +++ b/ports/esp32s2/peripherals/pins.c @@ -26,56 +26,58 @@ #include "peripherals/pins.h" -#define NO_ADC 0xff +#define NO_ADC 0 +#define NO_ADC_CHANNEL ADC_CHANNEL_MAX // This macro is used to simplify pin definition in boards//pins.c -#define PIN(p_name, p_number) \ +#define PIN(p_name, p_number, p_adc_index, p_adc_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, \ } -PIN(GPIO0, 0); -PIN(GPIO1, 1); -PIN(GPIO2, 2); -PIN(GPIO3, 3); -PIN(GPIO4, 4); -PIN(GPIO5, 5); -PIN(GPIO6, 6); -PIN(GPIO7, 7); -PIN(GPIO8, 8); -PIN(GPIO9, 9); -PIN(GPIO10, 10); -PIN(GPIO11, 11); -PIN(GPIO12, 12); -PIN(GPIO13, 13); -PIN(GPIO14, 14); -PIN(GPIO15, 15); -PIN(GPIO16, 16); -PIN(GPIO17, 17); -PIN(GPIO18, 18); - -PIN(GPIO19, 19); -PIN(GPIO20, 20); -PIN(GPIO21, 21); -PIN(GPIO26, 26); -PIN(GPIO27, 27); -PIN(GPIO28, 28); -PIN(GPIO29, 29); -PIN(GPIO30, 30); -PIN(GPIO31, 31); -PIN(GPIO32, 32); -PIN(GPIO33, 33); -PIN(GPIO34, 34); -PIN(GPIO35, 35); -PIN(GPIO36, 36); -PIN(GPIO37, 37); -PIN(GPIO38, 38); -PIN(GPIO39, 39); -PIN(GPIO40, 40); -PIN(GPIO41, 41); -PIN(GPIO42, 42); -PIN(GPIO43, 43); -PIN(GPIO44, 44); -PIN(GPIO45, 45); -PIN(GPIO46, 46); +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); diff --git a/ports/esp32s2/peripherals/pins.h b/ports/esp32s2/peripherals/pins.h index 07d0b908ee..3f41cf35b2 100644 --- a/ports/esp32s2/peripherals/pins.h +++ b/ports/esp32s2/peripherals/pins.h @@ -35,10 +35,13 @@ #include "esp32s2_peripherals_config.h" #include "esp-idf/config/sdkconfig.h" #include "esp-idf/components/soc/include/hal/gpio_types.h" +#include "esp-idf/components/soc/include/hal/adc_types.h" typedef struct { PIN_PREFIX_FIELDS gpio_num_t number; + uint8_t adc_index:2; + uint8_t adc_channel:6; } mcu_pin_obj_t; extern const mcu_pin_obj_t pin_GPIO0; From 66b8559fd4e4ea7d50adb12a87b7bac208b5fc16 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 28 Sep 2020 18:59:29 -0400 Subject: [PATCH 02/73] Change submodule, rework all includes --- .gitmodules | 6 +- ports/esp32s2/Makefile | 61 +++++++++++-------- ports/esp32s2/bindings/espidf/__init__.c | 2 +- ports/esp32s2/common-hal/busio/I2C.c | 2 +- ports/esp32s2/common-hal/busio/I2C.h | 2 +- ports/esp32s2/common-hal/busio/SPI.c | 2 +- ports/esp32s2/common-hal/busio/SPI.h | 6 +- ports/esp32s2/common-hal/busio/UART.c | 2 +- ports/esp32s2/common-hal/busio/UART.h | 2 +- .../common-hal/digitalio/DigitalInOut.c | 4 +- .../esp32s2/common-hal/microcontroller/Pin.c | 4 +- .../common-hal/microcontroller/Processor.c | 2 +- .../common-hal/neopixel_write/__init__.c | 4 +- ports/esp32s2/common-hal/pulseio/PulseIn.h | 4 +- ports/esp32s2/common-hal/pulseio/PulseOut.h | 4 +- ports/esp32s2/common-hal/pwmio/PWMOut.c | 2 +- ports/esp32s2/common-hal/pwmio/PWMOut.h | 2 +- ports/esp32s2/common-hal/rtc/RTC.c | 2 +- ports/esp32s2/common-hal/socketpool/Socket.h | 3 +- .../common-hal/socketpool/SocketPool.c | 2 +- ports/esp32s2/common-hal/ssl/SSLContext.h | 2 +- ports/esp32s2/common-hal/ssl/__init__.c | 2 +- ports/esp32s2/common-hal/wifi/Network.h | 2 +- ports/esp32s2/common-hal/wifi/Radio.c | 4 +- ports/esp32s2/common-hal/wifi/Radio.h | 2 +- .../esp32s2/common-hal/wifi/ScannedNetworks.c | 2 +- .../esp32s2/common-hal/wifi/ScannedNetworks.h | 3 +- ports/esp32s2/common-hal/wifi/__init__.c | 7 ++- ports/esp32s2/esp-idf | 2 +- ports/esp32s2/mphalport.c | 4 +- ports/esp32s2/peripherals/pins.h | 2 +- ports/esp32s2/peripherals/rmt.c | 2 +- ports/esp32s2/peripherals/rmt.h | 2 +- ports/esp32s2/supervisor/internal_flash.c | 2 +- ports/esp32s2/supervisor/port.c | 4 +- ports/esp32s2/supervisor/usb.c | 8 +-- shared-bindings/socketpool/Socket.c | 1 - shared-bindings/socketpool/SocketPool.c | 1 - shared-bindings/wifi/ScannedNetworks.c | 1 - 39 files changed, 89 insertions(+), 82 deletions(-) diff --git a/.gitmodules b/.gitmodules index 3603cea696..f66ce8aafa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -144,12 +144,12 @@ [submodule "frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center"] path = frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center url = https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center -[submodule "ports/esp32s2/esp-idf"] - path = ports/esp32s2/esp-idf - url = https://github.com/tannewt/esp-idf.git [submodule "frozen/Adafruit_CircuitPython_RFM9x"] path = frozen/Adafruit_CircuitPython_RFM9x url = https://github.com/adafruit/Adafruit_CircuitPython_RFM9x.git [submodule "frozen/Adafruit_CircuitPython_RFM69"] path = frozen/Adafruit_CircuitPython_RFM69 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 diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 229a3bf3ab..49b9c6d2bd 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -73,30 +73,37 @@ INC += -I./peripherals INC += -I../../lib/mp-readline INC += -I../../lib/tinyusb/src INC += -I../../supervisor/shared/usb -INC += -Iesp-idf/components/freertos/include/freertos -INC += -Iesp-idf/components/freertos/xtensa/include -INC += -Iesp-idf/components/esp32s2/include -INC += -Iesp-idf/components/xtensa/esp32s2/include -INC += -Iesp-idf/components/esp_common/include -INC += -Iesp-idf/components/esp_event/include -INC += -Iesp-idf/components/esp_netif/include -INC += -Iesp-idf/components/esp_ringbuf/include -INC += -Iesp-idf/components/esp_rom/include -INC += -Iesp-idf/components/esp_wifi/include -INC += -Iesp-idf/components/xtensa/include -INC += -Iesp-idf/components/esp_timer/include -INC += -Iesp-idf/components/mbedtls/mbedtls/include -INC += -Iesp-idf/components/mbedtls/port/include/ -INC += -Iesp-idf/components/newlib/platform_include -INC += -Iesp-idf/components/lwip/lwip/src/include -INC += -Iesp-idf/components/lwip/port/esp32/include -INC += -Iesp-idf/components/lwip/include/apps/sntp -INC += -Iesp-idf/components/soc/include -INC += -Iesp-idf/components/soc/src/esp32s2/include -INC += -Iesp-idf/components/soc/soc/include -INC += -Iesp-idf/components/soc/soc/esp32s2/include -INC += -Iesp-idf/components/heap/include -INC += -Iesp-idf/components/esp_system/include + +INC += -isystem esp-idf +INC += -isystem esp-idf/components/driver/include +INC += -isystem esp-idf/components/hal/esp32s2/include +INC += -isystem esp-idf/components/hal/include + +INC += -isystem esp-idf/components/freertos/include/freertos +INC += -isystem esp-idf/components/freertos/xtensa/include +INC += -isystem esp-idf/components/esp32s2/include +INC += -isystem esp-idf/components/xtensa/esp32s2/include +INC += -isystem esp-idf/components/esp_common/include +INC += -isystem esp-idf/components/esp_event/include +INC += -isystem esp-idf/components/esp_netif/include +INC += -isystem esp-idf/components/esp_ringbuf/include +INC += -isystem esp-idf/components/esp_rom/include +INC += -isystem esp-idf/components/esp_wifi/include +INC += -isystem esp-idf/components/xtensa/include +INC += -isystem esp-idf/components/esp_timer/include +INC += -isystem esp-idf/components/mbedtls/mbedtls/include +INC += -isystem esp-idf/components/mbedtls/port/include/ +INC += -isystem esp-idf/components/newlib/platform_include +INC += -isystem esp-idf/components/lwip/lwip/src/include +INC += -isystem esp-idf/components/lwip/port/esp32/include +INC += -isystem esp-idf/components/lwip/include/apps/sntp +INC += -isystem esp-idf/components/hal/include +INC += -isystem esp-idf/components/soc/include +INC += -isystem esp-idf/components/soc/src/esp32s2/include +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 += -I$(BUILD)/esp-idf/config CFLAGS += -DHAVE_CONFIG_H \ @@ -256,7 +263,7 @@ menuconfig: $(BUILD)/esp-idf/config $(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h # Order here matters -ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls +ESP_IDF_COMPONENTS_LINK = freertos log hal esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls ESP_IDF_COMPONENTS_INCLUDE = driver freertos log soc @@ -268,11 +275,11 @@ ESP_IDF_WIFI_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_WIFI_COMPONENT MBEDTLS_COMPONENTS_LINK = crypto tls x509 MBEDTLS_COMPONENTS_LINK_EXPANDED = $(foreach component, $(MBEDTLS_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/mbedtls/mbedtls/library/libmbed$(component).a) -BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libhal.a +BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libxt_hal.a BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a librtc.a libsmartconfig.a libphy.a BINARY_BLOBS += $(addprefix esp-idf/components/esp_wifi/lib/esp32s2/, $(BINARY_WIFI_BLOBS)) -ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/soc/soc/esp32s2/libsoc_esp32s2.a esp-idf/components/xtensa/esp32s2/libhal.a +ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/soc/soc/esp32s2/libsoc_esp32s2.a esp-idf/components/xtensa/esp32s2/libxt_hal.a ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld $(BUILD)/esp-idf/esp-idf/esp32s2/ld/esp32s2.project.ld FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE) diff --git a/ports/esp32s2/bindings/espidf/__init__.c b/ports/esp32s2/bindings/espidf/__init__.c index 3b910cfe6f..554bfaa39e 100644 --- a/ports/esp32s2/bindings/espidf/__init__.c +++ b/ports/esp32s2/bindings/espidf/__init__.c @@ -29,7 +29,7 @@ #include "bindings/espidf/__init__.h" -#include "esp-idf/components/heap/include/esp_heap_caps.h" +#include "components/heap/include/esp_heap_caps.h" //| """Direct access to a few ESP-IDF details. This module *should not* include any functionality //| that could be implemented by other frameworks. It should only include ESP-IDF specific diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c index 57270372f1..6f19531288 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -28,7 +28,7 @@ #include "py/mperrno.h" #include "py/runtime.h" -#include "driver/i2c.h" +#include "components/driver/include/driver/i2c.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" diff --git a/ports/esp32s2/common-hal/busio/I2C.h b/ports/esp32s2/common-hal/busio/I2C.h index 24a3fd4951..c39d6d7448 100644 --- a/ports/esp32s2/common-hal/busio/I2C.h +++ b/ports/esp32s2/common-hal/busio/I2C.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "esp-idf/components/soc/include/hal/i2c_types.h" +#include "components/hal/include/hal/i2c_types.h" #include "FreeRTOS.h" #include "freertos/semphr.h" #include "py/obj.h" diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index eaafa87b74..1906ca6f00 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -266,7 +266,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, self->bits = bits; self->target_frequency = baudrate; self->hal_context.timing_conf = &self->timing_conf; - esp_err_t result = spi_hal_get_clock_conf(&self->hal_context, + esp_err_t result = spi_hal_cal_clock_conf(&self->hal_context, self->target_frequency, 128 /* duty_cycle */, self->connected_through_gpio, diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h index 38fbe42ffc..f6c1c344a1 100644 --- a/ports/esp32s2/common-hal/busio/SPI.h +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -29,9 +29,9 @@ #include "common-hal/microcontroller/Pin.h" -#include "esp-idf/components/driver/include/driver/spi_common_internal.h" -#include "esp-idf/components/soc/include/hal/spi_hal.h" -#include "esp-idf/components/soc/include/hal/spi_types.h" +#include "components/driver/include/driver/spi_common_internal.h" +#include "components/hal/include/hal/spi_hal.h" +#include "components/hal/include/hal/spi_types.h" #include "py/obj.h" typedef struct { diff --git a/ports/esp32s2/common-hal/busio/UART.c b/ports/esp32s2/common-hal/busio/UART.c index b0162adba9..98cebba67f 100644 --- a/ports/esp32s2/common-hal/busio/UART.c +++ b/ports/esp32s2/common-hal/busio/UART.c @@ -27,7 +27,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/busio/UART.h" -#include "driver/uart.h" +#include "components/driver/include/driver/uart.h" #include "mpconfigport.h" #include "lib/utils/interrupt_char.h" diff --git a/ports/esp32s2/common-hal/busio/UART.h b/ports/esp32s2/common-hal/busio/UART.h index b3cc929665..1d7f135115 100644 --- a/ports/esp32s2/common-hal/busio/UART.h +++ b/ports/esp32s2/common-hal/busio/UART.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "esp-idf/components/soc/include/hal/uart_types.h" +#include "components/hal/include/hal/uart_types.h" #include "py/obj.h" typedef struct { diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c index fb3ee10ad7..2c7902616f 100644 --- a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c +++ b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c @@ -28,9 +28,9 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -#include "driver/gpio.h" +#include "components/driver/include/driver/gpio.h" -#include "esp-idf/components/soc/include/hal/gpio_hal.h" +#include "components/hal/include/hal/gpio_hal.h" void common_hal_digitalio_digitalinout_never_reset( digitalio_digitalinout_obj_t *self) { diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 546dca848c..3c2611efeb 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -31,8 +31,8 @@ #include "py/mphal.h" -#include "esp-idf/components/driver/include/driver/gpio.h" -#include "esp-idf/components/soc/include/hal/gpio_hal.h" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" #ifdef MICROPY_HW_NEOPIXEL bool neopixel_in_use; diff --git a/ports/esp32s2/common-hal/microcontroller/Processor.c b/ports/esp32s2/common-hal/microcontroller/Processor.c index c64fa010e6..b815216012 100644 --- a/ports/esp32s2/common-hal/microcontroller/Processor.c +++ b/ports/esp32s2/common-hal/microcontroller/Processor.c @@ -34,7 +34,7 @@ #include "soc/efuse_reg.h" -#include "esp-idf/components/driver/esp32s2/include/driver/temp_sensor.h" +#include "components/driver/esp32s2/include/driver/temp_sensor.h" float common_hal_mcu_processor_get_temperature(void) { float tsens_out; diff --git a/ports/esp32s2/common-hal/neopixel_write/__init__.c b/ports/esp32s2/common-hal/neopixel_write/__init__.c index 193d754f43..553cb79f83 100644 --- a/ports/esp32s2/common-hal/neopixel_write/__init__.c +++ b/ports/esp32s2/common-hal/neopixel_write/__init__.c @@ -43,8 +43,8 @@ #include "py/mphal.h" #include "py/runtime.h" #include "shared-bindings/neopixel_write/__init__.h" -#include "driver/rmt.h" -#include "rmt.h" +#include "components/driver/include/driver/rmt.h" +#include "peripherals/rmt.h" #define WS2812_T0H_NS (350) #define WS2812_T0L_NS (1000) diff --git a/ports/esp32s2/common-hal/pulseio/PulseIn.h b/ports/esp32s2/common-hal/pulseio/PulseIn.h index 97d70d4b03..289605ed05 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseIn.h +++ b/ports/esp32s2/common-hal/pulseio/PulseIn.h @@ -30,8 +30,8 @@ #include "common-hal/microcontroller/Pin.h" #include "py/obj.h" -#include "driver/rmt.h" -#include "rmt.h" +#include "components/driver/include/driver/rmt.h" +#include "peripherals/rmt.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/pulseio/PulseOut.h b/ports/esp32s2/common-hal/pulseio/PulseOut.h index 629591af61..c3952452f6 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseOut.h +++ b/ports/esp32s2/common-hal/pulseio/PulseOut.h @@ -28,8 +28,8 @@ #define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H #include "common-hal/microcontroller/Pin.h" -#include "driver/rmt.h" -#include "rmt.h" +#include "components/driver/include/driver/rmt.h" +#include "peripherals/rmt.h" #include "py/obj.h" diff --git a/ports/esp32s2/common-hal/pwmio/PWMOut.c b/ports/esp32s2/common-hal/pwmio/PWMOut.c index d745b7789e..e1fdd4760a 100644 --- a/ports/esp32s2/common-hal/pwmio/PWMOut.c +++ b/ports/esp32s2/common-hal/pwmio/PWMOut.c @@ -28,7 +28,7 @@ #include "common-hal/pwmio/PWMOut.h" #include "shared-bindings/pwmio/PWMOut.h" #include "py/runtime.h" -#include "driver/ledc.h" +#include "components/driver/include/driver/ledc.h" #define INDEX_EMPTY 0xFF diff --git a/ports/esp32s2/common-hal/pwmio/PWMOut.h b/ports/esp32s2/common-hal/pwmio/PWMOut.h index c489e5a278..9055dee8e3 100644 --- a/ports/esp32s2/common-hal/pwmio/PWMOut.h +++ b/ports/esp32s2/common-hal/pwmio/PWMOut.h @@ -28,7 +28,7 @@ #define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PWMIO_PWMOUT_H #include "common-hal/microcontroller/Pin.h" -#include "driver/ledc.h" +#include "components/driver/include/driver/ledc.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/rtc/RTC.c b/ports/esp32s2/common-hal/rtc/RTC.c index 1218186a8c..4d8713639f 100644 --- a/ports/esp32s2/common-hal/rtc/RTC.c +++ b/ports/esp32s2/common-hal/rtc/RTC.c @@ -28,7 +28,7 @@ #include "py/obj.h" #include "py/runtime.h" -#include "soc/rtc_periph.h" +#include "components/soc/soc/include/soc/rtc_periph.h" #include "shared-bindings/rtc/RTC.h" void common_hal_rtc_get_time(timeutils_struct_time_t *tm) { diff --git a/ports/esp32s2/common-hal/socketpool/Socket.h b/ports/esp32s2/common-hal/socketpool/Socket.h index c23dd171cf..de63c8ab2c 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.h +++ b/ports/esp32s2/common-hal/socketpool/Socket.h @@ -32,7 +32,8 @@ #include "common-hal/socketpool/SocketPool.h" #include "common-hal/ssl/SSLContext.h" -#include "esp-idf/components/esp-tls/esp_tls.h" +#include "components/esp-tls/esp_tls.h" +#include "components/log/include/esp_log.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/socketpool/SocketPool.c b/ports/esp32s2/common-hal/socketpool/SocketPool.c index 4a07f21c48..1d4d04b034 100644 --- a/ports/esp32s2/common-hal/socketpool/SocketPool.c +++ b/ports/esp32s2/common-hal/socketpool/SocketPool.c @@ -29,7 +29,7 @@ #include "py/runtime.h" #include "shared-bindings/wifi/__init__.h" -#include "esp-idf/components/lwip/lwip/src/include/lwip/netdb.h" +#include "components/lwip/lwip/src/include/lwip/netdb.h" #include "bindings/espidf/__init__.h" diff --git a/ports/esp32s2/common-hal/ssl/SSLContext.h b/ports/esp32s2/common-hal/ssl/SSLContext.h index 41d199f080..e359ac0de4 100644 --- a/ports/esp32s2/common-hal/ssl/SSLContext.h +++ b/ports/esp32s2/common-hal/ssl/SSLContext.h @@ -29,7 +29,7 @@ #include "py/obj.h" -#include "esp-idf/components/esp-tls/esp_tls.h" +#include "components/esp-tls/esp_tls.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/ssl/__init__.c b/ports/esp32s2/common-hal/ssl/__init__.c index a105e53624..8d386d0c3a 100644 --- a/ports/esp32s2/common-hal/ssl/__init__.c +++ b/ports/esp32s2/common-hal/ssl/__init__.c @@ -26,7 +26,7 @@ #include "shared-bindings/ssl/SSLContext.h" -#include "esp-idf/components/mbedtls/esp_crt_bundle/include/esp_crt_bundle.h" +#include "components/mbedtls/esp_crt_bundle/include/esp_crt_bundle.h" void common_hal_ssl_create_default_context(ssl_sslcontext_obj_t* self) { memset(&self->ssl_config, 0, sizeof(esp_tls_cfg_t)); diff --git a/ports/esp32s2/common-hal/wifi/Network.h b/ports/esp32s2/common-hal/wifi/Network.h index ab75fcafe5..9345bb4576 100644 --- a/ports/esp32s2/common-hal/wifi/Network.h +++ b/ports/esp32s2/common-hal/wifi/Network.h @@ -29,7 +29,7 @@ #include "py/obj.h" -#include "esp-idf/components/esp_wifi/include/esp_wifi_types.h" +#include "components/esp_wifi/include/esp_wifi_types.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index a0b8b6adc5..ac3e2ee4c9 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -35,8 +35,8 @@ #include "shared-bindings/wifi/ScannedNetworks.h" #include "shared-module/ipaddress/__init__.h" -#include "esp-idf/components/esp_wifi/include/esp_wifi.h" -#include "esp-idf/components/lwip/include/apps/ping/ping_sock.h" +#include "components/esp_wifi/include/esp_wifi.h" +#include "components/lwip/include/apps/ping/ping_sock.h" static void start_station(wifi_radio_obj_t *self) { if (self->sta_mode) { diff --git a/ports/esp32s2/common-hal/wifi/Radio.h b/ports/esp32s2/common-hal/wifi/Radio.h index 205aef1761..8679cbef1e 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.h +++ b/ports/esp32s2/common-hal/wifi/Radio.h @@ -29,7 +29,7 @@ #include "py/obj.h" -#include "esp-idf/components/esp_event/include/esp_event.h" +#include "components/esp_event/include/esp_event.h" #include "shared-bindings/wifi/ScannedNetworks.h" diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c index 507c6d1861..cc733308db 100644 --- a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c +++ b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c @@ -37,7 +37,7 @@ #include "shared-bindings/wifi/Radio.h" #include "shared-bindings/wifi/ScannedNetworks.h" -#include "esp-idf/components/esp_wifi/include/esp_wifi.h" +#include "components/esp_wifi/include/esp_wifi.h" static void wifi_scannednetworks_done(wifi_scannednetworks_obj_t *self) { self->done = true; diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.h b/ports/esp32s2/common-hal/wifi/ScannedNetworks.h index cd57e95f29..db0c2a1484 100644 --- a/ports/esp32s2/common-hal/wifi/ScannedNetworks.h +++ b/ports/esp32s2/common-hal/wifi/ScannedNetworks.h @@ -35,7 +35,8 @@ #include "FreeRTOS.h" #include "freertos/event_groups.h" -#include "esp-idf/components/esp_wifi/include/esp_wifi_types.h" +#include "components/esp_wifi/include/esp_wifi_types.h" +#include "components/log/include/esp_log.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index b9ea9da06f..5c8d2e9526 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -31,13 +31,14 @@ #include "py/runtime.h" -#include "esp-idf/components/esp_wifi/include/esp_wifi.h" +#include "components/esp_wifi/include/esp_wifi.h" -#include "esp-idf/components/heap/include/esp_heap_caps.h" +#include "components/heap/include/esp_heap_caps.h" wifi_radio_obj_t common_hal_wifi_radio_obj; -#include "esp_log.h" +#include "components/log/include/esp_log.h" + static const char* TAG = "wifi"; static void event_handler(void* arg, esp_event_base_t event_base, diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index de733cdab5..8bc19ba893 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit de733cdab556c5713c94ba95078f4024dd56fd87 +Subproject commit 8bc19ba893e5544d571a753d82b44a84799b94b1 diff --git a/ports/esp32s2/mphalport.c b/ports/esp32s2/mphalport.c index e1662a6ce2..9b4c4bc5eb 100644 --- a/ports/esp32s2/mphalport.c +++ b/ports/esp32s2/mphalport.c @@ -31,8 +31,8 @@ #include "py/mpstate.h" #include "py/gc.h" -#include "esp-idf/components/xtensa/include/esp_debug_helpers.h" -#include "esp-idf/components/esp_rom/include/esp32s2/rom/ets_sys.h" +#include "components/xtensa/include/esp_debug_helpers.h" +#include "components/esp_rom/include/esp32s2/rom/ets_sys.h" void mp_hal_delay_us(mp_uint_t delay) { ets_delay_us(delay); diff --git a/ports/esp32s2/peripherals/pins.h b/ports/esp32s2/peripherals/pins.h index 07d0b908ee..9776fbb78f 100644 --- a/ports/esp32s2/peripherals/pins.h +++ b/ports/esp32s2/peripherals/pins.h @@ -34,7 +34,7 @@ #include "esp32s2_peripherals_config.h" #include "esp-idf/config/sdkconfig.h" -#include "esp-idf/components/soc/include/hal/gpio_types.h" +#include "components/hal/include/hal/gpio_types.h" typedef struct { PIN_PREFIX_FIELDS diff --git a/ports/esp32s2/peripherals/rmt.c b/ports/esp32s2/peripherals/rmt.c index b7629dbd5c..2be5f06d81 100644 --- a/ports/esp32s2/peripherals/rmt.c +++ b/ports/esp32s2/peripherals/rmt.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "rmt.h" +#include "peripherals/rmt.h" #include "py/runtime.h" bool rmt_reserved_channels[RMT_CHANNEL_MAX]; diff --git a/ports/esp32s2/peripherals/rmt.h b/ports/esp32s2/peripherals/rmt.h index 01ed09907a..020f8dc3ee 100644 --- a/ports/esp32s2/peripherals/rmt.h +++ b/ports/esp32s2/peripherals/rmt.h @@ -28,7 +28,7 @@ #define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_RMT_H #include "py/mphal.h" -#include "driver/rmt.h" +#include "components/driver/include/driver/rmt.h" #include void esp32s2_peripherals_rmt_reset(void); diff --git a/ports/esp32s2/supervisor/internal_flash.c b/ports/esp32s2/supervisor/internal_flash.c index 4b216a095a..de69a49f94 100644 --- a/ports/esp32s2/supervisor/internal_flash.c +++ b/ports/esp32s2/supervisor/internal_flash.c @@ -37,7 +37,7 @@ #include "py/runtime.h" #include "lib/oofatfs/ff.h" -#include "esp-idf/components/spi_flash/include/esp_partition.h" +#include "components/spi_flash/include/esp_partition.h" #include "supervisor/usb.h" diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 3de63278dc..d2630617b9 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -46,8 +46,8 @@ #include "shared-bindings/rtc/__init__.h" #include "peripherals/rmt.h" -#include "esp-idf/components/heap/include/esp_heap_caps.h" -#include "esp-idf/components/soc/soc/esp32s2/include/soc/cache_memory.h" +#include "components/heap/include/esp_heap_caps.h" +#include "components/soc/soc/esp32s2/include/soc/cache_memory.h" #define HEAP_SIZE (48 * 1024) diff --git a/ports/esp32s2/supervisor/usb.c b/ports/esp32s2/supervisor/usb.c index 39eb8204ff..c91c2ec4b0 100644 --- a/ports/esp32s2/supervisor/usb.c +++ b/ports/esp32s2/supervisor/usb.c @@ -29,10 +29,10 @@ #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" -#include "esp-idf/components/soc/soc/esp32s2/include/soc/usb_periph.h" -#include "esp-idf/components/driver/include/driver/periph_ctrl.h" -#include "esp-idf/components/driver/include/driver/gpio.h" -#include "esp-idf/components/esp_rom/include/esp32s2/rom/gpio.h" +#include "components/soc/soc/esp32s2/include/soc/usb_periph.h" +#include "components/driver/include/driver/periph_ctrl.h" +#include "components/driver/include/driver/gpio.h" +#include "components/esp_rom/include/esp32s2/rom/gpio.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index e1b1e69672..de05b8eb4b 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -36,7 +36,6 @@ #include "py/runtime.h" #include "py/mperrno.h" -#include "esp_log.h" static const char* TAG = "socket binding"; //| class Socket: diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 0eeebd6911..9f56e8c7e8 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -37,7 +37,6 @@ #include "shared-bindings/socketpool/Socket.h" #include "shared-bindings/socketpool/SocketPool.h" -#include "esp_log.h" static const char* TAG = "socketpool binding"; //| class SocketPool: diff --git a/shared-bindings/wifi/ScannedNetworks.c b/shared-bindings/wifi/ScannedNetworks.c index c927d7282f..d04f0f92a3 100644 --- a/shared-bindings/wifi/ScannedNetworks.c +++ b/shared-bindings/wifi/ScannedNetworks.c @@ -32,7 +32,6 @@ #include "py/runtime.h" #include "shared-bindings/wifi/ScannedNetworks.h" -#include "esp_log.h" static const char *TAG = "cp iternext"; //| class ScannedNetworks: From e01e8dd6b9c886c091bdbe735f4a3f63a4fb6859 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 30 Sep 2020 16:36:13 -0400 Subject: [PATCH 03/73] Revert HAL refactor changes to avoid USB breaking changes past esp-idf dde6222cd --- ports/esp32s2/Makefile | 6 +++--- ports/esp32s2/common-hal/busio/I2C.h | 2 +- ports/esp32s2/common-hal/busio/SPI.h | 4 ++-- ports/esp32s2/common-hal/busio/UART.h | 2 +- ports/esp32s2/common-hal/digitalio/DigitalInOut.c | 2 +- ports/esp32s2/common-hal/microcontroller/Pin.c | 2 +- ports/esp32s2/esp-idf | 2 +- ports/esp32s2/peripherals/pins.h | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 49b9c6d2bd..700af9b196 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -263,7 +263,7 @@ menuconfig: $(BUILD)/esp-idf/config $(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h # Order here matters -ESP_IDF_COMPONENTS_LINK = freertos log hal esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls +ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls ESP_IDF_COMPONENTS_INCLUDE = driver freertos log soc @@ -275,11 +275,11 @@ ESP_IDF_WIFI_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_WIFI_COMPONENT MBEDTLS_COMPONENTS_LINK = crypto tls x509 MBEDTLS_COMPONENTS_LINK_EXPANDED = $(foreach component, $(MBEDTLS_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/mbedtls/mbedtls/library/libmbed$(component).a) -BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libxt_hal.a +BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libhal.a BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a librtc.a libsmartconfig.a libphy.a BINARY_BLOBS += $(addprefix esp-idf/components/esp_wifi/lib/esp32s2/, $(BINARY_WIFI_BLOBS)) -ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/soc/soc/esp32s2/libsoc_esp32s2.a esp-idf/components/xtensa/esp32s2/libxt_hal.a +ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/soc/soc/esp32s2/libsoc_esp32s2.a esp-idf/components/xtensa/esp32s2/libhal.a ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld $(BUILD)/esp-idf/esp-idf/esp32s2/ld/esp32s2.project.ld FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE) diff --git a/ports/esp32s2/common-hal/busio/I2C.h b/ports/esp32s2/common-hal/busio/I2C.h index c39d6d7448..1a989e30a4 100644 --- a/ports/esp32s2/common-hal/busio/I2C.h +++ b/ports/esp32s2/common-hal/busio/I2C.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "components/hal/include/hal/i2c_types.h" +#include "components/soc/include/hal/i2c_types.h" #include "FreeRTOS.h" #include "freertos/semphr.h" #include "py/obj.h" diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h index f6c1c344a1..d6203feae6 100644 --- a/ports/esp32s2/common-hal/busio/SPI.h +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -30,8 +30,8 @@ #include "common-hal/microcontroller/Pin.h" #include "components/driver/include/driver/spi_common_internal.h" -#include "components/hal/include/hal/spi_hal.h" -#include "components/hal/include/hal/spi_types.h" +#include "components/soc/include/hal/spi_hal.h" +#include "components/soc/include/hal/spi_types.h" #include "py/obj.h" typedef struct { diff --git a/ports/esp32s2/common-hal/busio/UART.h b/ports/esp32s2/common-hal/busio/UART.h index 1d7f135115..751fb2e002 100644 --- a/ports/esp32s2/common-hal/busio/UART.h +++ b/ports/esp32s2/common-hal/busio/UART.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "components/hal/include/hal/uart_types.h" +#include "components/soc/include/hal/uart_types.h" #include "py/obj.h" typedef struct { diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c index 2c7902616f..46c47a285f 100644 --- a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c +++ b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c @@ -30,7 +30,7 @@ #include "components/driver/include/driver/gpio.h" -#include "components/hal/include/hal/gpio_hal.h" +#include "components/soc/include/hal/gpio_hal.h" void common_hal_digitalio_digitalinout_never_reset( digitalio_digitalinout_obj_t *self) { diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 3c2611efeb..0f4669fe0d 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -32,7 +32,7 @@ #include "py/mphal.h" #include "components/driver/include/driver/gpio.h" -#include "components/hal/include/hal/gpio_hal.h" +#include "components/soc/include/hal/gpio_hal.h" #ifdef MICROPY_HW_NEOPIXEL bool neopixel_in_use; diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 8bc19ba893..dde6222cdc 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 8bc19ba893e5544d571a753d82b44a84799b94b1 +Subproject commit dde6222cdceca978b2588fbf0eb25b8255741fba diff --git a/ports/esp32s2/peripherals/pins.h b/ports/esp32s2/peripherals/pins.h index 9776fbb78f..0cf63a029a 100644 --- a/ports/esp32s2/peripherals/pins.h +++ b/ports/esp32s2/peripherals/pins.h @@ -34,7 +34,7 @@ #include "esp32s2_peripherals_config.h" #include "esp-idf/config/sdkconfig.h" -#include "components/hal/include/hal/gpio_types.h" +#include "components/soc/include/hal/gpio_types.h" typedef struct { PIN_PREFIX_FIELDS From 0bbd067a17eaf89ec5fdc87d18555edb4608f784 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 1 Oct 2020 13:06:48 -0400 Subject: [PATCH 04/73] Revert ADC calibration removal, complete merge --- ports/esp32s2/Makefile | 5 +---- ports/esp32s2/common-hal/analogio/AnalogIn.c | 18 +++++++----------- ports/esp32s2/common-hal/analogio/AnalogIn.h | 2 +- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 1289835059..f19c960f43 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -77,6 +77,7 @@ INC += -I../../supervisor/shared/usb INC += -isystem esp-idf INC += -isystem esp-idf/components/driver/include INC += -isystem esp-idf/components/hal/esp32s2/include +INC += -isystem esp-idf/components/driver/esp32s2/include INC += -isystem esp-idf/components/hal/include INC += -isystem esp-idf/components/freertos/include/freertos @@ -97,10 +98,6 @@ INC += -isystem esp-idf/components/newlib/platform_include INC += -isystem esp-idf/components/lwip/lwip/src/include INC += -isystem esp-idf/components/lwip/port/esp32/include INC += -isystem esp-idf/components/lwip/include/apps/sntp -<<<<<<< HEAD -======= -INC += -isystem esp-idf/components/hal/include ->>>>>>> esp32-update-idf INC += -isystem esp-idf/components/soc/include INC += -isystem esp-idf/components/soc/src/esp32s2/include INC += -isystem esp-idf/components/soc/soc/include diff --git a/ports/esp32s2/common-hal/analogio/AnalogIn.c b/ports/esp32s2/common-hal/analogio/AnalogIn.c index 1a15fc77cd..d8acc5728c 100644 --- a/ports/esp32s2/common-hal/analogio/AnalogIn.c +++ b/ports/esp32s2/common-hal/analogio/AnalogIn.c @@ -29,9 +29,9 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -#include "driver/adc.h" -// TODO: Add when ESP-IDF is updated latest version -// #include "esp-idf/components/esp_adc_cal/include/esp_adc_cal.h" +#include "components/driver/include/driver/adc_common.h" + +#include "components/esp_adc_cal/include/esp_adc_cal.h" #include "shared-bindings/microcontroller/Pin.h" @@ -69,10 +69,9 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { adc2_config_channel_atten((adc2_channel_t)self->pin->adc_channel, ATTENUATION); } - // TODO: esp_adc_cal is only available in the latest version of the esp-idf. Enable when we update. // Automatically select calibration process depending on status of efuse - // esp_adc_cal_characteristics_t *adc_chars = calloc(1, sizeof(esp_adc_cal_characteristics_t)); - // esp_adc_cal_characterize(self->pin->adc_index, ATTENUATION, DATA_WIDTH, DEFAULT_VREF, adc_chars); + esp_adc_cal_characteristics_t *adc_chars = calloc(1, sizeof(esp_adc_cal_characteristics_t)); + esp_adc_cal_characterize(self->pin->adc_index, ATTENUATION, DATA_WIDTH, DEFAULT_VREF, adc_chars); uint32_t adc_reading = 0; //Multisampling @@ -91,11 +90,8 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { adc_reading /= NO_OF_SAMPLES; // This corrects non-linear regions of the ADC range with a LUT, so it's a better reading than raw - // Enable when ESP-IDF is updated - //uint32_t voltage = esp_adc_cal_raw_to_voltage(adc_reading, adc_chars); - //return voltage * ((1 << 16) - 1)/3300; - - return adc_reading; + uint32_t voltage = esp_adc_cal_raw_to_voltage(adc_reading, adc_chars); + return voltage * ((1 << 16) - 1)/3300; } float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { diff --git a/ports/esp32s2/common-hal/analogio/AnalogIn.h b/ports/esp32s2/common-hal/analogio/AnalogIn.h index 5ea4a913de..548cbb5cc0 100644 --- a/ports/esp32s2/common-hal/analogio/AnalogIn.h +++ b/ports/esp32s2/common-hal/analogio/AnalogIn.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "esp-idf/components/soc/include/hal/adc_types.h" +#include "components/soc/include/hal/adc_types.h" #include "FreeRTOS.h" #include "freertos/semphr.h" #include "py/obj.h" From 9a3bd82f40784c53f39d3fb806476c6fd2083da6 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 1 Oct 2020 13:19:54 -0400 Subject: [PATCH 05/73] Update TinyUSB include compatibility --- ports/esp32s2/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 700af9b196..04b3e43467 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -76,9 +76,6 @@ INC += -I../../supervisor/shared/usb INC += -isystem esp-idf INC += -isystem esp-idf/components/driver/include -INC += -isystem esp-idf/components/hal/esp32s2/include -INC += -isystem esp-idf/components/hal/include - INC += -isystem esp-idf/components/freertos/include/freertos INC += -isystem esp-idf/components/freertos/xtensa/include INC += -isystem esp-idf/components/esp32s2/include @@ -98,6 +95,8 @@ INC += -isystem esp-idf/components/lwip/lwip/src/include INC += -isystem esp-idf/components/lwip/port/esp32/include INC += -isystem esp-idf/components/lwip/include/apps/sntp INC += -isystem esp-idf/components/hal/include +INC += -isystem esp-idf/components/hal/esp32s2/include +INC += -isystem esp-idf/components/log/include/ INC += -isystem esp-idf/components/soc/include INC += -isystem esp-idf/components/soc/src/esp32s2/include INC += -isystem esp-idf/components/soc/soc/include From 23cd9fcdadcdd950efad7d99a977a42808199f81 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Thu, 1 Oct 2020 23:18:24 +0000 Subject: [PATCH 06/73] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (829 of 829 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 68dd2df7e1..e2ca8e9ab0 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-09-29 20:14-0500\n" -"PO-Revision-Date: 2020-10-01 14:20+0000\n" +"PO-Revision-Date: 2020-10-02 22:53+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1717,7 +1717,7 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" -msgstr "" +msgstr "O comprimento dos rgb_pins devem ser 6, 12, 18, 24, ou 30" #: supervisor/shared/safe_mode.c msgid "" @@ -3618,7 +3618,7 @@ msgstr "o tempo limite do watchdog deve ser maior que 0" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" -msgstr "" +msgstr "a largura deve ser maior que zero" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" From cdf18885eecb8d75f71f39959b496ae8b2b021ca Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Fri, 2 Oct 2020 11:32:23 +0000 Subject: [PATCH 07/73] Translated using Weblate (Swedish) Currently translated at 100.0% (829 of 829 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 0b958e7a4e..de4c592958 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-09-29 20:14-0500\n" -"PO-Revision-Date: 2020-10-01 21:24+0000\n" +"PO-Revision-Date: 2020-10-02 22:53+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -1702,7 +1702,7 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" -msgstr "" +msgstr "Längden på rgb_pins vara 6, 12, 18, 24 eller 30" #: supervisor/shared/safe_mode.c msgid "" @@ -3585,7 +3585,7 @@ msgstr "watchdog timeout måste vara större än 0" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" -msgstr "" +msgstr "width måste vara större än noll" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" From 1cdc91dce69d1ec15d2e6b7a1a397d5a5cb41fa9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 3 Oct 2020 13:21:58 -0500 Subject: [PATCH 08/73] Update protomatter This brings in the following, and updates us to the 1.0.4 release tag: Submodule lib/protomatter 2a1ba8fa4..5f07ec618: > Bumping version for release > Merge pull request #21 from makermelissa/master > Merge pull request #20 from makermelissa/master > Merge pull request #18 from jepler/fix-cpy-3184 > Merge pull request #14 from hierophect/cpy-timer-allocator We previously had the _changes_ of jepler/fix-cpy-3184 and hierophect/cpy-timer-allocator but not their merge commits. The only other changes in protomatter were one formatting change in the core, plus several Arduino sketches. So this should make no practical difference for CPy. --- lib/protomatter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protomatter b/lib/protomatter index 2a1ba8fa47..5f07ec6188 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 2a1ba8fa4753b2bcb158c9b17351cf18eade0d2b +Subproject commit 5f07ec6188852794a94138763e612844842f13e4 From 8e3ec3d5201d67a6fd06cf92fef380bf4a155186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Sun, 4 Oct 2020 11:25:48 +0000 Subject: [PATCH 09/73] Translated using Weblate (Korean) Currently translated at 9.4% (78 of 829 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ko/ --- locale/ko.po | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/locale/ko.po b/locale/ko.po index 0c87677e66..e2bf7a372d 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -7,13 +7,15 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2019-05-06 14:22-0700\n" -"Last-Translator: \n" +"PO-Revision-Date: 2020-10-05 12:12+0000\n" +"Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" "Language: ko\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" #: main.c msgid "" @@ -156,7 +158,7 @@ msgstr "'%s' 에는 라벨이 필요합니다" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a register" -msgstr "'%s%' 에는 레지스터가 필요합니다" +msgstr "'%s' 에는 레지스터가 필요합니다" #: py/emitinlinethumb.c #, c-format From 0467a828808f15cc5f0e502667f61e4a448450df Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 5 Oct 2020 12:58:42 -0400 Subject: [PATCH 10/73] Fix/remove various style issues --- locale/circuitpython.pot | 2 +- ports/esp32s2/common-hal/analogio/AnalogIn.h | 8 -------- ports/esp32s2/common-hal/analogio/AnalogOut.c | 3 +-- ports/esp32s2/common-hal/analogio/AnalogOut.h | 4 ++-- ports/esp32s2/mpconfigport.mk | 1 - 5 files changed, 4 insertions(+), 14 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index d0bbe6707f..1960a36946 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-01 17:17-0400\n" +"POT-Creation-Date: 2020-10-05 12:59-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/ports/esp32s2/common-hal/analogio/AnalogIn.h b/ports/esp32s2/common-hal/analogio/AnalogIn.h index 548cbb5cc0..b9c4866f29 100644 --- a/ports/esp32s2/common-hal/analogio/AnalogIn.h +++ b/ports/esp32s2/common-hal/analogio/AnalogIn.h @@ -39,12 +39,4 @@ typedef struct { const mcu_pin_obj_t * pin; } analogio_analogin_obj_t; -static inline uint8_t stm32_adc_units(uint8_t adc_packed) { - return adc_packed >> 5; -} - -static inline uint8_t stm32_adc_channel(uint8_t adc_packed) { - return adc_packed & 0x1f; -} - #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGIN_H diff --git a/ports/esp32s2/common-hal/analogio/AnalogOut.c b/ports/esp32s2/common-hal/analogio/AnalogOut.c index d67dc6083f..b23c405142 100644 --- a/ports/esp32s2/common-hal/analogio/AnalogOut.c +++ b/ports/esp32s2/common-hal/analogio/AnalogOut.c @@ -39,7 +39,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, const mcu_pin_obj_t *pin) { - //mp_raise_ValueError(translate("No DAC on chip")); + mp_raise_NotImplementedError(translate("No DAC on chip")); } bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { @@ -52,7 +52,6 @@ void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self, uint16_t value) { - } void analogout_reset(void) { diff --git a/ports/esp32s2/common-hal/analogio/AnalogOut.h b/ports/esp32s2/common-hal/analogio/AnalogOut.h index d5f29ffd74..a8cbc39d5f 100644 --- a/ports/esp32s2/common-hal/analogio/AnalogOut.h +++ b/ports/esp32s2/common-hal/analogio/AnalogOut.h @@ -25,8 +25,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGOUT_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGOUT_H #include "common-hal/microcontroller/Pin.h" diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index d68fe469dc..4e8a7bdef2 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -13,7 +13,6 @@ USB_SERIAL_NUMBER_LENGTH = 12 LONGINT_IMPL = MPZ # These modules are implemented in ports//common-hal: -# CIRCUITPY_ANALOGIO = 0 CIRCUITPY_FULL_BUILD = 1 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 From 5c00ba8592fd0b9eba9e5c795630638a79fc4044 Mon Sep 17 00:00:00 2001 From: Seon Rozenblum Date: Fri, 2 Oct 2020 19:25:04 +1000 Subject: [PATCH 11/73] Removed hardware APA settings from mpconfigboard.h because they make the APA flicker on boot. I need to look into why, but I don't think they are being used for anything right now anyway. --- .../esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h | 4 ++-- .../unexpectedmaker_feathers2_prerelease/mpconfigboard.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h index a77de15116..5a885f29ce 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h @@ -35,5 +35,5 @@ #define AUTORESET_DELAY_MS 500 -#define MICROPY_HW_APA102_MOSI (&pin_GPIO40) -#define MICROPY_HW_APA102_SCK (&pin_GPIO45) +// #define MICROPY_HW_APA102_MOSI (&pin_GPIO40) +// #define MICROPY_HW_APA102_SCK (&pin_GPIO45) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h index ee97d62c63..90a368006a 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h @@ -34,5 +34,5 @@ #define AUTORESET_DELAY_MS 500 -#define MICROPY_HW_APA102_MOSI (&pin_GPIO40) -#define MICROPY_HW_APA102_SCK (&pin_GPIO45) +// #define MICROPY_HW_APA102_MOSI (&pin_GPIO40) +// #define MICROPY_HW_APA102_SCK (&pin_GPIO45) From 0d7552b67eac91500db5e5ba25607df8bd3e16e5 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 6 Oct 2020 12:48:28 -0400 Subject: [PATCH 12/73] Update ESP-IDF to newer fixed fork --- .gitmodules | 2 +- ports/esp32s2/esp-idf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index f66ce8aafa..b1ae2276ca 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/hierophect/esp-idf.git diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index dde6222cdc..a7f7779881 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit dde6222cdceca978b2588fbf0eb25b8255741fba +Subproject commit a7f77798816661f7c4ae198f3878bc92a9274f82 From 68cb384f8faed451c3e31a83ae087646b0c0a9f6 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 6 Oct 2020 13:29:12 -0400 Subject: [PATCH 13/73] Remove logging from shared-bindings, fix translations, revert config target macro --- locale/circuitpython.pot | 14 +++++++++----- ports/esp32s2/common-hal/socketpool/Socket.h | 1 - ports/esp32s2/common-hal/wifi/ScannedNetworks.h | 1 - ports/esp32s2/mpconfigport.h | 3 --- shared-bindings/socketpool/Socket.c | 3 --- shared-bindings/socketpool/SocketPool.c | 3 --- shared-bindings/wifi/ScannedNetworks.c | 3 --- 7 files changed, 9 insertions(+), 19 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 62e1fbb102..199f39c589 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-05 12:59-0400\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -271,6 +271,10 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1225,6 +1229,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -1421,6 +1426,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -1482,10 +1488,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -3148,6 +3150,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3155,6 +3158,7 @@ msgstr "" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "" diff --git a/ports/esp32s2/common-hal/socketpool/Socket.h b/ports/esp32s2/common-hal/socketpool/Socket.h index de63c8ab2c..62b5ded58e 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.h +++ b/ports/esp32s2/common-hal/socketpool/Socket.h @@ -33,7 +33,6 @@ #include "common-hal/ssl/SSLContext.h" #include "components/esp-tls/esp_tls.h" -#include "components/log/include/esp_log.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.h b/ports/esp32s2/common-hal/wifi/ScannedNetworks.h index db0c2a1484..36da387f21 100644 --- a/ports/esp32s2/common-hal/wifi/ScannedNetworks.h +++ b/ports/esp32s2/common-hal/wifi/ScannedNetworks.h @@ -36,7 +36,6 @@ #include "freertos/event_groups.h" #include "components/esp_wifi/include/esp_wifi_types.h" -#include "components/log/include/esp_log.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/mpconfigport.h b/ports/esp32s2/mpconfigport.h index 066d0fd2cf..cec8dd35df 100644 --- a/ports/esp32s2/mpconfigport.h +++ b/ports/esp32s2/mpconfigport.h @@ -36,9 +36,6 @@ #include "py/circuitpy_mpconfig.h" -// ESP-IDF leaves this undefined but uses it everywhere. -// Defining it will reduce chance of undef errors. -#define CONFIG_IDF_TARGET_ESP32 (0) #define MICROPY_PORT_ROOT_POINTERS \ CIRCUITPY_COMMON_ROOT_POINTERS diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index de05b8eb4b..b0af57a5d3 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -36,8 +36,6 @@ #include "py/runtime.h" #include "py/mperrno.h" -static const char* TAG = "socket binding"; - //| class Socket: //| """TCP, UDP and RAW socket. Cannot be created directly. Instead, call //| `SocketPool.socket()`. @@ -182,7 +180,6 @@ STATIC mp_obj_t socketpool_socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { bool ok = common_hal_socketpool_socket_connect(self, host, hostlen, port); if (!ok) { - ESP_EARLY_LOGW(TAG, "socket connect failed"); mp_raise_OSError(0); } diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 9f56e8c7e8..527cf7e984 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -37,8 +37,6 @@ #include "shared-bindings/socketpool/Socket.h" #include "shared-bindings/socketpool/SocketPool.h" -static const char* TAG = "socketpool binding"; - //| class SocketPool: //| """A pool of socket resources available for the given radio. Only one //| SocketPool can be created for each radio. @@ -121,7 +119,6 @@ STATIC mp_obj_t socketpool_socketpool_getaddrinfo(size_t n_args, const mp_obj_t } if (ip_str == mp_const_none) { - ESP_EARLY_LOGW(TAG, "no ip str"); mp_raise_OSError(0); } diff --git a/shared-bindings/wifi/ScannedNetworks.c b/shared-bindings/wifi/ScannedNetworks.c index d04f0f92a3..9316faa45b 100644 --- a/shared-bindings/wifi/ScannedNetworks.c +++ b/shared-bindings/wifi/ScannedNetworks.c @@ -32,8 +32,6 @@ #include "py/runtime.h" #include "shared-bindings/wifi/ScannedNetworks.h" -static const char *TAG = "cp iternext"; - //| class ScannedNetworks: //| """Iterates over all `wifi.Network` objects found while scanning. This object is always created //| by a `wifi.Radio`: it has no user-visible constructor.""" @@ -46,7 +44,6 @@ STATIC mp_obj_t scannednetworks_iternext(mp_obj_t self_in) { return network; } - ESP_EARLY_LOGI(TAG, "stop iteration"); return MP_OBJ_STOP_ITERATION; } From d5c8e557691f307871aabdf7d10f49768c43b4f9 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 6 Oct 2020 15:00:26 -0400 Subject: [PATCH 14/73] Add AnalogIO --- ports/esp32s2/common-hal/analogio/AnalogOut.c | 22 +++++++++++++++---- ports/esp32s2/common-hal/analogio/AnalogOut.h | 1 - ports/esp32s2/supervisor/port.c | 5 +++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ports/esp32s2/common-hal/analogio/AnalogOut.c b/ports/esp32s2/common-hal/analogio/AnalogOut.c index b23c405142..a85a171837 100644 --- a/ports/esp32s2/common-hal/analogio/AnalogOut.c +++ b/ports/esp32s2/common-hal/analogio/AnalogOut.c @@ -35,25 +35,39 @@ #include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/translate.h" +#include "components/driver/include/driver/dac.h" + #include "common-hal/microcontroller/Pin.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, const mcu_pin_obj_t *pin) { - mp_raise_NotImplementedError(translate("No DAC on chip")); + if (pin == &pin_GPIO17) { + self->channel = DAC_CHANNEL_1; + } else if (pin == &pin_GPIO18) { + self->channel = DAC_CHANNEL_2; + } else { + mp_raise_ValueError(translate("Invalid DAC pin supplied")); + } + dac_output_enable(self->channel); } bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { - return true; + return (self->channel == DAC_CHANNEL_MAX); } void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { - + dac_output_disable(self->channel); + self->channel = DAC_CHANNEL_MAX; } void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self, uint16_t value) { + uint8_t dac_value = (value * 255) / 65535; + dac_output_enable(self->channel); + dac_output_voltage(self->channel, dac_value); } void analogout_reset(void) { - + dac_output_disable(DAC_CHANNEL_1); + dac_output_disable(DAC_CHANNEL_2); } diff --git a/ports/esp32s2/common-hal/analogio/AnalogOut.h b/ports/esp32s2/common-hal/analogio/AnalogOut.h index a8cbc39d5f..6285151ba0 100644 --- a/ports/esp32s2/common-hal/analogio/AnalogOut.h +++ b/ports/esp32s2/common-hal/analogio/AnalogOut.h @@ -36,7 +36,6 @@ typedef struct { mp_obj_base_t base; const mcu_pin_obj_t * pin; uint8_t channel; - uint8_t dac_index:1; } analogio_analogout_obj_t; void analogout_reset(void); diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 4290b9bb4a..0b9c03f747 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -35,6 +35,7 @@ #include "freertos/task.h" #include "common-hal/microcontroller/Pin.h" +#include "common-hal/analogio/AnalogOut.h" #include "common-hal/busio/I2C.h" #include "common-hal/busio/SPI.h" #include "common-hal/busio/UART.h" @@ -95,6 +96,10 @@ void reset_port(void) { // A larger delay so the idle task can run and do any IDF cleanup needed. vTaskDelay(4); +#if CIRCUITPY_ANALOGIO + analogout_reset(); +#endif + #if CIRCUITPY_PULSEIO esp32s2_peripherals_rmt_reset(); pulsein_reset(); From 01e9e355cefe53edcbd6662e98d926c248fc5b95 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 24 Sep 2020 11:19:46 -0500 Subject: [PATCH 15/73] canio: implement for stm32f405 The has successfully run my loopback self-test program for CAN, which tests transmission, reception, and filtering. The 1M baud rate setting was also verified on saleae to be accurate. --- ports/stm/Makefile | 4 + .../mpconfigboard.mk | 2 + .../boards/feather_stm32f405_express/pins.c | 3 + ports/stm/common-hal/canio/CAN.c | 279 ++++++++++++++++ ports/stm/common-hal/canio/CAN.h | 60 ++++ ports/stm/common-hal/canio/Listener.c | 314 ++++++++++++++++++ ports/stm/common-hal/canio/Listener.h | 47 +++ ports/stm/common-hal/canio/__init__.c | 25 ++ ports/stm/common-hal/canio/__init__.h | 27 ++ ports/stm/hal_conf/stm32_hal_conf.h | 2 +- .../peripherals/stm32f4/stm32f405xx/periph.c | 23 ++ .../peripherals/stm32f4/stm32f405xx/periph.h | 6 + 12 files changed, 791 insertions(+), 1 deletion(-) create mode 100644 ports/stm/common-hal/canio/CAN.c create mode 100644 ports/stm/common-hal/canio/CAN.h create mode 100644 ports/stm/common-hal/canio/Listener.c create mode 100644 ports/stm/common-hal/canio/Listener.h create mode 100644 ports/stm/common-hal/canio/__init__.c create mode 100644 ports/stm/common-hal/canio/__init__.h diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 9e1d10b998..b9426e07ec 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -198,6 +198,10 @@ SRC_STM32 = $(addprefix $(HAL_DIR)/Src/stm32$(MCU_SERIES_LOWER)xx_,\ ll_utils.c \ ) +ifeq ($(CIRCUITPY_CANIO),1) +SRC_STM32 += $(HAL_DIR)/Src/stm32$(MCU_SERIES_LOWER)xx_hal_can.c +endif + # Need this to avoid UART linker problems. TODO: rewrite to use registered callbacks. # Does not exist for F4 and lower ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32F765xx STM32F767xx STM32F769xx STM32H743xx)) diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk index 4d0bd4598d..0866223841 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -16,3 +16,5 @@ LD_DEFAULT = boards/STM32F405_default.ld # UF2 boot option LD_BOOT = boards/STM32F405_boot.ld UF2_OFFSET = 0x8010000 + +CIRCUITPY_CANIO = 1 diff --git a/ports/stm/boards/feather_stm32f405_express/pins.c b/ports/stm/boards/feather_stm32f405_express/pins.c index 571076c339..e20ad50281 100644 --- a/ports/stm/boards/feather_stm32f405_express/pins.c +++ b/ports/stm/boards/feather_stm32f405_express/pins.c @@ -47,5 +47,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SDIO_CLOCK), MP_ROM_PTR(&pin_PC12) }, { MP_ROM_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_PD02) }, { MP_ROM_QSTR(MP_QSTR_SDIO_DATA), MP_ROM_PTR(&sdio_data_tuple) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_PB09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_PB08) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c new file mode 100644 index 0000000000..0edf1217e3 --- /dev/null +++ b/ports/stm/common-hal/canio/CAN.c @@ -0,0 +1,279 @@ +/* + * 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 "peripherals/periph.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/util.h" +#include "supervisor/port.h" + +STATIC bool reserved_can[MP_ARRAY_SIZE(mcu_can_banks)]; + +STATIC const mcu_periph_obj_t *find_pin_function(const mcu_periph_obj_t *table, size_t sz, const mcu_pin_obj_t *pin, int periph_index) { + for(size_t i = 0; iperiph_index) { + continue; + } + if (pin == table->pin) { + return table; + } + } + return NULL; +} + + +__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)) + + const uint8_t can_tx_len = MP_ARRAY_SIZE(mcu_can_tx_list); + const uint8_t can_rx_len = MP_ARRAY_SIZE(mcu_can_rx_list); + + const mcu_periph_obj_t *mcu_tx = find_pin_function(mcu_can_tx_list, can_tx_len, tx, -1); + if (!mcu_tx) { + mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_tx); + } + int periph_index = mcu_tx->periph_index; + + const mcu_periph_obj_t *mcu_rx = find_pin_function(mcu_can_rx_list, can_rx_len, rx, periph_index); + if (!mcu_rx) { + mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_rx); + } + + if (reserved_can[periph_index]) { + mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + } + + const uint32_t can_frequency = 42000000; + uint32_t clocks_per_bit = DIV_ROUND(can_frequency, baudrate); + uint32_t clocks_to_sample = DIV_ROUND(clocks_per_bit * 7, 8); + uint32_t clocks_after_sample = clocks_per_bit - clocks_to_sample; + uint32_t divisor = MAX(DIV_ROUND_UP(clocks_to_sample, 16), DIV_ROUND_UP(clocks_after_sample, 8)); + const uint32_t sjw = 3; + + uint32_t tq_per_bit = DIV_ROUND(clocks_per_bit, divisor); + uint32_t tq_to_sample = DIV_ROUND(clocks_to_sample, divisor); + uint32_t tq_after_sample = tq_per_bit - tq_to_sample; + + if (divisor > 1023) { + mp_raise_OSError(MP_EINVAL); // baudrate cannot be attained (16kHz or something is lower bound, should never happen) + } + + { + GPIO_InitTypeDef GPIO_InitStruct = { + .Pin = pin_mask(tx->number), + .Speed = GPIO_SPEED_FREQ_VERY_HIGH, + .Mode = GPIO_MODE_AF_PP, + .Pull = GPIO_PULLUP, + .Alternate = mcu_tx->altfn_index, + }; + HAL_GPIO_Init(pin_port(tx->port), &GPIO_InitStruct); + + GPIO_InitStruct.Pin = pin_mask(rx->number); + GPIO_InitStruct.Alternate = mcu_rx->altfn_index; + HAL_GPIO_Init(pin_port(rx->port), &GPIO_InitStruct); + } + + CAN_TypeDef *hw = mcu_can_banks[periph_index - 1]; + + // CAN2 shares resources with CAN1. So we always enable CAN1, then split + // the filter banks equally between them. + + __HAL_RCC_CAN1_CLK_ENABLE(); + + if(hw == CAN2) { + __HAL_RCC_CAN2_CLK_ENABLE(); + self->start_filter_bank = 14; + self->end_filter_bank = 28; + self->filter_hw = CAN1; + } else { + self->start_filter_bank = 0; + self->end_filter_bank = 14; + self->filter_hw = hw; + } + + CAN_InitTypeDef init = { + .AutoRetransmission = ENABLE, + .AutoBusOff = ENABLE, + .Prescaler = divisor, + .Mode = (loopback ? CAN_MODE_LOOPBACK : 0) | (silent ? CAN_MODE_SILENT_LOOPBACK : 0), + .SyncJumpWidth = (sjw-1) << CAN_BTR_SJW_Pos, + .TimeSeg1 = (tq_to_sample-2) << CAN_BTR_TS1_Pos, + .TimeSeg2 = (tq_after_sample-1) << CAN_BTR_TS2_Pos, + }; + + self->periph_index = periph_index; + self->silent = silent; + self->loopback = loopback; + self->baudrate = baudrate; + + self->handle.Instance = hw; + self->handle.Init = init; + self->handle.State = HAL_CAN_STATE_RESET; + + HAL_CAN_Init(&self->handle); + + // Set the filter split as 14:14 + // COULDDO(@jepler): Dynamically allocate filter banks between CAN1/2 + self->filter_hw->FMR |= CAN_FMR_FINIT; + self->filter_hw->FMR = CAN_FMR_FINIT | (14 << CAN_FMR_CAN2SB_Pos); + + // Clear every filter enable bit for this can HW + uint32_t fa1r = self->filter_hw->FA1R; + for (int i = self->start_filter_bank; iend_filter_bank; i++) { + fa1r &= ~(1 << i); + } + self->filter_hw->FA1R = fa1r; + CLEAR_BIT(self->filter_hw->FMR, CAN_FMR_FINIT); + + HAL_CAN_Start(&self->handle); + + reserved_can[periph_index] = 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) +{ + return (self->handle.Instance->ESR & CAN_ESR_TEC) >> CAN_ESR_TEC_Pos; +} + +int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self) +{ + return (self->handle.Instance->ESR & CAN_ESR_REC) >> CAN_ESR_REC_Pos; +} + +int common_hal_canio_can_error_warning_state_count_get(canio_can_obj_t *self) +{ + return self->error_warning_state_count; +} + +int common_hal_canio_can_error_passive_state_count_get(canio_can_obj_t *self) +{ + return self->error_passive_state_count; +} + +int common_hal_canio_can_bus_off_state_count_get(canio_can_obj_t *self) +{ + return self->bus_off_state_count; +} + +canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self) { + uint32_t esr = self->handle.Instance->ESR; + if (READ_BIT(esr, CAN_ESR_BOFF)) { + return BUS_STATE_OFF; + } + if (READ_BIT(esr, CAN_ESR_EPVF)) { + return BUS_STATE_ERROR_PASSIVE; + } + if (READ_BIT(esr, CAN_ESR_EWGF)) { + return BUS_STATE_ERROR_WARNING; + } + return BUS_STATE_ERROR_ACTIVE; +} + +void common_hal_canio_can_restart(canio_can_obj_t *self) { + if (!common_hal_canio_can_auto_restart_get(self)) { + HAL_CAN_Start(&self->handle); + } +} + +bool common_hal_canio_can_auto_restart_get(canio_can_obj_t *self) { + return READ_BIT(self->handle.Instance->MCR, CAN_MCR_ABOM); +} + +void common_hal_canio_can_auto_restart_set(canio_can_obj_t *self, bool value) { + if(value) { + SET_BIT(self->handle.Instance->MCR, CAN_MCR_ABOM); + } else { + CLEAR_BIT(self->handle.Instance->MCR, CAN_MCR_ABOM); + } +} + +void common_hal_canio_can_send(canio_can_obj_t *self, mp_obj_t message_in) +{ + canio_message_obj_t *message = message_in; + uint32_t mailbox; + bool rtr = message->base.type == &canio_remote_transmission_request_type; + CAN_TxHeaderTypeDef header = { + .StdId = message->id, + .ExtId = message->id, + .IDE = message->extended ? CAN_ID_EXT : CAN_ID_STD, + .RTR = rtr ? CAN_RTR_REMOTE : CAN_RTR_DATA, + .DLC = message->size, + }; + HAL_StatusTypeDef status = HAL_CAN_AddTxMessage(&self->handle, &header, message->data, &mailbox); + if (status != HAL_OK) { + mp_raise_OSError(MP_ENOMEM); + } +} + +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->handle.Instance; +} + +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->handle.Instance) { + SET_BIT(self->handle.Instance->MCR, CAN_MCR_RESET); + while (READ_BIT(self->handle.Instance->MCR, CAN_MCR_RESET)) { + } + reserved_can[self->periph_index] = 0; + } + self->handle.Instance = NULL; +} + +void common_hal_canio_reset(void) { + for (size_t i=0; iMCR, CAN_MCR_RESET); + reserved_can[i] = 0; + } +} diff --git a/ports/stm/common-hal/canio/CAN.h b/ports/stm/common-hal/canio/CAN.h new file mode 100644 index 0000000000..bffc0f65f0 --- /dev/null +++ b/ports/stm/common-hal/canio/CAN.h @@ -0,0 +1,60 @@ +/* + * 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 "stm32f4xx_hal.h" +#include "stm32f4xx_hal_can.h" + +#define FILTER_BANK_COUNT (28) + +typedef struct canio_can_obj { + mp_obj_base_t base; + CAN_HandleTypeDef handle; + CAN_TypeDef *filter_hw; + volatile uint32_t error_warning_state_count; + volatile uint32_t error_passive_state_count; + volatile uint32_t bus_off_state_count; + 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 fifo0_in_use:1; + bool fifo1_in_use:1; + uint8_t periph_index:2; + uint8_t start_filter_bank; + uint8_t end_filter_bank; + long filter_in_use; // bitmask for the 28 filter banks +} canio_can_obj_t; diff --git a/ports/stm/common-hal/canio/Listener.c b/ports/stm/common-hal/canio/Listener.c new file mode 100644 index 0000000000..dd968979d2 --- /dev/null +++ b/ports/stm/common-hal/canio/Listener.c @@ -0,0 +1,314 @@ +/* + * 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/util.h" +#include "supervisor/shared/tick.h" +#include "supervisor/shared/safe_mode.h" + +STATIC void allow_filter_change(canio_can_obj_t *can) { + can->filter_hw->FMR |= CAN_FMR_FINIT; +} + +STATIC void prevent_filter_change(canio_can_obj_t *can) { + can->filter_hw->FMR &= ~CAN_FMR_FINIT; +} + +STATIC bool filter_in_use(canio_can_obj_t *can, int idx) { + return can->filter_hw->FA1R & (1<extended) { + num_extended_mask += 1; + } else { + num_standard_mask += 1; + } + } + return num_extended_mask + num_standard_mask/2; +} + +STATIC size_t num_filters_available(canio_can_obj_t *can) { + size_t available = 0; + for(size_t i = can->start_filter_bank; i < can->end_filter_bank; i++) { + if (!filter_in_use(can, i)) { + available++; + } + } + return available; +} + +STATIC void clear_filters(canio_listener_obj_t *self) { + canio_can_obj_t *can = self->can; + + allow_filter_change(can); + uint32_t fa1r = can->filter_hw->FA1R; + for(size_t i = can->start_filter_bank; i < can->end_filter_bank; i++) { + if (((can->filter_hw->FFA1R >> i) & 1) == self->fifo_idx) { + fa1r &= ~(1<filter_hw->FA1R = fa1r; + prevent_filter_change(can); +} + +STATIC int next_filter(canio_can_obj_t *can) { + uint32_t fa1r = can->filter_hw->FA1R; + for(size_t i = can->start_filter_bank; i < can->end_filter_bank; i++) { + if (!(fa1r & (1<can); + + // filter is already deactivated, so we skip deactivating it here + // CLEAR_BIT(self->can->filter_hw->FA1R, bank); + + self->can->filter_hw->sFilterRegister[bank].FR1 = + (((match1->id & 0x7ff) << 5)) | + (((match1->mask & 0x7ff) << 5 | FILTER16_IDE)) << 16; + self->can->filter_hw->sFilterRegister[bank].FR2 = + (((match2->id & 0x7ff) << 5)) | + (((match2->mask & 0x7ff) << 5 | FILTER16_IDE)) << 16; + + // filter mode: 0 = mask + // (this bit should be clear already, we never set it; but just in case) + CLEAR_BIT(self->can->filter_hw->FM1R, 1 << bank); + // filter scale: 0 = 16 bits + CLEAR_BIT(self->can->filter_hw->FS1R, 1 << bank); + // fifo assignment: 1 = FIFO 1 + if (self->fifo_idx) { + SET_BIT(self->can->filter_hw->FFA1R, 1 << bank); + } else { + CLEAR_BIT(self->can->filter_hw->FFA1R, 1 << bank); + } + + // filter activation: 1 = enabled + SET_BIT(self->can->filter_hw->FA1R, 1 << bank); +} + +STATIC void install_extended_filter(canio_listener_obj_t *self, canio_match_obj_t *match) { + int bank = next_filter(self->can); + + // filter is already deactivated, so we skip deactivating it here + // CLEAR_BIT(self->can->filter_hw->FA1R, bank); + + self->can->filter_hw->sFilterRegister[bank].FR1 = + ((match->id << 3) | FILTER32_IDE); + self->can->filter_hw->sFilterRegister[bank].FR2 = + ((match->mask << 3) | FILTER32_IDE); + + // filter mode: 0 = mask + // (this bit should be clear already, we never set it; but just in case) + CLEAR_BIT(self->can->filter_hw->FM1R, 1 << bank); + // filter scale: 1 = 32 bits + SET_BIT(self->can->filter_hw->FS1R, 1 << bank); + // fifo assignment: 1 = FIFO 1 + if (self->fifo_idx) { + SET_BIT(self->can->filter_hw->FFA1R, 1 << bank); + } else { + CLEAR_BIT(self->can->filter_hw->FFA1R, 1 << bank); + } + + // filter activation: 1 = enabled + SET_BIT(self->can->filter_hw->FA1R, 1 << bank); +} + +STATIC void install_all_match_filter(canio_listener_obj_t *self) { + int bank = next_filter(self->can); + + // filter is already deactivated, so we skip deactivating it here + // CLEAR_BIT(self->can->filter_hw->FA1R, bank); + + self->can->filter_hw->sFilterRegister[bank].FR1 = 0; + self->can->filter_hw->sFilterRegister[bank].FR2 = 0; + + // filter mode: 0 = mask + // (this bit should be clear already, we never set it; but just in case) + CLEAR_BIT(self->can->filter_hw->FM1R, bank); + // filter scale: 1 = 32 bits + SET_BIT(self->can->filter_hw->FS1R, bank); + // fifo assignment: 1 = FIFO 1 + if (self->fifo_idx) { + SET_BIT(self->can->filter_hw->FFA1R, bank); + } else { + CLEAR_BIT(self->can->filter_hw->FFA1R, bank); + } + + // filter activation: 1 = enabled + SET_BIT(self->can->filter_hw->FA1R, (1 << bank)); +} + + +#define NO_ADDRESS (-1) +void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **matches) { + allow_filter_change(self->can); + if (!nmatch) { + install_all_match_filter(self); + } else { + canio_match_obj_t *first_match = NULL; + for(size_t i = 0; iextended) { + install_extended_filter(self, matches[i]); + } else { + if (first_match) { + install_standard_filter(self, first_match, matches[i]); + first_match = NULL; + } else { + first_match = matches[i]; + } + } + } + if (first_match) { + install_standard_filter(self, first_match, first_match); + } + } + prevent_filter_change(self->can); +} + + +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->fifo0_in_use) { + self->fifo_idx = 0; + self->rfr = &can->handle.Instance->RF0R; + can->fifo0_in_use = true; + } else if (!can->fifo1_in_use) { + self->fifo_idx = 1; + self->rfr = &can->handle.Instance->RF1R; + can->fifo1_in_use = true; + } else { + mp_raise_ValueError(translate("All RX FIFOs in use")); + } + + if (num_filters_needed(nmatch, matches) > num_filters_available(can)) { + mp_raise_ValueError(translate("Filters too complex")); + } + + // Nothing can fail now so it's safe to assign self->can + self->can = can; + + self->mailbox = &can->handle.Instance->sFIFOMailBox[self->fifo_idx]; + set_filters(self, nmatch, matches); + 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); +} + +int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self) { + return *(self->rfr) & CAN_RF0R_FMP0; +} + +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)); + } + + uint32_t rir = self->mailbox->RIR; + uint32_t rdtr = self->mailbox->RDTR; + + bool rtr = rir & CAN_RI0R_RTR; + 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 = rir & CAN_RI0R_IDE; + if (message->extended) { + message->id = rir >> 3; + } else { + message->id = rir >> 21; + } + message->size = rdtr & CAN_RDT0R_DLC; + if (!rtr) { + uint32_t payload[] = { self->mailbox->RDLR, self->mailbox->RDHR }; + MP_STATIC_ASSERT(sizeof(payload) == sizeof(message->data)); + memcpy(message->data, payload, sizeof(payload)); + } + // Release the mailbox + SET_BIT(*self->rfr, CAN_RF0R_RFOM0); + return message; +} + +void common_hal_canio_listener_deinit(canio_listener_obj_t *self) { + if (self->can) { + clear_filters(self); + if (self->fifo_idx == 0) { + self->can->fifo0_in_use = false; + } + if (self->fifo_idx == 1) { + self->can->fifo1_in_use = false; + } + } + self->fifo_idx = -1; + self->can = NULL; + self->mailbox = NULL; + self->rfr = NULL; +} diff --git a/ports/stm/common-hal/canio/Listener.h b/ports/stm/common-hal/canio/Listener.h new file mode 100644 index 0000000000..2e17788888 --- /dev/null +++ b/ports/stm/common-hal/canio/Listener.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include "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; + CAN_FIFOMailBox_TypeDef *mailbox; + __IO uint32_t *rfr; + uint32_t timeout_ms; + uint8_t fifo_idx; +} canio_listener_obj_t; + +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); +void common_hal_canio_listener_check_for_deinit(canio_listener_obj_t *self); +void common_hal_canio_listener_deinit(canio_listener_obj_t *self); +bool common_hal_canio_listener_receiveinto(canio_listener_obj_t *self, canio_message_obj_t *message); +int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self); +float common_hal_canio_listener_get_timeout(canio_listener_obj_t *self); +void common_hal_canio_listener_set_timeout(canio_listener_obj_t *self, float timeout); diff --git a/ports/stm/common-hal/canio/__init__.c b/ports/stm/common-hal/canio/__init__.c new file mode 100644 index 0000000000..7932bfc2da --- /dev/null +++ b/ports/stm/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/stm/common-hal/canio/__init__.h b/ports/stm/common-hal/canio/__init__.h new file mode 100644 index 0000000000..20b6638cd8 --- /dev/null +++ b/ports/stm/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/stm/hal_conf/stm32_hal_conf.h b/ports/stm/hal_conf/stm32_hal_conf.h index c91be86fdf..8000e7e83d 100644 --- a/ports/stm/hal_conf/stm32_hal_conf.h +++ b/ports/stm/hal_conf/stm32_hal_conf.h @@ -11,7 +11,7 @@ */ #define HAL_MODULE_ENABLED #define HAL_ADC_MODULE_ENABLED -// #define HAL_CAN_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED // #define HAL_CEC_MODULE_ENABLED // #define HAL_COMP_MODULE_ENABLED #define HAL_CORTEX_MODULE_ENABLED diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c index c58234671c..2f9accbf11 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c @@ -216,3 +216,26 @@ const mcu_periph_obj_t mcu_sdio_data2_list[1] = { const mcu_periph_obj_t mcu_sdio_data3_list[1] = { PERIPH(1, 12, &pin_PC11), }; + +//CAN +CAN_TypeDef * mcu_can_banks[2] = {CAN1, CAN2}; + +const mcu_periph_obj_t mcu_can_tx_list[6] = { + PERIPH(1, 9, &pin_PA11), + PERIPH(1, 9, &pin_PB08), + PERIPH(1, 9, &pin_PD00), + PERIPH(1, 9, &pin_PI09), + + PERIPH(2, 9, &pin_PB12), + PERIPH(2, 9, &pin_PB05), +}; + +const mcu_periph_obj_t mcu_can_rx_list[6] = { + PERIPH(1, 9, &pin_PA12), + PERIPH(1, 9, &pin_PB09), + PERIPH(1, 9, &pin_PD01), + PERIPH(1, 9, &pin_PH13), + + PERIPH(2, 9, &pin_PB13), + PERIPH(2, 9, &pin_PB06), +}; diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h index 5b64fe10c4..03198af55e 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h @@ -71,5 +71,11 @@ extern const mcu_periph_obj_t mcu_sdio_data1_list[1]; extern const mcu_periph_obj_t mcu_sdio_data2_list[1]; extern const mcu_periph_obj_t mcu_sdio_data3_list[1]; +// CAN +extern CAN_TypeDef * mcu_can_banks[2]; + +extern const mcu_periph_obj_t mcu_can_tx_list[6]; +extern const mcu_periph_obj_t mcu_can_rx_list[6]; + #endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PERIPH_H From 7df01d3fbd321855cc65dc185d17933e4c5b388f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 5 Oct 2020 12:41:22 -0500 Subject: [PATCH 16/73] stm32: canio: enable on all stm32f405 boards --- ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk | 2 -- ports/stm/mpconfigport.mk | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk index 0866223841..4d0bd4598d 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -16,5 +16,3 @@ LD_DEFAULT = boards/STM32F405_default.ld # UF2 boot option LD_BOOT = boards/STM32F405_boot.ld UF2_OFFSET = 0x8010000 - -CIRCUITPY_CANIO = 1 diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index b827aa48b9..bcecaa5170 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -4,6 +4,7 @@ INTERNAL_LIBM ?= 1 USB_SERIAL_NUMBER_LENGTH ?= 24 ifeq ($(MCU_VARIANT),STM32F405xx) + CIRCUITPY_CANIO = 1 CIRCUITPY_FRAMEBUFFERIO ?= 1 CIRCUITPY_RGBMATRIX ?= 1 CIRCUITPY_SDIOIO ?= 1 From 23bd2496de3eb07385f74801df9971f9b63236bb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 5 Oct 2020 12:41:31 -0500 Subject: [PATCH 17/73] stm32: canio: remove some unneeded declarations --- ports/stm/common-hal/canio/Listener.c | 1 + ports/stm/common-hal/canio/Listener.h | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/ports/stm/common-hal/canio/Listener.c b/ports/stm/common-hal/canio/Listener.c index dd968979d2..09456d39dd 100644 --- a/ports/stm/common-hal/canio/Listener.c +++ b/ports/stm/common-hal/canio/Listener.c @@ -32,6 +32,7 @@ #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" diff --git a/ports/stm/common-hal/canio/Listener.h b/ports/stm/common-hal/canio/Listener.h index 2e17788888..2d0e302e9f 100644 --- a/ports/stm/common-hal/canio/Listener.h +++ b/ports/stm/common-hal/canio/Listener.h @@ -37,11 +37,3 @@ typedef struct canio_listener_obj { uint32_t timeout_ms; uint8_t fifo_idx; } canio_listener_obj_t; - -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); -void common_hal_canio_listener_check_for_deinit(canio_listener_obj_t *self); -void common_hal_canio_listener_deinit(canio_listener_obj_t *self); -bool common_hal_canio_listener_receiveinto(canio_listener_obj_t *self, canio_message_obj_t *message); -int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self); -float common_hal_canio_listener_get_timeout(canio_listener_obj_t *self); -void common_hal_canio_listener_set_timeout(canio_listener_obj_t *self, float timeout); From a7dccb39a487cdd2e65d9b9b588829818de1d16f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 5 Oct 2020 12:41:50 -0500 Subject: [PATCH 18/73] stm32: canio: remove unused functions --- ports/stm/common-hal/canio/CAN.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c index 0edf1217e3..244cc037ce 100644 --- a/ports/stm/common-hal/canio/CAN.c +++ b/ports/stm/common-hal/canio/CAN.c @@ -181,21 +181,6 @@ int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self) return (self->handle.Instance->ESR & CAN_ESR_REC) >> CAN_ESR_REC_Pos; } -int common_hal_canio_can_error_warning_state_count_get(canio_can_obj_t *self) -{ - return self->error_warning_state_count; -} - -int common_hal_canio_can_error_passive_state_count_get(canio_can_obj_t *self) -{ - return self->error_passive_state_count; -} - -int common_hal_canio_can_bus_off_state_count_get(canio_can_obj_t *self) -{ - return self->bus_off_state_count; -} - canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self) { uint32_t esr = self->handle.Instance->ESR; if (READ_BIT(esr, CAN_ESR_BOFF)) { From e5a0af9216a6d868fad9105a4eb44e0889f54e29 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 6 Oct 2020 09:18:53 -0500 Subject: [PATCH 19/73] stm32: canio: When Tx mailboxes are full, cancel an old message .. also add the 8ms wait for transmission that the atmel sam port has --- ports/stm/common-hal/canio/CAN.c | 18 ++++++++++++++++++ ports/stm/common-hal/canio/CAN.h | 1 + 2 files changed, 19 insertions(+) diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c index 244cc037ce..8ff91aaca4 100644 --- a/ports/stm/common-hal/canio/CAN.c +++ b/ports/stm/common-hal/canio/CAN.c @@ -225,10 +225,28 @@ void common_hal_canio_can_send(canio_can_obj_t *self, mp_obj_t message_in) .RTR = rtr ? CAN_RTR_REMOTE : CAN_RTR_DATA, .DLC = message->size, }; + uint32_t free_level = HAL_CAN_GetTxMailboxesFreeLevel(&self->handle); + if (free_level == 0) { + // There's no free Tx mailbox. We need to cancel some message without + // transmitting it, because once the bus returns to active state it's + // preferable to transmit the newest messages instead of older messages. + // + // We don't strictly guarantee that we abort the oldest Tx request, + // rather we just abort a different index each time. This permits us + // to avoid tracking this information altogether. + HAL_CAN_AbortTxRequest(&self->handle, 1 << (self->cancel_mailbox)); + self->cancel_mailbox = (self->cancel_mailbox + 1) % 3; + } HAL_StatusTypeDef status = HAL_CAN_AddTxMessage(&self->handle, &header, message->data, &mailbox); if (status != HAL_OK) { mp_raise_OSError(MP_ENOMEM); } + + // wait 8ms (hard coded for now) for TX to occur + uint64_t deadline = port_get_raw_ticks(NULL) + 8; + while (port_get_raw_ticks(NULL) < deadline && HAL_CAN_IsTxMessagePending(&self->handle, 1 << mailbox)) { + RUN_BACKGROUND_TASKS; + } } bool common_hal_canio_can_silent_get(canio_can_obj_t *self) { diff --git a/ports/stm/common-hal/canio/CAN.h b/ports/stm/common-hal/canio/CAN.h index bffc0f65f0..94d7e99a8a 100644 --- a/ports/stm/common-hal/canio/CAN.h +++ b/ports/stm/common-hal/canio/CAN.h @@ -54,6 +54,7 @@ typedef struct canio_can_obj { bool fifo0_in_use:1; bool fifo1_in_use:1; uint8_t periph_index:2; + uint8_t cancel_mailbox; uint8_t start_filter_bank; uint8_t end_filter_bank; long filter_in_use; // bitmask for the 28 filter banks From abe0405d6e643614557edd65995b61c04c656c44 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 6 Oct 2020 10:31:01 -0500 Subject: [PATCH 20/73] stm32: canio: Fix canio.CAN.restart() --- ports/stm/common-hal/canio/CAN.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c index 8ff91aaca4..62c4e9935f 100644 --- a/ports/stm/common-hal/canio/CAN.c +++ b/ports/stm/common-hal/canio/CAN.c @@ -197,7 +197,15 @@ canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self) { void common_hal_canio_can_restart(canio_can_obj_t *self) { if (!common_hal_canio_can_auto_restart_get(self)) { - HAL_CAN_Start(&self->handle); + // "If ABOM is cleared, the software must initiate the recovering + // sequence by requesting bxCAN to enter and to leave initialization + // mode." + self->handle.Instance->MCR |= CAN_MCR_INRQ; + while ((self->handle.Instance->MSR & CAN_MSR_INAK) == 0) { + } + self->handle.Instance->MCR &= ~CAN_MCR_INRQ; + while ((self->handle.Instance->MSR & CAN_MSR_INAK)) { + } } } From eed3387f4e625335a5d2f6582946ec75d1c1ed10 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 6 Oct 2020 10:31:38 -0500 Subject: [PATCH 21/73] stm32: canio: Fix message cancellation .. it's necessary to wait for a cancellation request to actually free the respective Tx mailbox --- ports/stm/common-hal/canio/CAN.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c index 62c4e9935f..fe1c3f2b14 100644 --- a/ports/stm/common-hal/canio/CAN.c +++ b/ports/stm/common-hal/canio/CAN.c @@ -241,13 +241,21 @@ void common_hal_canio_can_send(canio_can_obj_t *self, mp_obj_t message_in) // // We don't strictly guarantee that we abort the oldest Tx request, // rather we just abort a different index each time. This permits us - // to avoid tracking this information altogether. + // to just track a single cancel index HAL_CAN_AbortTxRequest(&self->handle, 1 << (self->cancel_mailbox)); self->cancel_mailbox = (self->cancel_mailbox + 1) % 3; + // The abort request may not have completed immediately, so wait for + // the Tx mailbox to become free + do { + free_level = HAL_CAN_GetTxMailboxesFreeLevel(&self->handle); + } while (!free_level); } HAL_StatusTypeDef status = HAL_CAN_AddTxMessage(&self->handle, &header, message->data, &mailbox); if (status != HAL_OK) { - mp_raise_OSError(MP_ENOMEM); + // this is a "shouldn't happen" condition. we don't throw because the + // contract of send() is that it queues the packet to be sent if + // possible and does not signal success or failure to actually send. + return; } // wait 8ms (hard coded for now) for TX to occur From 81d7ef0256d5450e56809c5fe198693cc6cb9925 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 6 Oct 2020 20:13:23 -0500 Subject: [PATCH 22/73] stm: canio: remove stray optimization flag for debugging --- ports/stm/common-hal/canio/CAN.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c index fe1c3f2b14..52d5cad1fe 100644 --- a/ports/stm/common-hal/canio/CAN.c +++ b/ports/stm/common-hal/canio/CAN.c @@ -50,7 +50,6 @@ STATIC const mcu_periph_obj_t *find_pin_function(const mcu_periph_obj_t *table, } -__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)) From 16ed875f4e88fbf0ecd9f5fa71b1c28d7a5e444b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 6 Oct 2020 20:14:50 -0500 Subject: [PATCH 23/73] canio: remove unused fields these relate to properties that were removed as well --- ports/atmel-samd/common-hal/canio/CAN.h | 3 --- ports/stm/common-hal/canio/CAN.h | 3 --- 2 files changed, 6 deletions(-) diff --git a/ports/atmel-samd/common-hal/canio/CAN.h b/ports/atmel-samd/common-hal/canio/CAN.h index cdea60e7d0..15ac0f4b7f 100644 --- a/ports/atmel-samd/common-hal/canio/CAN.h +++ b/ports/atmel-samd/common-hal/canio/CAN.h @@ -41,9 +41,6 @@ typedef struct canio_can_obj { mp_obj_base_t base; Can *hw; canio_can_state_t *state; - volatile uint32_t error_warning_state_count; - volatile uint32_t error_passive_state_count; - volatile uint32_t bus_off_state_count; int baudrate; uint8_t rx_pin_number:8; uint8_t tx_pin_number:8; diff --git a/ports/stm/common-hal/canio/CAN.h b/ports/stm/common-hal/canio/CAN.h index 94d7e99a8a..3157d0a036 100644 --- a/ports/stm/common-hal/canio/CAN.h +++ b/ports/stm/common-hal/canio/CAN.h @@ -42,9 +42,6 @@ typedef struct canio_can_obj { mp_obj_base_t base; CAN_HandleTypeDef handle; CAN_TypeDef *filter_hw; - volatile uint32_t error_warning_state_count; - volatile uint32_t error_passive_state_count; - volatile uint32_t bus_off_state_count; int baudrate; const mcu_pin_obj_t *rx_pin; const mcu_pin_obj_t *tx_pin; From d01b9ce933048c69c7611cd4f512baa040f2f101 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 7 Oct 2020 22:15:05 +0530 Subject: [PATCH 24/73] Disable auto-reload in safe mode --- main.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/main.c b/main.c index dbd367a596..1f7352b0e9 100755 --- a/main.c +++ b/main.c @@ -249,10 +249,7 @@ bool run_code_py(safe_mode_t safe_mode) { serial_write("\n"); if (autoreload_is_enabled()) { serial_write_compressed(translate("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\n")); - } else if (safe_mode != NO_SAFE_MODE) { - serial_write_compressed(translate("Running in safe mode! ")); - serial_write_compressed(translate("Auto-reload is off.\n")); - } else if (!autoreload_is_enabled()) { + } else { serial_write_compressed(translate("Auto-reload is off.\n")); } } @@ -322,16 +319,16 @@ bool run_code_py(safe_mode_t safe_mode) { } if (!serial_connected_before_animation && serial_connected()) { - if (serial_connected_at_start) { - serial_write("\n\n"); - } - if (!serial_connected_at_start) { if (autoreload_is_enabled()) { serial_write_compressed(translate("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\n")); } else { serial_write_compressed(translate("Auto-reload is off.\n")); } + if (safe_mode != NO_SAFE_MODE) { + serial_write_compressed(translate("Running in safe mode! ")); + serial_write_compressed(translate("Not running saved code.\n")); + } } print_safe_mode_message(safe_mode); serial_write("\n"); @@ -486,8 +483,10 @@ int __attribute__((used)) main(void) { reset_devices(); reset_board(); - // Turn on autoreload by default but before boot.py in case it wants to change it. - autoreload_enable(); + // If not in safe mode turn on autoreload by default but before boot.py in case it wants to change it. + if (safe_mode == NO_SAFE_MODE) { + autoreload_enable(); + } // By default our internal flash is readonly to local python code and // writable over USB. Set it here so that boot.py can change it. From b7ed18d622fb6ca5b02034cbd2ac8d256374d77d Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 8 Oct 2020 00:52:00 +0700 Subject: [PATCH 25/73] change idf to espressif fix hal includes --- .gitmodules | 2 +- ports/esp32s2/common-hal/busio/I2C.h | 2 +- ports/esp32s2/common-hal/busio/SPI.h | 4 ++-- ports/esp32s2/common-hal/busio/UART.h | 2 +- ports/esp32s2/common-hal/digitalio/DigitalInOut.c | 2 +- ports/esp32s2/common-hal/microcontroller/Pin.c | 2 +- ports/esp32s2/esp-idf | 2 +- ports/esp32s2/peripherals/pins.h | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitmodules b/.gitmodules index b1ae2276ca..f66ce8aafa 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/hierophect/esp-idf.git + url = https://github.com/espressif/esp-idf.git diff --git a/ports/esp32s2/common-hal/busio/I2C.h b/ports/esp32s2/common-hal/busio/I2C.h index 1a989e30a4..c39d6d7448 100644 --- a/ports/esp32s2/common-hal/busio/I2C.h +++ b/ports/esp32s2/common-hal/busio/I2C.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "components/soc/include/hal/i2c_types.h" +#include "components/hal/include/hal/i2c_types.h" #include "FreeRTOS.h" #include "freertos/semphr.h" #include "py/obj.h" diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h index d6203feae6..f6c1c344a1 100644 --- a/ports/esp32s2/common-hal/busio/SPI.h +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -30,8 +30,8 @@ #include "common-hal/microcontroller/Pin.h" #include "components/driver/include/driver/spi_common_internal.h" -#include "components/soc/include/hal/spi_hal.h" -#include "components/soc/include/hal/spi_types.h" +#include "components/hal/include/hal/spi_hal.h" +#include "components/hal/include/hal/spi_types.h" #include "py/obj.h" typedef struct { diff --git a/ports/esp32s2/common-hal/busio/UART.h b/ports/esp32s2/common-hal/busio/UART.h index 751fb2e002..1d7f135115 100644 --- a/ports/esp32s2/common-hal/busio/UART.h +++ b/ports/esp32s2/common-hal/busio/UART.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "components/soc/include/hal/uart_types.h" +#include "components/hal/include/hal/uart_types.h" #include "py/obj.h" typedef struct { diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c index a2a0209f93..152db1e71d 100644 --- a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c +++ b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c @@ -30,7 +30,7 @@ #include "components/driver/include/driver/gpio.h" -#include "components/soc/include/hal/gpio_hal.h" +#include "components/hal/include/hal/gpio_hal.h" void common_hal_digitalio_digitalinout_never_reset( digitalio_digitalinout_obj_t *self) { diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 0f4669fe0d..3c2611efeb 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -32,7 +32,7 @@ #include "py/mphal.h" #include "components/driver/include/driver/gpio.h" -#include "components/soc/include/hal/gpio_hal.h" +#include "components/hal/include/hal/gpio_hal.h" #ifdef MICROPY_HW_NEOPIXEL bool neopixel_in_use; diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index a7f7779881..8bc19ba893 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit a7f77798816661f7c4ae198f3878bc92a9274f82 +Subproject commit 8bc19ba893e5544d571a753d82b44a84799b94b1 diff --git a/ports/esp32s2/peripherals/pins.h b/ports/esp32s2/peripherals/pins.h index 0cf63a029a..9776fbb78f 100644 --- a/ports/esp32s2/peripherals/pins.h +++ b/ports/esp32s2/peripherals/pins.h @@ -34,7 +34,7 @@ #include "esp32s2_peripherals_config.h" #include "esp-idf/config/sdkconfig.h" -#include "components/soc/include/hal/gpio_types.h" +#include "components/hal/include/hal/gpio_types.h" typedef struct { PIN_PREFIX_FIELDS From 8487a51995d708b6ade7f714600b37ee6e7d4a5a Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 7 Oct 2020 23:53:08 +0530 Subject: [PATCH 26/73] Factor out code.py status messages --- main.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/main.c b/main.c index 1f7352b0e9..b43b3b8c80 100755 --- a/main.c +++ b/main.c @@ -242,16 +242,24 @@ void cleanup_after_vm(supervisor_allocation* heap) { reset_status_led(); } +void print_code_py_status_message(safe_mode_t safe_mode) { + if (autoreload_is_enabled()) { + serial_write_compressed(translate("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\n")); + } else { + serial_write_compressed(translate("Auto-reload is off.\n")); + } + if (safe_mode != NO_SAFE_MODE) { + serial_write_compressed(translate("Running in safe mode! ")); + serial_write_compressed(translate("Not running saved code.\n")); + } +} + bool run_code_py(safe_mode_t safe_mode) { bool serial_connected_at_start = serial_connected(); #if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 if (serial_connected_at_start) { serial_write("\n"); - if (autoreload_is_enabled()) { - serial_write_compressed(translate("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\n")); - } else { - serial_write_compressed(translate("Auto-reload is off.\n")); - } + print_code_py_status_message(safe_mode); } #endif @@ -263,10 +271,7 @@ bool run_code_py(safe_mode_t safe_mode) { bool found_main = false; - if (safe_mode != NO_SAFE_MODE) { - serial_write_compressed(translate("Running in safe mode! ")); - serial_write_compressed(translate("Not running saved code.\n")); - } else { + if (safe_mode == NO_SAFE_MODE) { new_status_color(MAIN_RUNNING); static const char * const supported_filenames[] = STRING_LIST("code.txt", "code.py", "main.py", "main.txt"); @@ -320,15 +325,7 @@ bool run_code_py(safe_mode_t safe_mode) { if (!serial_connected_before_animation && serial_connected()) { if (!serial_connected_at_start) { - if (autoreload_is_enabled()) { - serial_write_compressed(translate("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\n")); - } else { - serial_write_compressed(translate("Auto-reload is off.\n")); - } - if (safe_mode != NO_SAFE_MODE) { - serial_write_compressed(translate("Running in safe mode! ")); - serial_write_compressed(translate("Not running saved code.\n")); - } + print_code_py_status_message(safe_mode); } print_safe_mode_message(safe_mode); serial_write("\n"); From 085d2a22746f4e16915d64a81ac6b62123d650ee Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Wed, 7 Oct 2020 14:09:26 -0500 Subject: [PATCH 27/73] Update submodule to merge commit --- ports/atmel-samd/peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 2ff4ab0510..a7e39c4d01 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 2ff4ab05101ce7d3e105009cc6612df6e992123f +Subproject commit a7e39c4d01aa5916015beecb021777617e77b0ad From 09bc4157516dd59754a3eb1a5dbbb72a758ebe93 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 28 Sep 2020 19:21:17 -0700 Subject: [PATCH 28/73] Unify iMX flash config and add Metro M7 1011 This unifies the flash config to the settings used by the Boot ROM. This makes the config unique per board which allows for changing quad enable and status bit differences per flash device. It also allows for timing differences due to the board layout. This change also tweaks linker layout to leave more ram space for the CircuitPython heap. --- .github/workflows/build.yml | 1 + extmod/vfs_fat_diskio.c | 37 ++- ports/mimxrt10xx/Makefile | 2 +- ports/mimxrt10xx/boards/board.h | 8 + .../boards/feather_m7_1011/flash_config.c | 203 ++++++++++------ .../boards/feather_mimxrt1011/flash_config.c | 203 ++++++++++------ .../boards/feather_mimxrt1062/flash_config.c | 203 ++++++++++------ .../boards/imxrt1010_evk/flash_config.c | 204 ++++++++++------ .../boards/imxrt1020_evk/flash_config.c | 207 +++++++++------- .../boards/imxrt1060_evk/flash_config.c | 205 ++++++++++------ ports/mimxrt10xx/boards/metro_m7_1011/board.c | 52 ++++ .../boards/metro_m7_1011/flash_config.c | 179 ++++++++++++++ .../boards/metro_m7_1011/mpconfigboard.h | 20 ++ .../boards/metro_m7_1011/mpconfigboard.mk | 12 + ports/mimxrt10xx/boards/metro_m7_1011/pins.c | 59 +++++ .../mimxrt10xx/boards/teensy40/flash_config.c | 217 ++++++++++------- .../mimxrt10xx/boards/teensy41/flash_config.c | 207 +++++++++------- ports/mimxrt10xx/linking/common.ld | 3 - .../supervisor/flexspi_nor_flash_ops.c | 228 ++---------------- ports/mimxrt10xx/supervisor/internal_flash.c | 121 +--------- ports/mimxrt10xx/supervisor/internal_flash.h | 17 +- ports/mimxrt10xx/supervisor/port.c | 22 +- ports/mimxrt10xx/supervisor/usb.c | 4 - supervisor/shared/background_callback.c | 3 +- supervisor/shared/filesystem.c | 17 +- supervisor/shared/flash.c | 49 +++- 26 files changed, 1458 insertions(+), 1025 deletions(-) create mode 100644 ports/mimxrt10xx/boards/metro_m7_1011/board.c create mode 100644 ports/mimxrt10xx/boards/metro_m7_1011/flash_config.c create mode 100644 ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.h create mode 100644 ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk create mode 100644 ports/mimxrt10xx/boards/metro_m7_1011/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc3dc68352..cced2d702b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -243,6 +243,7 @@ jobs: - "metro_m0_express" - "metro_m4_airlift_lite" - "metro_m4_express" + - "metro_m7_1011" - "metro_nrf52840_express" - "mini_sam_m4" - "monster_m4sk" diff --git a/extmod/vfs_fat_diskio.c b/extmod/vfs_fat_diskio.c index ac8924394a..432c03b7c9 100644 --- a/extmod/vfs_fat_diskio.c +++ b/extmod/vfs_fat_diskio.c @@ -123,7 +123,7 @@ DRESULT disk_write ( DRESULT disk_ioctl ( bdev_t pdrv, /* Physical drive nmuber (0..) */ - BYTE cmd, /* Control code */ + BYTE cmd, /* Control code */ void *buff /* Buffer to send/receive control data */ ) { @@ -133,7 +133,7 @@ DRESULT disk_ioctl ( } // First part: call the relevant method of the underlying block device - mp_obj_t ret = mp_const_none; + mp_int_t out_value = 0; if (vfs->flags & FSUSER_HAVE_IOCTL) { // new protocol with ioctl static const uint8_t op_map[8] = { @@ -144,9 +144,19 @@ DRESULT disk_ioctl ( }; uint8_t bp_op = op_map[cmd & 7]; if (bp_op != 0) { - vfs->u.ioctl[2] = MP_OBJ_NEW_SMALL_INT(bp_op); - vfs->u.ioctl[3] = MP_OBJ_NEW_SMALL_INT(0); // unused - ret = mp_call_method_n_kw(2, 0, vfs->u.ioctl); + if (vfs->flags & FSUSER_NATIVE) { + bool (*f)(size_t, mp_int_t*) = (void*)(uintptr_t)vfs->u.ioctl[2]; + if (!f(bp_op, (mp_int_t*) &out_value)) { + return RES_ERROR; + } + } else { + vfs->u.ioctl[2] = MP_OBJ_NEW_SMALL_INT(bp_op); + vfs->u.ioctl[3] = MP_OBJ_NEW_SMALL_INT(0); // unused + mp_obj_t ret = mp_call_method_n_kw(2, 0, vfs->u.ioctl); + if (ret != mp_const_none) { + out_value = mp_obj_get_int(ret); + } + } } } else { // old protocol with sync and count @@ -157,10 +167,13 @@ DRESULT disk_ioctl ( } break; - case GET_SECTOR_COUNT: - ret = mp_call_method_n_kw(0, 0, vfs->u.old.count); + case GET_SECTOR_COUNT: { + mp_obj_t ret = mp_call_method_n_kw(0, 0, vfs->u.old.count); + if (ret != mp_const_none) { + out_value = mp_obj_get_int(ret); + } break; - + } case GET_SECTOR_SIZE: // old protocol has fixed sector size of 512 bytes break; @@ -177,16 +190,16 @@ DRESULT disk_ioctl ( return RES_OK; case GET_SECTOR_COUNT: { - *((DWORD*)buff) = mp_obj_get_int(ret); + *((DWORD*)buff) = out_value; return RES_OK; } case GET_SECTOR_SIZE: { - if (ret == mp_const_none) { + if (out_value == 0) { // Default sector size *((WORD*)buff) = 512; } else { - *((WORD*)buff) = mp_obj_get_int(ret); + *((WORD*)buff) = out_value; } #if _MAX_SS != _MIN_SS // need to store ssize because we use it in disk_read/disk_write @@ -202,7 +215,7 @@ DRESULT disk_ioctl ( case IOCTL_INIT: case IOCTL_STATUS: { DSTATUS stat; - if (ret != mp_const_none && MP_OBJ_SMALL_INT_VALUE(ret) != 0) { + if (out_value != 0) { // error initialising stat = STA_NOINIT; } else if (vfs->writeblocks[0] == MP_OBJ_NULL) { diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 248798f634..12c9bde4f5 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -75,7 +75,7 @@ INC += \ # NDEBUG disables assert() statements. This reduces code size pretty dramatically, per tannewt. -CFLAGS += -Os -DNDEBUG +CFLAGS += -Os -DNDEBUG -ffreestanding # TinyUSB defines CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_MIMXRT10XX -DCFG_TUD_MIDI_RX_BUFSIZE=512 -DCFG_TUD_CDC_RX_BUFSIZE=512 -DCFG_TUD_MIDI_TX_BUFSIZE=512 -DCFG_TUD_CDC_TX_BUFSIZE=512 -DCFG_TUD_MSC_BUFSIZE=1024 diff --git a/ports/mimxrt10xx/boards/board.h b/ports/mimxrt10xx/boards/board.h index 92d02d900e..678c223ae0 100644 --- a/ports/mimxrt10xx/boards/board.h +++ b/ports/mimxrt10xx/boards/board.h @@ -33,6 +33,7 @@ #include "py/mpconfig.h" #include "fsl_common.h" +#include "fsl_flexspi_nor_config.h" // Initializes board related state once on start up. void board_init(void); @@ -45,4 +46,11 @@ bool board_requests_safe_mode(void); // Reset the state of off MCU components such as neopixels. void reset_board(void); +#define SEQUENCE(first, second, third, fourth) first, second, third, fourth +#define TWO_EMPTY_STEPS 0x00000000 +#define EMPTY_SEQUENCE SEQUENCE(TWO_EMPTY_STEPS, TWO_EMPTY_STEPS, TWO_EMPTY_STEPS, TWO_EMPTY_STEPS) + +// FlexSPI configuration that stores command info. +extern const flexspi_nor_config_t qspiflash_config; + #endif // MICROPY_INCLUDED_MIMXRT10XX_BOARDS_BOARD_H diff --git a/ports/mimxrt10xx/boards/feather_m7_1011/flash_config.c b/ports/mimxrt10xx/boards/feather_m7_1011/flash_config.c index b74c0b1514..282464c75d 100644 --- a/ports/mimxrt10xx/boards/feather_m7_1011/flash_config.c +++ b/ports/mimxrt10xx/boards/feather_m7_1011/flash_config.c @@ -6,7 +6,7 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" __attribute__((section(".boot_hdr.ivt"))) @@ -35,88 +35,135 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for W25Q32JV with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x02, // Bit pattern for setting Quad Enable. + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_133MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x02), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status -2 + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x31 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01 /* number of bytes to write */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1011/flash_config.c b/ports/mimxrt10xx/boards/feather_mimxrt1011/flash_config.c index b74c0b1514..51cc0f164b 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1011/flash_config.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1011/flash_config.c @@ -6,7 +6,7 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" __attribute__((section(".boot_hdr.ivt"))) @@ -35,88 +35,135 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for W25Q64JV with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x02, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_133MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x31 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1062/flash_config.c b/ports/mimxrt10xx/boards/feather_mimxrt1062/flash_config.c index b74c0b1514..51cc0f164b 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1062/flash_config.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1062/flash_config.c @@ -6,7 +6,7 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" __attribute__((section(".boot_hdr.ivt"))) @@ -35,88 +35,135 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for W25Q64JV with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x02, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_133MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x31 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/boards/imxrt1010_evk/flash_config.c b/ports/mimxrt10xx/boards/imxrt1010_evk/flash_config.c index 7e8fb75b24..19573bd993 100644 --- a/ports/mimxrt10xx/boards/imxrt1010_evk/flash_config.c +++ b/ports/mimxrt10xx/boards/imxrt1010_evk/flash_config.c @@ -6,7 +6,8 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" + __attribute__((section(".boot_hdr.ivt"))) /************************************* @@ -34,88 +35,135 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for AT25SF128A with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x02, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x02), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x31 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c b/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c index 43ffe0dd13..40b566618e 100644 --- a/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c +++ b/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c @@ -6,7 +6,7 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" __attribute__((section(".boot_hdr.ivt"))) @@ -35,92 +35,135 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for IS25LP064A with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, -#ifdef BOARD_USING_SECONDARY_QSPI_PINMUX - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromInternally, -#else - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, -#endif - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x40, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_30MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + // SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + // RADDR_SDR, FLEXSPI_4PAD, 24 bits to transmit ), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + // READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x01 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/boards/imxrt1060_evk/flash_config.c b/ports/mimxrt10xx/boards/imxrt1060_evk/flash_config.c index 7e046d4940..d79a8d0f91 100644 --- a/ports/mimxrt10xx/boards/imxrt1060_evk/flash_config.c +++ b/ports/mimxrt10xx/boards/imxrt1060_evk/flash_config.c @@ -6,10 +6,10 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" + __attribute__((section(".boot_hdr.ivt"))) - /************************************* * IVT Data *************************************/ @@ -35,88 +35,135 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for IS25WP064A with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x40, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x02), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x01 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/board.c b/ports/mimxrt10xx/boards/metro_m7_1011/board.c new file mode 100644 index 0000000000..ed543e1b06 --- /dev/null +++ b/ports/mimxrt10xx/boards/metro_m7_1011/board.c @@ -0,0 +1,52 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Artur Pacholec + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // SWD Pins + common_hal_never_reset_pin(&pin_GPIO_AD_13);//SWDIO + common_hal_never_reset_pin(&pin_GPIO_AD_12);//SWCLK + + // FLEX flash + common_hal_never_reset_pin(&pin_GPIO_SD_12); + common_hal_never_reset_pin(&pin_GPIO_SD_11); + common_hal_never_reset_pin(&pin_GPIO_SD_10); + common_hal_never_reset_pin(&pin_GPIO_SD_09); + common_hal_never_reset_pin(&pin_GPIO_SD_08); + common_hal_never_reset_pin(&pin_GPIO_SD_07); + common_hal_never_reset_pin(&pin_GPIO_SD_06); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/flash_config.c b/ports/mimxrt10xx/boards/metro_m7_1011/flash_config.c new file mode 100644 index 0000000000..30ce67523e --- /dev/null +++ b/ports/mimxrt10xx/boards/metro_m7_1011/flash_config.c @@ -0,0 +1,179 @@ +/* + * Copyright 2017 NXP + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "fsl_flexspi_nor_boot.h" +#include "boards/board.h" + + +__attribute__((section(".boot_hdr.ivt"))) +/************************************* + * IVT Data + *************************************/ +const ivt image_vector_table = { + IVT_HEADER, /* IVT Header */ + IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ + IVT_RSVD, /* Reserved = 0 */ + (uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */ + (uint32_t)BOOT_DATA_ADDRESS, /* Address where BOOT Data Structure is stored */ + (uint32_t)&image_vector_table, /* Pointer to IVT Self (absolute address */ + (uint32_t)CSF_ADDRESS, /* Address where CSF file is stored */ + IVT_RSVD /* Reserved = 0 */ +}; + +__attribute__((section(".boot_hdr.boot_data"))) +/************************************* + * Boot Data + *************************************/ +const BOOT_DATA_T boot_data = { + FLASH_BASE, /* boot start location */ + FLASH_SIZE, /* size */ + PLUGIN_FLAG, /* Plugin flag*/ + 0xFFFFFFFF /* empty - extra data word */ +}; + +// Config for W25Q16JV with QSPI routed. +__attribute__((section(".boot_hdr.conf"))) +const flexspi_nor_config_t qspiflash_config = { + .pageSize = 256u, + .sectorSize = 4u * 1024u, + .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, + .blockSize = 0x00010000, + .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x0200, + .configCmdEnable = 1u, + .configModeType[0] = kDeviceConfigCmdType_Generic, + .configCmdSeqs[0] = { + .seqId = 2u, + .seqNum = 1u, + }, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x02), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x35 /* the command to send */, + DUMMY_SDR, FLEXSPI_1PAD, 8), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x01 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x02), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, +}; diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.h b/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.h new file mode 100644 index 0000000000..b11edb18b4 --- /dev/null +++ b/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.h @@ -0,0 +1,20 @@ +#define MICROPY_HW_BOARD_NAME "Metro MIMXRT1011" +#define MICROPY_HW_MCU_NAME "IMXRT1011DAE5A" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO_00) + +// If you change this, then make sure to update the linker scripts as well to +// make sure you don't overwrite code +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 + +#define BOARD_FLASH_SIZE (2 * 1024 * 1024) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO_02) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO_01) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO_AD_06) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO_AD_04) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO_AD_03) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO_09) +#define DEFAULT_UART_BUS_TX (&pin_GPIO_10) diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk b/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk new file mode 100644 index 0000000000..8cb150bb4b --- /dev/null +++ b/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk @@ -0,0 +1,12 @@ +USB_VID = 0x239A +USB_PID = 0x8092 +USB_PRODUCT = "Metro M7 1011" +USB_MANUFACTURER = "Adafruit" + +CHIP_VARIANT = MIMXRT1011DAE5A +CHIP_FAMILY = MIMXRT1011 +FLASH = W25Q16JV + +# Include these Python libraries in the firmware +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ESP32SPI +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/pins.c b/ports/mimxrt10xx/boards/metro_m7_1011/pins.c new file mode 100644 index 0000000000..e884934134 --- /dev/null +++ b/ports/mimxrt10xx/boards/metro_m7_1011/pins.c @@ -0,0 +1,59 @@ +#include "shared-bindings/board/__init__.h" + +#include "boards/board.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + // Analog + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_08) }, + + // Digital + { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_SD_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_SD_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_SD_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_GPIO_03) }, + + // ESP control + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_GPIO_AD_14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_GPIO0), MP_ROM_PTR(&pin_GPIO_SD_05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY), MP_ROM_PTR(&pin_GPIO_AD_11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_GPIO_AD_07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_GPIO_09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_GPIO_10) }, + + // SPI + { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_AD_06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_AD_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_AD_04) }, + + // UART + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_09) }, + + // I2C + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_02) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO_00) }, + + { 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); diff --git a/ports/mimxrt10xx/boards/teensy40/flash_config.c b/ports/mimxrt10xx/boards/teensy40/flash_config.c index 426deb884d..30ce67523e 100644 --- a/ports/mimxrt10xx/boards/teensy40/flash_config.c +++ b/ports/mimxrt10xx/boards/teensy40/flash_config.c @@ -6,12 +6,8 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.xip_device" -#endif __attribute__((section(".boot_hdr.ivt"))) /************************************* @@ -39,88 +35,145 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for W25Q16JV with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x0200, + .configCmdEnable = 1u, + .configModeType[0] = kDeviceConfigCmdType_Generic, + .configCmdSeqs[0] = { + .seqId = 2u, + .seqNum = 1u, + }, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x02), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x35 /* the command to send */, + DUMMY_SDR, FLEXSPI_1PAD, 8), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x01 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x02), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/boards/teensy41/flash_config.c b/ports/mimxrt10xx/boards/teensy41/flash_config.c index 426deb884d..7b2bfb768d 100644 --- a/ports/mimxrt10xx/boards/teensy41/flash_config.c +++ b/ports/mimxrt10xx/boards/teensy41/flash_config.c @@ -6,12 +6,8 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.xip_device" -#endif __attribute__((section(".boot_hdr.ivt"))) /************************************* @@ -39,88 +35,135 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for W25Q64JV with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x02, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x31 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/linking/common.ld b/ports/mimxrt10xx/linking/common.ld index 90fc780933..720361aa0a 100644 --- a/ports/mimxrt10xx/linking/common.ld +++ b/ports/mimxrt10xx/linking/common.ld @@ -62,7 +62,6 @@ SECTIONS KEEP(*(.isr_vector)) /* Startup code */ *(EXCLUDE_FILE( - *flexspi_nor_flash_ops.o *fsl_flexspi.o ) .text*) /* .text* sections (code) */ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ @@ -84,7 +83,6 @@ SECTIONS { . = ALIGN(4); *(.data*) /* .data* sections */ - *flexspi_nor_flash_ops.o(.text*) *fsl_flexspi.o(.text*) . = ALIGN(4); } > OCRAM AT> FLASH_FIRMWARE @@ -110,7 +108,6 @@ SECTIONS .itcm : { . = ALIGN(4); - *(.itcm.*) . = ALIGN(4); diff --git a/ports/mimxrt10xx/supervisor/flexspi_nor_flash_ops.c b/ports/mimxrt10xx/supervisor/flexspi_nor_flash_ops.c index 28d5115ac7..353ba3176d 100644 --- a/ports/mimxrt10xx/supervisor/flexspi_nor_flash_ops.c +++ b/ports/mimxrt10xx/supervisor/flexspi_nor_flash_ops.c @@ -9,23 +9,10 @@ #include "fsl_flexspi.h" #include "internal_flash.h" +#include "boards/board.h" +#include "supervisor/linker.h" -#define FLASH_QUAD_ENABLE 0x02 -#define FLASH_BUSY_STATUS_POL 1 -#define FLASH_BUSY_STATUS_OFFSET 0 - -static inline void flexspi_clock_init(void) -{ - /* Switch to PLL2 for XIP to avoid hardfault during re-initialize clock. */ - CLOCK_InitSysPfd(kCLOCK_Pfd2, 24); /* Set PLL2 PFD2 clock 396MHZ. */ - CLOCK_SetMux(kCLOCK_FlexspiMux, 0x2); /* Choose PLL2 PFD2 clock as flexspi source clock. */ - CLOCK_SetDiv(kCLOCK_FlexspiDiv, 2); /* flexspi clock 133M. */ -} - -extern flexspi_device_config_t deviceconfig; -extern const uint32_t customLUT[CUSTOM_LUT_LENGTH]; - -status_t flexspi_nor_write_enable(FLEXSPI_Type *base, uint32_t baseAddr) +status_t PLACE_IN_ITCM(flexspi_nor_write_enable)(FLEXSPI_Type *base, uint32_t baseAddr) { flexspi_transfer_t flashXfer; status_t status; @@ -35,14 +22,14 @@ status_t flexspi_nor_write_enable(FLEXSPI_Type *base, uint32_t baseAddr) flashXfer.port = kFLEXSPI_PortA1; flashXfer.cmdType = kFLEXSPI_Command; flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_WRITEENABLE; + flashXfer.seqIndex = ROM_INDEX_WRITEENABLE; status = FLEXSPI_TransferBlocking(base, &flashXfer); return status; } -status_t flexspi_nor_wait_bus_busy(FLEXSPI_Type *base) +status_t PLACE_IN_ITCM(flexspi_nor_wait_bus_busy)(FLEXSPI_Type *base) { /* Wait status ready. */ bool isBusy; @@ -54,7 +41,7 @@ status_t flexspi_nor_wait_bus_busy(FLEXSPI_Type *base) flashXfer.port = kFLEXSPI_PortA1; flashXfer.cmdType = kFLEXSPI_Read; flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_READSTATUSREG; + flashXfer.seqIndex = ROM_INDEX_READSTATUSREG; flashXfer.data = &readValue; flashXfer.dataSize = 1; @@ -66,72 +53,15 @@ status_t flexspi_nor_wait_bus_busy(FLEXSPI_Type *base) { return status; } - if (FLASH_BUSY_STATUS_POL) - { - if (readValue & (1U << FLASH_BUSY_STATUS_OFFSET)) - { - isBusy = true; - } - else - { - isBusy = false; - } - } - else - { - if (readValue & (1U << FLASH_BUSY_STATUS_OFFSET)) - { - isBusy = false; - } - else - { - isBusy = true; - } - } - + size_t busyBit = readValue & (1U << qspiflash_config.memConfig.busyOffset); + isBusy = (qspiflash_config.memConfig.busyBitPolarity == 0 && busyBit != 0) || + (qspiflash_config.memConfig.busyBitPolarity == 1 && busyBit == 0); } while (isBusy); return status; } -status_t flexspi_nor_enable_quad_mode(FLEXSPI_Type *base) -{ - flexspi_transfer_t flashXfer; - status_t status; - uint32_t writeValue = FLASH_QUAD_ENABLE; - - /* Write enable */ - status = flexspi_nor_write_enable(base, 0); - - if (status != kStatus_Success) - { - return status; - } - - /* Enable quad mode. */ - flashXfer.deviceAddress = 0; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Write; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_WRITESTATUSREG; - flashXfer.data = &writeValue; - flashXfer.dataSize = 1; - - status = FLEXSPI_TransferBlocking(base, &flashXfer); - if (status != kStatus_Success) - { - return status; - } - - status = flexspi_nor_wait_bus_busy(base); - - /* Do software reset. */ - FLEXSPI_SoftwareReset(base); - - return status; -} - -status_t flexspi_nor_flash_erase_sector(FLEXSPI_Type *base, uint32_t address) +status_t PLACE_IN_ITCM(flexspi_nor_flash_erase_sector)(FLEXSPI_Type *base, uint32_t address) { status_t status; flexspi_transfer_t flashXfer; @@ -141,7 +71,7 @@ status_t flexspi_nor_flash_erase_sector(FLEXSPI_Type *base, uint32_t address) flashXfer.port = kFLEXSPI_PortA1; flashXfer.cmdType = kFLEXSPI_Command; flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_WRITEENABLE; + flashXfer.seqIndex = ROM_INDEX_WRITEENABLE; status = FLEXSPI_TransferBlocking(base, &flashXfer); @@ -154,7 +84,7 @@ status_t flexspi_nor_flash_erase_sector(FLEXSPI_Type *base, uint32_t address) flashXfer.port = kFLEXSPI_PortA1; flashXfer.cmdType = kFLEXSPI_Command; flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_ERASESECTOR; + flashXfer.seqIndex = ROM_INDEX_ERASESECTOR; status = FLEXSPI_TransferBlocking(base, &flashXfer); if (status != kStatus_Success) @@ -170,7 +100,7 @@ status_t flexspi_nor_flash_erase_sector(FLEXSPI_Type *base, uint32_t address) return status; } -status_t flexspi_nor_flash_program(FLEXSPI_Type *base, uint32_t dstAddr, const uint32_t *src, uint32_t length) +status_t PLACE_IN_ITCM(flexspi_nor_flash_page_program)(FLEXSPI_Type *base, uint32_t dstAddr, const uint32_t *src) { status_t status; flexspi_transfer_t flashXfer; @@ -188,48 +118,7 @@ status_t flexspi_nor_flash_program(FLEXSPI_Type *base, uint32_t dstAddr, const u flashXfer.port = kFLEXSPI_PortA1; flashXfer.cmdType = kFLEXSPI_Write; flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD; - flashXfer.data = (uint32_t *)src; - flashXfer.dataSize = length; - status = FLEXSPI_TransferBlocking(base, &flashXfer); - - if (status != kStatus_Success) - { - return status; - } - - status = flexspi_nor_wait_bus_busy(base); - - /* Do software reset. */ -#if defined(FSL_FEATURE_SOC_OTFAD_COUNT) - base->AHBCR |= FLEXSPI_AHBCR_CLRAHBRXBUF_MASK | FLEXSPI_AHBCR_CLRAHBTXBUF_MASK; - base->AHBCR &= ~(FLEXSPI_AHBCR_CLRAHBRXBUF_MASK | FLEXSPI_AHBCR_CLRAHBTXBUF_MASK); -#else - FLEXSPI_SoftwareReset(base); -#endif - - return status; -} - -status_t flexspi_nor_flash_page_program(FLEXSPI_Type *base, uint32_t dstAddr, const uint32_t *src) -{ - status_t status; - flexspi_transfer_t flashXfer; - - /* Write enable */ - status = flexspi_nor_write_enable(base, dstAddr); - - if (status != kStatus_Success) - { - return status; - } - - /* Prepare page program command */ - flashXfer.deviceAddress = dstAddr; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Write; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD; + flashXfer.seqIndex = ROM_INDEX_PAGEPROGRAM; flashXfer.data = (uint32_t *)src; flashXfer.dataSize = FLASH_PAGE_SIZE; status = FLEXSPI_TransferBlocking(base, &flashXfer); @@ -251,92 +140,3 @@ status_t flexspi_nor_flash_page_program(FLEXSPI_Type *base, uint32_t dstAddr, co return status; } - -status_t flexspi_nor_get_vendor_id(FLEXSPI_Type *base, uint8_t *vendorId) -{ - uint32_t temp; - flexspi_transfer_t flashXfer; - flashXfer.deviceAddress = 0; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Read; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_READID; - flashXfer.data = &temp; - flashXfer.dataSize = 1; - - status_t status = FLEXSPI_TransferBlocking(base, &flashXfer); - - *vendorId = temp; - - /* Do software reset. */ -#if defined(FSL_FEATURE_SOC_OTFAD_COUNT) - base->AHBCR |= FLEXSPI_AHBCR_CLRAHBRXBUF_MASK | FLEXSPI_AHBCR_CLRAHBTXBUF_MASK; - base->AHBCR &= ~(FLEXSPI_AHBCR_CLRAHBRXBUF_MASK | FLEXSPI_AHBCR_CLRAHBTXBUF_MASK); -#else - FLEXSPI_SoftwareReset(base); -#endif - - return status; -} - -status_t flexspi_nor_erase_chip(FLEXSPI_Type *base) -{ - status_t status; - flexspi_transfer_t flashXfer; - - /* Write enable */ - status = flexspi_nor_write_enable(base, 0); - - if (status != kStatus_Success) - { - return status; - } - - flashXfer.deviceAddress = 0; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Command; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_ERASECHIP; - - status = FLEXSPI_TransferBlocking(base, &flashXfer); - - if (status != kStatus_Success) - { - return status; - } - - status = flexspi_nor_wait_bus_busy(base); - - return status; -} - -void flexspi_nor_flash_init(FLEXSPI_Type *base) -{ - flexspi_config_t config; - - flexspi_clock_init(); - - /*Get FLEXSPI default settings and configure the flexspi. */ - FLEXSPI_GetDefaultConfig(&config); - - /*Set AHB buffer size for reading data through AHB bus. */ - config.ahbConfig.enableAHBPrefetch = true; - config.ahbConfig.enableAHBBufferable = true; - config.ahbConfig.enableReadAddressOpt = true; - config.ahbConfig.enableAHBCachable = true; -#ifdef BOARD_USING_SECONDARY_QSPI_PINMUX - config.rxSampleClock = kFLEXSPI_ReadSampleClkLoopbackInternally; -#else - config.rxSampleClock = kFLEXSPI_ReadSampleClkLoopbackFromDqsPad; -#endif - FLEXSPI_Init(base, &config); - - /* Configure flash settings according to serial flash feature. */ - FLEXSPI_SetFlashConfig(base, &deviceconfig, kFLEXSPI_PortA1); - - /* Update LUT table. */ - FLEXSPI_UpdateLUT(base, 0, customLUT, CUSTOM_LUT_LENGTH); - - /* Do software reset. */ - FLEXSPI_SoftwareReset(base); -} diff --git a/ports/mimxrt10xx/supervisor/internal_flash.c b/ports/mimxrt10xx/supervisor/internal_flash.c index 09f44ccedf..e194cbed96 100644 --- a/ports/mimxrt10xx/supervisor/internal_flash.c +++ b/ports/mimxrt10xx/supervisor/internal_flash.c @@ -30,6 +30,7 @@ #include #include +#include "boards/board.h" #include "extmod/vfs.h" #include "extmod/vfs_fat.h" #include "py/mphal.h" @@ -50,125 +51,14 @@ extern uint32_t __fatfs_flash_length[]; uint8_t _flash_cache[SECTOR_SIZE] __attribute__((aligned(4))); uint32_t _flash_page_addr = NO_CACHE; -static bool init_done = false; - -flexspi_device_config_t deviceconfig = { - .flexspiRootClk = 133000000, - .flashSize = (BOARD_FLASH_SIZE / 1024), - .CSIntervalUnit = kFLEXSPI_CsIntervalUnit1SckCycle, - .CSInterval = 2, - .CSHoldTime = 3, - .CSSetupTime = 3, - .dataValidTime = 0, - .columnspace = 0, - .enableWordAddress = 0, - .AWRSeqIndex = 0, - .AWRSeqNumber = 0, - .ARDSeqIndex = NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD, - .ARDSeqNumber = 1, - .AHBWriteWaitUnit = kFLEXSPI_AhbWriteWaitUnit2AhbCycle, - .AHBWriteWaitInterval = 0, -}; - -const uint32_t customLUT[CUSTOM_LUT_LENGTH] = { - /* Normal read mode -SDR */ - /* Normal read mode -SDR */ - [4 * NOR_CMD_LUT_SEQ_IDX_READ_NORMAL] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x03, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18), - [4 * NOR_CMD_LUT_SEQ_IDX_READ_NORMAL + 1] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0), - - /* Fast read mode - SDR */ - [4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x0B, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18), - [4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST + 1] = FLEXSPI_LUT_SEQ( - kFLEXSPI_Command_DUMMY_SDR, kFLEXSPI_1PAD, 0x08, kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04), - - /* Fast read quad mode - SDR */ - [4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0xEB, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_4PAD, 0x18), - [4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD + 1] = FLEXSPI_LUT_SEQ( - kFLEXSPI_Command_DUMMY_SDR, kFLEXSPI_4PAD, 0x06, kFLEXSPI_Command_READ_SDR, kFLEXSPI_4PAD, 0x04), - - /* Read extend parameters */ - [4 * NOR_CMD_LUT_SEQ_IDX_READSTATUS] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x81, kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04), - - /* Write Enable */ - [4 * NOR_CMD_LUT_SEQ_IDX_WRITEENABLE] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x06, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0), - - /* Erase Sector */ - [4 * NOR_CMD_LUT_SEQ_IDX_ERASESECTOR] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x20, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18), - - /* Page Program - single mode */ - [4 * NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_SINGLE] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x02, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18), - [4 * NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_SINGLE + 1] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_1PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0), - - /* Page Program - quad mode */ - [4 * NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x32, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18), - [4 * NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD + 1] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_4PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0), - - /* Read ID */ - [4 * NOR_CMD_LUT_SEQ_IDX_READID] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x9F, kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04), - - /* Enable Quad mode */ - [4 * NOR_CMD_LUT_SEQ_IDX_WRITESTATUSREG] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x31, kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_1PAD, 0x04), - - /* Read status register */ - [4 * NOR_CMD_LUT_SEQ_IDX_READSTATUSREG] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x05, kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04), - - /* Erase whole chip */ - [4 * NOR_CMD_LUT_SEQ_IDX_ERASECHIP] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0xC7, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0), -}; extern status_t flexspi_nor_flash_erase_sector(FLEXSPI_Type *base, uint32_t address); extern status_t flexspi_nor_flash_page_program(FLEXSPI_Type *base, uint32_t dstAddr, const uint32_t *src); -extern status_t flexspi_nor_get_vendor_id(FLEXSPI_Type *base, uint8_t *vendorId); extern status_t flexspi_nor_enable_quad_mode(FLEXSPI_Type *base); -extern status_t flexspi_nor_erase_chip(FLEXSPI_Type *base); -extern void flexspi_nor_flash_init(FLEXSPI_Type *base); -void supervisor_flash_init(void) { - if (init_done) - return; - - SCB_DisableDCache(); - - status_t status; - uint8_t vendorID = 0; - - flexspi_nor_flash_init(FLEXSPI); - - /* Get vendor ID. */ - status = flexspi_nor_get_vendor_id(FLEXSPI, &vendorID); - if (status != kStatus_Success) { - printf("flexspi_nor_get_vendor_id fail %ld\r\n", status); - return; - } - - /* Enter quad mode. */ - __disable_irq(); - status = flexspi_nor_enable_quad_mode(FLEXSPI); - if (status != kStatus_Success) - { - printf("flexspi_nor_enable_quad_mode fail %ld\r\n", status); - return; - } - __enable_irq(); - - SCB_EnableDCache(); - - init_done = true; +void PLACE_IN_ITCM(supervisor_flash_init)(void) { + // Update the LUT to make sure all entries are available. + FLEXSPI_UpdateLUT(FLEXSPI, 0, (const uint32_t*) &qspiflash_config.memConfig.lookupTable, 64); } static inline uint32_t lba2addr(uint32_t block) { @@ -183,7 +73,7 @@ uint32_t supervisor_flash_get_block_count(void) { return CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE; } -void port_internal_flash_flush(void) { +void PLACE_IN_ITCM(port_internal_flash_flush)(void) { if (_flash_page_addr == NO_CACHE) return; status_t status; @@ -211,6 +101,7 @@ void port_internal_flash_flush(void) { DCACHE_CleanInvalidateByRange(_flash_page_addr, SECTOR_SIZE); } + _flash_page_addr = NO_CACHE; } mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { diff --git a/ports/mimxrt10xx/supervisor/internal_flash.h b/ports/mimxrt10xx/supervisor/internal_flash.h index daee66620c..ae33fd134f 100644 --- a/ports/mimxrt10xx/supervisor/internal_flash.h +++ b/ports/mimxrt10xx/supervisor/internal_flash.h @@ -34,20 +34,11 @@ #define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms #define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2) -#define CUSTOM_LUT_LENGTH 60 #define FLASH_PAGE_SIZE 256 -#define NOR_CMD_LUT_SEQ_IDX_READ_NORMAL 7 -#define NOR_CMD_LUT_SEQ_IDX_READ_FAST 13 -#define NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD 0 -#define NOR_CMD_LUT_SEQ_IDX_READSTATUS 1 -#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE 2 -#define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 3 -#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_SINGLE 6 -#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD 4 -#define NOR_CMD_LUT_SEQ_IDX_READID 8 -#define NOR_CMD_LUT_SEQ_IDX_WRITESTATUSREG 9 -#define NOR_CMD_LUT_SEQ_IDX_READSTATUSREG 12 -#define NOR_CMD_LUT_SEQ_IDX_ERASECHIP 5 +#define ROM_INDEX_WRITEENABLE 3 +#define ROM_INDEX_ERASESECTOR 5 +#define ROM_INDEX_PAGEPROGRAM 9 +#define ROM_INDEX_READSTATUSREG 1 #endif // MICROPY_INCLUDED_MIMXRT10XX_INTERNAL_FLASH_H diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 38cf16a494..e3fef373f8 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -72,7 +72,8 @@ #define NO_EXECUTION 1 #define EXECUTION 0 -// Shareable if the memory system manages coherency. +// Shareable if the memory system manages coherency. This means shared between memory bus masters, +// not just CPUs. #define NOT_SHAREABLE 0 #define SHAREABLE 1 @@ -207,9 +208,11 @@ __attribute__((used, naked)) void Reset_Handler(void) { MPU->RBAR = ARM_MPU_RBAR(13, 0x20000000U); MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_32KB); - // This is OCRAM. + // This is OCRAM. We mark it as shareable so that it isn't cached. This makes USB work at the + // cost of 1/4 speed OCRAM accesses. It will leave more room for caching data from the flash + // too which might be a net win. MPU->RBAR = ARM_MPU_RBAR(14, 0x20200000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_512KB); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_512KB); // We steal 64k from FlexRAM for ITCM and DTCM so disable those memory regions here. MPU->RBAR = ARM_MPU_RBAR(15, 0x20280000U); @@ -322,19 +325,22 @@ void reset_cpu(void) { reset(); } -supervisor_allocation* port_fixed_stack(void) { - return NULL; -} - extern uint32_t _ld_heap_start, _ld_heap_end, _ld_stack_top, _ld_stack_bottom; uint32_t *port_stack_get_limit(void) { - return &_ld_heap_start; + return &_ld_stack_bottom; } 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; +} + uint32_t *port_heap_get_bottom(void) { return &_ld_heap_start; } diff --git a/ports/mimxrt10xx/supervisor/usb.c b/ports/mimxrt10xx/supervisor/usb.c index af259405a3..91135289c8 100644 --- a/ports/mimxrt10xx/supervisor/usb.c +++ b/ports/mimxrt10xx/supervisor/usb.c @@ -50,10 +50,6 @@ void init_usb_hardware(void) { phytx &= ~(USBPHY_TX_D_CAL_MASK | USBPHY_TX_TXCAL45DM_MASK | USBPHY_TX_TXCAL45DP_MASK); phytx |= USBPHY_TX_D_CAL(0x0C) | USBPHY_TX_TXCAL45DP(0x06) | USBPHY_TX_TXCAL45DM(0x06); usb_phy->TX = phytx; - - // Temporarily disable the data cache until we can sort out all of the spots in TinyUSB that - // need the cache invalidated or cleaned. - SCB_DisableDCache(); } void USB_OTG1_IRQHandler(void) { diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index 8e12dd3625..ef686cbabe 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -29,6 +29,7 @@ #include "py/gc.h" #include "py/mpconfig.h" #include "supervisor/background_callback.h" +#include "supervisor/linker.h" #include "supervisor/shared/tick.h" #include "shared-bindings/microcontroller/__init__.h" @@ -63,7 +64,7 @@ void background_callback_add(background_callback_t *cb, background_callback_fun } static bool in_background_callback; -void background_callback_run_all() { +void PLACE_IN_ITCM(background_callback_run_all)() { if (!callback_head) { return; } diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index f6b94e38b5..88603be0c0 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -105,13 +105,19 @@ void filesystem_init(bool create_allowed, bool force_create) { // set label #ifdef CIRCUITPY_DRIVE_LABEL - f_setlabel(&vfs_fat->fatfs, CIRCUITPY_DRIVE_LABEL); + res = f_setlabel(&vfs_fat->fatfs, CIRCUITPY_DRIVE_LABEL); #else - f_setlabel(&vfs_fat->fatfs, "CIRCUITPY"); + res = f_setlabel(&vfs_fat->fatfs, "CIRCUITPY"); #endif + if (res != FR_OK) { + return; + } // inhibit file indexing on MacOS - f_mkdir(&vfs_fat->fatfs, "/.fseventsd"); + res = f_mkdir(&vfs_fat->fatfs, "/.fseventsd"); + if (res != FR_OK) { + return; + } make_empty_file(&vfs_fat->fatfs, "/.metadata_never_index"); make_empty_file(&vfs_fat->fatfs, "/.Trashes"); make_empty_file(&vfs_fat->fatfs, "/.fseventsd/no_log"); @@ -119,7 +125,10 @@ void filesystem_init(bool create_allowed, bool force_create) { make_sample_code_file(&vfs_fat->fatfs); // create empty lib directory - f_mkdir(&vfs_fat->fatfs, "/lib"); + res = f_mkdir(&vfs_fat->fatfs, "/lib"); + if (res != FR_OK) { + return; + } // and ensure everything is flushed supervisor_flash_flush(); diff --git a/supervisor/shared/flash.c b/supervisor/shared/flash.c index 9f52ddbc48..1e09fe14b3 100644 --- a/supervisor/shared/flash.c +++ b/supervisor/shared/flash.c @@ -88,9 +88,6 @@ static void build_partition(uint8_t *buf, int boot, int type, uint32_t start_blo mp_uint_t flash_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t num_blocks) { if (block_num == 0) { - if (num_blocks > 1) { - return 1; // error - } // fake the MBR so we can decide on our own partition table for (int i = 0; i < 446; i++) { @@ -104,9 +101,13 @@ mp_uint_t flash_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t num_bloc dest[510] = 0x55; dest[511] = 0xaa; - - return 0; // ok - + if (num_blocks > 1) { + dest += 512; + num_blocks -= 1; + // Fall through and do a read from flash. + } else { + return 0; // Done and ok. + } } return supervisor_flash_read_blocks(dest, block_num - PART1_START_BLOCK, num_blocks); } @@ -159,16 +160,37 @@ STATIC mp_obj_t supervisor_flash_obj_writeblocks(mp_obj_t self, mp_obj_t block_n } STATIC MP_DEFINE_CONST_FUN_OBJ_3(supervisor_flash_obj_writeblocks_obj, supervisor_flash_obj_writeblocks); +bool flash_ioctl(size_t cmd, mp_int_t* out_value) { + *out_value = 0; + switch (cmd) { + case BP_IOCTL_INIT: + supervisor_flash_init(); + break; + case BP_IOCTL_DEINIT: + supervisor_flash_flush(); + break; // TODO properly + case BP_IOCTL_SYNC: + supervisor_flash_flush(); + break; + case BP_IOCTL_SEC_COUNT: + *out_value = flash_get_block_count(); + break; + case BP_IOCTL_SEC_SIZE: + *out_value = supervisor_flash_get_block_size(); + break; + default: + return false; + } + return true; +} + STATIC mp_obj_t supervisor_flash_obj_ioctl(mp_obj_t self, mp_obj_t cmd_in, mp_obj_t arg_in) { mp_int_t cmd = mp_obj_get_int(cmd_in); - switch (cmd) { - case BP_IOCTL_INIT: supervisor_flash_init(); return MP_OBJ_NEW_SMALL_INT(0); - case BP_IOCTL_DEINIT: supervisor_flash_flush(); return MP_OBJ_NEW_SMALL_INT(0); // TODO properly - case BP_IOCTL_SYNC: supervisor_flash_flush(); return MP_OBJ_NEW_SMALL_INT(0); - case BP_IOCTL_SEC_COUNT: return MP_OBJ_NEW_SMALL_INT(flash_get_block_count()); - case BP_IOCTL_SEC_SIZE: return MP_OBJ_NEW_SMALL_INT(supervisor_flash_get_block_size()); - default: return mp_const_none; + mp_int_t out_value; + if (flash_ioctl(cmd, &out_value)) { + return MP_OBJ_NEW_SMALL_INT(out_value); } + return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_3(supervisor_flash_obj_ioctl_obj, supervisor_flash_obj_ioctl); @@ -200,4 +222,5 @@ void supervisor_flash_init_vfs(fs_user_mount_t *vfs) { vfs->writeblocks[2] = (mp_obj_t)flash_write_blocks; // native version vfs->u.ioctl[0] = (mp_obj_t)&supervisor_flash_obj_ioctl_obj; vfs->u.ioctl[1] = (mp_obj_t)&supervisor_flash_obj; + vfs->u.ioctl[2] = (mp_obj_t)flash_ioctl; // native version } From ef42d6bb6caaab8599fe0ac6211eca444ca109f1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 7 Oct 2020 16:12:07 -0700 Subject: [PATCH 29/73] Update USB PID --- ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk b/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk index 8cb150bb4b..1a3f7e766c 100644 --- a/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk +++ b/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x8092 +USB_PID = 0x80E2 USB_PRODUCT = "Metro M7 1011" USB_MANUFACTURER = "Adafruit" From 9fcf96cb645d726cd4c80b9cce438f1633dab95f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 7 Oct 2020 17:11:32 -0700 Subject: [PATCH 30/73] Replace _bleio.ConnectionError with the native version Replace uses of _bleio.ConnectionError with regular ConnectionError Fixes #3008 --- ports/nrf/common-hal/_bleio/__init__.c | 4 ++-- shared-bindings/_bleio/CharacteristicBuffer.c | 2 +- shared-bindings/_bleio/Connection.c | 2 +- shared-bindings/_bleio/PacketBuffer.c | 2 +- shared-bindings/_bleio/__init__.c | 15 +-------------- shared-bindings/_bleio/__init__.h | 2 -- 6 files changed, 6 insertions(+), 21 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index 496c9429fe..5293f7ad14 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -50,7 +50,7 @@ void check_nrf_error(uint32_t err_code) { mp_raise_msg(&mp_type_TimeoutError, NULL); return; case BLE_ERROR_INVALID_CONN_HANDLE: - mp_raise_bleio_ConnectionError(translate("Not connected")); + mp_raise_ConnectionError(translate("Not connected")); return; default: mp_raise_bleio_BluetoothError(translate("Unknown soft device error: %04x"), err_code); @@ -115,7 +115,7 @@ bleio_adapter_obj_t common_hal_bleio_adapter_obj = { void common_hal_bleio_check_connected(uint16_t conn_handle) { if (conn_handle == BLE_CONN_HANDLE_INVALID) { - mp_raise_bleio_ConnectionError(translate("Not connected")); + mp_raise_ConnectionError(translate("Not connected")); } } diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c index 7bcbc807e6..4d6c836c13 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.c +++ b/shared-bindings/_bleio/CharacteristicBuffer.c @@ -37,7 +37,7 @@ STATIC void raise_error_if_not_connected(bleio_characteristic_buffer_obj_t *self) { if (!common_hal_bleio_characteristic_buffer_connected(self)) { - mp_raise_bleio_ConnectionError(translate("Not connected")); + mp_raise_ConnectionError(translate("Not connected")); } } diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index b5eeaa9069..fe82af098f 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -63,7 +63,7 @@ void bleio_connection_ensure_connected(bleio_connection_obj_t *self) { if (!common_hal_bleio_connection_get_connected(self)) { - mp_raise_bleio_ConnectionError(translate("Connection has been disconnected and can no longer be used. Create a new connection.")); + mp_raise_ConnectionError(translate("Connection has been disconnected and can no longer be used. Create a new connection.")); } } diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 8c8970939a..f2a3cbce07 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -161,7 +161,7 @@ STATIC mp_obj_t bleio_packet_buffer_write(mp_uint_t n_args, const mp_obj_t *pos_ // gatts write events, which may not have been sent yet. // // IDEAL: - // mp_raise_bleio_ConnectionError(translate("Not connected")); + // mp_raise_ConnectionError(translate("Not connected")); // TEMPORARY: num_bytes_written = 0; } diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index 3d9084dd53..2ef70a64f7 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -63,7 +63,6 @@ //| """Catchall exception for Bluetooth related errors.""" //| ... MP_DEFINE_BLEIO_EXCEPTION(BluetoothError, Exception) - NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...) { va_list argptr; va_start(argptr,fmt); @@ -71,18 +70,6 @@ NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...) va_end(argptr); nlr_raise(exception); } -//| class ConnectionError(BluetoothError): -//| """Raised when a connection is unavailable.""" -//| ... -//| -MP_DEFINE_BLEIO_EXCEPTION(ConnectionError, bleio_BluetoothError) -NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* fmt, ...) { - va_list argptr; - va_start(argptr,fmt); - mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_bleio_ConnectionError, fmt, argptr); - va_end(argptr); - nlr_raise(exception); -} //| class RoleError(BluetoothError): //| """Raised when a resource is used as the mismatched role. For example, if a local CCCD is @@ -93,6 +80,7 @@ MP_DEFINE_BLEIO_EXCEPTION(RoleError, bleio_BluetoothError) NORETURN void mp_raise_bleio_RoleError(const compressed_string_t* msg) { mp_raise_msg(&mp_type_bleio_RoleError, msg); } + //| class SecurityError(BluetoothError): //| """Raised when a security related error occurs.""" //| ... @@ -183,7 +171,6 @@ STATIC const mp_rom_map_elem_t bleio_module_globals_table[] = { // Errors { MP_ROM_QSTR(MP_QSTR_BluetoothError), OBJ_FROM_PTR(&mp_type_bleio_BluetoothError) }, - { MP_ROM_QSTR(MP_QSTR_ConnectionError), OBJ_FROM_PTR(&mp_type_bleio_ConnectionError) }, { MP_ROM_QSTR(MP_QSTR_RoleError), OBJ_FROM_PTR(&mp_type_bleio_RoleError) }, { MP_ROM_QSTR(MP_QSTR_SecurityError), OBJ_FROM_PTR(&mp_type_bleio_SecurityError) }, diff --git a/shared-bindings/_bleio/__init__.h b/shared-bindings/_bleio/__init__.h index 588b1f1973..65ba9b3a5d 100644 --- a/shared-bindings/_bleio/__init__.h +++ b/shared-bindings/_bleio/__init__.h @@ -51,14 +51,12 @@ const mp_obj_type_t mp_type_bleio_ ## exc_name = { \ }; extern const mp_obj_type_t mp_type_bleio_BluetoothError; -extern const mp_obj_type_t mp_type_bleio_ConnectionError; extern const mp_obj_type_t mp_type_bleio_RoleError; extern const mp_obj_type_t mp_type_bleio_SecurityError; extern mp_obj_t bleio_set_adapter(mp_obj_t adapter_obj); NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* msg, ...); -NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* msg, ...); NORETURN void mp_raise_bleio_RoleError(const compressed_string_t* msg); NORETURN void mp_raise_bleio_SecurityError(const compressed_string_t* msg, ...); From d93a1961c4dc3f0bc02b79b6ac116638a4f64794 Mon Sep 17 00:00:00 2001 From: Seon Rozenblum Date: Thu, 8 Oct 2020 14:03:16 +1100 Subject: [PATCH 31/73] Fixed the FeatherS2 prerelease hardware name --- .../boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h index 90a368006a..93d901becb 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h @@ -26,7 +26,7 @@ //Micropython setup -#define MICROPY_HW_BOARD_NAME "FeatherS2" +#define MICROPY_HW_BOARD_NAME "FeatherS2 PreRelease" #define MICROPY_HW_MCU_NAME "ESP32S2" #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) From e1fc85c56bb5e308d497c09eca8154243f85a83c Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 8 Oct 2020 13:30:32 +0700 Subject: [PATCH 32/73] fix usb issue with latest idf --- ports/esp32s2/Makefile | 6 +++--- ports/esp32s2/supervisor/usb.c | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index f8818eca01..935ced7cc0 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -271,7 +271,7 @@ menuconfig: $(BUILD)/esp-idf/config $(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h # Order here matters -ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls +ESP_IDF_COMPONENTS_LINK = freertos log hal esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls ESP_IDF_COMPONENTS_INCLUDE = driver freertos log soc @@ -283,11 +283,11 @@ ESP_IDF_WIFI_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_WIFI_COMPONENT MBEDTLS_COMPONENTS_LINK = crypto tls x509 MBEDTLS_COMPONENTS_LINK_EXPANDED = $(foreach component, $(MBEDTLS_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/mbedtls/mbedtls/library/libmbed$(component).a) -BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libhal.a +BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libxt_hal.a BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a librtc.a libsmartconfig.a libphy.a BINARY_BLOBS += $(addprefix esp-idf/components/esp_wifi/lib/esp32s2/, $(BINARY_WIFI_BLOBS)) -ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/soc/soc/esp32s2/libsoc_esp32s2.a esp-idf/components/xtensa/esp32s2/libhal.a +ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/soc/soc/esp32s2/libsoc_esp32s2.a esp-idf/components/xtensa/esp32s2/libxt_hal.a ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld $(BUILD)/esp-idf/esp-idf/esp32s2/ld/esp32s2.project.ld FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE) diff --git a/ports/esp32s2/supervisor/usb.c b/ports/esp32s2/supervisor/usb.c index c91c2ec4b0..1ad6af0470 100644 --- a/ports/esp32s2/supervisor/usb.c +++ b/ports/esp32s2/supervisor/usb.c @@ -33,6 +33,8 @@ #include "components/driver/include/driver/periph_ctrl.h" #include "components/driver/include/driver/gpio.h" #include "components/esp_rom/include/esp32s2/rom/gpio.h" +#include "components/esp_rom/include/esp_rom_gpio.h" +#include "components/hal/esp32s2/include/hal/gpio_ll.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" @@ -68,6 +70,33 @@ void usb_device_task(void* param) } } +static void configure_pins (usb_hal_context_t *usb) +{ + /* usb_periph_iopins currently configures USB_OTG as USB Device. + * Introduce additional parameters in usb_hal_context_t when adding support + * for USB Host. + */ + for ( const usb_iopin_dsc_t *iopin = usb_periph_iopins; iopin->pin != -1; ++iopin ) { + if ( (usb->use_external_phy) || (iopin->ext_phy_only == 0) ) { + esp_rom_gpio_pad_select_gpio(iopin->pin); + if ( iopin->is_output ) { + esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false); + } + else { + esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false); + if ( (iopin->pin != GPIO_FUNC_IN_LOW) && (iopin->pin != GPIO_FUNC_IN_HIGH) ) { + gpio_ll_input_enable(&GPIO, iopin->pin); + } + } + esp_rom_gpio_pad_unhold(iopin->pin); + } + } + if ( !usb->use_external_phy ) { + gpio_set_drive_capability(USBPHY_DM_NUM, GPIO_DRIVE_CAP_3); + gpio_set_drive_capability(USBPHY_DP_NUM, GPIO_DRIVE_CAP_3); + } +} + void init_usb_hardware(void) { periph_module_reset(PERIPH_USB_MODULE); periph_module_enable(PERIPH_USB_MODULE); @@ -75,10 +104,7 @@ void init_usb_hardware(void) { .use_external_phy = false // use built-in PHY }; usb_hal_init(&hal); - - // Initialize the pin drive strength. - gpio_set_drive_capability(USBPHY_DM_NUM, GPIO_DRIVE_CAP_3); - gpio_set_drive_capability(USBPHY_DP_NUM, GPIO_DRIVE_CAP_3); + configure_pins(&hal); (void) xTaskCreateStatic(usb_device_task, "usbd", From 10b5ab1058f30c7090dd7d892af08ea5e07cf92d Mon Sep 17 00:00:00 2001 From: oon arfiandwi Date: Wed, 7 Oct 2020 01:38:24 +0000 Subject: [PATCH 33/73] Translated using Weblate (Indonesian) Currently translated at 42.0% (349 of 829 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/id/ --- locale/ID.po | 65 +++++++++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index f6cd07a8cb..cff2a24656 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2020-07-06 18:10+0000\n" +"PO-Revision-Date: 2020-10-07 17:22+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" "Language: ID\n" @@ -14,7 +14,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.2-dev\n" +"X-Generator: Weblate 4.3-dev\n" #: main.c msgid "" @@ -1218,32 +1218,32 @@ msgstr "Kesalahan fatal MicroPython." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" -msgstr "" +msgstr "Penundaan mulai mikrofon harus dalam kisaran 0,0 hingga 1,0" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "Tidak menemukan Pin MISO atau MOSI" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." -msgstr "" +msgstr "Harus berupa subclass %q." #: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "Harus menyediakan pin MISO atau MOSI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "Harus menggunakan kelipatan 6 pin rgb, bukan %d" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "Nama terlalu panjang" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" -msgstr "" +msgstr "Tidak ada CCCD untuk Karakteristik ini" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c @@ -1258,12 +1258,12 @@ msgstr "tidak ada channel DMA ditemukan" #: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Tidak ada Pin MISO" #: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Tidak ada Pin MOSI" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c @@ -1281,11 +1281,11 @@ msgstr "Tidak ada pin TX" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "No available clocks" -msgstr "" +msgstr "Tidak ada clocks yang tersedia" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Tidak ada koneksi: panjang tidak dapat ditentukan" #: shared-bindings/board/__init__.c msgid "No default %q bus" @@ -1297,11 +1297,11 @@ msgstr "Tidak ada GCLK yang kosong" #: shared-bindings/os/__init__.c msgid "No hardware random available" -msgstr "" +msgstr "Tidak ada perangkat keras acak yang tersedia" #: ports/atmel-samd/common-hal/ps2io/Ps2.c msgid "No hardware support on clk pin" -msgstr "" +msgstr "Tidak ada dukungan perangkat keras pada pin clk" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -1310,11 +1310,11 @@ msgstr "Tidak ada dukungan hardware untuk pin" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "Tidak ada kunci yang ditentukan" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "" +msgstr "Tidak ada dukungan bilangan bulat yang panjang" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" @@ -1326,7 +1326,7 @@ msgstr "" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." -msgstr "" +msgstr "Tidak ada lagi penghitung waktu yang tersedia pada pin ini." #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" @@ -1334,23 +1334,23 @@ msgstr "" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" -msgstr "" +msgstr "Tidak ada pull-down pada pin; 1Mohm direkomendasikan" #: py/moduerrno.c msgid "No space left on device" -msgstr "" +msgstr "Tidak ada ruang yang tersisa di perangkat" #: py/moduerrno.c msgid "No such file/directory" -msgstr "" +msgstr "Tidak ada file/direktori" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "Penghitung waktu tidak tersedia" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." -msgstr "" +msgstr "Pernyataan kegagalan Perangkat Lunak Nordic." #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" @@ -1365,7 +1365,7 @@ msgstr "Tidak dapat menyambungkan ke AP" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c #: shared-bindings/audiopwmio/PWMAudioOut.c msgid "Not playing" -msgstr "" +msgstr "Tidak berfungsi" #: main.c msgid "Not running saved code.\n" @@ -1379,6 +1379,7 @@ msgstr "" msgid "" "Object has been deinitialized and can no longer be used. Create a new object." msgstr "" +"Objek telah dideinisialisasi dan tidak dapat lagi digunakan. Buat objek baru." #: ports/nrf/common-hal/busio/UART.c msgid "Odd parity is not supported" @@ -1401,6 +1402,8 @@ msgstr "" msgid "" "Only Windows format, uncompressed BMP supported: given header size is %d" msgstr "" +"Hanya format Windows, mendukung BMP tidak dikompresi: ukuran header yang " +"diberikan adalah %d" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1408,6 +1411,8 @@ msgid "" "Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " "%d bpp given" msgstr "" +"Hanya monokrom, 4bpp atau 8bpp yang diindeks, dan 16bpp atau lebih yang " +"didukung: %d bpp diberikan" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" @@ -1419,27 +1424,29 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." -msgstr "" +msgstr "Sampel berlebihan harus kelipatan 8." #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" +msgstr "PWM duty_cycle harus antara 0 dan 65535 inklusif (resolusi 16 bit)" #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +"Frekuensi PWM tidak dapat ditulis ketika variabel_frequency Salah pada " +"konstruksi." #: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "" +msgstr "ParallelBus belum didukung" #: py/moduerrno.c msgid "Permission denied" -msgstr "" +msgstr "Izin ditolak" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c @@ -1455,7 +1462,7 @@ msgstr "" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "Pin harus mendukung interupsi perangkat keras" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" From e0f6d883f57aeee1b8785c500096fe96113adbf9 Mon Sep 17 00:00:00 2001 From: oon arfiandwi Date: Thu, 8 Oct 2020 15:03:19 +0000 Subject: [PATCH 34/73] Translated using Weblate (Indonesian) Currently translated at 43.9% (364 of 829 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/id/ --- locale/ID.po | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index cff2a24656..2ad8acd9b0 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2020-10-07 17:22+0000\n" +"PO-Revision-Date: 2020-10-08 16:22+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" "Language: ID\n" @@ -1466,7 +1466,7 @@ msgstr "Pin harus mendukung interupsi perangkat keras" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "" +msgstr "Nomor pin sudah dipesan oleh EXTI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1475,6 +1475,9 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" +"Pinout menggunakan %d byte per elemen, yang mengonsumsi lebih dari %d byte " +"ideal. Jika ini tidak dapat dihindari, berikan allow_inefficient=True ke " +"konstruktor" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -1501,7 +1504,7 @@ msgstr "" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "" +msgstr "Buffer awalan harus ada di heap" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." @@ -1511,43 +1514,43 @@ msgstr "" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." -msgstr "" +msgstr "Pull tidak digunakan saat arah output." #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "" +msgstr "Kesalahan DeInit RNG" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "" +msgstr "Kesalahan Init 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 "" +msgstr "Pembalikan RS485 ditentukan saat tidak dalam mode 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 msgid "RTC calibration is not supported on this board" -msgstr "" +msgstr "Kalibrasi RTC tidak didukung pada board ini" #: shared-bindings/time/__init__.c msgid "RTC is not supported on this board" -msgstr "" +msgstr "RTC tidak didukung di board ini" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" +msgstr "RTS/CTS/RS485 Belum didukung pada perangkat ini" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" -msgstr "" +msgstr "Kesalahan pembuatan nomor acak" #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" -msgstr "" +msgstr "Baca-saja" #: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" @@ -1560,7 +1563,7 @@ msgstr "sistem file (filesystem) bersifat Read-only" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" -msgstr "" +msgstr "Segarkan terlalu cepat" #: shared-bindings/canio/RemoteTransmissionRequest.c msgid "RemoteTransmissionRequests limited to 8 bytes" @@ -1568,7 +1571,7 @@ msgstr "" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "Mode AES yang diminta tidak didukung" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1576,7 +1579,7 @@ msgstr "Channel Kanan tidak didukung" #: shared-bindings/_pew/PewPew.c msgid "Row entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "Entri baris harus digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! " From 860bba05550a08751870446d6c4dafe6af46a2a8 Mon Sep 17 00:00:00 2001 From: hexthat Date: Thu, 8 Oct 2020 02:26:21 +0000 Subject: [PATCH 35/73] Translated using Weblate (Chinese (Pinyin)) Currently translated at 99.8% (828 of 829 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 144 ++++++++++++++++++++------------------- 1 file changed, 73 insertions(+), 71 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 6e65fa13a0..32af6c2c6f 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,14 +7,15 @@ msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2019-04-13 10:10-0700\n" -"Last-Translator: hexthat\n" +"PO-Revision-Date: 2020-10-08 16:22+0000\n" +"Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" -"Language: zh\n" +"Language: zh_Latn_pinyin\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.2.1\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 4.3-dev\n" #: main.c msgid "" @@ -99,7 +100,7 @@ msgstr "%q bìxū shì chángdù wèi 2 de yuán zǔ" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q chāochū fànwéi" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" @@ -119,7 +120,7 @@ msgstr "xūyào '%q' cānshù" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "'%q' duì xiàng wú fǎ fēn pèi shǔ xìng '%q'" +msgstr "'%q' duì xiàng wú fǎ fēn pèi shǔ xìng '%q'" #: py/proto.c msgid "'%q' object does not support '%q'" @@ -291,7 +292,7 @@ msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "Suǒyǒu shǐyòng zhōng de RX FIFO" #: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" @@ -330,11 +331,11 @@ msgstr "Suǒyǒu jìshí qì shǐyòng" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "Mùqián zhèngzài guǎngbò" +msgstr "Mùqián zhèngzài guǎngbò." #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" -msgstr "" +msgstr "yǐ jù yǒu quán pǐ pèi zhēn tīng qì" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c @@ -343,7 +344,7 @@ msgstr "yǐ zài yùn xíng" #: ports/esp32s2/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" -msgstr "" +msgstr "yǐ jīng sǎo miáo WIFI wǎng luò" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -391,7 +392,7 @@ msgstr "MicroPython VM zài wèi yùnxíng shí chángshì fēnpèi duī." #: shared-bindings/wifi/Radio.c msgid "Authentication failure" -msgstr "" +msgstr "shēn fèn yàn zhèng shī bài" #: main.c msgid "Auto-reload is off.\n" @@ -454,7 +455,7 @@ msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè. Yīnggāi shì %d zì jié." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "Huǎnchōng qū bùshì bytearray" +msgstr "Huǎnchōng qū bùshì bytearray." #: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c @@ -508,7 +509,7 @@ msgstr "CBC kuài bì xū shì 16 zì jié de bèi shù" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "Zài fǎngwèn běn jī wùjiàn zhīqián diàoyòng super().__init__()" +msgstr "Zài fǎngwèn běn jī wùjiàn zhīqián diàoyòng super().__init__()." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" @@ -516,7 +517,7 @@ msgstr "Wúfǎ jiāng CCCD shèzhì wéi běndì tèzhēng" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" -msgstr "" +msgstr "Wúfǎ chuàngjiàn xīn de shìpèiqì; shǐyòng_bleio.Adapter;" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c @@ -607,7 +608,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap.\n" -msgstr "" +msgstr "CircuitPython wúfǎ fēnpèi duī.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -646,7 +647,7 @@ msgstr "Sǔnhuài de yuánshǐ dàimǎ" #: ports/cxd56/common-hal/camera/Camera.c msgid "Could not initialize Camera" -msgstr "" +msgstr "Wúfǎ chūshǐhuà xiàngjī" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -683,7 +684,7 @@ msgstr "Wúfǎ chóngqǐ PWM" #: ports/esp32s2/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" -msgstr "" +msgstr "Wúfǎ huòqǔ shízhōng" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" @@ -777,7 +778,7 @@ msgstr "ECB yí cì zhǐ shǐ yòng 16 gè zì jié" #: ports/esp32s2/common-hal/busio/SPI.c msgid "ESP-IDF memory allocation failed" -msgstr "" +msgstr "ESP-IDF nèicún fēnpèi shībài" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -804,7 +805,7 @@ msgstr "Yùqí de tèdiǎn" #: shared-bindings/_bleio/Adapter.c msgid "Expected a DigitalInOut" -msgstr "" +msgstr "yù qī shù zì huà" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" @@ -812,7 +813,7 @@ msgstr "Yùqí fúwù" #: shared-bindings/_bleio/Adapter.c msgid "Expected a UART" -msgstr "" +msgstr "qī dài UART" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -838,7 +839,7 @@ msgstr "FFT jǐn wéi ndarrays dìng yì" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" -msgstr "" +msgstr "SSL wòshǒu shībài" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -865,11 +866,11 @@ msgstr "Fēnpèi RX huǎnchōng qū%d zì jié shībài" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" -msgstr "" +msgstr "Wúfǎ fēnpèi Wifi nèicún" #: ports/esp32s2/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" -msgstr "" +msgstr "Wúfǎ fēnpèi wifi sǎomiáo nèicún" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" @@ -881,7 +882,7 @@ msgstr "Liánjiē shībài: Chāoshí" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to init wifi" -msgstr "" +msgstr "Wúfǎ chūshǐhuà wifi" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" @@ -902,11 +903,11 @@ msgstr "Wénjiàn cúnzài" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Filters too complex" -msgstr "" +msgstr "guò lǜ qì tài fù zá" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "Bù zhīyuán géshì" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format @@ -976,7 +977,7 @@ msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" -msgstr "" +msgstr "Shūrù shíjiānguò zhǎng" #: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" @@ -1023,7 +1024,7 @@ msgstr "Wúxiào de BMP wénjiàn" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "Wúxiào de BSSID" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" @@ -1073,7 +1074,7 @@ msgstr "Géshì kuài dàxiǎo wúxiào" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "" +msgstr "Wúxiào de pínlǜ" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" @@ -1196,7 +1197,7 @@ msgstr "Jìngxiàng shí de zuìdà X zhí wèi%d" #: shared-bindings/canio/Message.c msgid "Messages limited to 8 bytes" -msgstr "" +msgstr "Yóujiàn xiànzhì wèi 8 gè zì jié" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." @@ -1308,11 +1309,11 @@ msgstr "Méiyǒu zhǎng zhěngshù zhīchí" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" -msgstr "" +msgstr "Méiyǒu gèng duō kěyòng píndào" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more timers available" -msgstr "" +msgstr "Méiyǒu gèng duō kěyòng de jìshí qì" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." @@ -1320,7 +1321,7 @@ msgstr "Gāi yǐn jiǎo shàng méiyǒu kěyòng de dìngshí qì." #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" -msgstr "" +msgstr "Méiyǒu wǎngluò yǔ gāi ssid" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1344,7 +1345,7 @@ msgstr "Nordic ruǎn shèbèi gùzhàng shēngmíng." #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" -msgstr "" +msgstr "Wúxiào de IP zìfú chuàn" #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1362,7 +1363,7 @@ msgstr "Méiyǒu yùnxíng yǐ bǎocún de dàimǎ.\n" #: shared-bindings/_bleio/__init__.c msgid "Not settable" -msgstr "" +msgstr "bù kě shè zhì" #: shared-bindings/util.c msgid "" @@ -1380,11 +1381,11 @@ 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 "" +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 "" +msgstr "Jǐn zhīchí IPv4 dìzhǐ" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1405,11 +1406,11 @@ msgstr "" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" -msgstr "" +msgstr "Ip jǐn zhīchí raw int" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Out of sockets" -msgstr "" +msgstr "tào jiē zì wài" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1479,7 +1480,7 @@ msgstr "Duōbiānxíng zhìshǎo xūyào 3 diǎn" msgid "" "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " "instead" -msgstr "" +msgstr "Duānkǒu bù jiēshòu PWM zàibō. Tōngguò yǐn jiǎo, pínlǜ hé zhàn kōng bǐ" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c @@ -1488,7 +1489,7 @@ msgstr "" msgid "" "Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " "instead" -msgstr "" +msgstr "Duānkǒu bù jiēshòu yǐn jiǎo huò pínlǜ. Gòuzào bìng chuándì PWMOut zàibō" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -1552,7 +1553,7 @@ msgstr "Shuāxīn tài kuàile" #: shared-bindings/canio/RemoteTransmissionRequest.c msgid "RemoteTransmissionRequests limited to 8 bytes" -msgstr "" +msgstr "RemoteTransmissionRequests xiànzhì wèi 8 gè zì jié" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" @@ -1568,7 +1569,7 @@ msgstr "Xíng xiàng bìxū shì digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! " -msgstr "Zài ānquán móshì xià yùnxíng!" +msgstr "Zài ānquán móshì xià yùnxíng! " #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1625,11 +1626,11 @@ msgstr "Xùliè huà yǐjīng shǐyòngguò" #: shared-bindings/ssl/SSLContext.c msgid "Server side context cannot have hostname" -msgstr "" +msgstr "Fúwùqì duān shàngxiàwén bùnéng jùyǒu zhǔjī míng" #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" -msgstr "" +msgstr "bù zhī chí dà xiǎo" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." @@ -1644,7 +1645,7 @@ msgstr "Qiēpiàn bù shòu zhīchí" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" -msgstr "" +msgstr "SocketPool zhǐ néng yǔ wifi.Radio yīqǐ shǐyòng" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" @@ -1692,7 +1693,7 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" -msgstr "" +msgstr "Rgb_pins de chángdù bìxū wèi 6,12,18,24 huò 30" #: supervisor/shared/safe_mode.c msgid "" @@ -1823,7 +1824,7 @@ msgstr "Wúfǎ fēnpèi huǎnchōng qū yòng yú qiānmíng zhuǎnhuàn" #: ports/esp32s2/common-hal/busio/I2C.c msgid "Unable to create lock" -msgstr "" +msgstr "Wúfǎ chuàngjiàn suǒ" #: shared-module/displayio/I2CDisplay.c #, c-format @@ -1854,11 +1855,11 @@ msgstr "Yìwài de nrfx uuid lèixíng" #: ports/esp32s2/common-hal/socketpool/Socket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" -msgstr "" +msgstr "Wèi chǔlǐ de ESP TLS cuòwù %d %d %x %d" #: shared-bindings/wifi/Radio.c msgid "Unknown failure" -msgstr "" +msgstr "Wèizhī gùzhàng" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -1946,7 +1947,7 @@ msgstr "WatchDogTimer dāngqián wèi yùnxíng" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -"Yīdàn shèzhì wèi WatchDogMode.RESET, zé bùnéng gēnggǎi WatchDogTimer.Mode." +"Yīdàn shèzhì wèi WatchDogMode.RESET, zé bùnéng gēnggǎi WatchDogTimer.Mode" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.timeout must be greater than 0" @@ -1967,13 +1968,14 @@ msgid "" msgstr "" "Huānyíng lái dào Adafruit CircuitPython%s!\n" "\n" -"Qǐng fǎngwèn xuéxí. learn.Adafruit.com/category/circuitpython.\n" +"Qǐng fǎngwèn learn.Adafruit.Com/category/circuitpython yǐ huòqǔ xiàngmù " +"zhǐnán.\n" "\n" -"Ruò yào liè chū nèizài de mókuài, qǐng qǐng zuò yǐxià `help(\"modules\")`.\n" +"Yào liè chū nèizhì mókuài, qǐng zhíxíng `help(“modules”)`\n" #: shared-bindings/wifi/Radio.c msgid "WiFi password must be between 8 and 63 characters" -msgstr "" +msgstr "WiFi mìmǎ bìxū jiè yú 8 dào 63 gè zìfú zhī jiān" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" @@ -1989,7 +1991,7 @@ msgstr "Nín qǐngqiú qǐdòng ānquán móshì " #: py/objtype.c msgid "__init__() should return None" -msgstr "__init__() fǎnhuí not" +msgstr "__init__() fǎnhuí not" #: py/objtype.c msgid "__init__() should return None, not '%q'" @@ -2145,7 +2147,7 @@ msgstr "zì jié > 8 wèi" #: py/objarray.c msgid "bytes length not a multiple of item size" -msgstr "" +msgstr "zì jié chángdù, bùshì xiàngmù dàxiǎo de bèishù" #: py/objstr.c msgid "bytes value out of range" @@ -2405,7 +2407,8 @@ msgstr "mòrèn 'except' bìxū shì zuìhòu yīgè" msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" msgstr "" -"mùbiāo huǎnchōng qū bìxū shì zì yǎnlèi huò lèixíng 'B' wèi wèi shēndù = 8" +"Duìyú bit_depth = 8, mùbiāo huǎnchōng qū bìxū shì zì jié shùzǔ huò lèixíng " +"wèi 'B' de shùzǔ" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" @@ -2463,11 +2466,11 @@ msgstr "lìwài bìxū láizì BaseException" #: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" -msgstr "" +msgstr "yùqí wèi'%q'dàn dédàole'%q'" #: shared-bindings/canio/CAN.c msgid "expected '%q' or '%q' but got '%q'" -msgstr "" +msgstr "yùqí wèi'%q'huò'%q', dàn huòdéle'%q'" #: py/objstr.c msgid "expected ':' after format specifier" @@ -2680,7 +2683,7 @@ msgstr "chūshǐ zhí bìxū shì kě diédài de" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "initial_value length is wrong" -msgstr "" +msgstr "Initial_value chángdù cuòwù" #: py/compile.c msgid "inline assembler must be a function" @@ -2877,7 +2880,7 @@ msgstr "Dāng gùdìng chángdù wèi %s shí, zuìdà chángdù bìxū wèi 0-% #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "max_length must be > 0" -msgstr "" +msgstr "Max_length bìxū > 0" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -2937,9 +2940,8 @@ msgid "name reused for argument" msgstr "cān shǔ míngchēng bèi chóngxīn shǐyòng" #: py/emitnative.c -#, fuzzy msgid "native yield" -msgstr "yuánshēng chǎnliàng" +msgstr "yuán chǎn" #: py/runtime.c #, c-format @@ -3116,11 +3118,11 @@ msgstr "ord() yùqí zìfú, dàn chángdù zìfú chuàn %d" #: shared-bindings/displayio/Bitmap.c msgid "out of range of source" -msgstr "" +msgstr "yuán fàn wéi wài" #: shared-bindings/displayio/Bitmap.c msgid "out of range of target" -msgstr "" +msgstr "mù biāo fàn wéi wài" #: py/objint_mpz.c msgid "overflow converting long int to machine word" @@ -3129,7 +3131,7 @@ msgstr "chāo gāo zhuǎnhuàn zhǎng zhěng shùzì shí" #: py/modstruct.c #, c-format msgid "pack expected %d items for packing (got %d)" -msgstr "" +msgstr "bāo zhuāng yù qī de %d bāo zhuāng xiàng mù (dé dào %d)" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" @@ -3169,7 +3171,7 @@ msgstr "duōbiānxíng zhī néng zài yīgè fù jí zhōng zhùcè" #: ports/esp32s2/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" -msgstr "cóng kōng de PulseIn dànchū dànchū" +msgstr "cóng kōng mài chōng tán chū" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -3195,7 +3197,7 @@ msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h msgid "pressing boot button at start up.\n" -msgstr "" +msgstr "Zài qǐdòng shí àn qǐdòng ànniǔ.\n" #: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h #: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -3203,7 +3205,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 "zài qǐdòng shí tóngshí àn xià liǎng gè ànniǔ.\n" #: extmod/modutimeq.c msgid "queue overflow" @@ -3330,7 +3332,7 @@ msgstr "sosfilt xūyào diédài cānshù" #: shared-bindings/displayio/Bitmap.c msgid "source palette too large" -msgstr "" +msgstr "yuán miànbǎn tài dà" #: py/objstr.c msgid "start/end indices" @@ -3571,7 +3573,7 @@ msgstr "kān mén gǒu chāoshí bìxū dàyú 0" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" -msgstr "" +msgstr "kuāndù bìxū dàyú líng" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" From 76f431df704174f99f269c29382e82a0e4e03c21 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 8 Oct 2020 11:02:14 -0700 Subject: [PATCH 36/73] Fix ble_hci --- devices/ble_hci/common-hal/_bleio/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index 9fc4b480d9..8d6d764155 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -98,7 +98,7 @@ bleio_adapter_obj_t *common_hal_bleio_allocate_adapter_or_raise(void) { void common_hal_bleio_check_connected(uint16_t conn_handle) { if (conn_handle == BLE_CONN_HANDLE_INVALID) { - mp_raise_bleio_ConnectionError(translate("Not connected")); + mp_raise_ConnectionError(translate("Not connected")); } } From 5af1e054a74a9d088c3c2ca2bbac86ebd326d937 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 8 Oct 2020 14:57:41 -0400 Subject: [PATCH 37/73] Fix strange merge submodule edit --- ports/atmel-samd/peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 2ff4ab0510..a7e39c4d01 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 2ff4ab05101ce7d3e105009cc6612df6e992123f +Subproject commit a7e39c4d01aa5916015beecb021777617e77b0ad From 3149f5bfd8baa59b52fbd8e98c036caa53cd2ce6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 8 Oct 2020 13:58:45 -0500 Subject: [PATCH 38/73] workflows: Replace deprecated ::set-env --- .github/workflows/build.yml | 6 +++--- .github/workflows/pre-commit.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc3dc68352..dcd91b312e 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: @@ -132,7 +132,7 @@ jobs: - name: Install dependencies run: | brew install gettext awscli - echo "::set-env name=PATH::/usr/local/opt/gettext/bin:$PATH" + echo >>$GITHUB_PATH /usr/local/opt/gettext/bin - name: Versions run: | gcc --version @@ -146,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 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 9663103046..eac9bfe096 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-python@v1 - name: set PY - run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" + run: echo >>$GITHUB_ENV PY="$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" - uses: actions/cache@v1 with: path: ~/.cache/pre-commit From ccbc15046a818094124565667d9687ff41e1b0a8 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 9 Oct 2020 13:29:35 -0400 Subject: [PATCH 39/73] Fix submodule issue --- ports/atmel-samd/peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 2ff4ab0510..a7e39c4d01 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 2ff4ab05101ce7d3e105009cc6612df6e992123f +Subproject commit a7e39c4d01aa5916015beecb021777617e77b0ad From 3ccf644dd0afd85ad8d8c6c67494cebab172b5a8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 9 Oct 2020 12:53:00 -0700 Subject: [PATCH 40/73] Fix autoreload on SAMD21 The issue was that a time.sleep() would set the RTC wake up further into the future even if we wanted to tick every ms. Ticking every ms is used to time the autoreload delay and without it, autoreload doesn't work. Fixes #3528 --- ports/atmel-samd/supervisor/port.c | 58 +++++++++++++++++------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 8d52c30c53..e69062296d 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -430,6 +430,33 @@ uint32_t port_get_saved_word(void) { static volatile uint64_t overflowed_ticks = 0; static volatile bool _ticks_enabled = false; +static uint32_t _get_count(void) { + #ifdef SAM_D5X_E5X + while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {} + #endif + #ifdef SAMD21 + while (RTC->MODE0.STATUS.bit.SYNCBUSY != 0) {} + #endif + + return RTC->MODE0.COUNT.reg; +} + +static void _port_interrupt_after_ticks(uint32_t ticks) { + uint32_t current_ticks = _get_count(); + if (ticks > 1 << 28) { + // We'll interrupt sooner with an overflow. + return; + } +#ifdef SAMD21 + if (hold_interrupt) { + return; + } +#endif + RTC->MODE0.COMP[0].reg = current_ticks + (ticks << 4); + RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0; + RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_CMP0; +} + void RTC_Handler(void) { uint32_t intflag = RTC->MODE0.INTFLAG.reg; if (intflag & RTC_MODE0_INTFLAG_OVF) { @@ -452,7 +479,7 @@ void RTC_Handler(void) { supervisor_tick(); // Check _ticks_enabled again because a tick handler may have turned it off. if (_ticks_enabled) { - port_interrupt_after_ticks(1); + _port_interrupt_after_ticks(1); } } #endif @@ -462,17 +489,6 @@ void RTC_Handler(void) { } } -static uint32_t _get_count(void) { - #ifdef SAM_D5X_E5X - while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {} - #endif - #ifdef SAMD21 - while (RTC->MODE0.STATUS.bit.SYNCBUSY != 0) {} - #endif - - return RTC->MODE0.COUNT.reg; -} - uint64_t port_get_raw_ticks(uint8_t* subticks) { uint32_t current_ticks = _get_count(); if (subticks != NULL) { @@ -490,7 +506,7 @@ void port_enable_tick(void) { #endif #ifdef SAMD21 _ticks_enabled = true; - port_interrupt_after_ticks(1); + _port_interrupt_after_ticks(1); #endif } @@ -505,20 +521,14 @@ void port_disable_tick(void) { #endif } +// This is called by sleep, we ignore it when our ticks are enabled because +// they'll wake us up earlier. If we don't, we'll mess up ticks by overwriting +// the next RTC wake up time. void port_interrupt_after_ticks(uint32_t ticks) { - uint32_t current_ticks = _get_count(); - if (ticks > 1 << 28) { - // We'll interrupt sooner with an overflow. + if (_ticks_enabled) { return; } -#ifdef SAMD21 - if (hold_interrupt) { - return; - } -#endif - RTC->MODE0.COMP[0].reg = current_ticks + (ticks << 4); - RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0; - RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_CMP0; + _port_interrupt_after_ticks(ticks); } void port_sleep_until_interrupt(void) { From 70a94c8d2dec709e6692a89131f04e05b81bcae0 Mon Sep 17 00:00:00 2001 From: lady ada Date: Sat, 10 Oct 2020 12:27:35 -0400 Subject: [PATCH 41/73] fix for https://github.com/adafruit/circuitpython/issues/3534 --- ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h index 0368d577bf..cbca94e030 100644 --- a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h @@ -15,8 +15,8 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define DEFAULT_I2C_BUS_SCL (&pin_PB03) -#define DEFAULT_I2C_BUS_SDA (&pin_PB02) +#define DEFAULT_I2C_BUS_SCL (&pin_PB30) +#define DEFAULT_I2C_BUS_SDA (&pin_PB31) #define DEFAULT_SPI_BUS_SCK (&pin_PA16) #define DEFAULT_SPI_BUS_MOSI (&pin_PA19) From 5e38bb98cbcc2d1ab607b19d11e628def4f48f4c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 10 Oct 2020 14:30:37 -0500 Subject: [PATCH 42/73] rgbmatrix: update protomatter to 1.0.5 tag this is compile-tested on stm32f405 feather matrixportal nrf52840 feather but not actually tested-tested. --- lib/protomatter | 2 +- py/circuitpy_defns.mk | 4 ++-- shared-bindings/rgbmatrix/RGBMatrix.h | 2 +- shared-module/rgbmatrix/RGBMatrix.c | 12 ++++++------ shared-module/rgbmatrix/RGBMatrix.h | 2 +- shared-module/rgbmatrix/allocator.h | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/protomatter b/lib/protomatter index 5f07ec6188..de6b7704c5 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 5f07ec6188852794a94138763e612844842f13e4 +Subproject commit de6b7704c530d886ad8dfa0fa1864764d86117ee diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 76c0a4db67..525e0b2bf2 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -528,10 +528,10 @@ SRC_MOD += $(addprefix lib/mp3/src/, \ $(BUILD)/lib/mp3/src/buffers.o: CFLAGS += -include "py/misc.h" -D'MPDEC_ALLOCATOR(x)=m_malloc(x,0)' -D'MPDEC_FREE(x)=m_free(x)' endif ifeq ($(CIRCUITPY_RGBMATRIX),1) -SRC_MOD += $(addprefix lib/protomatter/, \ +SRC_MOD += $(addprefix lib/protomatter/src/, \ core.c \ ) -$(BUILD)/lib/protomatter/core.o: CFLAGS += -include "shared-module/rgbmatrix/allocator.h" -DCIRCUITPY -Wno-missing-braces +$(BUILD)/lib/protomatter/src/core.o: CFLAGS += -include "shared-module/rgbmatrix/allocator.h" -DCIRCUITPY -Wno-missing-braces endif # All possible sources are listed here, and are filtered by SRC_PATTERNS. diff --git a/shared-bindings/rgbmatrix/RGBMatrix.h b/shared-bindings/rgbmatrix/RGBMatrix.h index 1dc5a406ca..bfe37c3404 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.h +++ b/shared-bindings/rgbmatrix/RGBMatrix.h @@ -27,7 +27,7 @@ #pragma once #include "shared-module/rgbmatrix/RGBMatrix.h" -#include "lib/protomatter/core.h" +#include "lib/protomatter/src/core.h" extern const mp_obj_type_t rgbmatrix_RGBMatrix_type; diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index 3007ca4db5..a775181309 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); + _PM_free(self->bufinfo.buf); + _PM_free(self->protomatter.rgbPins); + _PM_free(self->protomatter.addr); + _PM_free(self->protomatter.screenData); self->framebuffer = NULL; self->bufinfo.buf = common_hal_rgbmatrix_allocator_impl(self->bufsize); @@ -164,13 +164,13 @@ void common_hal_rgbmatrix_rgbmatrix_deinit(rgbmatrix_rgbmatrix_obj_t* self) { free_pin(&self->oe_pin); if (self->protomatter.rgbPins) { - _PM_free(&self->protomatter); + _PM_deallocate(&self->protomatter); } memset(&self->protomatter, 0, sizeof(self->protomatter)); // If it was supervisor-allocated, it is supervisor-freed and the pointer // is zeroed, otherwise the pointer is just zeroed - _PM_FREE(self->bufinfo.buf); + _PM_free(self->bufinfo.buf); self->base.type = NULL; // If a framebuffer was passed in to the constructor, NULL the reference diff --git a/shared-module/rgbmatrix/RGBMatrix.h b/shared-module/rgbmatrix/RGBMatrix.h index 19d7d5f2e7..6dbc6fd41e 100644 --- a/shared-module/rgbmatrix/RGBMatrix.h +++ b/shared-module/rgbmatrix/RGBMatrix.h @@ -26,7 +26,7 @@ #pragma once -#include "lib/protomatter/core.h" +#include "lib/protomatter/src/core.h" extern const mp_obj_type_t rgbmatrix_RGBMatrix_type; typedef struct { diff --git a/shared-module/rgbmatrix/allocator.h b/shared-module/rgbmatrix/allocator.h index 323fa5ec06..3431046d5b 100644 --- a/shared-module/rgbmatrix/allocator.h +++ b/shared-module/rgbmatrix/allocator.h @@ -31,7 +31,7 @@ #include "py/misc.h" #include "supervisor/memory.h" -#define _PM_ALLOCATOR common_hal_rgbmatrix_allocator_impl -#define _PM_FREE(x) (common_hal_rgbmatrix_free_impl((x)), (x)=NULL, (void)0) +#define _PM_allocate common_hal_rgbmatrix_allocator_impl +#define _PM_free(x) (common_hal_rgbmatrix_free_impl((x)), (x)=NULL, (void)0) extern void *common_hal_rgbmatrix_allocator_impl(size_t sz); extern void common_hal_rgbmatrix_free_impl(void *); From d94d2d297552decfc1f02b84c898127eb14e96bf Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 31 May 2020 13:09:45 -0700 Subject: [PATCH 43/73] Add async/await syntax to FULL_BUILD This adds the `async def` and `await` verbs to valid CircuitPython syntax using the Micropython implementation. Consider: ``` >>> class Awaitable: ... def __iter__(self): ... for i in range(3): ... print('awaiting', i) ... yield ... return 42 ... >>> async def wait_for_it(): ... a = Awaitable() ... result = await a ... return result ... >>> task = wait_for_it() >>> next(task) awaiting 0 >>> next(task) awaiting 1 >>> next(task) awaiting 2 >>> next(task) Traceback (most recent call last): File "", line 1, in StopIteration: 42 >>> ``` and more excitingly: ``` >>> async def it_awaits_a_subtask(): ... value = await wait_for_it() ... print('twice as good', value * 2) ... >>> task = it_awaits_a_subtask() >>> next(task) awaiting 0 >>> next(task) awaiting 1 >>> next(task) awaiting 2 >>> next(task) twice as good 84 Traceback (most recent call last): File "", line 1, in StopIteration: ``` Note that this is just syntax plumbing, not an all-encompassing implementation of an asynchronous task scheduler or asynchronous hardware apis. uasyncio might be a good module to bring in, or something else - but the standard Python syntax does not _strictly require_ deeper hardware support. Micropython implements the await verb via the __iter__ function rather than __await__. It's okay. The syntax being present will enable users to write clean and expressive multi-step state machines that are written serially and interleaved according to the rules provided by those users. Given that this does not include an all-encompassing C scheduler, this is expected to be an advanced functionality until the community settles on the future of deep hardware support for async/await in CircuitPython. Users will implement yield-based schedulers and tasks wrapping synchronous hardware APIs with polling to avoid blocking, while their application business logic gets simple `await` statements. --- py/circuitpy_mpconfig.h | 1 - py/circuitpy_mpconfig.mk | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 0583ae1c97..5ffdd4c8f3 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -79,7 +79,6 @@ #define MICROPY_PY_ARRAY (1) #define MICROPY_PY_ARRAY_SLICE_ASSIGN (1) -#define MICROPY_PY_ASYNC_AWAIT (0) #define MICROPY_PY_ATTRTUPLE (1) #define MICROPY_PY_BUILTINS_BYTEARRAY (1) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 9b9bd83b4d..cab6d339e5 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -290,3 +290,6 @@ CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI) # Enabled micropython.native decorator (experimental) CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) + +# async/await language keyword support +MICROPY_PY_ASYNC_AWAIT ?= $(CIRCUITPY_FULL_BUILD) From f5f1e29dc0503483ecdaef853b0b9361a5731b55 Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 31 May 2020 14:25:09 -0700 Subject: [PATCH 44/73] disable async/await on a several small ucontrollers --- ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk | 1 + ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk | 3 +++ .../atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/datum_distance/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/datum_imu/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/datum_light/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/datum_weather/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/shirtty/mpconfigboard.mk | 3 +++ .../boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/uchip/mpconfigboard.mk | 1 + ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk | 3 +++ ports/nrf/boards/pca10100/mpconfigboard.mk | 2 ++ ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk | 3 +++ 28 files changed, 75 insertions(+) diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index d31d1f54a4..2c0056847c 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -10,3 +10,4 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 +MICROPY_PY_ASYNC_AWAIT = 0 diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index 7eb83a1230..230bce4f21 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk index fd24edafa2..1d652737a7 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index a5722c9ade..e4d0916fa1 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk index 055e6b19e2..47a5434504 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk @@ -9,3 +9,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk index 892a5371ef..201c9b1424 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_ROTARYIO = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk index 5656d4cb86..fa437bf364 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk @@ -16,6 +16,7 @@ CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 +MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 @@ -33,3 +34,4 @@ RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 endif + diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk index ae05d32f2c..365b935ee8 100644 --- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk index 6fd05f403b..f5900c8f78 100644 --- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk index d42a7869de..3cefa856fa 100644 --- a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk index d92cbc71b3..1293a5aaa3 100644 --- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index 143910318d..0f784be8af 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk index 69ebdfc237..b535085704 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index 1ad4292950..fe588b1635 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -21,10 +21,13 @@ CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_TOUCHIO = 0 +MICROPY_PY_ASYNC_AWAIT = 0 CFLAGS_INLINE_LIMIT = 35 + # Make more room. SUPEROPT_GC = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM69 + diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index 44606e340f..f2e27d1e23 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -22,6 +22,8 @@ CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_TOUCHIO = 0 +MICROPY_PY_ASYNC_AWAIT = 0 + CFLAGS_INLINE_LIMIT = 35 # Make more room. SUPEROPT_GC = 0 @@ -29,3 +31,4 @@ SUPEROPT_GC = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM9x + diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index 0345417a98..10705f2802 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -9,6 +9,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 +MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 @@ -21,3 +22,4 @@ ifeq ($(TRANSLATION), de_DE) RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 endif + diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index 1cc91a8df6..b5e1ce69ad 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -24,3 +24,6 @@ SUPEROPT_GC = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x CFLAGS_BOARD = --param max-inline-insns-auto=15 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk b/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk index bedec87f45..b89bee482b 100644 --- a/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk +++ b/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk index a04e097692..ed4960cd83 100644 --- a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk +++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk @@ -13,3 +13,6 @@ CIRCUITPY_I2CPERIPHERAL = 1 CIRCUITPY_TOUCHIO = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk index 22e2059a93..18b057a18a 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk index a2bd577cd3..c97207b215 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk index 9460d0009b..d9bde81833 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index 735d422973..a65c570c7d 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -9,6 +9,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 +MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 @@ -22,3 +23,4 @@ RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 endif + diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index 402db7ebc0..82d2768d8f 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -17,6 +17,7 @@ CIRCUITPY_COUNTIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 +MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 @@ -34,3 +35,4 @@ RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 endif + diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index d08690a15a..7270effde4 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -14,3 +14,4 @@ CIRCUITPY_FULL_BUILD = 0 CFLAGS_INLINE_LIMIT = 45 SUPEROPT_GC = 0 +MICROPY_PY_ASYNC_AWAIT = 0 diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk index 9309fdce0d..b08d36b59d 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk @@ -28,3 +28,6 @@ CIRCUITPY_COUNTIO=0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index f952983f55..6a6ca72ce1 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -29,3 +29,5 @@ SUPEROPT_GC = 0 # Override optimization to keep binary small OPTIMIZATION_FLAGS = -Os +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk index f66b2eaf7a..7077766a37 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk +++ b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk @@ -6,3 +6,6 @@ USB_MANUFACTURER = "SparkFun Electronics" MCU_CHIP = nrf52840 INTERNAL_FLASH_FILESYSTEM = 1 + +MICROPY_PY_ASYNC_AWAIT = 0 + From 5cadf525bdf27ef4a3fab9b1c7242384f260003e Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 31 May 2020 15:16:44 -0700 Subject: [PATCH 45/73] fix missing cflag defeating the board gating --- py/circuitpy_mpconfig.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index cab6d339e5..ba75d29a5c 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -32,6 +32,8 @@ CIRCUITPY_FULL_BUILD ?= 1 CFLAGS += -DCIRCUITPY_FULL_BUILD=$(CIRCUITPY_FULL_BUILD) +MICROPY_PY_ASYNC_AWAIT ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DMICROPY_PY_ASYNC_AWAIT=$(MICROPY_PY_ASYNC_AWAIT) CIRCUITPY_AESIO ?= 0 CFLAGS += -DCIRCUITPY_AESIO=$(CIRCUITPY_AESIO) From bf849ff674a953ea36dbffc856a05158b2350077 Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Wed, 5 Aug 2020 19:55:40 -0700 Subject: [PATCH 46/73] async def syntax rigor and __await__ magic method Some examples of improved compliance with CPython that currently have divergent behavior in CircuitPython are listed below: * yield from is not allowed in async methods ``` >>> async def f(): ... yield from 'abc' ... Traceback (most recent call last): File "", line 2, in f SyntaxError: 'yield from' inside async function ``` * await only works on awaitable expressions ``` >>> async def f(): ... await 'not awaitable' ... >>> f().send(None) Traceback (most recent call last): File "", line 1, in File "", line 2, in f AttributeError: 'str' object has no attribute '__await__' ``` * only __await__()able expressions are awaitable Okay this one actually does not work in circuitpython at all today. This is how CPython works though and pretending __await__ does not exist will only bite users who write both. ``` >>> class c: ... pass ... >>> def f(self): ... yield ... yield ... return 'f to pay respects' ... >>> c.__await__ = f # could just as easily have put it on the class but this shows how it's wired >>> async def g(): ... awaitable_thing = c() ... partial = await awaitable_thing ... return 'press ' + partial ... >>> q = g() >>> q.send(None) >>> q.send(None) >>> q.send(None) Traceback (most recent call last): File "", line 1, in StopIteration: press f to pay respects ``` --- py/compile.c | 9 ++++++++- py/objgenerator.c | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/py/compile.c b/py/compile.c index 653aae0041..f194302982 100644 --- a/py/compile.c +++ b/py/compile.c @@ -2632,6 +2632,12 @@ STATIC void compile_yield_expr(compiler_t *comp, mp_parse_node_struct_t *pns) { EMIT_ARG(yield, MP_EMIT_YIELD_VALUE); } else if (MP_PARSE_NODE_IS_STRUCT_KIND(pns->nodes[0], PN_yield_arg_from)) { pns = (mp_parse_node_struct_t*)pns->nodes[0]; +#if MICROPY_PY_ASYNC_AWAIT + if(comp->scope_cur->scope_flags & MP_SCOPE_FLAG_ASYNC) { + compile_syntax_error(comp, (mp_parse_node_t)pns, translate("'yield from' inside async function")); + return; + } +#endif compile_node(comp, pns->nodes[0]); compile_yield_from(comp); } else { @@ -2648,7 +2654,8 @@ STATIC void compile_atom_expr_await(compiler_t *comp, mp_parse_node_struct_t *pn } compile_require_async_context(comp, pns); compile_atom_expr_normal(comp, pns); - compile_yield_from(comp); + + compile_await_object_method(comp, MP_QSTR___await__); } #endif diff --git a/py/objgenerator.c b/py/objgenerator.c index df421b60c8..baa6a9849c 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -225,6 +225,25 @@ STATIC mp_obj_t gen_instance_send(mp_obj_t self_in, mp_obj_t send_value) { STATIC MP_DEFINE_CONST_FUN_OBJ_2(gen_instance_send_obj, gen_instance_send); +#if MICROPY_PY_ASYNC_AWAIT +STATIC mp_obj_t gen_instance_await(mp_obj_t self_in) { + mp_obj_gen_instance_t *self = MP_OBJ_TO_PTR(self_in); + if ( !self->coroutine_generator ) { + // Pretend like a generator does not have this coroutine behavior. + // Pay no attention to the dir() behind the curtain + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_AttributeError, + translate("type object 'generator' has no attribute '__await__'"))); + } + mp_obj_t ret = gen_resume_and_raise(self_in, mp_const_none, MP_OBJ_NULL); + if (ret == MP_OBJ_STOP_ITERATION) { + nlr_raise(mp_obj_new_exception(&mp_type_StopIteration)); + } else { + return ret; + } +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(gen_instance_await_obj, gen_instance_await); +#endif + STATIC mp_obj_t gen_instance_close(mp_obj_t self_in); STATIC mp_obj_t gen_instance_throw(size_t n_args, const mp_obj_t *args) { mp_obj_t exc = (n_args == 2) ? args[1] : args[2]; @@ -280,6 +299,9 @@ STATIC const mp_rom_map_elem_t gen_instance_locals_dict_table[] = { #if MICROPY_PY_GENERATOR_PEND_THROW { MP_ROM_QSTR(MP_QSTR_pend_throw), MP_ROM_PTR(&gen_instance_pend_throw_obj) }, #endif + #if MICROPY_PY_ASYNC_AWAIT + { MP_ROM_QSTR(MP_QSTR___await__), MP_ROM_PTR(&gen_instance_await_obj) }, + #endif }; STATIC MP_DEFINE_CONST_DICT(gen_instance_locals_dict, gen_instance_locals_dict_table); From 5d96afc5c2e4b4b6aa265a96a3921ac71f036980 Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Sat, 10 Oct 2020 15:30:37 -0700 Subject: [PATCH 47/73] i do not know if this is needed but this is not the vm i use anymore --- py/compile.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/py/compile.c b/py/compile.c index f194302982..da31846e23 100644 --- a/py/compile.c +++ b/py/compile.c @@ -2655,7 +2655,11 @@ STATIC void compile_atom_expr_await(compiler_t *comp, mp_parse_node_struct_t *pn compile_require_async_context(comp, pns); compile_atom_expr_normal(comp, pns); - compile_await_object_method(comp, MP_QSTR___await__); + + EMIT_ARG(load_method, MP_QSTR___await__, false); + EMIT_ARG(call_method, 0, 0, 0); + // EMIT_ARG(load_const_tok, MP_TOKEN_KW_NONE); // don't yield anything from an awaitable; only return the final result. + // EMIT_ARG(yield, MP_EMIT_YIELD_FROM); } #endif From 92fcb92138bb8ef074dc1c5efc9c5e169989e36a Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 8 Oct 2020 20:14:25 +0000 Subject: [PATCH 48/73] Translated using Weblate (Spanish) Currently translated at 100.0% (829 of 829 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 0d2b6743cb..75642b0098 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-09-29 20:14-0500\n" -"PO-Revision-Date: 2020-10-01 21:24+0000\n" -"Last-Translator: Alvaro Figueroa \n" +"PO-Revision-Date: 2020-10-09 17:19+0000\n" +"Last-Translator: dherrada \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" @@ -1709,7 +1709,7 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" -msgstr "" +msgstr "La longitud de rgb_pins debe ser 6, 12, 18, 24, o 30" #: supervisor/shared/safe_mode.c msgid "" @@ -3604,7 +3604,7 @@ msgstr "el tiempo de espera del perro guardián debe ser mayor a 0" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" -msgstr "" +msgstr "el ancho debe ser mayor que cero" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" From 940013a621c86ef93ecfec848b0f12ac8e9781a7 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Fri, 9 Oct 2020 23:10:33 +0200 Subject: [PATCH 49/73] 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 | 10 +++++++++- locale/cs.po | 10 +++++++++- locale/de_DE.po | 10 +++++++++- locale/el.po | 10 +++++++++- locale/es.po | 10 +++++++++- locale/fil.po | 10 +++++++++- locale/fr.po | 10 +++++++++- locale/hi.po | 10 +++++++++- locale/it_IT.po | 10 +++++++++- locale/ja.po | 10 +++++++++- locale/ko.po | 10 +++++++++- locale/nl.po | 10 +++++++++- locale/pl.po | 10 +++++++++- locale/pt_BR.po | 10 +++++++++- locale/sv.po | 10 +++++++++- locale/zh_Latn_pinyin.po | 13 +++++++++++-- 16 files changed, 146 insertions(+), 17 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 2ad8acd9b0..1d9f447b12 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-10-08 16:22+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -275,6 +275,10 @@ msgstr "pow() 3-arg tidak didukung" msgid "A hardware interrupt channel is already in use" msgstr "Sebuah channel hardware interrupt sedang digunakan" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1246,6 +1250,7 @@ msgid "No CCCD for this Characteristic" msgstr "Tidak ada CCCD untuk Karakteristik ini" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Tidak ada DAC (Digital Analog Converter) di dalam chip" @@ -1450,6 +1455,7 @@ msgstr "Izin ditolak" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3188,6 +3194,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3195,6 +3202,7 @@ msgstr "" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index c20674d782..a099e1c94a 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -275,6 +275,10 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1229,6 +1233,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -1425,6 +1430,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3148,6 +3154,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3155,6 +3162,7 @@ msgstr "" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index aefe48b856..5084ca505f 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -274,6 +274,10 @@ msgstr "3-arg pow() wird nicht unterstützt" msgid "A hardware interrupt channel is already in use" msgstr "Ein Hardware Interrupt Kanal wird schon benutzt" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1248,6 +1252,7 @@ msgid "No CCCD for this Characteristic" msgstr "Kein CCCD für diese Charakteristik" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Kein DAC im Chip vorhanden" @@ -1450,6 +1455,7 @@ msgstr "Zugang verweigert" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3229,6 +3235,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_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3236,6 +3243,7 @@ msgstr "pow () mit 3 Argumenten erfordert Integer" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "" diff --git a/locale/el.po b/locale/el.po index c50c107d8c..32e08a5506 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -270,6 +270,10 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1224,6 +1228,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -1420,6 +1425,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3143,6 +3149,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3150,6 +3157,7 @@ msgstr "" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "" diff --git a/locale/es.po b/locale/es.po index 75642b0098..3a7e1c6823 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-10-09 17:19+0000\n" "Last-Translator: dherrada \n" "Language-Team: \n" @@ -278,6 +278,10 @@ msgstr "pow() con 3 argumentos no soportado" msgid "A hardware interrupt channel is already in use" msgstr "El canal EXTINT ya está siendo utilizado" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1247,6 +1251,7 @@ msgid "No CCCD for this Characteristic" msgstr "No hay CCCD para esta característica" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "El chip no tiene DAC" @@ -1451,6 +1456,7 @@ msgstr "Permiso denegado" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3219,6 +3225,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_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3226,6 +3233,7 @@ msgstr "pow() con 3 argumentos requiere enteros" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "presionando botón de arranque al inicio.\n" diff --git a/locale/fil.po b/locale/fil.po index 3ddec187c8..4e7ce9ed8f 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -272,6 +272,10 @@ msgstr "3-arg pow() hindi suportado" msgid "A hardware interrupt channel is already in use" msgstr "Isang channel ng hardware interrupt ay ginagamit na" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, fuzzy, c-format msgid "Address must be %d bytes long" @@ -1239,6 +1243,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Walang DAC sa chip" @@ -1439,6 +1444,7 @@ msgstr "Walang pahintulot" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3194,6 +3200,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_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3201,6 +3208,7 @@ msgstr "pow() na may 3 argumento kailangan ng integers" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 38364d2cf8..45a4cc25d0 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-09-16 13:47+0000\n" "Last-Translator: Hugo Dahl \n" "Language: fr\n" @@ -279,6 +279,10 @@ msgstr "pow() non supporté avec 3 arguments" msgid "A hardware interrupt channel is already in use" msgstr "Un canal d'interruptions matérielles est déjà utilisé" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1252,6 +1256,7 @@ msgid "No CCCD for this Characteristic" msgstr "Pas de CCCD pour cette caractéristique" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Pas de DAC sur la puce" @@ -1458,6 +1463,7 @@ msgstr "Permission refusée" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3237,6 +3243,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_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3244,6 +3251,7 @@ msgstr "pow() avec 3 arguments nécessite des entiers" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "" diff --git a/locale/hi.po b/locale/hi.po index fdcb7dc3ee..90d7a1107a 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -270,6 +270,10 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1224,6 +1228,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -1420,6 +1425,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3143,6 +3149,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3150,6 +3157,7 @@ msgstr "" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index b94f73accb..7ae72a2e5e 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -271,6 +271,10 @@ msgstr "pow() con tre argmomenti non supportata" msgid "A hardware interrupt channel is already in use" msgstr "Un canale di interrupt hardware è già in uso" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, fuzzy, c-format msgid "Address must be %d bytes long" @@ -1243,6 +1247,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Nessun DAC sul chip" @@ -1448,6 +1453,7 @@ msgstr "Permesso negato" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3201,6 +3207,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_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3208,6 +3215,7 @@ msgstr "pow() con 3 argomenti richiede interi" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index e8ca0f808e..8443db3493 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -277,6 +277,10 @@ msgstr "引数3つのpow()は非対応" msgid "A hardware interrupt channel is already in use" msgstr "ハードウェア割り込みチャネルは使用中" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1239,6 +1243,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "チップにDACがありません" @@ -1438,6 +1443,7 @@ msgstr "パーミッション拒否" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3175,6 +3181,7 @@ msgstr "pow()の3つ目の引数は0にできません" msgid "pow() with 3 arguments requires integers" msgstr "pow()の第3引数には整数が必要" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3182,6 +3189,7 @@ msgstr "pow()の第3引数には整数が必要" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index e2bf7a372d..822c450a3f 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -273,6 +273,10 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1229,6 +1233,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -1425,6 +1430,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3149,6 +3155,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3156,6 +3163,7 @@ msgstr "" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 8bc7d8840c..6ee0c68f40 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -275,6 +275,10 @@ msgstr "3-arg pow() niet ondersteund" msgid "A hardware interrupt channel is already in use" msgstr "Een hardware interrupt kanaal is al in gebruik" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1241,6 +1245,7 @@ msgid "No CCCD for this Characteristic" msgstr "Geen CCCD voor deze Characteristic" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Geen DAC op de chip" @@ -1446,6 +1451,7 @@ msgstr "Toegang geweigerd" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3204,6 +3210,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_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3211,6 +3218,7 @@ msgstr "pow() met 3 argumenten vereist integers" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 3cec5c4dfe..f2f2b2c14d 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-09-29 01:39+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -277,6 +277,10 @@ msgstr "3-argumentowy pow() jest niewspierany" msgid "A hardware interrupt channel is already in use" msgstr "Kanał przerwań sprzętowych w użyciu" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1240,6 +1244,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Brak DAC" @@ -1436,6 +1441,7 @@ msgstr "Odmowa dostępu" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3167,6 +3173,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_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3174,6 +3181,7 @@ msgstr "trzyargumentowe pow() wymaga liczb całkowitych" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e2ca8e9ab0..3a17d2325a 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-10-02 22:53+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -279,6 +279,10 @@ msgstr "3-arg pow() não compatível" msgid "A hardware interrupt channel is already in use" msgstr "Um canal de interrupção de hardware já está em uso" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1250,6 +1254,7 @@ msgid "No CCCD for this Characteristic" msgstr "Não há nenhum CCCD para esta característica" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Nenhum DAC no chip" @@ -1455,6 +1460,7 @@ msgstr "Permissão negada" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3234,6 +3240,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_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3241,6 +3248,7 @@ msgstr "o pow() com 3 argumentos requer números inteiros" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "pressionando o botão de boot na inicialização.\n" diff --git a/locale/sv.po b/locale/sv.po index de4c592958..a8d4d9ffc4 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-10-02 22:53+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -275,6 +275,10 @@ msgstr "3-arguments pow() stöds inte" msgid "A hardware interrupt channel is already in use" msgstr "En kanal för hårdvaruavbrott används redan" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1240,6 +1244,7 @@ msgid "No CCCD for this Characteristic" msgstr "Ingen CCCD för denna karaktäristik" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Ingen DAC på chipet" @@ -1443,6 +1448,7 @@ msgstr "Åtkomst nekad" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3201,6 +3207,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_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3208,6 +3215,7 @@ msgstr "pow() med 3 argument kräver heltal" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "trycka på startknappen vid start.\n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 32af6c2c6f..4910ea1306 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-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-10-08 16:22+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -277,6 +277,10 @@ msgstr "bù zhīchí 3-arg pow ()" msgid "A hardware interrupt channel is already in use" msgstr "Yìngjiàn zhōngduàn tōngdào yǐ zài shǐyòng zhōng" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1237,6 +1241,7 @@ msgid "No CCCD for this Characteristic" msgstr "Zhège tèzhēng méiyǒu CCCD" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Méiyǒu DAC zài xīnpiàn shàng de" @@ -1439,6 +1444,7 @@ msgstr "Quánxiàn bèi jùjué" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -1489,7 +1495,8 @@ msgstr "Duānkǒu bù jiēshòu PWM zàibō. Tōngguò yǐn jiǎo, pínlǜ hé z msgid "" "Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " "instead" -msgstr "Duānkǒu bù jiēshòu yǐn jiǎo huò pínlǜ. Gòuzào bìng chuándì PWMOut zàibō" +msgstr "" +"Duānkǒu bù jiēshòu yǐn jiǎo huò pínlǜ. Gòuzào bìng chuándì PWMOut zàibō" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -3189,6 +3196,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_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3196,6 +3204,7 @@ msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/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" msgstr "Zài qǐdòng shí àn qǐdòng ànniǔ.\n" From f987b363c89d43b34ff1eafd3cc5af8afd857bfe Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Fri, 9 Oct 2020 21:43:53 +0000 Subject: [PATCH 50/73] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (830 of 830 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 3a17d2325a..92214322d7 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-06 13:26-0400\n" -"PO-Revision-Date: 2020-10-02 22:53+0000\n" +"PO-Revision-Date: 2020-10-09 22:07+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -281,7 +281,7 @@ msgstr "Um canal de interrupção de hardware já está em uso" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "O ADC2 está sendo usado pelo WiFi" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format From e3378b7ccbf9a48b0488ec92a085779d1abc6112 Mon Sep 17 00:00:00 2001 From: oon arfiandwi Date: Sat, 10 Oct 2020 01:12:52 +0000 Subject: [PATCH 51/73] Translated using Weblate (Indonesian) Currently translated at 45.6% (379 of 830 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/id/ --- locale/ID.po | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 1d9f447b12..76e83920cc 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-06 13:26-0400\n" -"PO-Revision-Date: 2020-10-08 16:22+0000\n" +"PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" "Language: ID\n" @@ -1612,15 +1612,15 @@ msgstr "" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" -msgstr "" +msgstr "Kesalahan Init SPI" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" -msgstr "" +msgstr "Kesalahan Inisialisasi ulang SPI" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" -msgstr "" +msgstr "Tingkat sampel harus positif" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #, c-format @@ -1629,15 +1629,15 @@ msgstr "Nilai sampel terlalu tinggi. Nilai harus kurang dari %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "" +msgstr "Pindai sudah dalam proses. Hentikan dengan stop_scan." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "" +msgstr "Pin CTS yang dipilih tidak valid" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "" +msgstr "Pin RTS yang dipilih tidak valid" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1654,14 +1654,14 @@ msgstr "" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." -msgstr "" +msgstr "Potongan dan nilai panjangnya berbeda." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/TileGrid.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" -msgstr "" +msgstr "Potongan tidak didukung" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" @@ -1669,7 +1669,7 @@ msgstr "" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "Buffer sumber dan tujuan harus memiliki panjang yang sama" #: extmod/modure.c msgid "Splitting with sub-captures" @@ -1677,15 +1677,15 @@ msgstr "Memisahkan dengan menggunakan sub-captures" #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" -msgstr "" +msgstr "Ukuran stack minimal harus 256" #: shared-bindings/multiterminal/__init__.c msgid "Stream missing readinto() or write() method." -msgstr "" +msgstr "Aliran tidak menemukan metode readinto() atau write()." #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" -msgstr "" +msgstr "Berikan setidaknya satu pin UART" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" @@ -1693,19 +1693,23 @@ msgstr "" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "" +msgstr "Waktu baca suhu habis" #: supervisor/shared/safe_mode.c 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 "" +"heap dari CircuitPython rusak karena stack terlalu kecil.\n" +"Harap tambah ukuran stack jika Anda tahu caranya, atau jika tidak:" #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode.\n" msgstr "" +"Modul `microcontroller` digunakan untukboot ke mode aman. Tekan reset untuk " +"keluar dari mode aman.\n" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" From 6583e1087cb2d56d45f5daf678ff2ef8d3f115cb Mon Sep 17 00:00:00 2001 From: hexthat Date: Sat, 10 Oct 2020 11:23:02 +0000 Subject: [PATCH 52/73] Translated using Weblate (Chinese (Pinyin)) Currently translated at 100.0% (830 of 830 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 4910ea1306..9e7baa9d02 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-06 13:26-0400\n" -"PO-Revision-Date: 2020-10-08 16:22+0000\n" +"PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -279,7 +279,7 @@ msgstr "Yìngjiàn zhōngduàn tōngdào yǐ zài shǐyòng zhōng" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "ADC2 zhèng yóu WiFi shǐ yòng" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format @@ -3261,7 +3261,7 @@ msgstr "yòubiān bìxū shì ndarray huò biāoliàng" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "" +msgstr "Rchāifēn(wú ,N)" #: shared-bindings/audiocore/RawSample.c msgid "" From 98aa4b794346161e512d0fba913901021dd2cfbf Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Sat, 10 Oct 2020 23:39:32 -0700 Subject: [PATCH 53/73] update async tests with less upython workaround and more cpython compatibility --- py/compile.c | 12 ++++++++---- py/objgenerator.c | 8 ++------ tests/basics/async_await2.py | 28 ++++++++++++++-------------- tests/basics/async_for2.py | 28 ++++++++++++++-------------- tests/basics/async_with2.py | 32 ++++++++++++++++---------------- 5 files changed, 54 insertions(+), 54 deletions(-) diff --git a/py/compile.c b/py/compile.c index da31846e23..45a586594d 100644 --- a/py/compile.c +++ b/py/compile.c @@ -40,6 +40,8 @@ #if MICROPY_ENABLE_COMPILER +#define DEBUG_PRINT(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + // TODO need to mangle __attr names #define INVALID_LABEL (0xffff) @@ -853,7 +855,7 @@ STATIC void compile_decorated(compiler_t *comp, mp_parse_node_struct_t *pns) { mp_parse_node_struct_t *pns0 = (mp_parse_node_struct_t*)pns_body->nodes[0]; body_name = compile_funcdef_helper(comp, pns0, emit_options); scope_t *fscope = (scope_t*)pns0->nodes[4]; - fscope->scope_flags |= MP_SCOPE_FLAG_GENERATOR; + fscope->scope_flags |= MP_SCOPE_FLAG_GENERATOR | MP_SCOPE_FLAG_ASYNC; #endif } else { assert(MP_PARSE_NODE_STRUCT_KIND(pns_body) == PN_classdef); // should be @@ -2655,11 +2657,13 @@ STATIC void compile_atom_expr_await(compiler_t *comp, mp_parse_node_struct_t *pn compile_require_async_context(comp, pns); compile_atom_expr_normal(comp, pns); - + // If it's an awaitable thing, need to reach for the __await__ method for the coroutine. + // async def functions' __await__ return themselves, which are able to receive a send(), + // while other types with custom __await__ implementations return async generators. EMIT_ARG(load_method, MP_QSTR___await__, false); EMIT_ARG(call_method, 0, 0, 0); - // EMIT_ARG(load_const_tok, MP_TOKEN_KW_NONE); // don't yield anything from an awaitable; only return the final result. - // EMIT_ARG(yield, MP_EMIT_YIELD_FROM); + EMIT_ARG(load_const_tok, MP_TOKEN_KW_NONE); + EMIT_ARG(yield, MP_EMIT_YIELD_FROM); } #endif diff --git a/py/objgenerator.c b/py/objgenerator.c index baa6a9849c..5e651ac269 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -234,12 +234,8 @@ STATIC mp_obj_t gen_instance_await(mp_obj_t self_in) { nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_AttributeError, translate("type object 'generator' has no attribute '__await__'"))); } - mp_obj_t ret = gen_resume_and_raise(self_in, mp_const_none, MP_OBJ_NULL); - if (ret == MP_OBJ_STOP_ITERATION) { - nlr_raise(mp_obj_new_exception(&mp_type_StopIteration)); - } else { - return ret; - } + // You can directly call send on a coroutine generator or you can __await__ then send on the return of that. + return self; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(gen_instance_await_obj, gen_instance_await); #endif diff --git a/tests/basics/async_await2.py b/tests/basics/async_await2.py index 7097ce85a6..2c5015fb4f 100644 --- a/tests/basics/async_await2.py +++ b/tests/basics/async_await2.py @@ -1,22 +1,22 @@ # test await expression -import sys -if sys.implementation.name in ('micropython', 'circuitpython'): - # uPy allows normal generators to be awaitables - coroutine = lambda f: f -else: - import types - coroutine = types.coroutine +# uPy allows normal generators to be awaitables. +# CircuitPython does not. +# In CircuitPython you need to have an __await__ method on an awaitable like in CPython; +# and like in CPython, generators do not have __await__. -@coroutine -def wait(value): - print('wait value:', value) - msg = yield 'message from wait(%u)' % value - print('wait got back:', msg) - return 10 +class Awaitable: + def __init__(self, value): + self.value = value + + def __await__(self): + print('wait value:', self.value) + msg = yield 'message from wait(%u)' % self.value + print('wait got back:', msg) + return 10 async def f(): - x = await wait(1)**2 + x = await Awaitable(1)**2 print('x =', x) coro = f() diff --git a/tests/basics/async_for2.py b/tests/basics/async_for2.py index add74dd388..d7b97cb386 100644 --- a/tests/basics/async_for2.py +++ b/tests/basics/async_for2.py @@ -1,19 +1,19 @@ # test waiting within "async for" __anext__ function -import sys -if sys.implementation.name in ('micropython', 'circuitpython'): - # uPy allows normal generators to be awaitables - coroutine = lambda f: f -else: - import types - coroutine = types.coroutine +# uPy allows normal generators to be awaitables. +# CircuitPython does not. +# In CircuitPython you need to have an __await__ method on an awaitable like in CPython; +# and like in CPython, generators do not have __await__. -@coroutine -def f(x): - print('f start:', x) - yield x + 1 - yield x + 2 - return x + 3 +class Awaitable: + def __init__(self, x): + self.x = x + + def __await__(self): + print('f start:', self.x) + yield self.x + 1 + yield self.x + 2 + return self.x + 3 class ARange: def __init__(self, high): @@ -27,7 +27,7 @@ class ARange: async def __anext__(self): print('anext') - print('f returned:', await f(20)) + print('f returned:', await Awaitable(20)) if self.cur < self.high: val = self.cur self.cur += 1 diff --git a/tests/basics/async_with2.py b/tests/basics/async_with2.py index 5fb06ba604..2e9e9e5a75 100644 --- a/tests/basics/async_with2.py +++ b/tests/basics/async_with2.py @@ -1,32 +1,32 @@ # test waiting within async with enter/exit functions -import sys -if sys.implementation.name in ('micropython', 'circuitpython'): - # uPy allows normal generators to be awaitables - coroutine = lambda f: f -else: - import types - coroutine = types.coroutine +# uPy allows normal generators to be awaitables. +# CircuitPython does not. +# In CircuitPython you need to have an __await__ method on an awaitable like in CPython; +# and like in CPython, generators do not have __await__. -@coroutine -def f(x): - print('f start:', x) - yield x + 1 - yield x + 2 - return x + 3 +class Awaitable: + def __init__(self, x): + self.x = x + + def __await__(self): + print('f start:', self.x) + yield self.x + 1 + yield self.x + 2 + return self.x + 3 class AContext: async def __aenter__(self): print('enter') - print('f returned:', await f(10)) + print('f returned:', await Awaitable(10)) async def __aexit__(self, exc_type, exc, tb): print('exit', exc_type, exc) - print('f returned:', await f(20)) + print('f returned:', await Awaitable(20)) async def coro(): async with AContext(): print('body start') - print('body f returned:', await f(30)) + print('body f returned:', await Awaitable(30)) print('body end') o = coro() From 88db16a2c6c166f5b407b507efa8f56026996f9b Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Sat, 10 Oct 2020 23:50:12 -0700 Subject: [PATCH 54/73] add translations --- locale/circuitpython.pot | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 199f39c589..fc564feeaf 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -246,6 +246,10 @@ msgstr "" msgid "'return' outside function" msgstr "" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "" @@ -289,6 +293,7 @@ msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -896,6 +901,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -932,7 +938,8 @@ msgid "Group full" msgstr "" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1002,7 +1009,8 @@ msgid "Invalid %q pin" msgstr "" #: 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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3426,6 +3434,10 @@ msgstr "" msgid "type object '%q' has no attribute '%q'" msgstr "" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "" From 3c46e3a6aab8895f19302c4fe165d61d30f1a45e Mon Sep 17 00:00:00 2001 From: Kenny Date: Sun, 11 Oct 2020 08:16:36 -0700 Subject: [PATCH 55/73] Turn off async for circuitplayground express Firmware too large --- .../atmel-samd/boards/circuitplayground_express/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index 81391b953e..13ec9e861c 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -15,6 +15,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 +MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 CFLAGS_INLINE_LIMIT = 55 From c139eccc9271b8b81eb8ad3eb2dc09a68199a12c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 11 Oct 2020 16:23:02 -0500 Subject: [PATCH 56/73] remove warning that seems unneeded now --- py/circuitpy_defns.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 76c0a4db67..e5debc8ea5 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -45,7 +45,6 @@ BASE_CFLAGS = \ -Wnested-externs \ -Wunreachable-code \ -Wcast-align \ - -Wno-error=lto-type-mismatch \ -D__$(CHIP_VARIANT)__ \ -ffunction-sections \ -fdata-sections \ @@ -66,7 +65,6 @@ ifneq ($(FROZEN_DIR),) # To use frozen source modules, put your .py files in a subdirectory (eg scripts/) # and then invoke make with FROZEN_DIR=scripts (be sure to build from scratch). CFLAGS += -DMICROPY_MODULE_FROZEN_STR -CFLAGS += -Wno-error=lto-type-mismatch endif # To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and @@ -76,7 +74,6 @@ endif ifneq ($(FROZEN_MPY_DIRS),) CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool CFLAGS += -DMICROPY_MODULE_FROZEN_MPY -CFLAGS += -Wno-error=lto-type-mismatch endif From 607e4a905ae8654bd8450ae137ffa24367039277 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 11 Oct 2020 15:19:55 -0500 Subject: [PATCH 57/73] build: parallelize the creation of qstr.i.last Rather than simply invoking gcc in preprocessor mode with a list of files, use a Python script with the (python3) ThreadPoolExecutor to invoke the preprocessor in parallel. The amount of concurrency is the number of system CPUs, not the makefile "-j" parallelism setting, because there is no simple and correct way for a Python program to correctly work together with make's idea of parallelism. This reduces the build time of stm32f405 feather (a non-LTO build) from 16s to 12s on my 16-thread Ryzen machine. --- py/genlast.py | 38 ++++++++++++++++++++++++++++++++++++++ py/mkrules.mk | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 py/genlast.py diff --git a/py/genlast.py b/py/genlast.py new file mode 100644 index 0000000000..e14e7ef1e0 --- /dev/null +++ b/py/genlast.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +import sys +from concurrent.futures import ThreadPoolExecutor +import multiprocessing +import threading +import subprocess + + +def checkoutput1(args): + info = subprocess.run(args, check=True, stdout=subprocess.PIPE, input='') + return info.stdout + +idx1 = sys.argv.index('--') +idx2 = sys.argv.index('--', idx1+1) +check = sys.argv[1:idx1] +always = sys.argv[idx1+1:idx2] +command = sys.argv[idx2+1:] + +output_lock = threading.Lock() +def preprocess(fn): + output = checkoutput1(command + [fn]) + # Ensure our output doesn't interleave with others + # a threading.Lock is not a context manager object :( + try: + output_lock.acquire() + sys.stdout.buffer.write(output) + finally: + output_lock.release() + +def maybe_preprocess(fn): + if subprocess.call(["grep", "-lqE", "(MP_QSTR|translate)", fn]) == 0: + preprocess(fn) + +executor = ThreadPoolExecutor(max_workers=multiprocessing.cpu_count() + 1) +executor.map(maybe_preprocess, check) +executor.map(preprocess, always) +executor.shutdown() diff --git a/py/mkrules.mk b/py/mkrules.mk index 0b3ecc0e17..84e16ec960 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -78,7 +78,7 @@ $(OBJ): | $(HEADER_BUILD)/qstrdefs.enum.h $(HEADER_BUILD)/mpversion.h # - else, process all source files ($^) [this covers "make -B" which can set $? to empty] $(HEADER_BUILD)/qstr.i.last: $(SRC_QSTR) $(SRC_QSTR_PREPROCESSOR) $(QSTR_GLOBAL_DEPENDENCIES) | $(HEADER_BUILD)/mpversion.h $(STEPECHO) "GEN $@" - $(Q)grep -lE "(MP_QSTR|translate)" $(if $(filter $?,$(QSTR_GLOBAL_DEPENDENCIES)),$^,$(if $?,$?,$^)) | xargs $(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $(SRC_QSTR_PREPROCESSOR) >$(HEADER_BUILD)/qstr.i.last; + $(Q)$(PYTHON3) $(PY_SRC)/genlast.py $(if $(filter $?,$(QSTR_GLOBAL_DEPENDENCIES)),$^,$(if $?,$?,$^)) -- $(SRC_QSTR_PREPROCESSOR) -- $(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) >$(HEADER_BUILD)/qstr.i.last; $(HEADER_BUILD)/qstr.split: $(HEADER_BUILD)/qstr.i.last $(PY_SRC)/makeqstrdefs.py $(STEPECHO) "GEN $@" From 774f2e16ba166b5976a46519c38ea894f897dca4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 11 Oct 2020 21:09:08 -0500 Subject: [PATCH 58/73] displayio, framebufferio: Remove spurious call to supervisor_start_terminal A call to supervisor_start_terminal remained in common_hal_displayio_display_construct and was copied to other display _construct functions, even though it was also being done in displayio_display_core_construct when that was factored out. Originally, this was harmless, except it created an extra allocation. When investigating #3482, I found that this bug became harmful, especially for displays that were created in Python code, because it caused a supervisor allocation to leak. I believe that it is safe to merge #3482 after this PR is merged. --- shared-module/displayio/Display.c | 2 -- shared-module/displayio/EPaperDisplay.c | 2 -- shared-module/framebufferio/FramebufferDisplay.c | 2 -- 3 files changed, 6 deletions(-) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index bb7e40f41d..499c00ffbb 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -107,8 +107,6 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, i += 2 + data_size; } - supervisor_start_terminal(width, height); - // Always set the backlight type in case we're reusing memory. self->backlight_inout.base.type = &mp_type_NoneType; if (backlight_pin != NULL && common_hal_mcu_pin_is_free(backlight_pin)) { diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 5b055e62e4..46c7ea82e1 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -90,8 +90,6 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* // TODO: Clear } - supervisor_start_terminal(width, height); - // Set the group after initialization otherwise we may send pixels while we delay in // initialization. common_hal_displayio_epaperdisplay_show(self, &circuitpython_splash); diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 5163c3a7bc..6b506c7faf 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -96,8 +96,6 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu common_hal_framebufferio_framebufferdisplay_set_rotation(self, rotation); } - supervisor_start_terminal(self->core.width, self->core.height); - // Set the group after initialization otherwise we may send pixels while we delay in // initialization. common_hal_framebufferio_framebufferdisplay_show(self, &circuitpython_splash); From 479552ce564410f2d96855f5dbca223317c4cbe0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 11 Oct 2020 16:03:46 -0500 Subject: [PATCH 59/73] build: Make genlast write the "split" files This gets a further speedup of about 2s (12s -> 9.5s elapsed build time) for stm32f405_feather For what are probably historical reasons, the qstr process involves preprocessing a large number of source files into a single "qstr.i.last" file, then reading this and splitting it into one "qstr" file for each original source ("*.c") file. By eliminating the step of writing qstr.i.last as well as making the regular-expression-matching part be parallelized, build speed is further improved. Because the step to build QSTR_DEFS_COLLECTED does not access qstr.i.last, the path is replaced with "-" in the Makefile. --- py/genlast.py | 77 ++++++++++++++++++++++++++++++++++++--------------- py/mkrules.mk | 10 ++----- 2 files changed, 58 insertions(+), 29 deletions(-) diff --git a/py/genlast.py b/py/genlast.py index e14e7ef1e0..1df2a24825 100644 --- a/py/genlast.py +++ b/py/genlast.py @@ -1,38 +1,71 @@ #!/usr/bin/env python3 import sys -from concurrent.futures import ThreadPoolExecutor +import re +import os +import itertools +from concurrent.futures import ProcessPoolExecutor import multiprocessing import threading import subprocess +from makeqstrdefs import qstr_unescape, QSTRING_BLACK_LIST + +re_line = re.compile(r"#[line]*\s(\d+)\s\"([^\"]+)\"", re.DOTALL) +re_qstr = re.compile(r'MP_QSTR_[_a-zA-Z0-9]+', re.DOTALL) +re_translate = re.compile(r'translate\(\"((?:(?=(\\?))\2.)*?)\"\)', re.DOTALL) + +def write_out(fname, output_dir, output): + if output: + for m, r in [("/", "__"), ("\\", "__"), (":", "@"), ("..", "@@")]: + fname = fname.replace(m, r) + with open(output_dir + "/" + fname + ".qstr", "w") as f: + f.write("\n".join(output) + "\n") + +def process_file(fname, output_dir, content): + content = content.decode('utf-8', errors='ignore') + output = [] + for match in re_qstr.findall(content): + name = match.replace('MP_QSTR_', '') + if name not in QSTRING_BLACK_LIST: + output.append('Q(' + qstr_unescape(name) + ')') + for match in re_translate.findall(content): + output.append('TRANSLATE("' + match[0] + '")') + + write_out(fname, output_dir, output) + def checkoutput1(args): info = subprocess.run(args, check=True, stdout=subprocess.PIPE, input='') return info.stdout -idx1 = sys.argv.index('--') -idx2 = sys.argv.index('--', idx1+1) -check = sys.argv[1:idx1] -always = sys.argv[idx1+1:idx2] -command = sys.argv[idx2+1:] - -output_lock = threading.Lock() -def preprocess(fn): - output = checkoutput1(command + [fn]) - # Ensure our output doesn't interleave with others - # a threading.Lock is not a context manager object :( +def preprocess(command, output_dir, fn): try: - output_lock.acquire() - sys.stdout.buffer.write(output) - finally: - output_lock.release() + output = checkoutput1(command + [fn]) + process_file(fn, output_dir, output) + except Exception as e: + print(e, file=sys.stderr) -def maybe_preprocess(fn): +def maybe_preprocess(command, output_dir, fn): if subprocess.call(["grep", "-lqE", "(MP_QSTR|translate)", fn]) == 0: - preprocess(fn) + preprocess(command, output_dir, fn) -executor = ThreadPoolExecutor(max_workers=multiprocessing.cpu_count() + 1) -executor.map(maybe_preprocess, check) -executor.map(preprocess, always) -executor.shutdown() +if __name__ == '__main__': + + + idx1 = sys.argv.index('--') + idx2 = sys.argv.index('--', idx1+1) + output_dir = sys.argv[1] + check = sys.argv[2:idx1] + always = sys.argv[idx1+1:idx2] + command = sys.argv[idx2+1:] + + if not os.path.isdir(output_dir): + os.makedirs(output_dir) + + # Mac and Windows use 'spawn'. Uncomment this during testing to catch spawn-specific problems on Linux. + #multiprocessing.set_start_method("spawn") + executor = ProcessPoolExecutor(max_workers=multiprocessing.cpu_count() + 1) + executor.map(maybe_preprocess, itertools.repeat(command), itertools.repeat(output_dir), check) + executor.map(preprocess, itertools.repeat(command), itertools.repeat(output_dir), always) + executor.shutdown() diff --git a/py/mkrules.mk b/py/mkrules.mk index 84e16ec960..549b0e5e42 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -76,18 +76,14 @@ $(OBJ): | $(HEADER_BUILD)/qstrdefs.enum.h $(HEADER_BUILD)/mpversion.h # - if anything in QSTR_GLOBAL_DEPENDENCIES is newer, then process all source files ($^) # - else, if list of newer prerequisites ($?) is not empty, then process just these ($?) # - else, process all source files ($^) [this covers "make -B" which can set $? to empty] -$(HEADER_BUILD)/qstr.i.last: $(SRC_QSTR) $(SRC_QSTR_PREPROCESSOR) $(QSTR_GLOBAL_DEPENDENCIES) | $(HEADER_BUILD)/mpversion.h +$(HEADER_BUILD)/qstr.split: $(SRC_QSTR) $(SRC_QSTR_PREPROCESSOR) $(QSTR_GLOBAL_DEPENDENCIES) | $(HEADER_BUILD)/mpversion.h $(PY_SRC)/genlast.py $(STEPECHO) "GEN $@" - $(Q)$(PYTHON3) $(PY_SRC)/genlast.py $(if $(filter $?,$(QSTR_GLOBAL_DEPENDENCIES)),$^,$(if $?,$?,$^)) -- $(SRC_QSTR_PREPROCESSOR) -- $(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) >$(HEADER_BUILD)/qstr.i.last; - -$(HEADER_BUILD)/qstr.split: $(HEADER_BUILD)/qstr.i.last $(PY_SRC)/makeqstrdefs.py - $(STEPECHO) "GEN $@" - $(Q)$(PYTHON3) $(PY_SRC)/makeqstrdefs.py split $(HEADER_BUILD)/qstr.i.last $(HEADER_BUILD)/qstr $(QSTR_DEFS_COLLECTED) + $(Q)$(PYTHON3) $(PY_SRC)/genlast.py $(HEADER_BUILD)/qstr $(if $(filter $?,$(QSTR_GLOBAL_DEPENDENCIES)),$^,$(if $?,$?,$^)) -- $(SRC_QSTR_PREPROCESSOR) -- $(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $(Q)touch $@ $(QSTR_DEFS_COLLECTED): $(HEADER_BUILD)/qstr.split $(PY_SRC)/makeqstrdefs.py $(STEPECHO) "GEN $@" - $(Q)$(PYTHON3) $(PY_SRC)/makeqstrdefs.py cat $(HEADER_BUILD)/qstr.i.last $(HEADER_BUILD)/qstr $(QSTR_DEFS_COLLECTED) + $(Q)$(PYTHON3) $(PY_SRC)/makeqstrdefs.py cat - $(HEADER_BUILD)/qstr $(QSTR_DEFS_COLLECTED) # $(sort $(var)) removes duplicates # From 94beeabc515986e366de569e85d395ab2678ee3d Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 11 Oct 2020 22:42:21 -0700 Subject: [PATCH 60/73] remove unnecessary board configuration and address feedback --- ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk | 1 - ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk | 3 --- .../atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk | 1 - ports/atmel-samd/boards/datum_distance/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/datum_imu/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/datum_light/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/datum_weather/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk | 1 - ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/shirtty/mpconfigboard.mk | 3 --- .../boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk | 1 - ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk | 1 - ports/atmel-samd/boards/uchip/mpconfigboard.mk | 1 - ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk | 3 --- ports/nrf/boards/pca10100/mpconfigboard.mk | 3 +-- ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk | 1 - py/circuitpy_mpconfig.mk | 4 +--- py/compile.c | 2 -- 30 files changed, 2 insertions(+), 72 deletions(-) diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index 2c0056847c..d31d1f54a4 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -10,4 +10,3 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 -MICROPY_PY_ASYNC_AWAIT = 0 diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index 230bce4f21..7eb83a1230 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk index 1d652737a7..fd24edafa2 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index e4d0916fa1..a5722c9ade 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk index 47a5434504..055e6b19e2 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk @@ -9,6 +9,3 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk index 201c9b1424..892a5371ef 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_ROTARYIO = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk index fa437bf364..178258b6cd 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk @@ -34,4 +34,3 @@ RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 endif - diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk index 365b935ee8..ae05d32f2c 100644 --- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk index f5900c8f78..6fd05f403b 100644 --- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk index 3cefa856fa..d42a7869de 100644 --- a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk index 1293a5aaa3..d92cbc71b3 100644 --- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index 0f784be8af..143910318d 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk index b535085704..69ebdfc237 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index fe588b1635..c33ab07400 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -21,7 +21,6 @@ CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_TOUCHIO = 0 -MICROPY_PY_ASYNC_AWAIT = 0 CFLAGS_INLINE_LIMIT = 35 # Make more room. @@ -30,4 +29,3 @@ SUPEROPT_GC = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM69 - diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index f2e27d1e23..49b0ef5e36 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -22,7 +22,6 @@ CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_TOUCHIO = 0 -MICROPY_PY_ASYNC_AWAIT = 0 CFLAGS_INLINE_LIMIT = 35 # Make more room. @@ -31,4 +30,3 @@ SUPEROPT_GC = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM9x - diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index 10705f2802..e2604c89b5 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -9,7 +9,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 -MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index b5e1ce69ad..1cc91a8df6 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -24,6 +24,3 @@ SUPEROPT_GC = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x CFLAGS_BOARD = --param max-inline-insns-auto=15 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk b/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk index b89bee482b..bedec87f45 100644 --- a/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk +++ b/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk index ed4960cd83..a04e097692 100644 --- a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk +++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk @@ -13,6 +13,3 @@ CIRCUITPY_I2CPERIPHERAL = 1 CIRCUITPY_TOUCHIO = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk index 18b057a18a..22e2059a93 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk index c97207b215..a2bd577cd3 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk index d9bde81833..9460d0009b 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index a65c570c7d..4cd50a030d 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -9,7 +9,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 -MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index 82d2768d8f..7eda151f36 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -35,4 +35,3 @@ RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 endif - diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 7270effde4..d08690a15a 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -14,4 +14,3 @@ CIRCUITPY_FULL_BUILD = 0 CFLAGS_INLINE_LIMIT = 45 SUPEROPT_GC = 0 -MICROPY_PY_ASYNC_AWAIT = 0 diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk index b08d36b59d..9309fdce0d 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk @@ -28,6 +28,3 @@ CIRCUITPY_COUNTIO=0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 6a6ca72ce1..86ba654548 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -24,10 +24,9 @@ CIRCUITPY_RTC = 1 CIRCUITPY_SDCARDIO = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_ULAB = 0 +MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 # Override optimization to keep binary small OPTIMIZATION_FLAGS = -Os -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk index 7077766a37..eb28ef5ea3 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk +++ b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk @@ -8,4 +8,3 @@ MCU_CHIP = nrf52840 INTERNAL_FLASH_FILESYSTEM = 1 MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index ba75d29a5c..91850448db 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -32,6 +32,7 @@ CIRCUITPY_FULL_BUILD ?= 1 CFLAGS += -DCIRCUITPY_FULL_BUILD=$(CIRCUITPY_FULL_BUILD) +# async/await language keyword support MICROPY_PY_ASYNC_AWAIT ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DMICROPY_PY_ASYNC_AWAIT=$(MICROPY_PY_ASYNC_AWAIT) @@ -292,6 +293,3 @@ CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI) # Enabled micropython.native decorator (experimental) CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) - -# async/await language keyword support -MICROPY_PY_ASYNC_AWAIT ?= $(CIRCUITPY_FULL_BUILD) diff --git a/py/compile.c b/py/compile.c index 45a586594d..04bcf5bc14 100644 --- a/py/compile.c +++ b/py/compile.c @@ -40,8 +40,6 @@ #if MICROPY_ENABLE_COMPILER -#define DEBUG_PRINT(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) - // TODO need to mangle __attr names #define INVALID_LABEL (0xffff) From 10badd93c3ce4d2cdf074fe03bf23f9e481aa03e Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 11 Oct 2020 22:52:27 -0700 Subject: [PATCH 61/73] leftover newlines --- ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk | 1 - ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk | 1 - 2 files changed, 2 deletions(-) diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index e2604c89b5..0345417a98 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -21,4 +21,3 @@ ifeq ($(TRANSLATION), de_DE) RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 endif - diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index 4cd50a030d..735d422973 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -22,4 +22,3 @@ RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 endif - From 9696dbfd388aa4c21b686d4566832964c31f8035 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Oct 2020 13:26:58 -0500 Subject: [PATCH 62/73] rgbmatrix: Don't crash when setting brightness=0 If the display is paused, `_PM_swapbuffer_maybe` will never return. So, when brightness is 0, refresh does nothing. This makes it necessary to update the display when unpausing. Closes: #3524 --- shared-module/rgbmatrix/RGBMatrix.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index 3007ca4db5..abd6d500f6 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -190,6 +190,8 @@ void common_hal_rgbmatrix_rgbmatrix_set_paused(rgbmatrix_rgbmatrix_obj_t* self, _PM_stop(&self->protomatter); } else if (!paused && self->paused) { _PM_resume(&self->protomatter); + _PM_convert_565(&self->protomatter, self->bufinfo.buf, self->width); + _PM_swapbuffer_maybe(&self->protomatter); } self->paused = paused; } @@ -199,8 +201,10 @@ bool common_hal_rgbmatrix_rgbmatrix_get_paused(rgbmatrix_rgbmatrix_obj_t* self) } void common_hal_rgbmatrix_rgbmatrix_refresh(rgbmatrix_rgbmatrix_obj_t* self) { - _PM_convert_565(&self->protomatter, self->bufinfo.buf, self->width); - _PM_swapbuffer_maybe(&self->protomatter); + if (!self->paused) { + _PM_convert_565(&self->protomatter, self->bufinfo.buf, self->width); + _PM_swapbuffer_maybe(&self->protomatter); + } } int common_hal_rgbmatrix_rgbmatrix_get_width(rgbmatrix_rgbmatrix_obj_t* self) { From 8ddbebd2c1500ceba4b6628882f5a128743d323d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Oct 2020 13:35:15 -0500 Subject: [PATCH 63/73] esp32s2: fix build after qstr rule changes --- ports/esp32s2/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index a97ab0b00f..8d891edd02 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -269,7 +269,7 @@ menuconfig: $(BUILD)/esp-idf/config $(Q)grep -Fvxf $(DEBUG_SDKCONFIG) -f $(FLASH_SDKCONFIG) $(BUILD)/sdkconfig.diff > boards/$(BOARD)/sdkconfig # qstr builds include headers so we need to make sure they are up to date -$(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h +$(HEADER_BUILD)/qstr.split: | $(BUILD)/esp-idf/config/sdkconfig.h ESP_IDF_COMPONENTS_LINK = freertos log hal esp_system esp_adc_cal esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls From a0e5e961c594e26713aa9e255bf6e43214bf42a4 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 12 Oct 2020 17:43:13 -0700 Subject: [PATCH 64/73] Fix STM RTC read so it's atomic. Fixes #3376 --- ports/stm/supervisor/port.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index bb304a3173..79e4584b0e 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -190,6 +190,7 @@ safe_mode_t port_init(void) { _hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; HAL_RTC_Init(&_hrtc); + HAL_RTCEx_EnableBypassShadow(&_hrtc); HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn); // Turn off SysTick @@ -328,9 +329,23 @@ volatile uint32_t cached_date = 0; volatile uint32_t seconds_to_minute = 0; volatile uint32_t cached_hours_minutes = 0; uint64_t port_get_raw_ticks(uint8_t* subticks) { - uint32_t subseconds = rtc_clock_frequency - (uint32_t)(RTC->SSR); + // Disable IRQs to ensure we read all of the RTC registers as close in time as possible. Read + // SSR twice to make sure we didn't read across a tick. + __disable_irq(); + uint32_t first_ssr = (uint32_t)(RTC->SSR); uint32_t time = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK); uint32_t date = (uint32_t)(RTC->DR & RTC_DR_RESERVED_MASK); + uint32_t ssr = (uint32_t)(RTC->SSR); + while (ssr != first_ssr) { + first_ssr = ssr; + time = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK); + date = (uint32_t)(RTC->DR & RTC_DR_RESERVED_MASK); + ssr = (uint32_t)(RTC->SSR); + } + __enable_irq(); + + uint32_t subseconds = rtc_clock_frequency - 1 - ssr; + if (date != cached_date) { uint32_t year = (uint8_t)((date & (RTC_DR_YT | RTC_DR_YU)) >> 16U); uint8_t month = (uint8_t)((date & (RTC_DR_MT | RTC_DR_MU)) >> 8U); @@ -349,6 +364,7 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) { hours = (uint8_t)RTC_Bcd2ToByte(hours); minutes = (uint8_t)RTC_Bcd2ToByte(minutes); seconds_to_minute = 60 * (60 * hours + minutes); + cached_hours_minutes = hours_minutes; } uint8_t seconds = (uint8_t)(time & (RTC_TR_ST | RTC_TR_SU)); seconds = (uint8_t)RTC_Bcd2ToByte(seconds); From 379e73af2e55b1f0c517883360e29d5dbc27a20b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 12 Oct 2020 18:36:18 -0700 Subject: [PATCH 65/73] Finer grained, per port tick locking Fixes #3504 hopefully. --- ports/atmel-samd/common-hal/pulseio/PulseIn.h | 1 - ports/atmel-samd/supervisor/port.c | 37 +++++++++++++------ ports/litex/supervisor/port.c | 6 ++- ports/nrf/supervisor/port.c | 6 ++- supervisor/shared/tick.c | 2 - 5 files changed, 35 insertions(+), 17 deletions(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.h b/ports/atmel-samd/common-hal/pulseio/PulseIn.h index 99358178f2..b91bbd703b 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.h +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.h @@ -51,7 +51,6 @@ void pulsein_reset(void); void pulsein_interrupt_handler(uint8_t channel); void pulsein_timer_interrupt_handler(uint8_t index); #ifdef SAMD21 -void rtc_set_continuous(void); void rtc_start_pulsein(void); void rtc_end_pulsein(void); #endif diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index e69062296d..6686d794c4 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -96,19 +96,21 @@ #endif volatile bool hold_interrupt = false; #ifdef SAMD21 +static void rtc_set_continuous(bool continuous) { + while (RTC->MODE0.STATUS.bit.SYNCBUSY); + // TODO: DaveP: Do we need the RREQ here? + RTC->MODE0.READREQ.reg = RTC_READREQ_RREQ | (continuous ? RTC_READREQ_RCONT : 0) | 0x0010; + while (RTC->MODE0.STATUS.bit.SYNCBUSY); +} + void rtc_start_pulsein(void) { - rtc_set_continuous(); + rtc_set_continuous(true); hold_interrupt = true; } void rtc_end_pulsein(void) { hold_interrupt = false; -} - -void rtc_set_continuous(void) { - while (RTC->MODE0.STATUS.bit.SYNCBUSY); - RTC->MODE0.READREQ.reg = RTC_READREQ_RREQ | RTC_READREQ_RCONT | 0x0010; - while (RTC->MODE0.STATUS.bit.SYNCBUSY); + rtc_set_continuous(false); } #endif @@ -430,19 +432,28 @@ uint32_t port_get_saved_word(void) { static volatile uint64_t overflowed_ticks = 0; static volatile bool _ticks_enabled = false; -static uint32_t _get_count(void) { +static uint32_t _get_count(uint32_t* overflow_count) { #ifdef SAM_D5X_E5X while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {} #endif #ifdef SAMD21 + // Request a read so we don't stall the bus later. See section 14.3.1.5 Read Request + RTC->MODE0.READREQ.reg = RTC_READREQ_RREQ | 0x0010; while (RTC->MODE0.STATUS.bit.SYNCBUSY != 0) {} #endif + // Disable interrupts so we can grab the count and the overflow. + common_hal_mcu_disable_interrupts(); + uint32_t count = RTC->MODE0.COUNT.reg; + if (overflow_count != NULL) { + *overflow_count = overflowed_ticks; + } + common_hal_mcu_enable_interrupts(); - return RTC->MODE0.COUNT.reg; + return count; } static void _port_interrupt_after_ticks(uint32_t ticks) { - uint32_t current_ticks = _get_count(); + uint32_t current_ticks = _get_count(NULL); if (ticks > 1 << 28) { // We'll interrupt sooner with an overflow. return; @@ -490,12 +501,13 @@ void RTC_Handler(void) { } uint64_t port_get_raw_ticks(uint8_t* subticks) { - uint32_t current_ticks = _get_count(); + uint32_t overflow_count; + uint32_t current_ticks = _get_count(&overflow_count); if (subticks != NULL) { *subticks = (current_ticks % 16) * 2; } - return overflowed_ticks + current_ticks / 16; + return overflow_count + current_ticks / 16; } // Enable 1/1024 second tick. @@ -505,6 +517,7 @@ void port_enable_tick(void) { RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_PER2; #endif #ifdef SAMD21 + // TODO: Switch to using the PER *event* from the RTC to generate an interrupt via EVSYS. _ticks_enabled = true; _port_interrupt_after_ticks(1); #endif diff --git a/ports/litex/supervisor/port.c b/ports/litex/supervisor/port.c index e55eb49f00..02617b9af7 100644 --- a/ports/litex/supervisor/port.c +++ b/ports/litex/supervisor/port.c @@ -128,7 +128,11 @@ uint32_t port_get_saved_word(void) { } uint64_t port_get_raw_ticks(uint8_t* subticks) { - return raw_ticks; + // Reading 64 bits may take two loads, so turn of interrupts while we do it. + irq_setie(false); + uint64_t raw_tick_snapshot = raw_ticks; + irq_setie(true); + return raw_tick_snapshot; } // Enable 1/1024 second tick. diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index bc8b47be77..493de43e0f 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -274,11 +274,15 @@ uint32_t port_get_saved_word(void) { } uint64_t port_get_raw_ticks(uint8_t* subticks) { + common_hal_mcu_disable_interrupts(); uint32_t rtc = nrfx_rtc_counter_get(&rtc_instance); + uint32_t overflow_count = overflow_tracker.overflowed_ticks; + common_hal_mcu_enable_interrupts(); + if (subticks != NULL) { *subticks = (rtc % 32); } - return overflow_tracker.overflowed_ticks + rtc / 32; + return overflow_count + rtc / 32; } // Enable 1/1024 second tick. diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 91ffa307d7..a2855a5706 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -125,9 +125,7 @@ void supervisor_tick(void) { uint64_t supervisor_ticks_ms64() { uint64_t result; - common_hal_mcu_disable_interrupts(); result = port_get_raw_ticks(NULL); - common_hal_mcu_enable_interrupts(); result = result * 1000 / 1024; return result; } From cfa3163a7ea76689c2c54556c990692b62c2577d Mon Sep 17 00:00:00 2001 From: Noel Gaetan Date: Mon, 12 Oct 2020 19:47:22 +0000 Subject: [PATCH 66/73] Translated using Weblate (French) Currently translated at 92.4% (767 of 830 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 45a4cc25d0..59f69508fe 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-10-06 13:26-0400\n" -"PO-Revision-Date: 2020-09-16 13:47+0000\n" -"Last-Translator: Hugo Dahl \n" +"PO-Revision-Date: 2020-10-12 21:00+0000\n" +"Last-Translator: Noel Gaetan \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -102,7 +102,7 @@ msgstr "%q doit être un tuple de longueur 2" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q est hors de porté" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" @@ -281,7 +281,7 @@ msgstr "Un canal d'interruptions matérielles est déjà utilisé" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "ADC2 est utilisé pars le Wifi" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format @@ -298,7 +298,7 @@ msgstr "Tous les périphériques I2C sont utilisés" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "Tout les RX FIFOs sont utilisé" #: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" @@ -664,7 +664,7 @@ msgstr "Code brut corrompu" #: ports/cxd56/common-hal/camera/Camera.c msgid "Could not initialize Camera" -msgstr "" +msgstr "Impossible d'initialisé la Camera" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -795,7 +795,7 @@ msgstr "La BCE ne fonctionne que sur 16 octets à la fois" #: ports/esp32s2/common-hal/busio/SPI.c msgid "ESP-IDF memory allocation failed" -msgstr "" +msgstr "ESP-IDF échec d'allocation de la mémoire" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -900,7 +900,7 @@ msgstr "Impossible de se connecter : délai d'expiration" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to init wifi" -msgstr "" +msgstr "Echec de l'initialisation du Wifi" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" @@ -975,7 +975,7 @@ msgstr "Erreur d'initialisation I2C" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "I2SOut n'est pas disponible" #: shared-bindings/aesio/aes.c #, c-format @@ -1043,7 +1043,7 @@ msgstr "Fichier BMP invalide" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "BSSID Invalide" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" @@ -1093,7 +1093,7 @@ msgstr "Taille de bloc de formatage invalide" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "" +msgstr "fréquence non Valide" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" @@ -1216,7 +1216,7 @@ msgstr "La valeur max. de x est %d lors d'une opération miroir" #: shared-bindings/canio/Message.c msgid "Messages limited to 8 bytes" -msgstr "" +msgstr "Message limité a 8 bytes" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." @@ -1329,11 +1329,11 @@ msgstr "Pas de support entier long" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" -msgstr "" +msgstr "Pas de canal supplémentaire disponible" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more timers available" -msgstr "" +msgstr "Pas d'horloge supplémentaire disponible" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." @@ -1341,7 +1341,7 @@ msgstr "Plus de minuteurs disponibles sur cette broche." #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" -msgstr "" +msgstr "Aucun réseau avec ce ssid" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1365,7 +1365,7 @@ msgstr "Affirmation de défaillance du Nordic Soft Device." #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" -msgstr "" +msgstr "Chaîne IP non valide" #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -3601,7 +3601,7 @@ msgstr "caractère de format '%c' (0x%x) non supporté à l'index %d" #: py/runtime.c msgid "unsupported type for %q: '%q'" -msgstr "type non supporté pour %q: '%q'" +msgstr "type non supporté pour %q : '%q'" #: py/runtime.c msgid "unsupported type for operator" From 1d4d269092c0e90baeb479e362424584b50194e2 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 13 Oct 2020 00:31:54 +0200 Subject: [PATCH 67/73] 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 | 18 +++++++++++++++--- locale/cs.po | 18 +++++++++++++++--- locale/de_DE.po | 18 +++++++++++++++--- locale/el.po | 18 +++++++++++++++--- locale/es.po | 18 +++++++++++++++--- locale/fil.po | 18 +++++++++++++++--- locale/fr.po | 18 +++++++++++++++--- locale/hi.po | 18 +++++++++++++++--- locale/it_IT.po | 18 +++++++++++++++--- locale/ja.po | 18 +++++++++++++++--- locale/ko.po | 18 +++++++++++++++--- locale/nl.po | 18 +++++++++++++++--- locale/pl.po | 18 +++++++++++++++--- locale/pt_BR.po | 18 +++++++++++++++--- locale/sv.po | 18 +++++++++++++++--- locale/zh_Latn_pinyin.po | 18 +++++++++++++++--- 16 files changed, 240 insertions(+), 48 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 76e83920cc..61af353825 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -250,6 +250,10 @@ msgstr "'label' membutuhkan 1 argumen" msgid "'return' outside function" msgstr "'return' diluar fungsi" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' diluar fungsi" @@ -293,6 +297,7 @@ msgid "All I2C peripherals are in use" msgstr "Semua perangkat I2C sedang digunakan" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -914,6 +919,7 @@ msgid "File exists" msgstr "File sudah ada" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -951,7 +957,8 @@ msgid "Group full" msgstr "Grup penuh" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "Perangkat keras sibuk, coba pin alternatif" @@ -1023,7 +1030,8 @@ msgid "Invalid %q pin" msgstr "%q pada tidak valid" #: 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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3475,6 +3483,10 @@ msgstr "" msgid "type object '%q' has no attribute '%q'" msgstr "" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index a099e1c94a..6c5e871637 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -250,6 +250,10 @@ msgstr "" msgid "'return' outside function" msgstr "" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "" @@ -293,6 +297,7 @@ msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -900,6 +905,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -936,7 +942,8 @@ msgid "Group full" msgstr "" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1006,7 +1013,8 @@ msgid "Invalid %q pin" msgstr "" #: 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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3430,6 +3438,10 @@ msgstr "" msgid "type object '%q' has no attribute '%q'" msgstr "" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 5084ca505f..5633ae9c08 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -249,6 +249,10 @@ msgstr "'label' erfordert genau ein Argument" msgid "'return' outside function" msgstr "'return' außerhalb einer Funktion" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' außerhalb einer Funktion" @@ -292,6 +296,7 @@ msgid "All I2C peripherals are in use" msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -911,6 +916,7 @@ msgid "File exists" msgstr "Datei existiert" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -951,7 +957,8 @@ msgid "Group full" msgstr "Gruppe voll" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "Hardware beschäftigt, versuchen Sie alternative Pins" @@ -1023,7 +1030,8 @@ msgid "Invalid %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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3514,6 +3522,10 @@ msgstr "Typ ist kein akzeptierter Basis-Typ" msgid "type object '%q' has no attribute '%q'" msgstr "Typ vom Objekt '%q' hat kein Attribut '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "Typ akzeptiert 1 oder 3 Argumente" diff --git a/locale/el.po b/locale/el.po index 32e08a5506..4202f6ae06 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -245,6 +245,10 @@ msgstr "" msgid "'return' outside function" msgstr "" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "" @@ -288,6 +292,7 @@ msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -895,6 +900,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -931,7 +937,8 @@ msgid "Group full" msgstr "" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1001,7 +1008,8 @@ msgid "Invalid %q pin" msgstr "" #: 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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3425,6 +3433,10 @@ msgstr "" msgid "type object '%q' has no attribute '%q'" msgstr "" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "" diff --git a/locale/es.po b/locale/es.po index 3a7e1c6823..1b006e1d1e 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-10-09 17:19+0000\n" "Last-Translator: dherrada \n" "Language-Team: \n" @@ -253,6 +253,10 @@ msgstr "'label' requiere 1 argumento" msgid "'return' outside function" msgstr "'return' fuera de una función" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' fuera de una función" @@ -296,6 +300,7 @@ 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/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Todos los FIFOs de RX en uso" @@ -915,6 +920,7 @@ msgid "File exists" msgstr "El archivo ya existe" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filtros muy complejos" @@ -952,7 +958,8 @@ msgid "Group full" msgstr "Group lleno" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "Hardware ocupado, pruebe pines alternativos" @@ -1024,7 +1031,8 @@ msgid "Invalid %q pin" msgstr "Pin %q inválido" #: 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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "selección inválida de pin %q" @@ -3504,6 +3512,10 @@ msgstr "type no es un tipo de base aceptable" msgid "type object '%q' has no attribute '%q'" msgstr "objeto de tipo '%q' no tiene atributo '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "type acepta 1 ó 3 argumentos" diff --git a/locale/fil.po b/locale/fil.po index 4e7ce9ed8f..f71a0a757a 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -247,6 +247,10 @@ msgstr "'label' kailangan ng 1 argument" msgid "'return' outside function" msgstr "'return' sa labas ng function" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' sa labas ng function" @@ -290,6 +294,7 @@ msgid "All I2C peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -908,6 +913,7 @@ msgid "File exists" msgstr "Mayroong file" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -944,7 +950,8 @@ msgid "Group full" msgstr "Puno ang group" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1016,7 +1023,8 @@ msgid "Invalid %q pin" msgstr "Mali ang %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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3480,6 +3488,10 @@ msgstr "hindi puede ang type para sa base type" msgid "type object '%q' has no attribute '%q'" msgstr "type object '%q' ay walang attribute '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "type kumuhuha ng 1 o 3 arguments" diff --git a/locale/fr.po b/locale/fr.po index 59f69508fe..500f0a091d 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-10-12 21:00+0000\n" "Last-Translator: Noel Gaetan \n" "Language: fr\n" @@ -254,6 +254,10 @@ msgstr "'label' nécessite 1 argument" msgid "'return' outside function" msgstr "'return' en dehors d'une fonction" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' en dehors d'une fonction" @@ -297,6 +301,7 @@ 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/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Tout les RX FIFOs sont utilisé" @@ -920,6 +925,7 @@ msgid "File exists" msgstr "Le fichier existe" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -957,7 +963,8 @@ msgid "Group full" msgstr "Groupe plein" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "Matériel occupé, essayez d'autres broches" @@ -1029,7 +1036,8 @@ msgid "Invalid %q pin" msgstr "Broche invalide pour '%q'" #: 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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3522,6 +3530,10 @@ msgstr "le type n'est pas un type de base accepté" msgid "type object '%q' has no attribute '%q'" msgstr "l'objet de type '%q' n'a pas d'attribut '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "le type prend 1 ou 3 arguments" diff --git a/locale/hi.po b/locale/hi.po index 90d7a1107a..79b9e5105a 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -245,6 +245,10 @@ msgstr "" msgid "'return' outside function" msgstr "" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "" @@ -288,6 +292,7 @@ msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -895,6 +900,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -931,7 +937,8 @@ msgid "Group full" msgstr "" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1001,7 +1008,8 @@ msgid "Invalid %q pin" msgstr "" #: 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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3425,6 +3433,10 @@ msgstr "" msgid "type object '%q' has no attribute '%q'" msgstr "" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 7ae72a2e5e..ef86aa78ac 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -246,6 +246,10 @@ msgstr "'label' richiede 1 argomento" msgid "'return' outside function" msgstr "'return' al di fuori della funzione" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' al di fuori della funzione" @@ -289,6 +293,7 @@ msgid "All I2C peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -908,6 +913,7 @@ msgid "File exists" msgstr "File esistente" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -944,7 +950,8 @@ msgid "Group full" msgstr "Gruppo pieno" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1016,7 +1023,8 @@ msgid "Invalid %q pin" msgstr "Pin %q non valido" #: 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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3487,6 +3495,10 @@ msgstr "il tipo non è un tipo di base accettabile" msgid "type object '%q' has no attribute '%q'" msgstr "l'oggetto di tipo '%q' non ha l'attributo '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "tipo prende 1 o 3 argomenti" diff --git a/locale/ja.po b/locale/ja.po index 8443db3493..283149eee4 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -252,6 +252,10 @@ msgstr "" msgid "'return' outside function" msgstr "関数外でのreturn" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "関数外でのyield" @@ -295,6 +299,7 @@ msgid "All I2C peripherals are in use" msgstr "全てのI2C周辺機器が使用中" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "全てのRX FIFOが使用中" @@ -908,6 +913,7 @@ msgid "File exists" msgstr "ファイルが存在します" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -944,7 +950,8 @@ msgid "Group full" msgstr "グループが一杯" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "ハードウェアビジー。代替のピンを試してください" @@ -1016,7 +1023,8 @@ msgid "Invalid %q pin" msgstr "不正な%qピン" #: 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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "不正な%qピン選択" @@ -3458,6 +3466,10 @@ msgstr "この型はベース型にできません" msgid "type object '%q' has no attribute '%q'" msgstr "" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "typeは1つか3つの引数をとります" diff --git a/locale/ko.po b/locale/ko.po index 822c450a3f..48ecb77372 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -248,6 +248,10 @@ msgstr "'label' 에는 1 개의 독립변수가 필요합니다" msgid "'return' outside function" msgstr "'return' 는 함수 외부에 존재합니다" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' 는 함수 외부에 존재합니다" @@ -291,6 +295,7 @@ msgid "All I2C peripherals are in use" msgstr "사용중인 모든 I2C주변 기기" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -900,6 +905,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -936,7 +942,8 @@ msgid "Group full" msgstr "" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1006,7 +1013,8 @@ msgid "Invalid %q pin" msgstr "" #: 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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3431,6 +3439,10 @@ msgstr "" msgid "type object '%q' has no attribute '%q'" msgstr "" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 6ee0c68f40..c979b5dce6 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -250,6 +250,10 @@ msgstr "'label' vereist 1 argument" msgid "'return' outside function" msgstr "'return' buiten de functie" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' buiten de functie" @@ -293,6 +297,7 @@ msgid "All I2C peripherals are in use" 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 "" @@ -908,6 +913,7 @@ msgid "File exists" msgstr "Bestand bestaat" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -946,7 +952,8 @@ msgid "Group full" msgstr "Groep is vol" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "Hardware bezig, probeer alternatieve pinnen" @@ -1018,7 +1025,8 @@ msgid "Invalid %q pin" msgstr "Ongeldige %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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "Ongeldige %q pin selectie" @@ -3488,6 +3496,10 @@ msgstr "type is geen aanvaardbaar basistype" msgid "type object '%q' has no attribute '%q'" msgstr "objecttype '%q' heeft geen attribuut '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "type accepteert 1 of 3 argumenten" diff --git a/locale/pl.po b/locale/pl.po index f2f2b2c14d..50d519f6aa 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-09-29 01:39+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -252,6 +252,10 @@ msgstr "'label' wymaga 1 argumentu" msgid "'return' outside function" msgstr "'return' poza funkcją" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' poza funkcją" @@ -295,6 +299,7 @@ msgid "All I2C peripherals are in use" msgstr "Wszystkie peryferia I2C w użyciu" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -908,6 +913,7 @@ msgid "File exists" msgstr "Plik istnieje" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -944,7 +950,8 @@ msgid "Group full" msgstr "Grupa pełna" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "Sprzęt zajęty, wypróbuj alternatywne piny" @@ -1016,7 +1023,8 @@ msgid "Invalid %q pin" msgstr "Zła nóżka %q" #: 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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3450,6 +3458,10 @@ msgstr "typ nie może być bazowy" msgid "type object '%q' has no attribute '%q'" msgstr "typ '%q' nie ma atrybutu '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "type wymaga 1 lub 3 argumentów" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 92214322d7..f7dd7db7fd 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-10-09 22:07+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -254,6 +254,10 @@ msgstr "'label' exige 1 argumento" msgid "'return' outside function" msgstr "função externa 'return'" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "função externa 'yield'" @@ -297,6 +301,7 @@ 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/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Todos os FIFOs RX estão em uso" @@ -917,6 +922,7 @@ msgid "File exists" msgstr "Arquivo já existe" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Os filtros são muito complexos" @@ -955,7 +961,8 @@ msgid "Group full" msgstr "Grupo cheio" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "O hardware está ocupado, tente os pinos alternativos" @@ -1027,7 +1034,8 @@ msgid "Invalid %q pin" msgstr "Pino do %q inválido" #: 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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "Seleção inválida dos pinos %q" @@ -3518,6 +3526,10 @@ msgstr "tipo não é um tipo base aceitável" msgid "type object '%q' has no attribute '%q'" msgstr "o objeto tipo '%q' não possuí atributo '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "o tipo usa 1 ou 3 argumentos" diff --git a/locale/sv.po b/locale/sv.po index a8d4d9ffc4..1d5739ed70 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-10-02 22:53+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -250,6 +250,10 @@ msgstr "'label' kräver 1 argument" msgid "'return' outside function" msgstr "'return' utanför funktion" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' utanför funktion" @@ -293,6 +297,7 @@ msgid "All I2C peripherals are in use" msgstr "All I2C-kringutrustning används" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Alla RX FIFO i bruk" @@ -908,6 +913,7 @@ msgid "File exists" msgstr "Filen finns redan" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filter för komplexa" @@ -944,7 +950,8 @@ msgid "Group full" msgstr "Gruppen är full" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "Hårdvaran är upptagen, prova alternativa pinnar" @@ -1016,7 +1023,8 @@ msgid "Invalid %q pin" msgstr "Ogiltig %q-pinne" #: 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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "Ogiltigt val av %q pinne" @@ -3485,6 +3493,10 @@ msgstr "typ är inte en acceptabel bastyp" msgid "type object '%q' has no attribute '%q'" msgstr "typobjektet '%q' har inget attribut '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "typen tar 1 eller 3 argument" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9e7baa9d02..0747b0e6f7 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-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -252,6 +252,10 @@ msgstr "'label' xūyào 1 cānshù" msgid "'return' outside function" msgstr "'return' wàibù gōngnéng" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' wàibù gōngnéng" @@ -295,6 +299,7 @@ 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/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Suǒyǒu shǐyòng zhōng de RX FIFO" @@ -906,6 +911,7 @@ msgid "File exists" msgstr "Wénjiàn cúnzài" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "guò lǜ qì tài fù zá" @@ -942,7 +948,8 @@ msgid "Group full" msgstr "Fēnzǔ yǐ mǎn" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "Yìngjiàn máng, qǐng chángshì qítā zhēnjiǎo" @@ -1014,7 +1021,8 @@ msgid "Invalid %q pin" msgstr "Wúxiào de %q yǐn jiǎo" #: 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/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "wú xiào %q yǐn jiǎo xuǎn zé" @@ -3474,6 +3482,10 @@ msgstr "lèixíng bùshì kě jiēshòu de jīchǔ lèixíng" msgid "type object '%q' has no attribute '%q'" msgstr "lèixíng duìxiàng '%q' méiyǒu shǔxìng '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "lèixíng wèi 1 huò 3 gè cānshù" From 6e38bf629b09c952694c2afa1e3db107f0b8e6c2 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 13 Oct 2020 04:18:19 +0000 Subject: [PATCH 68/73] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (832 of 832 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 f7dd7db7fd..a8e1633898 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-10 23:49-0700\n" -"PO-Revision-Date: 2020-10-09 22:07+0000\n" +"PO-Revision-Date: 2020-10-13 17:11+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -256,7 +256,7 @@ msgstr "função externa 'return'" #: py/compile.c msgid "'yield from' inside async function" -msgstr "" +msgstr "'yield a partir' de dentro da função async" #: py/compile.c msgid "'yield' outside function" @@ -3528,7 +3528,7 @@ msgstr "o objeto tipo '%q' não possuí atributo '%q'" #: py/objgenerator.c msgid "type object 'generator' has no attribute '__await__'" -msgstr "" +msgstr "o tipo do objeto 'generator' não possui qualquer atributo '__await__'" #: py/objtype.c msgid "type takes 1 or 3 arguments" From b9c5fb57ff526d11218eef9e0537bd349ffff2fd Mon Sep 17 00:00:00 2001 From: hexthat Date: Mon, 12 Oct 2020 22:56:01 +0000 Subject: [PATCH 69/73] Translated using Weblate (Chinese (Pinyin)) Currently translated at 100.0% (832 of 832 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 0747b0e6f7..b9adc10dfe 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-10 23:49-0700\n" -"PO-Revision-Date: 2020-10-10 23:51+0000\n" +"PO-Revision-Date: 2020-10-13 17:11+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -254,7 +254,7 @@ msgstr "'return' wàibù gōngnéng" #: py/compile.c msgid "'yield from' inside async function" -msgstr "" +msgstr "Yì bù hán shù zhōng de 'yield from'" #: py/compile.c msgid "'yield' outside function" @@ -3484,7 +3484,7 @@ msgstr "lèixíng duìxiàng '%q' méiyǒu shǔxìng '%q'" #: py/objgenerator.c msgid "type object 'generator' has no attribute '__await__'" -msgstr "" +msgstr "lèi xíng duì xiàng 'generator' méi yǒu shǔ xìng '__await__'" #: py/objtype.c msgid "type takes 1 or 3 arguments" From 2bc40bcadf36d27d2807ac155f185e6cc55e9ecb Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 13 Oct 2020 10:15:34 -0700 Subject: [PATCH 70/73] Remove readreq when changing continuous --- ports/atmel-samd/supervisor/port.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 6686d794c4..d65d098257 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -98,8 +98,7 @@ volatile bool hold_interrupt = false; #ifdef SAMD21 static void rtc_set_continuous(bool continuous) { while (RTC->MODE0.STATUS.bit.SYNCBUSY); - // TODO: DaveP: Do we need the RREQ here? - RTC->MODE0.READREQ.reg = RTC_READREQ_RREQ | (continuous ? RTC_READREQ_RCONT : 0) | 0x0010; + RTC->MODE0.READREQ.reg = (continuous ? RTC_READREQ_RCONT : 0) | 0x0010; while (RTC->MODE0.STATUS.bit.SYNCBUSY); } From 2b33968a1e4bf72017c983e1d92c80c73b071745 Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Tue, 13 Oct 2020 16:46:25 -0400 Subject: [PATCH 71/73] Add new board to atmel-samd port: bdmicro_vina_d51 --- .../boards/bdmicro_vina_d51/board.c | 48 +++++++++++ .../boards/bdmicro_vina_d51/mpconfigboard.h | 28 +++++++ .../boards/bdmicro_vina_d51/mpconfigboard.mk | 12 +++ .../atmel-samd/boards/bdmicro_vina_d51/pins.c | 82 +++++++++++++++++++ 4 files changed, 170 insertions(+) create mode 100644 ports/atmel-samd/boards/bdmicro_vina_d51/board.c create mode 100644 ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/bdmicro_vina_d51/pins.c diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/board.c b/ports/atmel-samd/boards/bdmicro_vina_d51/board.c new file mode 100644 index 0000000000..bd63baa6fd --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/board.c @@ -0,0 +1,48 @@ +/* + * 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 "mpconfigboard.h" + +void board_init(void) +{ + // struct port_config pin_conf; + // port_get_config_defaults(&pin_conf); + // + // pin_conf.direction = PORT_PIN_DIR_OUTPUT; + // port_pin_set_config(MICROPY_HW_LED_TX, &pin_conf); + // port_pin_set_output_level(MICROPY_HW_LED_TX, true); + // + // port_pin_set_config(MICROPY_HW_LED_RX, &pin_conf); + // port_pin_set_output_level(MICROPY_HW_LED_RX, true); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h new file mode 100644 index 0000000000..6bc9bb7063 --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h @@ -0,0 +1,28 @@ +#define MICROPY_HW_BOARD_NAME "BDMICRO VINA-D51" +#define MICROPY_HW_MCU_NAME "samd51n20" + +#define CIRCUITPY_MCU_FAMILY samd51 + +// These are pins not to reset. +// Don't reset QSPI data pins +#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11) +#define MICROPY_PORT_B (PORT_PB10 | PORT_PB11) +#define MICROPY_PORT_C (0) +#define MICROPY_PORT_D (0) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SDA (&pin_PB02) +#define DEFAULT_I2C_BUS_SCL (&pin_PB03) +#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_RX (&pin_PC05) +#define MICROPY_HW_LED_TX (&pin_PC06) + +// 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/bdmicro_vina_d51/mpconfigboard.mk b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.mk new file mode 100644 index 0000000000..f1b2f4c1d9 --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.mk @@ -0,0 +1,12 @@ +USB_VID = 0x31e2 +USB_PID = 0x2011 +USB_PRODUCT = "VINA-D51" +USB_MANUFACTURER = "BDMICRO LLC" + +CHIP_VARIANT = SAMD51N20A +CHIP_FAMILY = samd51 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 2 +EXTERNAL_FLASH_DEVICES = "MX25L51245G","GD25S512MD" +LONGINT_IMPL = MPZ diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c b/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c new file mode 100644 index 0000000000..d0006393ce --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c @@ -0,0 +1,82 @@ +#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_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_GPIO0), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_UART3_RTS), 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_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_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_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) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PC27) }, + { MP_ROM_QSTR(MP_QSTR_SPI_SCK), MP_ROM_PTR(&pin_PC28) }, + { 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_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 af2a23bd18adbee007aca1cb3c670341fe48b44d Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Tue, 13 Oct 2020 17:08:30 -0400 Subject: [PATCH 72/73] workflows/build.yml - Add forgotten vina_d51 board. --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eaecd2fa4d..0edc8c023d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -180,6 +180,7 @@ jobs: - "arduino_zero" - "bast_pro_mini_m0" - "bdmicro_vina_d21" + - "bdmicro_vina_d51" - "bless_dev_board_multi_sensor" - "blm_badge" - "capablerobot_usbhub" From 852a91e1b73f217926379c114cafa6089980976e Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Wed, 14 Oct 2020 08:29:28 -0400 Subject: [PATCH 73/73] boards/bdmicro_vina_d51/pins.c: Fix illegal QSTR name (hyphen). --- ports/atmel-samd/boards/bdmicro_vina_d51/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c b/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c index d0006393ce..931e0328fc 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c @@ -41,7 +41,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_I2S_FS-0), MP_ROM_PTR(&pin_PA20) }, + { 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) },