Merge remote-tracking branch 'origin/main'

This commit is contained in:
Hosted Weblate 2022-07-14 02:36:52 +02:00
commit b7a7370297
No known key found for this signature in database
GPG Key ID: A3FAAA06E6569B4C
132 changed files with 2470 additions and 556 deletions

@ -1 +1 @@
Subproject commit d90f9e7b122aad072d59a01df524036995cf4a78
Subproject commit cdef09114d2b43d2e461d066a5b56697ab567abc

@ -1 +1 @@
Subproject commit a5b3f74049dfa0d39caf1c0520e46d773ba4d643
Subproject commit 217af2bc7de658ff2f6380a066d99a149e69693e

@ -1 +1 @@
Subproject commit cd1da8c9384537b886ea697d5c38c7b34f8a178a
Subproject commit 13cdb9912ba31f6e267f1afb9f71fddf5b1c139c

@ -1 +1 @@
Subproject commit 6e03832b1170d75d7a7e0b8a578160298905b726
Subproject commit b168b28fc58973cf20269cc87a655d7812659fd0

@ -1 +1 @@
Subproject commit 0c3a5ecaac0891776822556b18f79722d72a8f04
Subproject commit 3816a4f4c997b03d4a7ebfe35a617d1e50124b04

@ -1 +1 @@
Subproject commit 8b6cd888b264abaf8f9b1904b09b01313b273bb2
Subproject commit 4ba6956d49752f2d0cdc73903b86a34c225934ef

View File

@ -3755,6 +3755,10 @@ msgstr ""
msgid "pow() with 3 arguments requires integers"
msgstr ""
#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h
msgid "pressing SW38 button at start up.\n"
msgstr ""
#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h
#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h
#: supervisor/shared/safe_mode.c

4
main.c
View File

@ -704,6 +704,10 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re
vstr_t *boot_output;
STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) {
if (safe_mode == NO_HEAP) {
return;
}
// If not in safe mode, run boot before initing USB and capture output in a file.
// There is USB setup to do even if boot.py is not actually run.

@ -1 +1 @@
Subproject commit 79bf4e87e98356c54f13799ccb8fb84dff987bd1
Subproject commit 57133eefeb077f73b5ac17ee044d9feaf566da8e

View File

@ -60,7 +60,7 @@
#define MICROPY_PORT_ROOT_POINTERS \
CIRCUITPY_COMMON_ROOT_POINTERS
#define CIRCUITPY_DEBUG_UART_TX (&pin_GPIO14)
#define CIRCUITPY_DEBUG_UART_RX (&pin_GPIO15)
#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO14)
#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO15)
#endif // __INCLUDED_MPCONFIGPORT_H

View File

@ -194,7 +194,12 @@ LDFLAGS += \
-Wl,--build-id=none \
-fno-rtti
ifeq ($(IDF_TARGET),esp32c3)
ifeq ($(IDF_TARGET),esp32)
LDFLAGS += \
-T$(IDF_TARGET).rom.newlib-data.ld \
-T$(IDF_TARGET).rom.newlib-funcs.ld \
-T$(IDF_TARGET).rom.spiflash.ld
else ifeq ($(IDF_TARGET),esp32c3)
LDFLAGS += \
-Tesp32c3.rom.newlib.ld \
-Tesp32c3.rom.version.ld \
@ -242,7 +247,6 @@ SRC_C += \
bindings/espidf/__init__.c \
boards/$(BOARD)/board.c \
boards/$(BOARD)/pins.c \
modules/$(CIRCUITPY_MODULE).c \
shared/netutils/netutils.c \
peripherals/i2c.c \
peripherals/rmt.c \
@ -362,6 +366,9 @@ $(HEADER_BUILD)/qstr.split: | $(BUILD)/esp-idf/config/sdkconfig.h
BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a libsmartconfig.a libwapi.a
BINARY_BLOBS = esp-idf/components/esp_phy/lib/$(IDF_TARGET)/libphy.a $(addprefix esp-idf/components/esp_wifi/lib/$(IDF_TARGET)/, $(BINARY_WIFI_BLOBS))
ifeq ($(IDF_TARGET),esp32)
BINARY_BLOBS += esp-idf/components/esp_phy/lib/$(IDF_TARGET)/librtc.a
endif
ESP_IDF_COMPONENTS_LINK = $(IDF_TARGET_ARCH) app_update bootloader_support driver efuse esp_adc_cal esp_common esp_event esp_hw_support esp_ipc esp_netif esp_pm esp_phy esp_ringbuf esp_rom esp_system esp_timer esp-tls esp_wifi freertos hal heap log lwip mbedtls mdns newlib nvs_flash pthread soc spi_flash vfs wpa_supplicant
ifneq ($(CIRCUITPY_BLEIO),0)
@ -380,12 +387,17 @@ BINARY_BLOBS += esp-idf/components/xtensa/$(IDF_TARGET)/libxt_hal.a
ESP_IDF_COMPONENTS_EXPANDED += esp-idf/components/xtensa/$(IDF_TARGET)/libxt_hal.a
endif
ifeq ($(IDF_TARGET),esp32c3)
# BOOTLOADER_OFFSET is determined by chip type, based on the ROM bootloader, and is not changeable.
ifeq ($(IDF_TARGET),esp32)
BOOTLOADER_OFFSET = 0x1000
else ifeq ($(IDF_TARGET),esp32c3)
BOOTLOADER_OFFSET = 0x0
else ifeq ($(IDF_TARGET),esp32s3)
BOOTLOADER_OFFSET = 0x0
else
else ifeq ($(IDF_TARGET),esp32s2)
BOOTLOADER_OFFSET = 0x1000
else
$(error unknown IDF_TARGET $(IDF_TARGET))
endif
IDF_CMAKE_TARGETS = \
@ -400,7 +412,7 @@ ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/$(IDF_TARGET)/$(IDF_TARGET)_out.ld $(B
FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE)
ESPTOOL_FLAGS ?= --before=default_reset --after=no_reset
ESPTOOL_FLAGS ?= --before=default_reset --after=no_reset --baud 921600
ifeq ($(UF2_BOOTLOADER),1)
all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2

View File

@ -9,6 +9,7 @@ Support Status:
.. csv-table::
:header: SoC, Status
ESP, "beta"
ESP32-C3, "beta"
ESP32-S2, "stable"
ESP32-S3, "beta"
@ -20,13 +21,17 @@ How this port is organized:
- **boards/** contains the configuration files for each development board and breakout available on the port.
- **common-hal/** contains the port-specific module implementations, used by shared-module and shared-bindings.
- **esp-idf/** contains the Espressif IoT Development Framework installation, including all the drivers for the port.
- **modules/** contains information specific to certain Espressif SoC based hardware modules, such as the pins used for flash and RAM on the WROVER and WROOM.
- **peripherals/** contains peripheral setup files and peripheral mapping information, sorted by family and sub-variant. Most files in this directory can be generated with the python scripts in **tools/**.
- **supervisor/** contains port-specific implementations of internal flash, serial and USB, as well as the **port.c** file, which initializes the port at startup.
- **tools/** includes useful Python scripts for debugging and other purposes.
At the root level, refer to **mpconfigboard.h** and **mpconfigport.mk** for port specific settings and a list of enabled CircuitPython modules.
Connecting to the ESP32
---------------------------------------
The ESP32 chip itself has no USB support. On many boards there is a USB-serial adapter chip, such as a CP2102N, CP2104 or CH9102F, usually connected to the ESP32 TXD0 (GPIO1)and RXD0 (GPIO3) pins, for access to the bootloader. CircuitPython also uses this serial channel for the REPL.
Connecting to the ESP32-C3
---------------------------------------

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -1,5 +1,5 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
@ -24,12 +24,26 @@
* THE SOFTWARE.
*/
#ifndef MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H
#define MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "components/driver/include/driver/gpio.h"
#include "components/hal/include/hal/gpio_hal.h"
#include "common-hal/microcontroller/Pin.h"
void never_reset_module_internal_pins(void);
void board_init(void) {
reset_board();
}
#endif // MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
// Turn on NeoPixel and I2C power by default.
gpio_set_direction(2, GPIO_MODE_DEF_OUTPUT);
gpio_set_level(2, true);
}
void board_deinit(void) {
}

