diff --git a/lib/lib_basic/NeoPixelBus/src/internal/Esp32_i2s.c b/lib/lib_basic/NeoPixelBus/src/internal/Esp32_i2s.c index 9a2a268916d6..74a1ace8c24d 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/Esp32_i2s.c +++ b/lib/lib_basic/NeoPixelBus/src/internal/Esp32_i2s.c @@ -43,6 +43,7 @@ #include "soc/io_mux_reg.h" #if ESP_IDF_VERSION_MAJOR>=5 #include "soc/rtc_cntl_periph.h" +#include "soc/periph_defs.h" #else #include "soc/rtc_cntl_reg.h" #include "soc/sens_reg.h" @@ -60,7 +61,7 @@ #include "Esp32_i2s.h" #include "esp32-hal.h" -#if ESP_IDF_VERSION_MAJOR<=4 +#if ESP_IDF_VERSION_MAJOR<=4 || ESP_IDF_VERSION_MAJOR>=5 #define I2S_BASE_CLK (160000000L) #endif @@ -99,7 +100,11 @@ typedef struct { int8_t in; uint32_t rate; intr_handle_t isr_handle; +#if ESP_IDF_VERSION_MAJOR >= 5 + QueueHandle_t tx_queue; +#else xQueueHandle tx_queue; +#endif uint8_t* silence_buf; size_t silence_len; @@ -116,6 +121,10 @@ typedef struct { #define I2s_Is_Pending 1 #define I2s_Is_Sending 2 +#if ESP_IDF_VERSION_MAJOR >= 5 +#define I2S_NUM_MAX I2S_NUM_AUTO // not 100% correct +#endif + static uint8_t i2s_silence_buf[I2S_DMA_SILENCE_SIZE] = { 0 }; #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32I2sMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32I2sMethod.h index acc08ddc31d7..330c4153bf43 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32I2sMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32I2sMethod.h @@ -33,6 +33,7 @@ extern "C" { #include #include "Esp32_i2s.h" +#include "rom/gpio.h" } const uint16_t c_dmaBytesPerPixelBytes = 4; diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoEspBitBangMethod.cpp b/lib/lib_basic/NeoPixelBus/src/internal/NeoEspBitBangMethod.cpp index d29e121a334f..43cedf23933e 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/NeoEspBitBangMethod.cpp +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEspBitBangMethod.cpp @@ -31,6 +31,7 @@ License along with NeoPixel. If not, see // ESP32C3 I2S is not supported yet #if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C2) && !defined(CONFIG_IDF_TARGET_ESP32C6) +#include "soc/gpio_periph.h" static inline uint32_t getCycleCount(void) { uint32_t ccount; diff --git a/lib/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.h b/lib/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.h index 07bc9c2d5c2e..8cae8d49955d 100644 --- a/lib/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.h +++ b/lib/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.h @@ -126,7 +126,12 @@ uint32_t analogGetTimerFrequency(uint8_t timer); #define ESPhttpUpdate httpUpdate +#if ESP_IDF_VERSION_MAJOR >= 5 +#include "rom/ets_sys.h" +#else #define os_delay_us ets_delay_us +#endif + // Serial minimal type to hold the config typedef int SerConfu8; //typedef int SerialConfig; // Will be replaced enum in esp32_hal-uart.h (#7926) diff --git a/platformio_tasmota_core3_env.ini b/platformio_tasmota_core3_env.ini index fad1286b5a9f..bac5b6aea3d9 100644 --- a/platformio_tasmota_core3_env.ini +++ b/platformio_tasmota_core3_env.ini @@ -20,7 +20,7 @@ [core32] ; *** Uncomment the line below to use Arduino Core 3.0 !! -;platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5 +platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5 [esp32_arduino30] @@ -37,7 +37,6 @@ monitor_filters = esp32_exception_decoder lib_extra_dirs = lib/lib_ssl, lib/lib_basic, lib/libesp32 lib_ignore = ESP Mail Client IRremoteESP8266 - NeoPixelBus MFRC522 universal display Library ESP8266Audio @@ -53,7 +52,6 @@ monitor_filters = esp32_exception_decoder lib_extra_dirs = lib/lib_ssl, lib/lib_basic, lib/libesp32 lib_ignore = ESP Mail Client IRremoteESP8266 - NeoPixelBus MFRC522 universal display Library ESP8266Audio @@ -69,7 +67,6 @@ monitor_filters = esp32_exception_decoder lib_extra_dirs = lib/lib_ssl, lib/lib_basic, lib/libesp32 lib_ignore = ESP Mail Client IRremoteESP8266 - NeoPixelBus MFRC522 universal display Library ESP8266Audio @@ -111,7 +108,6 @@ lib_extra_dirs = lib/lib_ssl, lib/lib_basic, lib/libesp32 lib_ignore = ESP Mail Client IRremoteESP8266 - NeoPixelBus MFRC522 universal display Library ESP8266Audio diff --git a/tasmota/include/tasmota_configurations_ESP32.h b/tasmota/include/tasmota_configurations_ESP32.h index 737683bf73ba..3fe1a360e0f0 100644 --- a/tasmota/include/tasmota_configurations_ESP32.h +++ b/tasmota/include/tasmota_configurations_ESP32.h @@ -237,8 +237,8 @@ #undef USE_SONOFF_D1 // Disable support for Sonoff D1 Dimmer (+0k7 code) #undef USE_SHELLY_DIMMER // Disable support for Shelly Dimmer (+3k code) -#undef USE_LIGHT // Disable support for lights -#undef USE_WS2812 +#define USE_LIGHT // Disable support for lights +#define USE_WS2812 #define USE_DS18x20 // Enable DS18x20 sensor diff --git a/tasmota/tasmota_xlgt_light/xlgt_02_my92x1.ino b/tasmota/tasmota_xlgt_light/xlgt_02_my92x1.ino index ec72df8d89b2..6eacca0ff5d4 100644 --- a/tasmota/tasmota_xlgt_light/xlgt_02_my92x1.ino +++ b/tasmota/tasmota_xlgt_light/xlgt_02_my92x1.ino @@ -31,9 +31,17 @@ struct MY92X1 { uint8_t model = 0; } My92x1; +#if ESP_IDF_VERSION_MAJOR >= 5 +#include "rom/ets_sys.h" +#ifndef os_delay_us +#define os_delay_us ets_delay_us +#endif //os_delay_us +#else extern "C" { void os_delay_us(unsigned int); } +#endif + void LightDiPulse(uint8_t times) {