From 2e2a7423bfc15bd01a934941857c8f7e39686aca Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Wed, 16 Feb 2022 16:59:19 +0100 Subject: [PATCH] Update to Arduino core ESP32 v2.0.2 --- src/dev/esp32/esp32.cpp | 18 ++++-------------- user_setups/esp32/_esp32.ini | 13 +++---------- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/dev/esp32/esp32.cpp b/src/dev/esp32/esp32.cpp index c030e0ce..a8f1b50c 100644 --- a/src/dev/esp32/esp32.cpp +++ b/src/dev/esp32/esp32.cpp @@ -20,7 +20,7 @@ #define BACKLIGHT_CHANNEL 0 -#ifndef ESP32S2 +#if !defined(CONFIG_IDF_TARGET_ESP32S2) uint8_t temprature_sens_read(); #endif @@ -185,11 +185,7 @@ void Esp32Device::set_backlight_pin(uint8_t pin) /* Setup Backlight Control Pin */ if(pin < GPIO_NUM_MAX) { LOG_VERBOSE(TAG_GUI, F("Backlight : Pin %d"), pin); -#ifndef ESP32S2 - ledcSetup(BACKLIGHT_CHANNEL, 20000, 12); -#else - ledcSetup(BACKLIGHT_CHANNEL, 20000, 10); -#endif + ledcSetup(BACKLIGHT_CHANNEL, 2000, 10); ledcAttachPin(pin, BACKLIGHT_CHANNEL); update_backlight(); } else { @@ -222,15 +218,9 @@ bool Esp32Device::get_backlight_power() void Esp32Device::update_backlight() { if(_backlight_pin < GPIO_NUM_MAX) { -#ifndef ESP32S2 - uint32_t duty = _backlight_power ? map(_backlight_level, 0, 255, 0, 4095) : 0; - if(_backlight_invert) duty = 4095 - duty; - ledcWrite(BACKLIGHT_CHANNEL, duty); // ledChannel and value -#else uint32_t duty = _backlight_power ? map(_backlight_level, 0, 255, 0, 1023) : 0; if(_backlight_invert) duty = 1023 - duty; ledcWrite(BACKLIGHT_CHANNEL, duty); // ledChannel and value -#endif } // haspTft.tft.writecommand(0x53); // Write CTRL Display @@ -322,7 +312,7 @@ void Esp32Device::get_info(JsonDocument& doc) void Esp32Device::get_sensors(JsonDocument& doc) { -#ifndef ESP32S2 +#if !defined(CONFIG_IDF_TARGET_ESP32S2) JsonObject sensor = doc.createNestedObject(F("ESP32")); uint32_t temp = (temprature_sens_read() - 32) * 100 / 1.8; sensor[F("Temperature")] = serialized(String(1.0f * temp / 100, 2)); @@ -340,7 +330,7 @@ long Esp32Device::get_uptime() // #warning Building for Lanbon L8 #include "dev/esp32/lanbonl8.h" #elif defined(M5STACK) -// #warning Building for M5Stack core2 + // #warning Building for M5Stack core2 #include "dev/esp32/m5stackcore2.h" #else dev::Esp32Device haspDevice; diff --git a/user_setups/esp32/_esp32.ini b/user_setups/esp32/_esp32.ini index 1081502b..ea718b66 100644 --- a/user_setups/esp32/_esp32.ini +++ b/user_setups/esp32/_esp32.ini @@ -123,18 +123,11 @@ board_upload.maximum_size = 16777216 board_build.partitions = user_setups/esp32/partitions_16MB.csv -; -- The Arduino ESP32 v2.0.1 with 3 available flash sizes: +; -- The Arduino ESP32 v2.0.2 with 3 available flash sizes: [arduino_esp32_v2] framework = arduino -;platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream -;platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-idf-master -platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2idf/platform-espressif32-2.0.2.zip -platform_packages = framework-arduinoespressif32 @ https://github.com/tasmota/arduino-esp32/releases/download/2.0.1/framework-arduinoespressif32-release_IDF4.4.tar.gz - platformio/tool-esptoolpy @ https://github.com/tasmota/esptool/releases/download/v3.2/esptool-v3.2.zip - ;;framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#mem-optimized - ;framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.1 - ;;framework-arduinoespressif32 @ https://github.com/marcovannoord/arduino-esp32.git#idf-release/v4.0 - ;;toolchain-xtensa32 @ 3.80200.200512 +platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.2/platform-tasmota-espressif32-2.0.2.zip +platform_packages = board_build.embed_files = data/edit.htm.gz data/style.css.gz