View File

@ -1,9 +1,9 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
* Copyright (c) 2022 Dan Halbert 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
@ -24,7 +24,29 @@
* THE SOFTWARE.
*/
#include "modules/module.h"
// Micropython setup
void never_reset_module_internal_pins(void) {
}
#define MICROPY_HW_BOARD_NAME "Adafruit Feather ESP32 V2"
#define MICROPY_HW_MCU_NAME "ESP32"
#define MICROPY_HW_NEOPIXEL (&pin_GPIO0)
#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO2)
#define CIRCUITPY_BOARD_I2C (1)
#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO20, .sda = &pin_GPIO22}}
#define CIRCUITPY_BOARD_SPI (1)
#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO5, .mosi = &pin_GPIO19, .miso = &pin_GPIO21}}
#define CIRCUITPY_BOARD_UART (1)
#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO8, .rx = &pin_GPIO7}}
// For entering safe mode, use SW38 button
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO38)
// Explanation of how a user got into safe mode
#define BOARD_USER_SAFE_MODE_ACTION translate("pressing SW38 button at start up.\n")
// UART pins attached to the USB-serial converter chip
#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1)
#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3)

View File

@ -0,0 +1,18 @@
CIRCUITPY_CREATOR_ID = 0x0000239A
CIRCUITPY_CREATION_ID = 0x00320001
IDF_TARGET = esp32
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
# The default queue depth of 16 overflows on release builds,
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_STATUS_BAR = 0
CIRCUITPY_WEB_WORKFLOW = 0
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 8MB

View File

@ -0,0 +1,86 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
// External pins are in silkscreen order, from top to bottom, left side, then right side
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO25) },
{ MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO34) },
{ MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO39) },
{ MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) },
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO36) },
{ MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) },
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) },
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO27) },
{ MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO27) },
{ MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33) },
{ MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO33) },
{ MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO32) },
{ MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO32) },
{ MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO22) },
{ MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22) },
{ MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) },
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO35) },
{ MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO38) },
{ MP_ROM_QSTR(MP_QSTR_SW38), MP_ROM_PTR(&pin_GPIO38) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL_I2C_POWER), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

View File

