diff --git a/src/lgfx/v1/LGFX_Button.hpp b/src/lgfx/v1/LGFX_Button.hpp index 3decc6ba..371898f9 100644 --- a/src/lgfx/v1/LGFX_Button.hpp +++ b/src/lgfx/v1/LGFX_Button.hpp @@ -95,7 +95,7 @@ namespace lgfx static constexpr size_t label_length = 11; char _label[label_length + 1]; // Button text is 11 chars maximum unless long_name used float _textsize_x, _textsize_y; - bool _pressed, _last_press; // Button states + bool _pressed = false, _last_press = false; // Button states }; //---------------------------------------------------------------------------- diff --git a/src/lgfx/v1/platforms/esp32/common.cpp b/src/lgfx/v1/platforms/esp32/common.cpp index df3dd20d..fbc382d6 100644 --- a/src/lgfx/v1/platforms/esp32/common.cpp +++ b/src/lgfx/v1/platforms/esp32/common.cpp @@ -486,13 +486,11 @@ namespace lgfx buscfg.flags = SPICOMMON_BUSFLAG_MASTER; buscfg.intr_flags = 0; #if defined (ESP_IDF_VERSION_VAL) - #if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)) + #if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)) buscfg.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO; - #else - #if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 0)) + #elif (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 0)) buscfg.isr_cpu_id = INTR_CPU_ID_AUTO; #endif - #endif #endif if (ESP_OK != spi_bus_initialize(static_cast(spi_host), &buscfg, dma_channel)) { @@ -830,8 +828,8 @@ namespace lgfx } #if defined (CONFIG_IDF_TARGET_ESP32S3) #if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 3) && ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 1, 0)) \ - || (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 1) && ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(5, 2, 0)) \ - || (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)) + || (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 1) && ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 2, 0)) \ + || (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)) (&dev->comd[0])[index].val = cmd_val; #else (&dev->comd0)[index].val = cmd_val; diff --git a/src/lgfx/v1_autodetect/LGFX_AutoDetect_ESP32_all.hpp b/src/lgfx/v1_autodetect/LGFX_AutoDetect_ESP32_all.hpp index ed7fb5b8..538f0647 100644 --- a/src/lgfx/v1_autodetect/LGFX_AutoDetect_ESP32_all.hpp +++ b/src/lgfx/v1_autodetect/LGFX_AutoDetect_ESP32_all.hpp @@ -3084,7 +3084,13 @@ namespace lgfx { ESP_LOGI(LIBRARY_NAME, "[Autodetect] Sunton_2432S028 (ILI9341)"); - result->panel = new Panel_ILI9341(); + auto p = new Panel_ILI9341(); + result->panel = p; + { + auto cfg = p->config(); + cfg.offset_rotation = 2; + p->config(cfg); + } _detector_Sunton_ESP32_2432S028_t::setup(result); } }; @@ -3095,7 +3101,7 @@ namespace lgfx : _detector_Sunton_ESP32_2432S028_t { board_t::board_Sunton_ESP32_2432S028 , 0x04, 0xFF, 0x85 // ST7789 - , 40000000, 16000000 + , 80000000, 16000000 , GPIO_NUM_13 // MOSI , GPIO_NUM_12 // MISO , GPIO_NUM_14 // SCLK @@ -3112,13 +3118,7 @@ namespace lgfx { ESP_LOGI(LIBRARY_NAME, "[Autodetect] Sunton_2432S028 (ST7789)"); - auto p = new Panel_ST7789(); - { - auto cfg = p->config(); - cfg.offset_rotation = 2; - p->config(cfg); - } - result->panel = p; + result->panel = new Panel_ST7789(); _detector_Sunton_ESP32_2432S028_t::setup(result); auto t = result->panel->getTouch(); {