From 1536ec0123aafe0dd18cb2f0a8660064e53a05e4 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sat, 18 Sep 2021 18:00:18 +0530 Subject: [PATCH 1/4] rename left over esp32s2 to espressif --- ports/espressif/background.h | 6 ++--- ports/espressif/bindings/espidf/__init__.h | 6 ++--- .../espressif/common-hal/alarm/SleepMemory.h | 6 ++--- ports/espressif/common-hal/alarm/__init__.h | 6 ++--- .../espressif/common-hal/analogio/AnalogIn.h | 6 ++--- .../espressif/common-hal/analogio/AnalogOut.h | 6 ++--- ports/espressif/common-hal/busio/I2C.h | 6 ++--- ports/espressif/common-hal/busio/SPI.h | 6 ++--- ports/espressif/common-hal/busio/UART.h | 6 ++--- ports/espressif/common-hal/countio/Counter.h | 6 ++--- .../common-hal/digitalio/DigitalInOut.h | 6 ++--- .../espressif/common-hal/dualbank/__init__.h | 6 ++--- .../common-hal/frequencyio/FrequencyIn.h | 6 ++--- .../common-hal/microcontroller/Pin.h | 6 ++--- .../common-hal/microcontroller/Processor.h | 6 ++--- .../common-hal/neopixel_write/__init__.c | 4 +-- ports/espressif/common-hal/nvm/ByteArray.h | 6 ++--- ports/espressif/common-hal/os/__init__.c | 4 +-- .../common-hal/paralleldisplay/ParallelBus.h | 6 ++--- ports/espressif/common-hal/ps2io/Ps2.h | 6 ++--- ports/espressif/common-hal/pulseio/PulseIn.c | 6 ++--- ports/espressif/common-hal/pulseio/PulseIn.h | 6 ++--- ports/espressif/common-hal/pulseio/PulseOut.c | 6 ++--- ports/espressif/common-hal/pulseio/PulseOut.h | 6 ++--- ports/espressif/common-hal/pwmio/PWMOut.h | 6 ++--- .../common-hal/rotaryio/IncrementalEncoder.h | 6 ++--- ports/espressif/common-hal/rtc/RTC.h | 6 ++--- .../espressif/common-hal/socketpool/Socket.h | 6 ++--- .../common-hal/socketpool/SocketPool.h | 6 ++--- .../common-hal/socketpool/__init__.h | 6 ++--- ports/espressif/common-hal/ssl/SSLContext.h | 6 ++--- ports/espressif/common-hal/ssl/SSLSocket.h | 6 ++--- ports/espressif/common-hal/ssl/__init__.h | 6 ++--- .../espressif/common-hal/supervisor/Runtime.h | 6 ++--- ports/espressif/common-hal/touchio/TouchIn.h | 6 ++--- .../common-hal/watchdog/WatchDogTimer.h | 6 ++--- ports/espressif/common-hal/wifi/Network.h | 6 ++--- ports/espressif/common-hal/wifi/Radio.h | 6 ++--- .../common-hal/wifi/ScannedNetworks.h | 6 ++--- ports/espressif/common-hal/wifi/__init__.h | 6 ++--- ports/espressif/esp32s2_peripherals_config.h | 6 ++--- ports/espressif/modules/module.h | 6 ++--- ports/espressif/mpconfigport.h | 8 +++--- ports/espressif/mphalport.h | 6 ++--- ports/espressif/peripherals/pcnt.h | 6 ++--- ports/espressif/peripherals/pins.h | 6 ++--- ports/espressif/peripherals/rmt.c | 8 +++--- ports/espressif/peripherals/rmt.h | 12 ++++----- ports/espressif/peripherals/timer.h | 6 ++--- ports/espressif/peripherals/touch.h | 6 ++--- ports/espressif/supervisor/esp_port.h | 6 ++--- ports/espressif/supervisor/internal_flash.h | 6 ++--- .../supervisor/internal_flash_root_pointers.h | 6 ++--- ports/espressif/supervisor/port.c | 27 +++++++------------ 54 files changed, 171 insertions(+), 180 deletions(-) diff --git a/ports/espressif/background.h b/ports/espressif/background.h index cb850d4e5a..58793e95e9 100644 --- a/ports/espressif/background.h +++ b/ports/espressif/background.h @@ -24,9 +24,9 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_BACKGROUND_H -#define MICROPY_INCLUDED_ESP32S2_BACKGROUND_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_BACKGROUND_H +#define MICROPY_INCLUDED_ESPRESSIF_BACKGROUND_H #include -#endif // MICROPY_INCLUDED_ESP32S2_BACKGROUND_H +#endif // MICROPY_INCLUDED_ESPRESSIF_BACKGROUND_H diff --git a/ports/espressif/bindings/espidf/__init__.h b/ports/espressif/bindings/espidf/__init__.h index 866edb1288..5891d2c5c0 100644 --- a/ports/espressif/bindings/espidf/__init__.h +++ b/ports/espressif/bindings/espidf/__init__.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_BINDINGS_ESPIDF___INIT___H -#define MICROPY_INCLUDED_ESP32S2_BINDINGS_ESPIDF___INIT___H +#ifndef MICROPY_INCLUDED_ESPRESSIF_BINDINGS_ESPIDF___INIT___H +#define MICROPY_INCLUDED_ESPRESSIF_BINDINGS_ESPIDF___INIT___H #include "esp_err.h" #include "py/mpconfig.h" @@ -39,4 +39,4 @@ NORETURN void mp_raise_espidf_MemoryError(void); void raise_esp_error(esp_err_t err) NORETURN; #define CHECK_ESP_RESULT(x) do { int res = (x); if (res != ESP_OK) raise_esp_error(res); } while (0) -#endif // MICROPY_INCLUDED_ESP32S2_BINDINGS_ESPIDF___INIT___H +#endif // MICROPY_INCLUDED_ESPRESSIF_BINDINGS_ESPIDF___INIT___H diff --git a/ports/espressif/common-hal/alarm/SleepMemory.h b/ports/espressif/common-hal/alarm/SleepMemory.h index bf6713ab82..37d6cd371f 100644 --- a/ports/espressif/common-hal/alarm/SleepMemory.h +++ b/ports/espressif/common-hal/alarm/SleepMemory.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ALARM_SLEEPMEMORY_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ALARM_SLEEPMEMORY_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ALARM_SLEEPMEMORY_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ALARM_SLEEPMEMORY_H #include "py/obj.h" @@ -50,4 +50,4 @@ typedef struct { extern void alarm_sleep_memory_reset(void); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ALARM_SLEEPMEMORY_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ALARM_SLEEPMEMORY_H diff --git a/ports/espressif/common-hal/alarm/__init__.h b/ports/espressif/common-hal/alarm/__init__.h index 0823ff842e..ae7286db76 100644 --- a/ports/espressif/common-hal/alarm/__init__.h +++ b/ports/espressif/common-hal/alarm/__init__.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ALARM__INIT__H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ALARM__INIT__H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ALARM__INIT__H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ALARM__INIT__H #include "common-hal/alarm/SleepMemory.h" @@ -33,4 +33,4 @@ const alarm_sleep_memory_obj_t alarm_sleep_memory_obj; extern void alarm_reset(void); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ALARM__INIT__H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ALARM__INIT__H diff --git a/ports/espressif/common-hal/analogio/AnalogIn.h b/ports/espressif/common-hal/analogio/AnalogIn.h index 470570ceb3..5ac9c63f4d 100644 --- a/ports/espressif/common-hal/analogio/AnalogIn.h +++ b/ports/espressif/common-hal/analogio/AnalogIn.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGIN_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGIN_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ANALOGIO_ANALOGIN_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ANALOGIO_ANALOGIN_H #include "common-hal/microcontroller/Pin.h" @@ -39,4 +39,4 @@ typedef struct { const mcu_pin_obj_t *pin; } analogio_analogin_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGIN_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ANALOGIO_ANALOGIN_H diff --git a/ports/espressif/common-hal/analogio/AnalogOut.h b/ports/espressif/common-hal/analogio/AnalogOut.h index 6dc823ce53..085c4e6783 100644 --- a/ports/espressif/common-hal/analogio/AnalogOut.h +++ b/ports/espressif/common-hal/analogio/AnalogOut.h @@ -25,8 +25,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGOUT_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGOUT_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ANALOGIO_ANALOGOUT_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ANALOGIO_ANALOGOUT_H #include "common-hal/microcontroller/Pin.h" @@ -40,4 +40,4 @@ typedef struct { void analogout_reset(void); -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ANALOGIO_ANALOGOUT_H diff --git a/ports/espressif/common-hal/busio/I2C.h b/ports/espressif/common-hal/busio/I2C.h index 0844be6b22..a44c414505 100644 --- a/ports/espressif/common-hal/busio/I2C.h +++ b/ports/espressif/common-hal/busio/I2C.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_I2C_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_I2C_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_I2C_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_I2C_H #include "common-hal/microcontroller/Pin.h" @@ -45,4 +45,4 @@ typedef struct { void i2c_reset(void); -#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_I2C_H diff --git a/ports/espressif/common-hal/busio/SPI.h b/ports/espressif/common-hal/busio/SPI.h index 87c538babd..20a744a738 100644 --- a/ports/espressif/common-hal/busio/SPI.h +++ b/ports/espressif/common-hal/busio/SPI.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_SPI_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_SPI_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_SPI_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_SPI_H #include "driver/spi_master.h" #include "shared-bindings/microcontroller/Pin.h" @@ -49,4 +49,4 @@ typedef struct { void spi_reset(void); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_SPI_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_SPI_H diff --git a/ports/espressif/common-hal/busio/UART.h b/ports/espressif/common-hal/busio/UART.h index 4c80132050..1e0ed3dd99 100644 --- a/ports/espressif/common-hal/busio/UART.h +++ b/ports/espressif/common-hal/busio/UART.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_UART_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_UART_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_UART_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_UART_H #include "common-hal/microcontroller/Pin.h" @@ -46,4 +46,4 @@ typedef struct { void uart_reset(void); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_UART_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_UART_H diff --git a/ports/espressif/common-hal/countio/Counter.h b/ports/espressif/common-hal/countio/Counter.h index 20fe5b83e6..d7e048ddf0 100644 --- a/ports/espressif/common-hal/countio/Counter.h +++ b/ports/espressif/common-hal/countio/Counter.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNTER_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNTER_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_COUNTIO_COUNTER_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_COUNTIO_COUNTER_H #include "py/obj.h" #include "peripherals/pcnt.h" @@ -37,4 +37,4 @@ typedef struct { pcnt_unit_t unit; } countio_counter_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNT_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_COUNTIO_COUNT_H diff --git a/ports/espressif/common-hal/digitalio/DigitalInOut.h b/ports/espressif/common-hal/digitalio/DigitalInOut.h index c09c5502df..2d42e79809 100644 --- a/ports/espressif/common-hal/digitalio/DigitalInOut.h +++ b/ports/espressif/common-hal/digitalio/DigitalInOut.h @@ -25,8 +25,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DIGITALIO_DIGITALINOUT_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DIGITALIO_DIGITALINOUT_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_DIGITALIO_DIGITALINOUT_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_DIGITALIO_DIGITALINOUT_H #include "common-hal/microcontroller/Pin.h" @@ -36,4 +36,4 @@ typedef struct { bool output_value; } digitalio_digitalinout_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DIGITALIO_DIGITALINOUT_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_DIGITALIO_DIGITALINOUT_H diff --git a/ports/espressif/common-hal/dualbank/__init__.h b/ports/espressif/common-hal/dualbank/__init__.h index eb325b9fb7..33f2be344a 100644 --- a/ports/espressif/common-hal/dualbank/__init__.h +++ b/ports/espressif/common-hal/dualbank/__init__.h @@ -24,9 +24,9 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DUALBANK___INIT___H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DUALBANK___INIT___H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_DUALBANK___INIT___H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_DUALBANK___INIT___H extern void dualbank_reset(void); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DUALBANK___INIT___H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_DUALBANK___INIT___H diff --git a/ports/espressif/common-hal/frequencyio/FrequencyIn.h b/ports/espressif/common-hal/frequencyio/FrequencyIn.h index cf9d2ae538..d41fa8f44d 100644 --- a/ports/espressif/common-hal/frequencyio/FrequencyIn.h +++ b/ports/espressif/common-hal/frequencyio/FrequencyIn.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_FREQUENCYIO_FREQUENCYIN_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_FREQUENCYIO_FREQUENCYIN_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_FREQUENCYIO_FREQUENCYIN_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_FREQUENCYIO_FREQUENCYIN_H #include "py/obj.h" #include "peripherals/pcnt.h" @@ -42,4 +42,4 @@ typedef struct { uint16_t capture_period; } frequencyio_frequencyin_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_FREQUENCYIO_FREQUENCYIN_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_FREQUENCYIO_FREQUENCYIN_H diff --git a/ports/espressif/common-hal/microcontroller/Pin.h b/ports/espressif/common-hal/microcontroller/Pin.h index de7ea8e093..0bf6a532b1 100644 --- a/ports/espressif/common-hal/microcontroller/Pin.h +++ b/ports/espressif/common-hal/microcontroller/Pin.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PIN_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PIN_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_MICROCONTROLLER_PIN_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_MICROCONTROLLER_PIN_H #include "py/mphal.h" @@ -41,4 +41,4 @@ void claim_pin_number(gpio_num_t pin_number); bool pin_number_is_free(gpio_num_t pin_number); void never_reset_pin_number(gpio_num_t pin_number); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PIN_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/espressif/common-hal/microcontroller/Processor.h b/ports/espressif/common-hal/microcontroller/Processor.h index 641a11d555..e36d26ceb3 100644 --- a/ports/espressif/common-hal/microcontroller/Processor.h +++ b/ports/espressif/common-hal/microcontroller/Processor.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H #define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 6 @@ -36,4 +36,4 @@ typedef struct { // Stores no state currently. } mcu_processor_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H diff --git a/ports/espressif/common-hal/neopixel_write/__init__.c b/ports/espressif/common-hal/neopixel_write/__init__.c index 89d90ae996..b63390f155 100644 --- a/ports/espressif/common-hal/neopixel_write/__init__.c +++ b/ports/espressif/common-hal/neopixel_write/__init__.c @@ -91,7 +91,7 @@ static void IRAM_ATTR ws2812_rmt_adapter(const void *src, rmt_item32_t *dest, si void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout, uint8_t *pixels, uint32_t numBytes) { // Reserve channel uint8_t number = digitalinout->pin->number; - rmt_channel_t channel = esp32s2_peripherals_find_and_reserve_rmt(); + rmt_channel_t channel = peripherals_find_and_reserve_rmt(); if (channel == RMT_CHANNEL_MAX) { mp_raise_RuntimeError(translate("All timers in use")); } @@ -123,7 +123,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout, rmt_wait_tx_done(config.channel, pdMS_TO_TICKS(100)); // Free channel again - esp32s2_peripherals_free_rmt(config.channel); + peripherals_free_rmt(config.channel); // Swap pin back to GPIO mode gpio_set_direction(digitalinout->pin->number, GPIO_MODE_OUTPUT); } diff --git a/ports/espressif/common-hal/nvm/ByteArray.h b/ports/espressif/common-hal/nvm/ByteArray.h index 3bd5191fcd..4888521463 100644 --- a/ports/espressif/common-hal/nvm/ByteArray.h +++ b/ports/espressif/common-hal/nvm/ByteArray.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_NVM_BYTEARRAY_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_NVM_BYTEARRAY_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_NVM_BYTEARRAY_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_NVM_BYTEARRAY_H #include "py/obj.h" @@ -35,4 +35,4 @@ typedef struct { uint32_t len; } nvm_bytearray_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_NVM_BYTEARRAY_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_NVM_BYTEARRAY_H diff --git a/ports/espressif/common-hal/os/__init__.c b/ports/espressif/common-hal/os/__init__.c index ee53bec04b..b77898016f 100644 --- a/ports/espressif/common-hal/os/__init__.c +++ b/ports/espressif/common-hal/os/__init__.c @@ -36,8 +36,8 @@ STATIC const qstr os_uname_info_fields[] = { MP_QSTR_sysname, MP_QSTR_nodename, MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine }; -STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "esp32s2"); -STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "esp32s2"); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, MICROPY_HW_MCU_NAME); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, MICROPY_HW_MCU_NAME); STATIC const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING); STATIC const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE); STATIC const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME); diff --git a/ports/espressif/common-hal/paralleldisplay/ParallelBus.h b/ports/espressif/common-hal/paralleldisplay/ParallelBus.h index 8758b8fcca..fc9b378274 100644 --- a/ports/espressif/common-hal/paralleldisplay/ParallelBus.h +++ b/ports/espressif/common-hal/paralleldisplay/ParallelBus.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H #include "common-hal/digitalio/DigitalInOut.h" @@ -44,4 +44,4 @@ typedef struct { uint32_t write_mask; // bit mask for the single bit for the write pin register } paralleldisplay_parallelbus_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H diff --git a/ports/espressif/common-hal/ps2io/Ps2.h b/ports/espressif/common-hal/ps2io/Ps2.h index 497952b250..156689e0f0 100644 --- a/ports/espressif/common-hal/ps2io/Ps2.h +++ b/ports/espressif/common-hal/ps2io/Ps2.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PS2IO_PS2_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PS2IO_PS2_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PS2IO_PS2_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PS2IO_PS2_H #include "common-hal/microcontroller/Pin.h" @@ -57,4 +57,4 @@ typedef struct { void ps2_reset(void); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PS2IO_PS2_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PS2IO_PS2_H diff --git a/ports/espressif/common-hal/pulseio/PulseIn.c b/ports/espressif/common-hal/pulseio/PulseIn.c index a9533179bb..3da57bf563 100644 --- a/ports/espressif/common-hal/pulseio/PulseIn.c +++ b/ports/espressif/common-hal/pulseio/PulseIn.c @@ -31,7 +31,7 @@ STATIC uint8_t refcount = 0; STATIC pulseio_pulsein_obj_t *handles[RMT_CHANNEL_MAX]; -// Requires rmt.c void esp32s2_peripherals_reset_all(void) to reset +// Requires rmt.c void peripherals_reset_all(void) to reset STATIC void update_internal_buffer(pulseio_pulsein_obj_t *self) { uint32_t length = 0; @@ -106,7 +106,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu } // Find a free RMT Channel and configure it - rmt_channel_t channel = esp32s2_peripherals_find_and_reserve_rmt(); + rmt_channel_t channel = peripherals_find_and_reserve_rmt(); if (channel == RMT_CHANNEL_MAX) { mp_raise_RuntimeError(translate("All timers in use")); } @@ -136,7 +136,7 @@ bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t *self) { void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t *self) { handles[self->channel] = NULL; - esp32s2_peripherals_free_rmt(self->channel); + peripherals_free_rmt(self->channel); reset_pin_number(self->pin->number); refcount--; if (refcount == 0) { diff --git a/ports/espressif/common-hal/pulseio/PulseIn.h b/ports/espressif/common-hal/pulseio/PulseIn.h index 3afd8db250..55714b04b2 100644 --- a/ports/espressif/common-hal/pulseio/PulseIn.h +++ b/ports/espressif/common-hal/pulseio/PulseIn.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEIN_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEIN_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PULSEIO_PULSEIN_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PULSEIO_PULSEIN_H #include "common-hal/microcontroller/Pin.h" @@ -53,4 +53,4 @@ typedef struct { void pulsein_reset(void); void pulsein_background(void); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEIN_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PULSEIO_PULSEIN_H diff --git a/ports/espressif/common-hal/pulseio/PulseOut.c b/ports/espressif/common-hal/pulseio/PulseOut.c index b762cefb84..1cb02089e7 100644 --- a/ports/espressif/common-hal/pulseio/PulseOut.c +++ b/ports/espressif/common-hal/pulseio/PulseOut.c @@ -29,14 +29,14 @@ #include "shared-bindings/pwmio/PWMOut.h" #include "py/runtime.h" -// Requires rmt.c void esp32s2_peripherals_reset_all(void) to reset +// Requires rmt.c void peripherals_reset_all(void) to reset void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, const mcu_pin_obj_t *pin, uint32_t frequency, uint16_t duty_cycle) { - rmt_channel_t channel = esp32s2_peripherals_find_and_reserve_rmt(); + rmt_channel_t channel = peripherals_find_and_reserve_rmt(); if (channel == RMT_CHANNEL_MAX) { mp_raise_RuntimeError(translate("All timers in use")); } @@ -59,7 +59,7 @@ bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t *self) { } void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t *self) { - esp32s2_peripherals_free_rmt(self->channel); + peripherals_free_rmt(self->channel); self->channel = RMT_CHANNEL_MAX; } diff --git a/ports/espressif/common-hal/pulseio/PulseOut.h b/ports/espressif/common-hal/pulseio/PulseOut.h index c3952452f6..359280a86f 100644 --- a/ports/espressif/common-hal/pulseio/PulseOut.h +++ b/ports/espressif/common-hal/pulseio/PulseOut.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PULSEIO_PULSEOUT_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PULSEIO_PULSEOUT_H #include "common-hal/microcontroller/Pin.h" #include "components/driver/include/driver/rmt.h" @@ -38,4 +38,4 @@ typedef struct { rmt_channel_t channel; } pulseio_pulseout_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PULSEIO_PULSEOUT_H diff --git a/ports/espressif/common-hal/pwmio/PWMOut.h b/ports/espressif/common-hal/pwmio/PWMOut.h index f94325248b..cde579ce89 100644 --- a/ports/espressif/common-hal/pwmio/PWMOut.h +++ b/ports/espressif/common-hal/pwmio/PWMOut.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PWMIO_PWMOUT_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PWMIO_PWMOUT_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PWMIO_PWMOUT_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PWMIO_PWMOUT_H #include "common-hal/microcontroller/Pin.h" #include "components/driver/include/driver/ledc.h" @@ -42,4 +42,4 @@ typedef struct { void pwmout_reset(void); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PWMIO_PWMOUT_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PWMIO_PWMOUT_H diff --git a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.h b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.h index 8a717b7b5d..4982c39103 100644 --- a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.h +++ b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H #include "py/obj.h" #include "peripherals/pcnt.h" @@ -37,4 +37,4 @@ typedef struct { pcnt_unit_t unit; } rotaryio_incrementalencoder_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H diff --git a/ports/espressif/common-hal/rtc/RTC.h b/ports/espressif/common-hal/rtc/RTC.h index 233cde3fd2..efe45e66b4 100644 --- a/ports/espressif/common-hal/rtc/RTC.h +++ b/ports/espressif/common-hal/rtc/RTC.h @@ -24,11 +24,11 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_RTC_RTC_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_RTC_RTC_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_RTC_RTC_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_RTC_RTC_H extern void rtc_init(void); extern void rtc_reset(void); extern void common_hal_rtc_init(void); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_RTC_RTC_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_RTC_RTC_H diff --git a/ports/espressif/common-hal/socketpool/Socket.h b/ports/espressif/common-hal/socketpool/Socket.h index 87f8b20dbb..943b5d9fdd 100644 --- a/ports/espressif/common-hal/socketpool/Socket.h +++ b/ports/espressif/common-hal/socketpool/Socket.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKET_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKET_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL_SOCKET_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL_SOCKET_H #include "py/obj.h" @@ -48,4 +48,4 @@ typedef struct { void socket_reset(void); bool register_open_socket(socketpool_socket_obj_t *self); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKET_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL_SOCKET_H diff --git a/ports/espressif/common-hal/socketpool/SocketPool.h b/ports/espressif/common-hal/socketpool/SocketPool.h index ae9988d593..4051ed4255 100644 --- a/ports/espressif/common-hal/socketpool/SocketPool.h +++ b/ports/espressif/common-hal/socketpool/SocketPool.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKETPOOL_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKETPOOL_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL_SOCKETPOOL_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL_SOCKETPOOL_H #include "py/obj.h" @@ -33,4 +33,4 @@ typedef struct { mp_obj_base_t base; } socketpool_socketpool_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKETPOOL_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL_SOCKETPOOL_H diff --git a/ports/espressif/common-hal/socketpool/__init__.h b/ports/espressif/common-hal/socketpool/__init__.h index 8f9565b46e..58d2eb9d85 100644 --- a/ports/espressif/common-hal/socketpool/__init__.h +++ b/ports/espressif/common-hal/socketpool/__init__.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL___INIT___H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL___INIT___H -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL___INIT___H diff --git a/ports/espressif/common-hal/ssl/SSLContext.h b/ports/espressif/common-hal/ssl/SSLContext.h index e359ac0de4..b46ba3cd64 100644 --- a/ports/espressif/common-hal/ssl/SSLContext.h +++ b/ports/espressif/common-hal/ssl/SSLContext.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL_SSLCONTEXT_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL_SSLCONTEXT_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SSL_SSLCONTEXT_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SSL_SSLCONTEXT_H #include "py/obj.h" @@ -36,4 +36,4 @@ typedef struct { esp_tls_cfg_t ssl_config; } ssl_sslcontext_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL_SSL_CONTEXT_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SSL_SSL_CONTEXT_H diff --git a/ports/espressif/common-hal/ssl/SSLSocket.h b/ports/espressif/common-hal/ssl/SSLSocket.h index b485781259..dd1dcda4ac 100644 --- a/ports/espressif/common-hal/ssl/SSLSocket.h +++ b/ports/espressif/common-hal/ssl/SSLSocket.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL_SSLSOCKET_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL_SSLSOCKET_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SSL_SSLSOCKET_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SSL_SSLSOCKET_H #include "py/obj.h" @@ -41,4 +41,4 @@ typedef struct { ssl_sslcontext_obj_t *ssl_context; } ssl_sslsocket_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL_SSLSOCKET_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SSL_SSLSOCKET_H diff --git a/ports/espressif/common-hal/ssl/__init__.h b/ports/espressif/common-hal/ssl/__init__.h index fe83a79194..687146f4a7 100644 --- a/ports/espressif/common-hal/ssl/__init__.h +++ b/ports/espressif/common-hal/ssl/__init__.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL___INIT___H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL___INIT___H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SSL___INIT___H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SSL___INIT___H -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL___INIT___H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SSL___INIT___H diff --git a/ports/espressif/common-hal/supervisor/Runtime.h b/ports/espressif/common-hal/supervisor/Runtime.h index 840ce1bbb3..5783b41d04 100644 --- a/ports/espressif/common-hal/supervisor/Runtime.h +++ b/ports/espressif/common-hal/supervisor/Runtime.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SUPERVISOR_RUNTIME_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SUPERVISOR_RUNTIME_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SUPERVISOR_RUNTIME_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SUPERVISOR_RUNTIME_H #include "py/obj.h" @@ -34,4 +34,4 @@ typedef struct { // Stores no state currently. } super_runtime_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SUPERVISOR_RUNTIME_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SUPERVISOR_RUNTIME_H diff --git a/ports/espressif/common-hal/touchio/TouchIn.h b/ports/espressif/common-hal/touchio/TouchIn.h index d4ce2d8a5f..9e21c87fd1 100644 --- a/ports/espressif/common-hal/touchio/TouchIn.h +++ b/ports/espressif/common-hal/touchio/TouchIn.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_TOUCHIO_TOUCHIN_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_TOUCHIO_TOUCHIN_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_TOUCHIO_TOUCHIN_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_TOUCHIO_TOUCHIN_H #include "py/obj.h" #include "common-hal/microcontroller/Pin.h" @@ -36,4 +36,4 @@ typedef struct { uint16_t threshold; } touchio_touchin_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_TOUCHIO_TOUCHIN_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_TOUCHIO_TOUCHIN_H diff --git a/ports/espressif/common-hal/watchdog/WatchDogTimer.h b/ports/espressif/common-hal/watchdog/WatchDogTimer.h index c26d140139..8d95bfa4cc 100644 --- a/ports/espressif/common-hal/watchdog/WatchDogTimer.h +++ b/ports/espressif/common-hal/watchdog/WatchDogTimer.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H #include "py/obj.h" #include "shared-bindings/watchdog/WatchDogMode.h" @@ -40,4 +40,4 @@ struct _watchdog_watchdogtimer_obj_t { // This needs to be called in order to disable the watchdog void watchdog_reset(void); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H diff --git a/ports/espressif/common-hal/wifi/Network.h b/ports/espressif/common-hal/wifi/Network.h index 9345bb4576..05a6c34366 100644 --- a/ports/espressif/common-hal/wifi/Network.h +++ b/ports/espressif/common-hal/wifi/Network.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_NETWORK_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_NETWORK_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WIFI_NETWORK_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WIFI_NETWORK_H #include "py/obj.h" @@ -36,4 +36,4 @@ typedef struct { wifi_ap_record_t record; } wifi_network_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_NETWORK_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WIFI_NETWORK_H diff --git a/ports/espressif/common-hal/wifi/Radio.h b/ports/espressif/common-hal/wifi/Radio.h index b6cf750b4b..3f53329324 100644 --- a/ports/espressif/common-hal/wifi/Radio.h +++ b/ports/espressif/common-hal/wifi/Radio.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_RADIO_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_RADIO_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WIFI_RADIO_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WIFI_RADIO_H #include "py/obj.h" @@ -65,4 +65,4 @@ typedef struct { extern void common_hal_wifi_radio_gc_collect(wifi_radio_obj_t *self); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_RADIO_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WIFI_RADIO_H diff --git a/ports/espressif/common-hal/wifi/ScannedNetworks.h b/ports/espressif/common-hal/wifi/ScannedNetworks.h index 9790c4ab33..f089f27e3f 100644 --- a/ports/espressif/common-hal/wifi/ScannedNetworks.h +++ b/ports/espressif/common-hal/wifi/ScannedNetworks.h @@ -25,8 +25,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_SCANNEDNETWORKS_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_SCANNEDNETWORKS_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WIFI_SCANNEDNETWORKS_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WIFI_SCANNEDNETWORKS_H #include @@ -59,4 +59,4 @@ typedef struct { void wifi_scannednetworks_scan_next_channel(wifi_scannednetworks_obj_t *self); void wifi_scannednetworks_deinit(wifi_scannednetworks_obj_t *self); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_SCANNEDNETWORKS_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WIFI_SCANNEDNETWORKS_H diff --git a/ports/espressif/common-hal/wifi/__init__.h b/ports/espressif/common-hal/wifi/__init__.h index 1dbe50a04b..be91dca758 100644 --- a/ports/espressif/common-hal/wifi/__init__.h +++ b/ports/espressif/common-hal/wifi/__init__.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI___INIT___H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI___INIT___H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WIFI___INIT___H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WIFI___INIT___H #include "py/obj.h" @@ -35,4 +35,4 @@ void wifi_reset(void); void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t *esp_ip_address); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI___INIT___H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WIFI___INIT___H diff --git a/ports/espressif/esp32s2_peripherals_config.h b/ports/espressif/esp32s2_peripherals_config.h index aac1a2fa65..3d2fc353b3 100644 --- a/ports/espressif/esp32s2_peripherals_config.h +++ b/ports/espressif/esp32s2_peripherals_config.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_PERIPHERALS_CONFIG_H -#define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_CONFIG_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_CONFIG_H +#define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_CONFIG_H #include "py/obj.h" @@ -35,4 +35,4 @@ extern const mp_obj_type_t mcu_pin_type; #define PIN_PREFIX_FIELDS mp_obj_base_t base; -#endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_CONFIG_H +#endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_CONFIG_H diff --git a/ports/espressif/modules/module.h b/ports/espressif/modules/module.h index 6c40e30e07..643cdc854e 100644 --- a/ports/espressif/modules/module.h +++ b/ports/espressif/modules/module.h @@ -25,11 +25,11 @@ */ -#ifndef MICROPY_INCLUDED_ESP32S2_MODULES_MODULE_H -#define MICROPY_INCLUDED_ESP32S2_MODULES_MODULE_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H +#define MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H #include "shared-bindings/microcontroller/Pin.h" void never_reset_module_internal_pins(void); -#endif // MICROPY_INCLUDED_ESP32S2_MODULES_MODULE_H +#endif // MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H diff --git a/ports/espressif/mpconfigport.h b/ports/espressif/mpconfigport.h index 385c5eb55f..62e37d9374 100644 --- a/ports/espressif/mpconfigport.h +++ b/ports/espressif/mpconfigport.h @@ -25,13 +25,13 @@ * THE SOFTWARE. */ -#ifndef ESP32S2_MPCONFIGPORT_H__ -#define ESP32S2_MPCONFIGPORT_H__ +#ifndef MICROPY_INCLUDED_ESPRESSIF_MPCONFIGPORT_H +#define MICROPY_INCLUDED_ESPRESSIF_MPCONFIGPORT_H #define MICROPY_NLR_THUMB (0) #define MICROPY_USE_INTERNAL_PRINTF (0) -#define MICROPY_PY_SYS_PLATFORM "Espressif ESP32-S2" +#define MICROPY_PY_SYS_PLATFORM "Espressif" #include "py/circuitpy_mpconfig.h" @@ -61,4 +61,4 @@ #ifndef CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP #define CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP (0) #endif -#endif // __INCLUDED_ESP32S2_MPCONFIGPORT_H +#endif // MICROPY_INCLUDED_ESPRESSIF_MPCONFIGPORT_H diff --git a/ports/espressif/mphalport.h b/ports/espressif/mphalport.h index 8682baec45..6550b8c212 100644 --- a/ports/espressif/mphalport.h +++ b/ports/espressif/mphalport.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef __ESP32S2_HAL -#define __ESP32S2_HAL +#ifndef MICROPY_INCLUDED_ESPRESSIF_MPHAL_H +#define MICROPY_INCLUDED_ESPRESSIF_MPHAL_H #include #include @@ -38,4 +38,4 @@ bool mp_hal_stdin_any(void); -#endif +#endif // MICROPY_INCLUDED_ESPRESSIF_MPHAL_H diff --git a/ports/espressif/peripherals/pcnt.h b/ports/espressif/peripherals/pcnt.h index 8bd8b0272b..86a90b4444 100644 --- a/ports/espressif/peripherals/pcnt.h +++ b/ports/espressif/peripherals/pcnt.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PCNT_HANDLER_H -#define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PCNT_HANDLER_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_PCNT_HANDLER_H +#define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_PCNT_HANDLER_H #include "driver/pcnt.h" @@ -33,4 +33,4 @@ extern int peripherals_pcnt_init(pcnt_config_t pcnt_config); extern void peripherals_pcnt_deinit(pcnt_unit_t *unit); extern void peripherals_pcnt_reset(void); -#endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PCNT_HANDLER_H +#endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_PCNT_HANDLER_H diff --git a/ports/espressif/peripherals/pins.h b/ports/espressif/peripherals/pins.h index 5a5867ea0c..fe1a9195f9 100644 --- a/ports/espressif/peripherals/pins.h +++ b/ports/espressif/peripherals/pins.h @@ -27,8 +27,8 @@ // DO NOT include this file directly. Use shared-bindings/microcontroller/Pin.h instead to ensure // that all necessary includes are already included. -#ifndef MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PINS_H -#define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PINS_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_PINS_H +#define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_PINS_H #include @@ -93,4 +93,4 @@ extern const mcu_pin_obj_t pin_GPIO46; #define NO_PIN (GPIO_NUM_NC) -#endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PINS_H +#endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_PINS_H diff --git a/ports/espressif/peripherals/rmt.c b/ports/espressif/peripherals/rmt.c index 2be5f06d81..6fbf81f1bd 100644 --- a/ports/espressif/peripherals/rmt.c +++ b/ports/espressif/peripherals/rmt.c @@ -29,15 +29,15 @@ bool rmt_reserved_channels[RMT_CHANNEL_MAX]; -void esp32s2_peripherals_rmt_reset(void) { +void peripherals_rmt_reset(void) { for (size_t i = 0; i < RMT_CHANNEL_MAX; i++) { if (rmt_reserved_channels[i]) { - esp32s2_peripherals_free_rmt(i); + peripherals_free_rmt(i); } } } -rmt_channel_t esp32s2_peripherals_find_and_reserve_rmt(void) { +rmt_channel_t peripherals_find_and_reserve_rmt(void) { for (size_t i = 0; i < RMT_CHANNEL_MAX; i++) { if (!rmt_reserved_channels[i]) { rmt_reserved_channels[i] = true; @@ -48,7 +48,7 @@ rmt_channel_t esp32s2_peripherals_find_and_reserve_rmt(void) { return RMT_CHANNEL_MAX; } -void esp32s2_peripherals_free_rmt(rmt_channel_t chan) { +void peripherals_free_rmt(rmt_channel_t chan) { rmt_reserved_channels[chan] = false; rmt_driver_uninstall(chan); } diff --git a/ports/espressif/peripherals/rmt.h b/ports/espressif/peripherals/rmt.h index 020f8dc3ee..810b331048 100644 --- a/ports/espressif/peripherals/rmt.h +++ b/ports/espressif/peripherals/rmt.h @@ -24,15 +24,15 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_PERIPHERALS_RMT_H -#define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_RMT_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_RMT_H +#define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_RMT_H #include "py/mphal.h" #include "components/driver/include/driver/rmt.h" #include -void esp32s2_peripherals_rmt_reset(void); -rmt_channel_t esp32s2_peripherals_find_and_reserve_rmt(void); -void esp32s2_peripherals_free_rmt(rmt_channel_t chan); +void peripherals_rmt_reset(void); +rmt_channel_t peripherals_find_and_reserve_rmt(void); +void peripherals_free_rmt(rmt_channel_t chan); -#endif +#endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_RMT_H diff --git a/ports/espressif/peripherals/timer.h b/ports/espressif/peripherals/timer.h index 6869bd4352..c968b0f400 100644 --- a/ports/espressif/peripherals/timer.h +++ b/ports/espressif/peripherals/timer.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_PERIPHERALS_TIMER_HANDLER_H -#define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_TIMER_HANDLER_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_TIMER_HANDLER_H +#define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_TIMER_HANDLER_H #include "driver/timer.h" @@ -40,4 +40,4 @@ extern void peripherals_timer_deinit(timer_index_t *timer); extern void peripherals_timer_reset(void); extern void peripherals_timer_never_reset(timer_index_t *timer); -#endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_TIMER_HANDLER_H +#endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_TIMER_HANDLER_H diff --git a/ports/espressif/peripherals/touch.h b/ports/espressif/peripherals/touch.h index 218045f398..c7cd1f6be1 100644 --- a/ports/espressif/peripherals/touch.h +++ b/ports/espressif/peripherals/touch.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_PERIPHERALS_TOUCH_HANDLER_H -#define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_TOUCH_HANDLER_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_TOUCH_HANDLER_H +#define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_TOUCH_HANDLER_H #include "driver/touch_pad.h" @@ -33,4 +33,4 @@ extern void peripherals_touch_reset(void); extern void peripherals_touch_never_reset(const bool enable); extern void peripherals_touch_init(const touch_pad_t touchpad); -#endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_TOUCH_HANDLER_H +#endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_TOUCH_HANDLER_H diff --git a/ports/espressif/supervisor/esp_port.h b/ports/espressif/supervisor/esp_port.h index 8b9e13829f..90ba3f65f1 100644 --- a/ports/espressif/supervisor/esp_port.h +++ b/ports/espressif/supervisor/esp_port.h @@ -24,12 +24,12 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_SUPERVISOR_PORT_H -#define MICROPY_INCLUDED_ESP32S2_SUPERVISOR_PORT_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_SUPERVISOR_PORT_H +#define MICROPY_INCLUDED_ESPRESSIF_SUPERVISOR_PORT_H #include "freertos/FreeRTOS.h" #include "freertos/task.h" extern TaskHandle_t circuitpython_task; -#endif // MICROPY_INCLUDED_ESP32S2_SUPERVISOR_PORT_H +#endif // MICROPY_INCLUDED_ESPRESSIF_SUPERVISOR_PORT_H diff --git a/ports/espressif/supervisor/internal_flash.h b/ports/espressif/supervisor/internal_flash.h index 02d5190030..17a6869725 100644 --- a/ports/espressif/supervisor/internal_flash.h +++ b/ports/espressif/supervisor/internal_flash.h @@ -24,8 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_INTERNAL_FLASH_H -#define MICROPY_INCLUDED_ESP32S2_INTERNAL_FLASH_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_INTERNAL_FLASH_H +#define MICROPY_INCLUDED_ESPRESSIF_INTERNAL_FLASH_H #include #include @@ -35,4 +35,4 @@ #define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms #define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2) -#endif // MICROPY_INCLUDED_ESP32S2_INTERNAL_FLASH_H +#endif // MICROPY_INCLUDED_ESPRESSIF_INTERNAL_FLASH_H diff --git a/ports/espressif/supervisor/internal_flash_root_pointers.h b/ports/espressif/supervisor/internal_flash_root_pointers.h index a9a8c2a22e..b4908f8e4b 100644 --- a/ports/espressif/supervisor/internal_flash_root_pointers.h +++ b/ports/espressif/supervisor/internal_flash_root_pointers.h @@ -23,9 +23,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_INTERNAL_FLASH_ROOT_POINTERS_H -#define MICROPY_INCLUDED_ESP32S2_INTERNAL_FLASH_ROOT_POINTERS_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_INTERNAL_FLASH_ROOT_POINTERS_H +#define MICROPY_INCLUDED_ESPRESSIF_INTERNAL_FLASH_ROOT_POINTERS_H #define FLASH_ROOT_POINTERS -#endif // MICROPY_INCLUDED_ESP32S2_INTERNAL_FLASH_ROOT_POINTERS_H +#endif // MICROPY_INCLUDED_ESPRESSIF_INTERNAL_FLASH_ROOT_POINTERS_H diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index de6941ed70..dd736eaff3 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -173,27 +173,10 @@ void reset_port(void) { analogout_reset(); #endif - #if CIRCUITPY_DUALBANK - dualbank_reset(); - #endif - - #if CIRCUITPY_PS2IO - ps2_reset(); - #endif - #if CIRCUITPY_AUDIOBUSIO i2s_reset(); #endif - #if CIRCUITPY_PULSEIO - esp32s2_peripherals_rmt_reset(); - pulsein_reset(); - #endif - - #if CIRCUITPY_PWMIO - pwmout_reset(); - #endif - #if CIRCUITPY_BUSIO i2c_reset(); spi_reset(); @@ -204,12 +187,20 @@ void reset_port(void) { peripherals_pcnt_reset(); #endif + #if CIRCUITPY_DUALBANK + dualbank_reset(); + #endif + #if CIRCUITPY_FREQUENCYIO peripherals_timer_reset(); #endif + #if CIRCUITPY_PS2IO + ps2_reset(); + #endif + #if CIRCUITPY_PULSEIO - esp32s2_peripherals_rmt_reset(); + peripherals_rmt_reset(); pulsein_reset(); #endif From eb0738fb334664e0457db2af6a0bb4178a3de012 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sat, 18 Sep 2021 18:12:14 +0530 Subject: [PATCH 2/4] update esp-idf to v4.3.1 --- ports/espressif/esp-idf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/esp-idf b/ports/espressif/esp-idf index 48ae2309fd..e493a4c30e 160000 --- a/ports/espressif/esp-idf +++ b/ports/espressif/esp-idf @@ -1 +1 @@ -Subproject commit 48ae2309fd9cea600ff960b61a029892be1fdc1b +Subproject commit e493a4c30e1b2f7c54a376327388b9e12262cbbf From dcfde14bf9728716d50361cb450bb5547d410ee9 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sat, 18 Sep 2021 18:18:18 +0530 Subject: [PATCH 3/4] move pins and sdkconfig into soc specific directories --- .../{ => esp32s2}/sdkconfig.defaults | 0 .../esp-idf-config/sdkconfig-opt.defaults | 4 +- ports/espressif/esp32s2_peripherals_config.h | 38 -------- ports/espressif/peripherals/esp32s2/pins.c | 71 +++++++++++++++ ports/espressif/peripherals/esp32s2/pins.h | 78 +++++++++++++++++ ports/espressif/peripherals/pins.c | 86 ------------------- ports/espressif/peripherals/pins.h | 76 ++++++---------- 7 files changed, 176 insertions(+), 177 deletions(-) rename ports/espressif/esp-idf-config/{ => esp32s2}/sdkconfig.defaults (100%) delete mode 100644 ports/espressif/esp32s2_peripherals_config.h create mode 100644 ports/espressif/peripherals/esp32s2/pins.c create mode 100644 ports/espressif/peripherals/esp32s2/pins.h delete mode 100644 ports/espressif/peripherals/pins.c diff --git a/ports/espressif/esp-idf-config/sdkconfig.defaults b/ports/espressif/esp-idf-config/esp32s2/sdkconfig.defaults similarity index 100% rename from ports/espressif/esp-idf-config/sdkconfig.defaults rename to ports/espressif/esp-idf-config/esp32s2/sdkconfig.defaults diff --git a/ports/espressif/esp-idf-config/sdkconfig-opt.defaults b/ports/espressif/esp-idf-config/sdkconfig-opt.defaults index af0746bc0e..b24996c0f7 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-opt.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-opt.defaults @@ -7,6 +7,4 @@ CONFIG_ESP_CONSOLE_NONE=y CONFIG_ESP_CONSOLE_UART_NUM=-1 CONFIG_CONSOLE_UART_NUM=-1 # CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set -CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT=y -# CONFIG_ESP32S2_PANIC_PRINT_HALT is not set -CONFIG_ESP32S2_PANIC_SILENT_REBOOT=y \ No newline at end of file +CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT=y \ No newline at end of file diff --git a/ports/espressif/esp32s2_peripherals_config.h b/ports/espressif/esp32s2_peripherals_config.h deleted file mode 100644 index 3d2fc353b3..0000000000 --- a/ports/espressif/esp32s2_peripherals_config.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the Micro Python 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. - */ - -#ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_CONFIG_H -#define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_CONFIG_H - -#include "py/obj.h" - -extern const mp_obj_type_t mcu_pin_type; - -#define PIN_PREFIX_VALUES { &mcu_pin_type }, -#define PIN_PREFIX_FIELDS mp_obj_base_t base; - - -#endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_CONFIG_H diff --git a/ports/espressif/peripherals/esp32s2/pins.c b/ports/espressif/peripherals/esp32s2/pins.c new file mode 100644 index 0000000000..ad206cf022 --- /dev/null +++ b/ports/espressif/peripherals/esp32s2/pins.c @@ -0,0 +1,71 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "peripherals/pins.h" + +const mcu_pin_obj_t pin_GPIO0 = PIN(0, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO1 = PIN(1, ADC_UNIT_1, ADC_CHANNEL_0, TOUCH_PAD_NUM1); +const mcu_pin_obj_t pin_GPIO2 = PIN(2, ADC_UNIT_1, ADC_CHANNEL_1, TOUCH_PAD_NUM2); +const mcu_pin_obj_t pin_GPIO3 = PIN(3, ADC_UNIT_1, ADC_CHANNEL_2, TOUCH_PAD_NUM3); +const mcu_pin_obj_t pin_GPIO4 = PIN(4, ADC_UNIT_1, ADC_CHANNEL_3, TOUCH_PAD_NUM4); +const mcu_pin_obj_t pin_GPIO5 = PIN(5, ADC_UNIT_1, ADC_CHANNEL_4, TOUCH_PAD_NUM5); +const mcu_pin_obj_t pin_GPIO6 = PIN(6, ADC_UNIT_1, ADC_CHANNEL_5, TOUCH_PAD_NUM6); +const mcu_pin_obj_t pin_GPIO7 = PIN(7, ADC_UNIT_1, ADC_CHANNEL_6, TOUCH_PAD_NUM7); +const mcu_pin_obj_t pin_GPIO8 = PIN(8, ADC_UNIT_1, ADC_CHANNEL_7, TOUCH_PAD_NUM8); +const mcu_pin_obj_t pin_GPIO9 = PIN(9, ADC_UNIT_1, ADC_CHANNEL_8, TOUCH_PAD_NUM9); +const mcu_pin_obj_t pin_GPIO10 = PIN(10, ADC_UNIT_1, ADC_CHANNEL_9, TOUCH_PAD_NUM10); +const mcu_pin_obj_t pin_GPIO11 = PIN(11, ADC_UNIT_2, ADC_CHANNEL_0, TOUCH_PAD_NUM11); +const mcu_pin_obj_t pin_GPIO12 = PIN(12, ADC_UNIT_2, ADC_CHANNEL_1, TOUCH_PAD_NUM12); +const mcu_pin_obj_t pin_GPIO13 = PIN(13, ADC_UNIT_2, ADC_CHANNEL_2, TOUCH_PAD_NUM13); +const mcu_pin_obj_t pin_GPIO14 = PIN(14, ADC_UNIT_2, ADC_CHANNEL_3, TOUCH_PAD_NUM14); +const mcu_pin_obj_t pin_GPIO15 = PIN(15, ADC_UNIT_2, ADC_CHANNEL_4, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO16 = PIN(16, ADC_UNIT_2, ADC_CHANNEL_5, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO17 = PIN(17, ADC_UNIT_2, ADC_CHANNEL_6, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO18 = PIN(18, ADC_UNIT_2, ADC_CHANNEL_7, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO19 = PIN(19, ADC_UNIT_2, ADC_CHANNEL_8, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO20 = PIN(20, ADC_UNIT_2, ADC_CHANNEL_9, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO21 = PIN(21, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO26 = PIN(26, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO27 = PIN(27, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO28 = PIN(28, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO29 = PIN(29, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO30 = PIN(30, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO31 = PIN(31, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO32 = PIN(32, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO33 = PIN(33, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO34 = PIN(34, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO35 = PIN(35, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO36 = PIN(36, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO37 = PIN(37, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO38 = PIN(38, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO39 = PIN(39, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO40 = PIN(40, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO41 = PIN(41, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO42 = PIN(42, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO43 = PIN(43, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO44 = PIN(44, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO45 = PIN(45, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO46 = PIN(46, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); diff --git a/ports/espressif/peripherals/esp32s2/pins.h b/ports/espressif/peripherals/esp32s2/pins.h new file mode 100644 index 0000000000..b66db79861 --- /dev/null +++ b/ports/espressif/peripherals/esp32s2/pins.h @@ -0,0 +1,78 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// DO NOT include this file directly. +// Use shared-bindings/microcontroller/Pin.h instead. +// This ensures that all necessary includes are already included. + +#ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S2_PINS_H +#define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S2_PINS_H + +extern const mcu_pin_obj_t pin_GPIO0; +extern const mcu_pin_obj_t pin_GPIO1; +extern const mcu_pin_obj_t pin_GPIO2; +extern const mcu_pin_obj_t pin_GPIO3; +extern const mcu_pin_obj_t pin_GPIO4; +extern const mcu_pin_obj_t pin_GPIO5; +extern const mcu_pin_obj_t pin_GPIO6; +extern const mcu_pin_obj_t pin_GPIO7; +extern const mcu_pin_obj_t pin_GPIO8; +extern const mcu_pin_obj_t pin_GPIO9; +extern const mcu_pin_obj_t pin_GPIO10; +extern const mcu_pin_obj_t pin_GPIO11; +extern const mcu_pin_obj_t pin_GPIO12; +extern const mcu_pin_obj_t pin_GPIO13; +extern const mcu_pin_obj_t pin_GPIO14; +extern const mcu_pin_obj_t pin_GPIO15; +extern const mcu_pin_obj_t pin_GPIO16; +extern const mcu_pin_obj_t pin_GPIO17; +extern const mcu_pin_obj_t pin_GPIO18; +extern const mcu_pin_obj_t pin_GPIO19; +extern const mcu_pin_obj_t pin_GPIO20; +extern const mcu_pin_obj_t pin_GPIO21; +extern const mcu_pin_obj_t pin_GPIO26; +extern const mcu_pin_obj_t pin_GPIO27; +extern const mcu_pin_obj_t pin_GPIO28; +extern const mcu_pin_obj_t pin_GPIO29; +extern const mcu_pin_obj_t pin_GPIO30; +extern const mcu_pin_obj_t pin_GPIO31; +extern const mcu_pin_obj_t pin_GPIO32; +extern const mcu_pin_obj_t pin_GPIO33; +extern const mcu_pin_obj_t pin_GPIO34; +extern const mcu_pin_obj_t pin_GPIO35; +extern const mcu_pin_obj_t pin_GPIO36; +extern const mcu_pin_obj_t pin_GPIO37; +extern const mcu_pin_obj_t pin_GPIO38; +extern const mcu_pin_obj_t pin_GPIO39; +extern const mcu_pin_obj_t pin_GPIO40; +extern const mcu_pin_obj_t pin_GPIO41; +extern const mcu_pin_obj_t pin_GPIO42; +extern const mcu_pin_obj_t pin_GPIO43; +extern const mcu_pin_obj_t pin_GPIO44; +extern const mcu_pin_obj_t pin_GPIO45; +extern const mcu_pin_obj_t pin_GPIO46; + +#endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S2_PINS_H diff --git a/ports/espressif/peripherals/pins.c b/ports/espressif/peripherals/pins.c deleted file mode 100644 index f882281405..0000000000 --- a/ports/espressif/peripherals/pins.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "peripherals/pins.h" - -#define NO_ADC 0 -#define NO_ADC_CHANNEL ADC_CHANNEL_MAX - -#define NO_TOUCH_CHANNEL TOUCH_PAD_MAX - -// This macro is used to simplify pin definition in boards//pins.c -#define PIN(p_name, p_number, p_adc_index, p_adc_channel, p_touch_channel) \ - const mcu_pin_obj_t pin_##p_name = { \ - PIN_PREFIX_VALUES \ - .number = p_number, \ - .adc_index = p_adc_index, \ - .adc_channel = p_adc_channel, \ - .touch_channel = p_touch_channel, \ - } - -PIN(GPIO0, 0, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO1, 1, ADC_UNIT_1, ADC_CHANNEL_0, TOUCH_PAD_NUM1); -PIN(GPIO2, 2, ADC_UNIT_1, ADC_CHANNEL_1, TOUCH_PAD_NUM2); -PIN(GPIO3, 3, ADC_UNIT_1, ADC_CHANNEL_2, TOUCH_PAD_NUM3); -PIN(GPIO4, 4, ADC_UNIT_1, ADC_CHANNEL_3, TOUCH_PAD_NUM4); -PIN(GPIO5, 5, ADC_UNIT_1, ADC_CHANNEL_4, TOUCH_PAD_NUM5); -PIN(GPIO6, 6, ADC_UNIT_1, ADC_CHANNEL_5, TOUCH_PAD_NUM6); -PIN(GPIO7, 7, ADC_UNIT_1, ADC_CHANNEL_6, TOUCH_PAD_NUM7); -PIN(GPIO8, 8, ADC_UNIT_1, ADC_CHANNEL_7, TOUCH_PAD_NUM8); -PIN(GPIO9, 9, ADC_UNIT_1, ADC_CHANNEL_8, TOUCH_PAD_NUM9); -PIN(GPIO10, 10, ADC_UNIT_1, ADC_CHANNEL_9, TOUCH_PAD_NUM10); -PIN(GPIO11, 11, ADC_UNIT_2, ADC_CHANNEL_0, TOUCH_PAD_NUM11); -PIN(GPIO12, 12, ADC_UNIT_2, ADC_CHANNEL_1, TOUCH_PAD_NUM12); -PIN(GPIO13, 13, ADC_UNIT_2, ADC_CHANNEL_2, TOUCH_PAD_NUM13); -PIN(GPIO14, 14, ADC_UNIT_2, ADC_CHANNEL_3, TOUCH_PAD_NUM14); -PIN(GPIO15, 15, ADC_UNIT_2, ADC_CHANNEL_4, NO_TOUCH_CHANNEL); -PIN(GPIO16, 16, ADC_UNIT_2, ADC_CHANNEL_5, NO_TOUCH_CHANNEL); -PIN(GPIO17, 17, ADC_UNIT_2, ADC_CHANNEL_6, NO_TOUCH_CHANNEL); -PIN(GPIO18, 18, ADC_UNIT_2, ADC_CHANNEL_7, NO_TOUCH_CHANNEL); -PIN(GPIO19, 19, ADC_UNIT_2, ADC_CHANNEL_8, NO_TOUCH_CHANNEL); -PIN(GPIO20, 20, ADC_UNIT_2, ADC_CHANNEL_9, NO_TOUCH_CHANNEL); -PIN(GPIO21, 21, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO26, 26, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO27, 27, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO28, 28, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO29, 29, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO30, 30, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO31, 31, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO32, 32, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO33, 33, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO34, 34, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO35, 35, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO36, 36, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO37, 37, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO38, 38, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO39, 39, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO40, 40, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO41, 41, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO42, 42, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO43, 43, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO44, 44, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO45, 45, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); -PIN(GPIO46, 46, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); diff --git a/ports/espressif/peripherals/pins.h b/ports/espressif/peripherals/pins.h index fe1a9195f9..191f650915 100644 --- a/ports/espressif/peripherals/pins.h +++ b/ports/espressif/peripherals/pins.h @@ -24,73 +24,49 @@ * THE SOFTWARE. */ -// DO NOT include this file directly. Use shared-bindings/microcontroller/Pin.h instead to ensure -// that all necessary includes are already included. +// DO NOT include this file directly. +// Use shared-bindings/microcontroller/Pin.h instead. +// This ensures that all necessary includes are already included. #ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_PINS_H #define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_PINS_H -#include - -#include "esp32s2_peripherals_config.h" -#include "esp-idf/config/sdkconfig.h" +#include "py/obj.h" #include "components/hal/include/hal/gpio_types.h" #include "components/hal/include/hal/adc_types.h" #include "components/hal/include/hal/touch_sensor_types.h" typedef struct { - PIN_PREFIX_FIELDS + mp_obj_base_t base; gpio_num_t number; uint8_t adc_index : 2; uint8_t adc_channel : 6; touch_pad_t touch_channel; } mcu_pin_obj_t; -extern const mcu_pin_obj_t pin_GPIO0; -extern const mcu_pin_obj_t pin_GPIO1; -extern const mcu_pin_obj_t pin_GPIO2; -extern const mcu_pin_obj_t pin_GPIO3; -extern const mcu_pin_obj_t pin_GPIO4; -extern const mcu_pin_obj_t pin_GPIO5; -extern const mcu_pin_obj_t pin_GPIO6; -extern const mcu_pin_obj_t pin_GPIO7; -extern const mcu_pin_obj_t pin_GPIO8; -extern const mcu_pin_obj_t pin_GPIO9; -extern const mcu_pin_obj_t pin_GPIO10; -extern const mcu_pin_obj_t pin_GPIO11; -extern const mcu_pin_obj_t pin_GPIO12; -extern const mcu_pin_obj_t pin_GPIO13; -extern const mcu_pin_obj_t pin_GPIO14; -extern const mcu_pin_obj_t pin_GPIO15; -extern const mcu_pin_obj_t pin_GPIO16; -extern const mcu_pin_obj_t pin_GPIO17; -extern const mcu_pin_obj_t pin_GPIO18; -extern const mcu_pin_obj_t pin_GPIO19; -extern const mcu_pin_obj_t pin_GPIO20; -extern const mcu_pin_obj_t pin_GPIO21; -extern const mcu_pin_obj_t pin_GPIO26; -extern const mcu_pin_obj_t pin_GPIO27; -extern const mcu_pin_obj_t pin_GPIO28; -extern const mcu_pin_obj_t pin_GPIO29; -extern const mcu_pin_obj_t pin_GPIO30; -extern const mcu_pin_obj_t pin_GPIO31; -extern const mcu_pin_obj_t pin_GPIO32; -extern const mcu_pin_obj_t pin_GPIO33; -extern const mcu_pin_obj_t pin_GPIO34; -extern const mcu_pin_obj_t pin_GPIO35; -extern const mcu_pin_obj_t pin_GPIO36; -extern const mcu_pin_obj_t pin_GPIO37; -extern const mcu_pin_obj_t pin_GPIO38; -extern const mcu_pin_obj_t pin_GPIO39; -extern const mcu_pin_obj_t pin_GPIO40; -extern const mcu_pin_obj_t pin_GPIO41; -extern const mcu_pin_obj_t pin_GPIO42; -extern const mcu_pin_obj_t pin_GPIO43; -extern const mcu_pin_obj_t pin_GPIO44; -extern const mcu_pin_obj_t pin_GPIO45; -extern const mcu_pin_obj_t pin_GPIO46; +extern const mp_obj_type_t mcu_pin_type; #define NO_PIN (GPIO_NUM_NC) +#define NO_ADC 0 +#define NO_ADC_CHANNEL ADC_CHANNEL_MAX + +#define NO_TOUCH_CHANNEL TOUCH_PAD_MAX + +// This macro is used to simplify pin definition in boards//pins.c +#define PIN(p_number, p_adc_index, p_adc_channel, p_touch_channel) \ + { \ + { &mcu_pin_type }, \ + .number = p_number, \ + .adc_index = p_adc_index, \ + .adc_channel = p_adc_channel, \ + .touch_channel = p_touch_channel, \ + } + +// Choose based on chip +#if CONFIG_IDF_TARGET_ESP32S2 +#include "esp32s2/pins.h" +#endif + #endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_PINS_H From 7dda3ec91c04e9985bd0b6e525a4336bf3b34bd7 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sat, 18 Sep 2021 18:24:32 +0530 Subject: [PATCH 4/4] switch to `IDF_TARGET` for soc dependent stuff Co-authored-by: Seon Rozenblum --- ports/espressif/Makefile | 163 +++++++++--------- .../mpconfigboard.mk | 2 + .../mpconfigboard.mk | 2 + .../boards/adafruit_funhouse/mpconfigboard.mk | 2 + .../mpconfigboard.mk | 2 + .../adafruit_metro_esp32s2/mpconfigboard.mk | 2 + .../mpconfigboard.mk | 2 + .../boards/artisense_rd00/mpconfigboard.mk | 2 + .../atmegazero_esp32s2/mpconfigboard.mk | 2 + .../crumpspace_crumps2/mpconfigboard.mk | 2 + .../electroniccats_bastwifi/mpconfigboard.mk | 2 + .../espressif_hmi_devkit_1/mpconfigboard.mk | 2 + .../espressif_kaluga_1.3/mpconfigboard.mk | 2 + .../espressif_kaluga_1/mpconfigboard.mk | 2 + .../espressif_saola_1_wroom/mpconfigboard.mk | 2 + .../espressif_saola_1_wrover/mpconfigboard.mk | 2 + .../franzininho_wifi_wroom/mpconfigboard.mk | 2 + .../franzininho_wifi_wrover/mpconfigboard.mk | 2 + .../gravitech_cucumber_m/mpconfigboard.mk | 2 + .../gravitech_cucumber_ms/mpconfigboard.mk | 2 + .../gravitech_cucumber_r/mpconfigboard.mk | 2 + .../gravitech_cucumber_rs/mpconfigboard.mk | 2 + .../lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk | 2 + .../boards/lolin_s2_mini/mpconfigboard.mk | 2 + .../boards/microdev_micro_s2/mpconfigboard.mk | 2 + .../morpheans_morphesp-240/mpconfigboard.mk | 2 + .../mpconfigboard.mk | 2 + .../mpconfigboard.mk | 2 + .../odt_pixelwing_esp32_s2/mpconfigboard.mk | 2 + .../mpconfigboard.mk | 2 + .../mpconfigboard.mk | 2 + .../mpconfigboard.mk | 2 + .../mpconfigboard.mk | 2 + .../mpconfigboard.mk | 2 + .../unexpectedmaker_tinys2/mpconfigboard.mk | 2 + 35 files changed, 150 insertions(+), 81 deletions(-) diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index 90fa1ece0c..4b058f7d47 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -59,59 +59,61 @@ include $(TOP)/supervisor/supervisor.mk # Include make rules and variables common across CircuitPython builds. include $(TOP)/py/circuitpy_defns.mk -CROSS_COMPILE = xtensa-esp32s2-elf- +CROSS_COMPILE = xtensa-$(IDF_TARGET)-elf- ####################################### # CFLAGS ####################################### -INC += -I. -INC += -I./boards -INC += -I./boards/$(BOARD) -INC += -I./peripherals -INC += -I../.. -INC += -I../../lib/mp-readline -INC += -I../../lib/tinyusb/src -INC += -I../../supervisor/shared/usb -INC += -I$(BUILD) -INC += -I$(BUILD)/genhdr -INC += -I$(BUILD)/esp-idf/config - -INC += -isystem esp-idf -INC += -isystem esp-idf/components/app_update/include -INC += -isystem esp-idf/components/bootloader_support/include -INC += -isystem esp-idf/components/driver/esp32s2/include -INC += -isystem esp-idf/components/driver/include -INC += -isystem esp-idf/components/esp32s2/include -INC += -isystem esp-idf/components/esp_common/include -INC += -isystem esp-idf/components/esp_event/include -INC += -isystem esp-idf/components/esp_hw_support/include -INC += -isystem esp-idf/components/esp_netif/include -INC += -isystem esp-idf/components/esp_pm/include -INC += -isystem esp-idf/components/esp_ringbuf/include -INC += -isystem esp-idf/components/esp_rom/include -INC += -isystem esp-idf/components/esp_system/include -INC += -isystem esp-idf/components/esp_timer/include -INC += -isystem esp-idf/components/esp_wifi/include -INC += -isystem esp-idf/components/freertos/include -INC += -isystem esp-idf/components/freertos/include/freertos -INC += -isystem esp-idf/components/freertos/port/xtensa/include -INC += -isystem esp-idf/components/hal/include -INC += -isystem esp-idf/components/hal/esp32s2/include -INC += -isystem esp-idf/components/heap/include -INC += -isystem esp-idf/components/log/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/mbedtls/mbedtls/include -INC += -isystem esp-idf/components/mbedtls/port/include/ -INC += -isystem esp-idf/components/newlib/platform_include -INC += -isystem esp-idf/components/nvs_flash/include -INC += -isystem esp-idf/components/soc/include -INC += -isystem esp-idf/components/soc/esp32s2/include -INC += -isystem esp-idf/components/spi_flash/include -INC += -isystem esp-idf/components/xtensa/esp32s2/include -INC += -isystem esp-idf/components/xtensa/include +INC += -I.\ + -I./boards \ + -I./boards/$(BOARD) \ + -I./peripherals \ + -I../.. \ + -I../../lib/mp-readline \ + -I../../lib/tinyusb/src \ + -I../../supervisor/shared/usb \ + -I$(BUILD) \ + -I$(BUILD)/genhdr \ + -I$(BUILD)/esp-idf/config \ + -isystem esp-idf \ + -isystem esp-idf/components/app_update/include \ + -isystem esp-idf/components/bootloader_support/include \ + -isystem esp-idf/components/driver/include \ + -isystem esp-idf/components/driver/$(IDF_TARGET)/include \ + -isystem esp-idf/components/$(IDF_TARGET)/include \ + -isystem esp-idf/components/esp_adc_cal/include \ + -isystem esp-idf/components/esp_common/include \ + -isystem esp-idf/components/esp_event/include \ + -isystem esp-idf/components/esp_hw_support/include \ + -isystem esp-idf/components/esp_netif/include \ + -isystem esp-idf/components/esp_pm/include \ + -isystem esp-idf/components/esp_ringbuf/include \ + -isystem esp-idf/components/esp_rom/include \ + -isystem esp-idf/components/esp_system/include \ + -isystem esp-idf/components/esp_timer/include \ + -isystem esp-idf/components/esp_wifi/include \ + -isystem esp-idf/components/freertos/include \ + -isystem esp-idf/components/freertos/include/freertos \ + -isystem esp-idf/components/freertos/port/xtensa/include \ + -isystem esp-idf/components/hal/include \ + -isystem esp-idf/components/hal/$(IDF_TARGET)/include \ + -isystem esp-idf/components/hal/platform_port/include \ + -isystem esp-idf/components/heap/include \ + -isystem esp-idf/components/log/include \ + -isystem esp-idf/components/lwip/include \ + -isystem esp-idf/components/lwip/lwip/src/include \ + -isystem esp-idf/components/lwip/port/esp32/include \ + -isystem esp-idf/components/mbedtls/esp_crt_bundle/include \ + -isystem esp-idf/components/mbedtls/mbedtls/include \ + -isystem esp-idf/components/mbedtls/port/include \ + -isystem esp-idf/components/newlib/platform_include \ + -isystem esp-idf/components/nvs_flash/include \ + -isystem esp-idf/components/soc/include \ + -isystem esp-idf/components/soc/$(IDF_TARGET)/include \ + -isystem esp-idf/components/spi_flash/include \ + -isystem esp-idf/components/xtensa/include \ + -isystem esp-idf/components/xtensa/$(IDF_TARGET)/include CFLAGS += -DHAVE_CONFIG_H \ -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" \ @@ -141,19 +143,19 @@ CFLAGS += $(INC) -Werror -Wall -mlongcalls -std=gnu11 -Wl,--gc-sections $(BASE_C LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,-Map=$@.map -Wl,-cref -Wl,--undefined=uxTopUsedPriority -LDFLAGS += -L$(BUILD)/esp-idf/esp-idf/esp32s2 \ - -L$(BUILD)/esp-idf/esp-idf/esp32s2/ld \ - -Lesp-idf/components/esp32s2/ld \ - -Lesp-idf/components/esp_rom/esp32s2/ld \ - -Tesp32s2_out.ld \ - -Tesp32s2.project.ld \ - -Tesp32s2.peripherals.ld \ - -Tesp32s2.rom.ld \ - -Tesp32s2.rom.api.ld \ - -Tesp32s2.rom.libgcc.ld \ - -Tesp32s2.rom.newlib-data.ld \ - -Tesp32s2.rom.newlib-funcs.ld \ - -Tesp32s2.rom.spiflash.ld +LDFLAGS += -L$(BUILD)/esp-idf/esp-idf/$(IDF_TARGET) \ + -L$(BUILD)/esp-idf/esp-idf/$(IDF_TARGET)/ld \ + -Lesp-idf/components/$(IDF_TARGET)/ld \ + -Lesp-idf/components/esp_rom/$(IDF_TARGET)/ld \ + -T$(IDF_TARGET)_out.ld \ + -T$(IDF_TARGET).project.ld \ + -T$(IDF_TARGET).peripherals.ld \ + -T$(IDF_TARGET).rom.ld \ + -T$(IDF_TARGET).rom.api.ld \ + -T$(IDF_TARGET).rom.libgcc.ld \ + -T$(IDF_TARGET).rom.newlib-data.ld \ + -T$(IDF_TARGET).rom.newlib-funcs.ld \ + -T$(IDF_TARGET).rom.spiflash.ld LDFLAGS += -Wl,-Bstatic \ -Wl,--no-warn-mismatch \ @@ -188,11 +190,11 @@ SRC_C += \ boards/$(BOARD)/pins.c \ modules/$(CIRCUITPY_MODULE).c \ lib/netutils/netutils.c \ + peripherals/pcnt.c \ + peripherals/rmt.c \ peripherals/timer.c \ peripherals/touch.c \ - peripherals/pcnt.c \ - peripherals/pins.c \ - peripherals/rmt.c + peripherals/$(IDF_TARGET)/pins.c ifneq ($(CIRCUITPY_USB),0) SRC_C += lib/tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c @@ -246,23 +248,22 @@ ifeq ($(DEBUG), 1) else DEBUG_SDKCONFIG = esp-idf-config/sdkconfig-opt.defaults endif -SDKCONFIGS = esp-idf-config/sdkconfig.defaults;$(DEBUG_SDKCONFIG);$(FLASH_SDKCONFIG);boards/$(BOARD)/sdkconfig +SDKCONFIGS = esp-idf-config/$(IDF_TARGET)/sdkconfig.defaults;$(DEBUG_SDKCONFIG);$(FLASH_SDKCONFIG);boards/$(BOARD)/sdkconfig # create the config headers $(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig | $(BUILD)/esp-idf - IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja + IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-$(IDF_TARGET).cmake -DIDF_TARGET=$(IDF_TARGET) -GNinja # build a lib # Adding -d explain -j 1 -v to the ninja line will output debug info #$(BUILD)/esp-idf/esp-idf/%.a: $(BUILD)/esp-idf/config/sdkconfig.h # ninja -C $(BUILD)/esp-idf esp-idf/$*.a -$(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld: $(BUILD)/esp-idf/config/sdkconfig.h - ninja -C $(BUILD)/esp-idf esp-idf/esp32s2/esp32s2_out.ld - -$(BUILD)/esp-idf/esp-idf/esp32s2/ld/esp32s2.project.ld: $(BUILD)/esp-idf/config/sdkconfig.h - ninja -C $(BUILD)/esp-idf esp-idf/esp32s2/ld/esp32s2.project.ld +$(BUILD)/esp-idf/esp-idf/$(IDF_TARGET)/$(IDF_TARGET)_out.ld: $(BUILD)/esp-idf/config/sdkconfig.h + ninja -C $(BUILD)/esp-idf esp-idf/$(IDF_TARGET)/$(IDF_TARGET)_out.ld +$(BUILD)/esp-idf/esp-idf/$(IDF_TARGET)/ld/$(IDF_TARGET).project.ld: $(BUILD)/esp-idf/config/sdkconfig.h + ninja -C $(BUILD)/esp-idf esp-idf/$(IDF_TARGET)/ld/$(IDF_TARGET).project.ld $(BUILD)/esp-idf/partition_table/partition-table.bin: $(BUILD)/esp-idf/config/sdkconfig.h IDF_PATH=$(IDF_PATH) ninja -C $(BUILD)/esp-idf partition_table/partition-table.bin @@ -276,7 +277,7 @@ menuconfig: $(BUILD)/esp-idf/config # qstr builds include headers so we need to make sure they are up to date $(HEADER_BUILD)/qstr.split: | $(BUILD)/esp-idf/config/sdkconfig.h -ESP_IDF_COMPONENTS_LINK = app_update bootloader_support driver efuse esp32s2 esp_adc_cal esp_common esp_event esp_hw_support esp_netif esp_pm esp_ringbuf esp_rom esp_system esp_timer esp-tls esp_wifi freertos hal heap log lwip mbedtls newlib nvs_flash pthread soc spi_flash vfs wpa_supplicant xtensa +ESP_IDF_COMPONENTS_LINK = $(IDF_TARGET) app_update bootloader_support driver efuse esp_adc_cal esp_common esp_event esp_hw_support esp_netif esp_pm esp_ringbuf esp_rom esp_system esp_timer esp-tls esp_wifi freertos hal heap log lwip mbedtls newlib nvs_flash pthread soc spi_flash vfs wpa_supplicant xtensa ESP_IDF_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/$(component)/lib$(component).a) ESP_IDF_WIFI_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_WIFI_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/$(component)/lib$(component).a) @@ -284,12 +285,12 @@ 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/$(IDF_TARGET)/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)) +BINARY_BLOBS += $(addprefix esp-idf/components/esp_wifi/lib/$(IDF_TARGET)/, $(BINARY_WIFI_BLOBS)) -ESP_IDF_COMPONENTS_EXPANDED += 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 +ESP_IDF_COMPONENTS_EXPANDED += esp-idf/components/xtensa/$(IDF_TARGET)/libxt_hal.a +ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/$(IDF_TARGET)/$(IDF_TARGET)_out.ld $(BUILD)/esp-idf/esp-idf/$(IDF_TARGET)/ld/$(IDF_TARGET).project.ld FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE) @@ -305,8 +306,8 @@ esp-idf-stamp: $(BUILD)/esp-idf/config/sdkconfig.h esp-idf/bootloader_support/libbootloader_support.a \ esp-idf/driver/libdriver.a \ esp-idf/efuse/libefuse.a \ - esp-idf/esp32s2/libesp32s2.a \ - esp-idf/esp32s2/ld/esp32s2.project.ld \ + esp-idf/$(IDF_TARGET)/lib$(IDF_TARGET).a \ + esp-idf/$(IDF_TARGET)/ld/$(IDF_TARGET).project.ld \ esp-idf/esp_adc_cal/libesp_adc_cal.a \ esp-idf/esp_common/libesp_common.a \ esp-idf/esp_event/libesp_event.a \ @@ -340,7 +341,7 @@ $(BUILD)/firmware.elf: $(OBJ) | esp-idf-stamp $(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf | tools/build_memory_info.py $(STEPECHO) "Create $@" - $(Q)esptool.py --chip esp32s2 elf2image $(FLASH_FLAGS) --elf-sha256-offset 0xb0 -o $@ $^ + $(Q)esptool.py --chip $(IDF_TARGET) elf2image $(FLASH_FLAGS) --elf-sha256-offset 0xb0 -o $@ $^ $(Q)$(PYTHON3) tools/build_memory_info.py $< $(BUILD)/esp-idf/sdkconfig $@ $(BUILD)/firmware.bin: $(BUILD)/circuitpython-firmware.bin | esp-idf-stamp @@ -351,10 +352,10 @@ $(BUILD)/firmware.uf2: $(BUILD)/circuitpython-firmware.bin $(Q)$(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xbfdd4eee -b 0x0000 -c -o $@ $^ flash: $(BUILD)/firmware.bin - esptool.py --chip esp32s2 -p $(PORT) $(ESPTOOL_FLAGS) write_flash $(FLASH_FLAGS) 0x0000 $^ + esptool.py --chip $(IDF_TARGET) -p $(PORT) $(ESPTOOL_FLAGS) write_flash $(FLASH_FLAGS) 0x0000 $^ flash-circuitpython-only: $(BUILD)/circuitpython-firmware.bin - esptool.py --chip esp32s2 -p $(PORT) $(ESPTOOL_FLAGS) write_flash $(FLASH_FLAGS) 0x10000 $^ + esptool.py --chip $(IDF_TARGET) -p $(PORT) $(ESPTOOL_FLAGS) write_flash $(FLASH_FLAGS) 0x10000 $^ monitor: $(BUILD)/firmware.elf cp $< build/circuitpython.elf diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.mk index 3290f8cae3..fd8a37c18a 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80EC USB_PRODUCT = "Feather ESP32S2 no PSRAM" USB_MANUFACTURER = "Adafruit" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk index 3ba6f62289..01657b7ffd 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80EE USB_PRODUCT = "Feather ESP32S2 TFT no PSRAM" USB_MANUFACTURER = "Adafruit" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk index b71ff9e558..bcad455108 100644 --- a/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80FA USB_PRODUCT = "FunHouse" USB_MANUFACTURER = "Adafruit" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk index 0a141cbe3e..4acef7fd94 100644 --- a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80E6 USB_PRODUCT = "MagTag" USB_MANUFACTURER = "Adafruit" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk b/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk index e78098d644..a7204b957d 100644 --- a/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80E0 USB_PRODUCT = "Metro ESP32S2" USB_MANUFACTURER = "Adafruit" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk index 08baf474ee..1883b1fbfa 100644 --- a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk +++ b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80A7 USB_PRODUCT = "ESP 12k NodeMCU" USB_MANUFACTURER = "Ai-Thinker" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/artisense_rd00/mpconfigboard.mk b/ports/espressif/boards/artisense_rd00/mpconfigboard.mk index 8b6bfcb8d9..1f9d037ef2 100644 --- a/ports/espressif/boards/artisense_rd00/mpconfigboard.mk +++ b/ports/espressif/boards/artisense_rd00/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80AF USB_PRODUCT = "Reference Design RD00" USB_MANUFACTURER = "Artisense" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.mk b/ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.mk index 9a5d947e6c..79246b1393 100644 --- a/ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x8009 USB_PRODUCT = "ATMegaZero ESP32-S2" USB_MANUFACTURER = "ATMegaZero" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk index 8eea211d6a..e55ca0e4e8 100644 --- a/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk +++ b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x3141 USB_PRODUCT = "CrumpS2" USB_MANUFACTURER = "CrumpSpace" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk b/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk index 6a6ae7937e..8e2517ba23 100644 --- a/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk +++ b/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0xBAB0 USB_PRODUCT = "Bast WiFi" USB_MANUFACTURER = "ElectronicCats" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk b/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk index f9dbcfeee3..1b11f4fbee 100644 --- a/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x7001 USB_PRODUCT = "ESP32-S2-HMI-DevKit-1" USB_MANUFACTURER = "Espressif" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk index 2dce038819..7823674329 100644 --- a/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80C8 USB_PRODUCT = "Kaluga 1" USB_MANUFACTURER = "Espressif" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk b/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk index 2dce038819..7823674329 100644 --- a/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80C8 USB_PRODUCT = "Kaluga 1" USB_MANUFACTURER = "Espressif" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk index 9c9ca61694..f25cdc4a63 100644 --- a/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80A8 USB_PRODUCT = "Saola 1 w/WROOM" USB_MANUFACTURER = "Espressif" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk index d5ff1c5ac8..b4154bf3a4 100644 --- a/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80A6 USB_PRODUCT = "Saola 1 w/WROVER" USB_MANUFACTURER = "Espressif" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk b/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk index fc6c62257a..f1ed49a32a 100644 --- a/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80AA USB_PRODUCT = "Franzininho WIFI w/Wroom" USB_MANUFACTURER = "Espressif" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk b/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk index c0c47cef10..1478332fac 100644 --- a/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80AD USB_PRODUCT = "Franzininho WIFI w/Wrover" USB_MANUFACTURER = "Espressif" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk index 3e1fa2526a..ad9bce8cc0 100644 --- a/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80A4 USB_PRODUCT = "Cucumber M" USB_MANUFACTURER = "Gravitech" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk index 7a0d84a311..c96ac0dc09 100644 --- a/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80A7 USB_PRODUCT = "Cucumber MS" USB_MANUFACTURER = "Gravitech" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk index 018742b469..51f5fe468f 100644 --- a/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80A1 USB_PRODUCT = "Cucumber R" USB_MANUFACTURER = "Gravitech" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk index 807dcaabbf..6cb8d13d8e 100644 --- a/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x800D USB_PRODUCT = "Cucumber RS" USB_MANUFACTURER = "Gravitech" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk index 79b45fd92c..c7795bbdeb 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x8007 USB_PRODUCT = "TTGO T8 ESP32-S2" USB_MANUFACTURER = "LILYGO" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/lolin_s2_mini/mpconfigboard.mk b/ports/espressif/boards/lolin_s2_mini/mpconfigboard.mk index e4c7aacadd..5e40a1e13c 100644 --- a/ports/espressif/boards/lolin_s2_mini/mpconfigboard.mk +++ b/ports/espressif/boards/lolin_s2_mini/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80C3 USB_PRODUCT = "S2 Mini" USB_MANUFACTURER = "Lolin" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/microdev_micro_s2/mpconfigboard.mk b/ports/espressif/boards/microdev_micro_s2/mpconfigboard.mk index 783e7ad4c7..28d5e047dc 100644 --- a/ports/espressif/boards/microdev_micro_s2/mpconfigboard.mk +++ b/ports/espressif/boards/microdev_micro_s2/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80C6 USB_PRODUCT = "microS2" USB_MANUFACTURER = "microDev" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk b/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk index aee744ca1a..567f2ddea1 100644 --- a/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk +++ b/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80B7 USB_PRODUCT = "MORPHESP-240" USB_MANUFACTURER = "MORPHEANS" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk index 736bbb5adc..7385906921 100644 --- a/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80DE USB_PRODUCT = "nanoESP32-S2 w/Wroom" USB_MANUFACTURER = "Muselab" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk index 9904a06e4b..6060a5c581 100644 --- a/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80B2 USB_PRODUCT = "nanoESP32-S2 w/Wrover" USB_MANUFACTURER = "Muselab" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk b/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk index c3880b6ae9..f4c0be83dc 100644 --- a/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk +++ b/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x4DF0 USB_PRODUCT = "Pixelwing ESP32S2" USB_MANUFACTURER = "Oak Dev Tech" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk b/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk index f88cb75d25..a64f49c144 100644 --- a/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x3252 USB_PRODUCT = "Targett Module Clip w/Wroom" USB_MANUFACTURER = "Targett" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk b/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk index e2dc155846..6683acac15 100644 --- a/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x3253 USB_PRODUCT = "Targett Module Clip w/Wrover" USB_MANUFACTURER = "Targett" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk index d045cc2149..84c9787733 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80AC USB_PRODUCT = "FeatherS2" USB_MANUFACTURER = "UnexpectedMaker" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk index a3ec63eaf3..cef7355051 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80B5 USB_PRODUCT = "FeatherS2 Neo" USB_MANUFACTURER = "UnexpectedMaker" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk index d045cc2149..84c9787733 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x80AC USB_PRODUCT = "FeatherS2" USB_MANUFACTURER = "UnexpectedMaker" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk index 91fa9dcbe3..ead608e6b2 100644 --- a/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk @@ -3,6 +3,8 @@ USB_PID = 0x8002 USB_PRODUCT = "TinyS2" USB_MANUFACTURER = "UnexpectedMaker" +IDF_TARGET = esp32s2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