@ -0,0 +1,52 @@
#
# Partition Table
#
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv"
CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv"
# end of Partition Table
#
# SPI RAM config
#
# CONFIG_SPIRAM_TYPE_AUTO is not set
CONFIG_SPIRAM_TYPE_ESPPSRAM16=y
# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set
CONFIG_SPIRAM_SIZE=2097152
CONFIG_SPIRAM_SPEED_40M=y
CONFIG_SPIRAM=y
CONFIG_SPIRAM_BOOT_INIT=y
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
CONFIG_SPIRAM_USE_MEMMAP=y
# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set
# CONFIG_SPIRAM_USE_MALLOC is not set
CONFIG_SPIRAM_MEMTEST=y
# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set
# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set
CONFIG_SPIRAM_CACHE_WORKAROUND=y
#
# SPI RAM config
#
CONFIG_ESP32_SPIRAM_SUPPORT=y
# CONFIG_SPIRAM_TYPE_AUTO is not set
# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set
### # Uncomment to send log output to TX/RX pins on Feather ESP32V2
### #
### # ESP System Settings
### #
### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set
### CONFIG_ESP_CONSOLE_UART_CUSTOM=y
### # CONFIG_ESP_CONSOLE_NONE is not set
### CONFIG_ESP_CONSOLE_UART=y
### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y
### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set
### CONFIG_ESP_CONSOLE_UART_NUM=0
### CONFIG_ESP_CONSOLE_UART_TX_GPIO=8
### CONFIG_ESP_CONSOLE_UART_RX_GPIO=7
### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set
### # end of ESP System Settings

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wroom
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -1,3 +1,9 @@
#
# Component config
#
#
# ESP32S2-specific
#
CONFIG_ESP32S2_SPIRAM_SUPPORT=y
#
# SPI RAM config
@ -7,12 +13,10 @@ CONFIG_SPIRAM_TYPE_ESPPSRAM16=y
# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set
CONFIG_SPIRAM_SIZE=2097152
# end of SPI RAM config
CONFIG_DEFAULT_PSRAM_CLK_IO=30
#
# PSRAM clock and cs IO for ESP32S2
#
CONFIG_DEFAULT_PSRAM_CLK_IO=30
CONFIG_DEFAULT_PSRAM_CS_IO=26
# end of PSRAM clock and cs IO for ESP32S2
@ -30,8 +34,14 @@ CONFIG_SPIRAM_USE_MEMMAP=y
# CONFIG_SPIRAM_USE_MALLOC is not set
CONFIG_SPIRAM_MEMTEST=y
# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set
# end of SPI RAM config
# end of ESP32S2-specific
#
# LWIP
#
CONFIG_LWIP_LOCAL_HOSTNAME="espressif"
# end of LWIP
# end of Component config

View File

@ -13,8 +13,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wroom
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,11 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wroom
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=8MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 8MB

View File

@ -13,8 +13,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wroom
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,11 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase

View File

@ -12,11 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -1,10 +1,10 @@
CIRCUITPY_CREATOR_ID = 0x0000239A
CIRCUITPY_CREATION_ID = 0x00010001
CIRCUITPY_CREATION_ID = 0x00c30001
IDF_TARGET = esp32c3
INTERNAL_FLASH_FILESYSTEM = 1
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -13,8 +13,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wroom
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -13,9 +13,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=8MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 8MB
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

View File

@ -37,5 +37,5 @@
#define DEFAULT_UART_BUS_TX (&pin_GPIO21)
// Serial over UART
#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX
#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX
#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX
#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX

View File

@ -5,6 +5,6 @@ IDF_TARGET = esp32c3
INTERNAL_FLASH_FILESYSTEM = 1
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=2MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 2MB

View File

@ -37,5 +37,5 @@
#define DEFAULT_UART_BUS_TX (&pin_GPIO21)
// Serial over UART
#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX
#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX
#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX
#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX

View File

@ -5,6 +5,6 @@ IDF_TARGET = esp32c3
INTERNAL_FLASH_FILESYSTEM = 1
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=16MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 16MB

View File

@ -12,13 +12,11 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
CIRCUITPY_BITBANG_APA102 = 1
CIRCUITPY_MODULE=wrover
# Include these Python libraries in firmware.
# FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar

View File

@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=8MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 8MB
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

View File

@ -14,8 +14,6 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -37,5 +37,5 @@
#define DEFAULT_UART_BUS_TX (&pin_GPIO21)
// Serial over UART
#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX
#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX
#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX
#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX

View File

@ -5,6 +5,6 @@ IDF_TARGET = esp32c3
INTERNAL_FLASH_FILESYSTEM = 1
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=16MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 16MB

View File

@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=8MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 8MB

View File

@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=8MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 8MB

View File

@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=8MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 8MB

View File

@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=8MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 8MB

View File

@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=8MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 8MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wroom
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wroom
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wroom
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wroom
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -13,8 +13,8 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

View File

@ -12,7 +12,7 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=8MB
#CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 8MB
#CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -6,5 +6,5 @@
#define DEFAULT_UART_BUS_RX (&pin_GPIO20)
#define DEFAULT_UART_BUS_TX (&pin_GPIO21)
#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX
#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX
#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX
#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX

View File

@ -6,5 +6,5 @@
#define DEFAULT_UART_BUS_RX (&pin_GPIO20)
#define DEFAULT_UART_BUS_TX (&pin_GPIO21)
#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX
#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX
#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX
#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wroom
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
CIRCUITPY_MODULE = wroom

View File

@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
CIRCUITPY_MODULE = wroom

View File

@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
# Include these Python libraries in firmware.

View File

@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
# Include these Python libraries in firmware.

View File

@ -44,5 +44,5 @@
#define DEFAULT_UART_BUS_TX (&pin_GPIO21)
// Serial over UART
#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX
#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX
#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX
#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX

View File

@ -5,6 +5,6 @@ IDF_TARGET = esp32c3
INTERNAL_FLASH_FILESYSTEM = 1
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -11,6 +11,6 @@ INTERNAL_FLASH_FILESYSTEM = 1
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=16MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 16MB

View File

@ -12,11 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wroom
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

View File

@ -12,11 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wroom
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

View File

@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
CIRCUITPY_MODULE = wroom

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wroom
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wroom
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

View File

@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=16MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 16MB
CIRCUITPY_BITBANG_APA102 = 1

View File

@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
CIRCUITPY_BITBANG_NEOPIXEL = 1

View File

@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=16MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 16MB
CIRCUITPY_BITBANG_APA102 = 1

View File

@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=16MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 16MB
#CIRCUITPY_BITBANG_NEOPIXEL = 1

View File

@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=16MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 16MB
# CIRCUITPY_BITBANG_NEOPIXEL = 1

View File

@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
CIRCUITPY_BITBANG_NEOPIXEL = 1

View File

@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=8MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 8MB
# CIRCUITPY_BITBANG_NEOPIXEL = 1

View File

