From c1830d62122604840a05007b823b021280c9aee1 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 22 Sep 2020 20:25:34 +0000 Subject: [PATCH 01/13] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (807 of 807 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e4d5a5afe9..0f5885ccf5 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-21 16:45-0500\n" -"PO-Revision-Date: 2020-09-19 17:41+0000\n" +"PO-Revision-Date: 2020-09-22 21:30+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -98,7 +98,7 @@ msgstr "%q deve ser uma tupla de comprimento 2" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q fora do alcance" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" @@ -294,7 +294,7 @@ msgstr "Todos os periféricos I2C estão em uso" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "Todos os FIFOs RX estão em uso" #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" @@ -334,7 +334,7 @@ msgstr "Já está anunciando." #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" -msgstr "" +msgstr "Já há um ouvinte com todas as correspondências" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c @@ -880,7 +880,7 @@ msgstr "Arquivo já existe" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Filters too complex" -msgstr "" +msgstr "Os filtros são muito complexos" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" @@ -1170,7 +1170,7 @@ msgstr "O valor máximo de x quando espelhado é %d" #: shared-bindings/canio/Message.c msgid "Messages limited to 8 bytes" -msgstr "" +msgstr "As mensagens estão limitadas a 8 bytes" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." @@ -2410,7 +2410,7 @@ msgstr "as exceções devem derivar a partir do BaseException" #: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c msgid "expected '%q' but got '%q'" -msgstr "" +msgstr "o retorno esperado era '%q', porém obteve '% q'" #: py/objstr.c msgid "expected ':' after format specifier" @@ -3263,7 +3263,7 @@ msgstr "a paleta de origem é muito grande" #: shared-bindings/canio/Message.c msgid "specify size or data, but not both" -msgstr "" +msgstr "defina o tamanho ou os dados, porém não ambos" #: py/objstr.c msgid "start/end indices" From 3a6f7986df617e4330fdb267542ccf2cd619dc38 Mon Sep 17 00:00:00 2001 From: Maciej Stankiewicz Date: Tue, 22 Sep 2020 23:50:11 +0000 Subject: [PATCH 02/13] Translated using Weblate (Polish) Currently translated at 73.7% (595 of 807 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pl/ --- locale/pl.po | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/locale/pl.po b/locale/pl.po index 0538f61784..5428885c1d 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-21 16:45-0500\n" -"PO-Revision-Date: 2020-09-22 13:32+0000\n" -"Last-Translator: Szymon Jakubiak \n" +"PO-Revision-Date: 2020-09-23 18:31+0000\n" +"Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" "Language: pl\n" "MIME-Version: 1.0\n" @@ -100,7 +100,7 @@ msgstr "%q musi być krotką o długości 2" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q poza zakresem" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" @@ -438,7 +438,7 @@ msgstr "Jasność nie jest regulowana" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "Bufor + przesunięcie za małe %d %d %d" #: shared-module/usb_hid/Device.c #, c-format @@ -480,7 +480,7 @@ msgstr "Bufor jest zbyt duży i nie można go przydzielić" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "Bufor za krótki o% d bajtów" +msgstr "Bufor za krótki o %d bajtów" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -790,7 +790,7 @@ msgstr "Oczekiwano charakterystyki" #: shared-bindings/_bleio/Adapter.c msgid "Expected a DigitalInOut" -msgstr "" +msgstr "Oczekiwano DigitalInOut" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" @@ -875,7 +875,7 @@ msgstr "" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "Nie wspierany format" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format @@ -924,7 +924,7 @@ msgstr "Błąd inicjalizacji I2C" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "I2SOut niedostępne" #: shared-bindings/aesio/aes.c #, c-format @@ -1159,7 +1159,7 @@ msgstr "Największa wartość x przy odwróceniu to %d" #: shared-bindings/canio/Message.c msgid "Messages limited to 8 bytes" -msgstr "" +msgstr "Wiadomości ograniczone do 8 bajtów" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." @@ -1176,7 +1176,7 @@ msgstr "Opóźnienie włączenia mikrofonu musi być w zakresie od 0.0 do 1.0" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "Brak pinu MISO lub MOSI" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." @@ -1219,7 +1219,7 @@ msgstr "Brak pinu MISO" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Brak pinu MOSI" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c From 832869b257b50b12f9388c83021c53ece8761160 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 24 Sep 2020 16:56:07 -0500 Subject: [PATCH 03/13] make translate --- locale/circuitpython.pot | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index c9114dd5c5..2b395356ca 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-24 16:55-0500\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" From 6bcbe51f7fcfaca6ee3ee40b4ce64fd791725e8f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 24 Sep 2020 16:57:10 -0500 Subject: [PATCH 04/13] supervisor: stub: make unimplemented safe_mode loop forever --- supervisor/stub/safe_mode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supervisor/stub/safe_mode.c b/supervisor/stub/safe_mode.c index 1a792becd9..8072be2c65 100644 --- a/supervisor/stub/safe_mode.c +++ b/supervisor/stub/safe_mode.c @@ -32,6 +32,8 @@ safe_mode_t wait_for_safe_mode_reset(void) { void reset_into_safe_mode(safe_mode_t reason) { (void) reason; + for (;;) { + } } void print_safe_mode_message(safe_mode_t reason) { From eadb4de144005503dd648d16926527e5c40823f6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 24 Sep 2020 16:58:24 -0500 Subject: [PATCH 05/13] qtpy_m0_haxpress: add --- .../boards/qtpy_m0_haxpress/board.c | 44 ++++++++++++++ .../boards/qtpy_m0_haxpress/mpconfigboard.h | 60 +++++++++++++++++++ .../boards/qtpy_m0_haxpress/mpconfigboard.mk | 33 ++++++++++ .../atmel-samd/boards/qtpy_m0_haxpress/pins.c | 49 +++++++++++++++ 4 files changed, 186 insertions(+) create mode 100644 ports/atmel-samd/boards/qtpy_m0_haxpress/board.c create mode 100644 ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/qtpy_m0_haxpress/pins.c diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/board.c b/ports/atmel-samd/boards/qtpy_m0_haxpress/board.c new file mode 100644 index 0000000000..1a65a561f7 --- /dev/null +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/board.c @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "common-hal/microcontroller/Pin.h" +#include "supervisor/shared/board.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { + gpio_set_pin_function(PIN_PA15, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_direction(PIN_PA15, GPIO_DIRECTION_OUT); + gpio_set_pin_level(PIN_PA15, true); // Turn on neopixel by default + never_reset_pin_number(PIN_PA15); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.h b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.h new file mode 100644 index 0000000000..4e557751fc --- /dev/null +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.h @@ -0,0 +1,60 @@ +#define MICROPY_HW_BOARD_NAME "Adafruit QT Py M0 Haxpress" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_HW_NEOPIXEL (&pin_PA18) + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define SPI_FLASH_MOSI_PIN &pin_PA22 +#define SPI_FLASH_MISO_PIN &pin_PA19 +#define SPI_FLASH_SCK_PIN &pin_PA23 +#define SPI_FLASH_CS_PIN &pin_PA08 + +#define IGNORE_PIN_PA00 1 +#define IGNORE_PIN_PA01 1 +#define IGNORE_PIN_PA12 1 +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA20 1 +#define IGNORE_PIN_PA21 1 +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 +#define IGNORE_PIN_PB01 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PB04 1 +#define IGNORE_PIN_PB05 1 +#define IGNORE_PIN_PB06 1 +#define IGNORE_PIN_PB07 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PB10 1 +#define IGNORE_PIN_PB11 1 +#define IGNORE_PIN_PB12 1 +#define IGNORE_PIN_PB13 1 +#define IGNORE_PIN_PB14 1 +#define IGNORE_PIN_PB15 1 +#define IGNORE_PIN_PB16 1 +#define IGNORE_PIN_PB17 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PB30 1 +#define IGNORE_PIN_PB31 1 +#define IGNORE_PIN_PB00 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA17) +#define DEFAULT_I2C_BUS_SDA (&pin_PA16) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA11) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA10) +#define DEFAULT_SPI_BUS_MISO (&pin_PA09) + +#define DEFAULT_UART_BUS_RX (&pin_PA07) +#define DEFAULT_UART_BUS_TX (&pin_PA06) diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk new file mode 100644 index 0000000000..6c7bb3fca2 --- /dev/null +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk @@ -0,0 +1,33 @@ +USB_VID = 0x239A +USB_PID = 0x80CC +USB_PRODUCT = "QT Py M0 Haxpress" +USB_MANUFACTURER = "Adafruit Industries LLC" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 0 +LONGINT_IMPL = MPZ +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = GD25Q16C + +CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_COUNTIO = 0 +CIRCUITPY_RTC = 0 +CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_I2CPERIPHERAL = 0 + +SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/pins.c b/ports/atmel-samd/boards/qtpy_m0_haxpress/pins.c new file mode 100644 index 0000000000..636c48bffc --- /dev/null +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/pins.c @@ -0,0 +1,49 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA03) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA05) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA16) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA06) }, + + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA07) }, + + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA11) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA09) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA10) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_PA15) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 33952023e89b96530bc2acaaf6a5f03da01d9a3c Mon Sep 17 00:00:00 2001 From: askpatricw <4002194+askpatrickw@users.noreply.github.com> Date: Fri, 25 Sep 2020 10:08:26 -0700 Subject: [PATCH 06/13] Print package if it exists for pin or module only if it does not --- shared-bindings/microcontroller/Pin.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index 1294b78f00..6ba02a0e7d 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -71,7 +71,11 @@ STATIC void mcu_pin_print(const mp_print_t *print, mp_obj_t self_in, mp_print_ki qstr name; get_pin_name(self, &package, &module, &name); - mp_printf(print, "%q.%q.%q", MP_QSTR_microcontroller, MP_QSTR_pin, name); + if (package){ + mp_printf(print, "%q.%q.%q", package, module, name); + } else { + mp_printf(print, "%q.%q", module , name); + } } const mp_obj_type_t mcu_pin_type = { From b9d68bc5a6b7b63f52da6c7034d379d6de51be7e Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 25 Sep 2020 11:07:22 -0700 Subject: [PATCH 07/13] Change I2C default to 100khz Greater that 100khz is technically out of the original spec. Background here: https://github.com/adafruit/Adafruit_CircuitPython_CLUE/issues/36 --- shared-bindings/busio/I2C.c | 4 ++-- shared-module/board/__init__.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 157e779fdc..8b456dbd35 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -39,7 +39,7 @@ //| class I2C: //| """Two wire serial protocol""" //| -//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int = 255) -> None: +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 100000, timeout: int = 255) -> None: //| //| """I2C is a two-wire protocol for communicating between devices. At the //| physical level it consists of 2 wires: SCL and SDA, the clock and data @@ -70,7 +70,7 @@ STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, con static const mp_arg_t allowed_args[] = { { MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_sda, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 400000} }, + { MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 100000} }, { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 255} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 7d99f2d4e3..fb4f731b88 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -61,7 +61,7 @@ mp_obj_t common_hal_board_create_i2c(void) { busio_i2c_obj_t *self = &i2c_obj; self->base.type = &busio_i2c_type; - common_hal_busio_i2c_construct(self, DEFAULT_I2C_BUS_SCL, DEFAULT_I2C_BUS_SDA, 400000, 0); + common_hal_busio_i2c_construct(self, DEFAULT_I2C_BUS_SCL, DEFAULT_I2C_BUS_SDA, 100000, 0); i2c_singleton = (mp_obj_t)self; return i2c_singleton; } From 73d08df9adc603dd678b0d62e38b553eab18ff71 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 25 Sep 2020 12:23:31 -0700 Subject: [PATCH 08/13] Update TinyUSB to get MIDI SysEx fix Fixes #3465 --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index e90cf7a676..8b2c822557 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit e90cf7a676eddcbd9c35d2d99a0a9cd14686e2ce +Subproject commit 8b2c82255750488232eae72f3d5dcbacfd6227f3 From 9944935fdeb0783a8b1d1ce3fd98f9c7ea0924e3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 26 Sep 2020 11:31:54 -0500 Subject: [PATCH 09/13] qtpy haxpress: enable RTC --- ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk index 6c7bb3fca2..df452688e6 100644 --- a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk @@ -15,7 +15,6 @@ EXTERNAL_FLASH_DEVICES = GD25Q16C CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 -CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 From 8b27febf324d754ccc9bb07080453e33098a4e31 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 26 Sep 2020 11:43:46 -0500 Subject: [PATCH 10/13] add new board to actions build --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8edec5616..1c68a3e5c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -279,6 +279,7 @@ jobs: - "pyportal_titano" - "pyruler" - "qtpy_m0" + - "qtpy_m0_haxpress" - "raytac_mdbt50q-db-40" - "robohatmm1_m4" - "sam32" From 791d20f16ccfc0328ef0fab0159a2b4985480928 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 26 Sep 2020 11:43:55 -0500 Subject: [PATCH 11/13] give qtpy haxpress its own USB PID --- ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk index df452688e6..a63f142742 100644 --- a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x80CC +USB_PID = 0x00CC USB_PRODUCT = "QT Py M0 Haxpress" USB_MANUFACTURER = "Adafruit Industries LLC" From 66b8559fd4e4ea7d50adb12a87b7bac208b5fc16 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 28 Sep 2020 18:59:29 -0400 Subject: [PATCH 12/13] 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 13/13] 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