@ -58,10 +58,17 @@ mp_obj_t alarm_touch_touchalarm_create_wakeup_alarm(void) {
alarm->base.type = &alarm_touch_touchalarm_type;
alarm->pin = NULL;
#if defined(CONFIG_IDF_TARGET_ESP32)
touch_pad_t wake_channel;
if (touch_pad_get_wakeup_status(&wake_channel) != ESP_OK) {
return alarm;
}
#else
touch_pad_t wake_channel = touch_pad_get_current_meas_channel();
if (wake_channel == TOUCH_PAD_MAX) {
return alarm;
}
#endif
// Map the pin number back to a pin object.
for (size_t i = 0; i < mcu_pin_globals.map.used; i++) {
@ -122,16 +129,27 @@ void alarm_touch_touchalarm_set_alarm(const bool deep_sleep, const size_t n_alar
mp_hal_delay_ms(10);
// configure trigger threshold
#if defined(CONFIG_IDF_TARGET_ESP32)
uint16_t touch_value;
touch_pad_read(touch_channel, &touch_value);
touch_pad_set_thresh(touch_channel, touch_value / 10); // 10%
#else
uint32_t touch_value;
touch_pad_read_benchmark(touch_channel, &touch_value);
touch_pad_set_thresh(touch_channel, touch_value * 0.1); // 10%
touch_pad_set_thresh(touch_channel, touch_value / 10); // 10%
#endif
}
}
// configure touch interrupt
#if defined(CONFIG_IDF_TARGET_ESP32)
touch_pad_isr_register(touch_interrupt, NULL);
touch_pad_intr_enable();
#else
touch_pad_timeout_set(true, SOC_TOUCH_PAD_THRESHOLD_MAX);
touch_pad_isr_register(touch_interrupt, NULL, TOUCH_PAD_INTR_MASK_ALL);
touch_pad_intr_enable(TOUCH_PAD_INTR_MASK_ACTIVE | TOUCH_PAD_INTR_MASK_INACTIVE);
#endif
}
void alarm_touch_touchalarm_prepare_for_deep_sleep(void) {
@ -154,17 +172,25 @@ void alarm_touch_touchalarm_prepare_for_deep_sleep(void) {
// intialize touchpad
peripherals_touch_init(touch_channel);
#if !defined(CONFIG_IDF_TARGET_ESP32)
// configure touchpad for sleep
touch_pad_sleep_channel_enable(touch_channel, true);
touch_pad_sleep_channel_enable_proximity(touch_channel, false);
#endif
// wait for touch data to reset
mp_hal_delay_ms(10);
// configure trigger threshold
#if defined(CONFIG_IDF_TARGET_ESP32)
uint16_t touch_value;
touch_pad_read_filtered(touch_channel, &touch_value);
touch_pad_set_thresh(touch_channel, touch_value);
#else
uint32_t touch_value;
touch_pad_sleep_channel_read_smooth(touch_channel, &touch_value);
touch_pad_sleep_set_threshold(touch_channel, touch_value * 0.1); // 10%
touch_pad_sleep_set_threshold(touch_channel, touch_value / 10); // 10%
#endif
// enable touchpad wakeup
esp_sleep_enable_touchpad_wakeup();

View File

@ -40,12 +40,16 @@
#define DEFAULT_VREF 1100
#define NO_OF_SAMPLES 2
#define ATTENUATION ADC_ATTEN_DB_11
#ifdef CONFIG_IDF_TARGET_ESP32C3
#if defined(CONFIG_IDF_TARGET_ESP32)
#define DATA_WIDTH ADC_WIDTH_BIT_12
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
#define DATA_WIDTH ADC_WIDTH_BIT_12
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
#define DATA_WIDTH ADC_WIDTH_BIT_13
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
#define DATA_WIDTH ADC_WIDTH_BIT_12
#else
#error No known CONFIG_IDF_TARGET_xxx found
#endif
void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self,

View File

@ -35,18 +35,26 @@
#include "shared-bindings/microcontroller/Pin.h"
#include "supervisor/shared/translate/translate.h"
#ifdef CONFIG_IDF_TARGET_ESP32S2
#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S2)
#include "components/driver/include/driver/dac_common.h"
#define HAS_DAC 1
#if defined(CONFIG_IDF_TARGET_ESP32)
#define pin_CHANNEL_1 pin_GPIO25
#define pin_CHANNEL_2 pin_GPIO26
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
#define pin_CHANNEL_1 pin_GPIO17
#define pin_CHANNEL_2 pin_GPIO18
#endif
#else
#define HAS_DAC 0
#endif
#include "common-hal/microcontroller/Pin.h"
void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self,
const mcu_pin_obj_t *pin) {
#ifdef CONFIG_IDF_TARGET_ESP32S2
if (pin == &pin_GPIO17) {
#if HAS_DAC
if (pin == &pin_CHANNEL_1) {
self->channel = DAC_CHANNEL_1;
} else if (pin == &pin_GPIO18) {
} else if (pin == &pin_CHANNEL_2) {
self->channel = DAC_CHANNEL_2;
} else {
raise_ValueError_invalid_pin();
@ -58,7 +66,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self,
}
bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) {
#ifdef CONFIG_IDF_TARGET_ESP32S2
#if HAS_DAC
return self->channel == DAC_CHANNEL_MAX;
#else
return false;
@ -66,7 +74,7 @@ bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) {
}
void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) {
#ifdef CONFIG_IDF_TARGET_ESP32S2
#if HAS_DAC
dac_output_disable(self->channel);
self->channel = DAC_CHANNEL_MAX;
#endif
@ -74,7 +82,7 @@ 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) {
#ifdef CONFIG_IDF_TARGET_ESP32S2
#if HAS_DAC
uint8_t dac_value = (value * 255) / 65535;
dac_output_enable(self->channel);
dac_output_voltage(self->channel, dac_value);
@ -82,7 +90,7 @@ void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self,
}
void analogout_reset(void) {
#ifdef CONFIG_IDF_TARGET_ESP32S2
#if HAS_DAC
dac_output_disable(DAC_CHANNEL_1);
dac_output_disable(DAC_CHANNEL_2);
#endif

View File

@ -41,7 +41,7 @@
#include "supervisor/shared/translate/translate.h"
#include "supervisor/shared/tick.h"
uint8_t never_reset_uart_mask = 0;
static uint8_t never_reset_uart_mask = 0;
static void uart_event_task(void *param) {
busio_uart_obj_t *self = param;
@ -50,8 +50,8 @@ static void uart_event_task(void *param) {
if (xQueueReceive(self->event_queue, &event, portMAX_DELAY)) {
switch (event.type) {
case UART_PATTERN_DET:
// When the debug uart receives CTRL+C, wake the main task and schedule a keyboard interrupt
if (self->is_debug) {
// When the console uart receives CTRL+C, wake the main task and schedule a keyboard interrupt
if (self->is_console) {
port_wake_main_task();
if (mp_interrupt_char == CHAR_CTRL_C) {
uart_flush(self->uart_num);
@ -60,8 +60,8 @@ static void uart_event_task(void *param) {
}
break;
case UART_DATA:
// When the debug uart receives any key, wake the main task
if (self->is_debug) {
// When the console uart receives any key, wake the main task
if (self->is_console) {
port_wake_main_task();
}
break;
@ -74,13 +74,13 @@ static void uart_event_task(void *param) {
void uart_reset(void) {
for (uart_port_t num = 0; num < UART_NUM_MAX; num++) {
// Ignore the UART used by the IDF.
#ifdef CONFIG_CONSOLE_UART_NUM
if (num == CONFIG_CONSOLE_UART_NUM) {
#ifdef CONFIG_ESP_CONSOLE_UART_NUM
// Do not reset the UART used by the IDF for logging.
if (num == CONFIG_ESP_CONSOLE_UART_NUM) {
continue;
}
#endif
if (uart_is_driver_installed(num) && !(never_reset_uart_mask & 1 << num)) {
if (uart_is_driver_installed(num) && !(never_reset_uart_mask & (1 << num))) {
uart_driver_delete(num);
}
}
@ -162,13 +162,15 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
uart_set_mode(self->uart_num, mode) != ESP_OK) {
mp_raise_RuntimeError(translate("UART init"));
}
// On the debug uart, enable pattern detection to look for CTRL+C
#ifdef CIRCUITPY_DEBUG_UART_RX
if (rx == CIRCUITPY_DEBUG_UART_RX) {
self->is_debug = true;
// On the console uart, enable pattern detection to look for CTRL+C
#if CIRCUITPY_CONSOLE_UART
if (rx == CIRCUITPY_CONSOLE_UART_RX) {
self->is_console = true;
uart_enable_pattern_det_baud_intr(self->uart_num, CHAR_CTRL_C, 1, 1, 0, 0);
}
#endif
// Start a task to listen for uart events
xTaskCreatePinnedToCore(
uart_event_task,

View File

@ -46,7 +46,7 @@ typedef struct {
uint8_t character_bits;
bool rx_error;
uint32_t timeout_ms;
bool is_debug;
bool is_console;
QueueHandle_t event_queue;
TaskHandle_t event_task;
} busio_uart_obj_t;

View File

@ -76,30 +76,42 @@ STATIC twai_timing_config_t get_t_config(int baudrate) {
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_25KBITS();
return t_config;
}
#if defined(TWAI_TIMING_CONFIG_20KBITS)
case 20000: {
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_20KBITS();
return t_config;
}
#endif
#if defined(TWAI_TIMING_CONFIG_16KBITS)
case 16000: {
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_16KBITS();
return t_config;
}
#endif
#if defined(TWAI_TIMING_CONFIG_12_5KBITS)
case 12500: {
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_12_5KBITS();
return t_config;
}
#endif
#if defined(TWAI_TIMING_CONFIG_10KBITS)
case 10000: {
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_10KBITS();
return t_config;
}
#endif
#if defined(TWAI_TIMING_CONFIG_5KBITS)
case 5000: {
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_5KBITS();
return t_config;
}
#endif
#if defined(TWAI_TIMING_CONFIG_1KBITS)
case 1000: {
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_1KBITS();
return t_config;
}
#endif
default:
mp_raise_ValueError(translate("Baudrate not supported by peripheral"));
}

View File

@ -55,15 +55,29 @@ static void IRAM_ATTR timer_interrupt_handler(void *self_in) {
// reset interrupt
timg_dev_t *device = self->timer.group ? &(TIMERG1) : &(TIMERG0);
#if defined(CONFIG_IDF_TARGET_ESP32)
if (self->timer.idx) {
device->int_clr_timers.t1 = 1;
} else {
device->int_clr_timers.t0 = 1;
}
#else
if (self->timer.idx) {
device->int_clr_timers.t1_int_clr = 1;
} else {
device->int_clr_timers.t0_int_clr = 1;
}
#ifdef CONFIG_IDF_TARGET_ESP32S2
#endif
#if defined(CONFIG_IDF_TARGET_ESP32)
device->hw_timer[self->timer.idx].config.alarm_en = 1;
#elif defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C2)
device->hw_timer[self->timer.idx].config.tx_alarm_en = 1;
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
device->hw_timer[self->timer.idx].config.tn_alarm_en = 1;
#else
#error No known CONFIG_IDF_TARGET_xxx found
#endif
}

View File

@ -33,14 +33,85 @@
#include "components/driver/include/driver/gpio.h"
#include "components/hal/include/hal/gpio_hal.h"
STATIC uint32_t never_reset_pins[2];
STATIC uint32_t in_use[2];
STATIC uint64_t never_reset_pins;
STATIC uint64_t in_use;
// 64-bit pin mask for a single bit
#define PIN_BIT(pin_number) (((uint64_t)1) << pin_number)
// Bit mask of all pins that should never ever be reset.
// Typically these are SPI flash and PSRAM control pins, and communication pins.
static const uint64_t pin_mask_reset_forbidden =
#if defined(CONFIG_IDF_TARGET_ESP32)
// Never ever reset serial pins for bootloader and possibly USB-serial converter.
GPIO_SEL_1 | // TXD0
GPIO_SEL_3 | // RXD0
// Never ever reset pins used to communicate with SPI flash and PSRAM.
GPIO_SEL_6 | // CLK
GPIO_SEL_9 | // (PSRAM) SD2
GPIO_SEL_10 | // (PSRAM) SD3
GPIO_SEL_11 | // CMD
GPIO_SEL_16 | // SPIHD
GPIO_SEL_17 | // SPIDO
GPIO_SEL_18 | // SPIWP
GPIO_SEL_23 | // SPIDI
#endif // ESP32
#if defined(CONFIG_IDF_TARGET_ESP32C3)
// Never ever reset pins used to communicate with SPI flash.
GPIO_SEL_11 | // VDD_SPI
GPIO_SEL_12 | // SPIHD
GPIO_SEL_13 | // SPIWP
GPIO_SEL_14 | // SPICS0
GPIO_SEL_15 | // SPICLK
GPIO_SEL_16 | // SPID
GPIO_SEL_17 | // SPIQ
#if CIRCUITPY_ESP_USB_SERIAL_JTAG
// Never ever reset serial/JTAG communication pins.
GPIO_SEL_18 | // USB D-
GPIO_SEL_19 | // USB D+
#endif
#endif // ESP32C3
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
// Never ever reset pins used to communicate with SPI flash and PSRAM.
GPIO_SEL_19 | // USB D-
GPIO_SEL_20 | // USB D+
#if defined(CONFIG_ESP32_SPIRAM_SUPPORT) || defined(CONFIG_ESP32S2_SPIRAM_SUPPORT) || defined(CONFIG_ESP32S3_SPIRAM_SUPPORT)
// Note ESP32-C3 does not have SPIRAM support.
// Board uses PSRAM, and needs another chip select.
GPIO_SEL_26 | // SPICS1
#endif
GPIO_SEL_27 | // SPIHD
GPIO_SEL_28 | // SPIWP
GPIO_SEL_29 | // SPICS0
GPIO_SEL_30 | // SPICLK
GPIO_SEL_31 | // SPIHD
GPIO_SEL_32 | // SPIQ
#if defined(CONFIG_SPIRAM_MODE_OCT)
// Never reset octal SPI flash pins DQ4-DQ7 and DQS/DM.
GPIO_SEL_33 | // SPIIO4
GPIO_SEL_34 | // SPIIO5
GPIO_SEL_35 | // SPIIO6
GPIO_SEL_36 | // SPIIO7
GPIO_SEL_37 | // SPIDQS
#endif
#if CIRCUITPY_USB
// Never ever reset USB pins.
GPIO_SEL_19 | // USB D-
GPIO_SEL_20 | // USB D+
#endif
#endif // ESP32S2, ESP32S3
0; // Terminate last "|".
void never_reset_pin_number(gpio_num_t pin_number) {
if (pin_number == NO_PIN) {
return;
}
never_reset_pins[pin_number / 32] |= 1 << pin_number % 32;
never_reset_pins |= PIN_BIT(pin_number);
}
void common_hal_never_reset_pin(const mcu_pin_obj_t *pin) {
@ -55,35 +126,10 @@ MP_WEAK bool espressif_board_reset_pin_number(gpio_num_t pin_number) {
}
STATIC void _reset_pin(gpio_num_t pin_number) {
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
// Never ever reset pins used for flash and RAM.
if (26 <= pin_number && pin_number <= 32) {
// Never ever reset pins used for flash, RAM, and basic communication.
if (pin_mask_reset_forbidden & PIN_BIT(pin_number)) {
return;
}
#ifdef CONFIG_SPIRAM_MODE_OCT
// Octal DQ4-DQ7 and DQS/DM
if (33 <= pin_number && pin_number <= 37) {
return;
}
#endif
#if CIRCUITPY_USB
// Never reset USB pins.
if (pin_number == 19 || pin_number == 20) {
return;
}
#endif
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
// Never ever reset pins used for flash and RAM.
if (11 <= pin_number && pin_number <= 17) {
return;
}
#if CIRCUITPY_ESP_USB_SERIAL_JTAG
if (pin_number == 18 || pin_number == 19) {
return;
}
#endif
#endif
// Give the board a chance to reset the pin in a particular way.
if (espressif_board_reset_pin_number(pin_number)) {
@ -106,8 +152,8 @@ void reset_pin_number(gpio_num_t pin_number) {
if (pin_number == NO_PIN) {
return;
}
never_reset_pins[pin_number / 32] &= ~(1 << pin_number % 32);
in_use[pin_number / 32] &= ~(1 << pin_number % 32);
never_reset_pins &= ~PIN_BIT(pin_number);
in_use &= ~PIN_BIT(pin_number);
_reset_pin(pin_number);
}
@ -127,24 +173,23 @@ void reset_all_pins(void) {
for (uint8_t i = 0; i < GPIO_PIN_COUNT; i++) {
uint32_t iomux_address = GPIO_PIN_MUX_REG[i];
if (iomux_address == 0 ||
(never_reset_pins[i / 32] & (1 << i % 32)) != 0) {
(never_reset_pins & PIN_BIT(i))) {
continue;
}
_reset_pin(i);
}
in_use[0] = never_reset_pins[0];
in_use[1] = never_reset_pins[1];
in_use = never_reset_pins;
}
void claim_pin_number(gpio_num_t pin_number) {
if (pin_number == NO_PIN) {
return;
}
in_use[pin_number / 32] |= (1 << (pin_number % 32));
in_use |= PIN_BIT(pin_number);
}
void claim_pin(const mcu_pin_obj_t *pin) {
in_use[pin->number / 32] |= (1 << (pin->number % 32));
claim_pin_number(pin->number);
}
void common_hal_mcu_pin_claim(const mcu_pin_obj_t *pin) {
@ -152,9 +197,7 @@ void common_hal_mcu_pin_claim(const mcu_pin_obj_t *pin) {
}
bool pin_number_is_free(gpio_num_t pin_number) {
uint8_t offset = pin_number / 32;
uint32_t mask = 1 << (pin_number % 32);
return (in_use[offset] & mask) == 0;
return !(in_use & PIN_BIT(pin_number));
}
bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) {

View File

@ -39,11 +39,14 @@
#include "esp_system.h"
#include "soc/efuse_reg.h"
#if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S3)
#include "driver/temp_sensor.h"
#endif
float common_hal_mcu_processor_get_temperature(void) {
float tsens_out;
#ifdef CONFIG_IDF_TARGET_ESP32S3
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32)
mp_raise_NotImplementedError(NULL);
#else
temp_sensor_config_t temp_sensor = TSENS_CONFIG_DEFAULT(); // DEFAULT: range:-10℃ ~ 80℃, error < 1℃.
@ -60,12 +63,16 @@ float common_hal_mcu_processor_get_voltage(void) {
}
uint32_t common_hal_mcu_processor_get_frequency(void) {
#ifdef CONFIG_IDF_TARGET_ESP32C3
#if defined(CONFIG_IDF_TARGET_ESP32)
return CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ * 100000;
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
return CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ * 1000000;
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
return CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ * 1000000;
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
return CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ * 1000000;
#else
#error No known CONFIG_IDF_TARGET_xxx found
#endif
}
@ -78,7 +85,13 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
uint8_t *ptr = &raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH - 1];
// MAC address contains 48 bits (6 bytes), 32 in the low order word
#if defined(CONFIG_IDF_TARGET_ESP32)
uint32_t mac_address_part = REG_READ(EFUSE_BLK0_RDATA1_REG);
#else
uint32_t mac_address_part = REG_READ(EFUSE_RD_MAC_SPI_SYS_0_REG);
#endif
*ptr-- = swap_nibbles(mac_address_part & 0xff);
mac_address_part >>= 8;
*ptr-- = swap_nibbles(mac_address_part & 0xff);
@ -88,7 +101,12 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
*ptr-- = swap_nibbles(mac_address_part & 0xff);
// and 16 in the high order word
#if defined(CONFIG_IDF_TARGET_ESP32)
mac_address_part = REG_READ(EFUSE_BLK0_RDATA2_REG);
#else
mac_address_part = REG_READ(EFUSE_RD_MAC_SPI_SYS_1_REG);
#endif
*ptr-- = swap_nibbles(mac_address_part & 0xff);
mac_address_part >>= 8;
*ptr-- = swap_nibbles(mac_address_part & 0xff);

View File

@ -45,7 +45,9 @@
#include "soc/rtc_cntl_reg.h"
#include "esp_private/system_internal.h"
#ifdef CONFIG_IDF_TARGET_ESP32C3
#if defined(CONFIG_IDF_TARGET_ESP32)
#include "esp32/rom/rtc.h"
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
#include "esp32c3/rom/rtc.h"
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
#include "esp32s2/rom/rtc.h"
@ -55,6 +57,8 @@
#include "esp32s3/rom/rtc.h"
#include "esp32s3/rom/usb/usb_persist.h"
#include "esp32s3/rom/usb/chip_usb_dw_wrapper.h"
#else
#error No known CONFIG_IDF_TARGET_xxx found
#endif
void common_hal_mcu_delay_us(uint32_t delay) {
@ -85,16 +89,22 @@ void common_hal_mcu_enable_interrupts(void) {
void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) {
switch (runmode) {
case RUNMODE_UF2:
#ifndef CONFIG_IDF_TARGET_ESP32C3
#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32C3)
mp_arg_error_invalid(MP_QSTR_run_mode);
#else
// 0x11F2 is APP_REQUEST_UF2_RESET_HINT & is defined by TinyUF2
esp_reset_reason_set_hint(0x11F2);
#endif
break;
case RUNMODE_NORMAL:
#if defined(CONFIG_IDF_TARGET_ESP32)
safe_mode_on_next_reset(NO_SAFE_MODE);
#else
// revert back to normal boot
REG_WRITE(RTC_RESET_CAUSE_REG, 0); // reset uf2
REG_WRITE(RTC_CNTL_STORE0_REG, 0); // reset safe mode
REG_WRITE(RTC_CNTL_OPTION1_REG, 0); // reset bootloader
#endif
break;
case RUNMODE_SAFE_MODE:
// enter safe mode on next boot
@ -102,10 +112,12 @@ void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) {
break;
case RUNMODE_BOOTLOADER:
// DFU download
#ifndef CONFIG_IDF_TARGET_ESP32C3
#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32C3)
mp_arg_error_invalid(MP_QSTR_run_mode);
#else
chip_usb_set_persist_flags(USBDC_BOOT_DFU);
#endif
REG_WRITE(RTC_CNTL_OPTION1_REG, RTC_CNTL_FORCE_DOWNLOAD_BOOT);
#endif
break;
default:
break;
@ -149,49 +161,145 @@ watchdog_watchdogtimer_obj_t common_hal_mcu_watchdogtimer_obj = {
// This maps MCU pin names to pin objects.
STATIC const mp_rom_map_elem_t mcu_pin_global_dict_table[] = {
#ifdef GPIO0_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO0), MP_ROM_PTR(&pin_GPIO0) },
#endif
#ifdef GPIO1_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO1), MP_ROM_PTR(&pin_GPIO1) },
#endif
#ifdef GPIO2_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO2), MP_ROM_PTR(&pin_GPIO2) },
#endif
#ifdef GPIO3_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO3), MP_ROM_PTR(&pin_GPIO3) },
#endif
#ifdef GPIO4_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO4), MP_ROM_PTR(&pin_GPIO4) },
#endif
#ifdef GPIO5_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO5), MP_ROM_PTR(&pin_GPIO5) },
#endif
#ifdef GPIO6_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO6), MP_ROM_PTR(&pin_GPIO6) },
#endif
#ifdef GPIO7_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO7), MP_ROM_PTR(&pin_GPIO7) },
#endif
#ifdef GPIO8_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO8), MP_ROM_PTR(&pin_GPIO8) },
#endif
#ifdef GPIO9_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO9), MP_ROM_PTR(&pin_GPIO9) },
#endif
#ifdef GPIO10_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO10), MP_ROM_PTR(&pin_GPIO10) },
#endif
#ifdef GPIO11_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO11), MP_ROM_PTR(&pin_GPIO11) },
#endif
#ifdef GPIO12_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO12), MP_ROM_PTR(&pin_GPIO12) },
#endif
#ifdef GPIO13_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO13), MP_ROM_PTR(&pin_GPIO13) },
#endif
#ifdef GPIO14_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO14), MP_ROM_PTR(&pin_GPIO14) },
#endif
#ifdef GPIO15_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO15), MP_ROM_PTR(&pin_GPIO15) },
#endif
#ifdef GPIO16_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO16), MP_ROM_PTR(&pin_GPIO16) },
#endif
#ifdef GPIO17_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO17), MP_ROM_PTR(&pin_GPIO17) },
#endif
#ifdef GPIO18_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO18), MP_ROM_PTR(&pin_GPIO18) },
#endif
#ifdef GPIO19_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO19), MP_ROM_PTR(&pin_GPIO19) },
#endif
#ifdef GPIO20_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO20), MP_ROM_PTR(&pin_GPIO20) },
#endif
#ifdef GPIO21_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO21), MP_ROM_PTR(&pin_GPIO21) },
#ifndef CONFIG_IDF_TARGET_ESP32C3
#endif
#ifdef GPIO22_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO22), MP_ROM_PTR(&pin_GPIO22) },
#endif
#ifdef GPIO23_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO23), MP_ROM_PTR(&pin_GPIO23) },
#endif
#ifdef GPIO24_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO24), MP_ROM_PTR(&pin_GPIO24) },
#endif
#ifdef GPIO25_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO25), MP_ROM_PTR(&pin_GPIO25) },
#endif
#ifdef GPIO26_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO26), MP_ROM_PTR(&pin_GPIO26) },
#endif
#ifdef GPIO27_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO27), MP_ROM_PTR(&pin_GPIO27) },
#endif
#ifdef GPIO28_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO28), MP_ROM_PTR(&pin_GPIO28) },
#endif
#ifdef GPIO29_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO29), MP_ROM_PTR(&pin_GPIO29) },
#endif
#ifdef GPIO30_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO30), MP_ROM_PTR(&pin_GPIO30) },
#endif
#ifdef GPIO31_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO31), MP_ROM_PTR(&pin_GPIO31) },
#endif
#ifdef GPIO32_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO32), MP_ROM_PTR(&pin_GPIO32) },
#endif
#ifdef GPIO33_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO33), MP_ROM_PTR(&pin_GPIO33) },
#endif
#ifdef GPIO34_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO34), MP_ROM_PTR(&pin_GPIO34) },
#endif
#ifdef GPIO35_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO35), MP_ROM_PTR(&pin_GPIO35) },
#endif
#ifdef GPIO36_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO36), MP_ROM_PTR(&pin_GPIO36) },
#endif
#ifdef GPIO37_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO37), MP_ROM_PTR(&pin_GPIO37) },
#endif
#ifdef GPIO38_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO38), MP_ROM_PTR(&pin_GPIO38) },
#endif
#ifdef GPIO39_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO39), MP_ROM_PTR(&pin_GPIO39) },
#endif
#ifdef GPIO40_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO40), MP_ROM_PTR(&pin_GPIO40) },
#endif
#ifdef GPIO41_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO41), MP_ROM_PTR(&pin_GPIO41) },
#endif
#ifdef GPIO42_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO42), MP_ROM_PTR(&pin_GPIO42) },
#endif
#ifdef GPIO43_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO43), MP_ROM_PTR(&pin_GPIO43) },
#endif
#ifdef GPIO44_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO44), MP_ROM_PTR(&pin_GPIO44) },
#endif
#ifdef GPIO45_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO45), MP_ROM_PTR(&pin_GPIO45) },
#endif
#ifdef GPIO46_EXISTS
{ MP_ROM_QSTR(MP_QSTR_GPIO46), MP_ROM_PTR(&pin_GPIO46) },
#endif
};

View File

@ -31,12 +31,16 @@
#include "shared-bindings/microcontroller/Pin.h"
static uint16_t get_raw_reading(touchio_touchin_obj_t *self) {
#if defined(CONFIG_IDF_TARGET_ESP32)
uint16_t touch_value;
#else
uint32_t touch_value;
#endif;
touch_pad_read_raw_data(self->pin->touch_channel, &touch_value);
if (touch_value > UINT16_MAX) {
return UINT16_MAX;
}
return touch_value;
return (uint16_t)touch_value;
}
void common_hal_touchio_touchin_construct(touchio_touchin_obj_t *self,

Some files were not shown because too many files have changed in this diff Show More