diff --git a/platformio.ini b/platformio.ini index 19ebabfead..8b7bd4f74d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -160,9 +160,9 @@ upload_speed = 115200 # ------------------------------------------------------------------------------ lib_compat_mode = strict lib_deps = - fastled/FastLED @ 3.4.0 - IRremoteESP8266 @ 2.7.18 - https://github.com/Aircoookie/ESPAsyncWebServer.git @ ~2.0.2 + https://github.com/FastLED/FastLED + https://github.com/crankyoldgit/IRremoteESP8266 + https://github.com/Aircoookie/ESPAsyncWebServer.git @ ~2.0.4 #For use of the TTGO T-Display ESP32 Module with integrated TFT display uncomment the following line #TFT_eSPI #For use SSD1306 OLED display uncomment following @@ -229,6 +229,19 @@ lib_deps = makuna/NeoPixelBus @ 2.6.7 https://github.com/pbolduc/AsyncTCP.git @ 1.2.0 +[esp32c3] +build_flags = -g + -DARDUINO_ARCH_ESP32 + -DARDUINO_ARCH_ESP32C3 + -DCONFIG_IDF_TARGET_ESP32C3 + -D CONFIG_ASYNC_TCP_USE_WDT=0 + -DCO + +lib_deps = + ${env.lib_deps} + makuna/NeoPixelBus @ 2.6.7 + https://github.com/pbolduc/AsyncTCP.git @ 1.2.0 + # ------------------------------------------------------------------------------ # WLED BUILDS # ------------------------------------------------------------------------------ @@ -326,6 +339,18 @@ upload_speed = 460800 build_unflags = ${common.build_unflags} lib_deps = ${esp32s2.lib_deps} +[env:esp32c3] +board = esp32-c3-devkitm-1 +platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream +platform_packages = + toolchain-riscv-esp + framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.2 +framework = arduino +board_build.partitions = tools/WLED_ESP32_4MB_1MB_FS.csv +upload_speed = 460800 +build_unflags = ${common.build_unflags} +lib_deps = ${esp32c3.lib_deps} + [env:esp8285_4CH_MagicHome] board = esp8285 platform = ${common.platform_wled_default} diff --git a/wled00/bus_wrapper.h b/wled00/bus_wrapper.h index 362c05859f..4b939a0c92 100644 --- a/wled00/bus_wrapper.h +++ b/wled00/bus_wrapper.h @@ -98,26 +98,34 @@ #ifdef ARDUINO_ARCH_ESP32 //RGB #define B_32_RN_NEO_3 NeoPixelBrightnessBus +#ifndef CONFIG_IDF_TARGET_ESP32C3 #define B_32_I0_NEO_3 NeoPixelBrightnessBus -#ifndef CONFIG_IDF_TARGET_ESP32S2 +#endif +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) #define B_32_I1_NEO_3 NeoPixelBrightnessBus #endif //RGBW #define B_32_RN_NEO_4 NeoPixelBrightnessBus +#ifndef CONFIG_IDF_TARGET_ESP32C3 #define B_32_I0_NEO_4 NeoPixelBrightnessBus -#ifndef CONFIG_IDF_TARGET_ESP32S2 +#endif +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) #define B_32_I1_NEO_4 NeoPixelBrightnessBus #endif //400Kbps #define B_32_RN_400_3 NeoPixelBrightnessBus +#ifndef CONFIG_IDF_TARGET_ESP32C3 #define B_32_I0_400_3 NeoPixelBrightnessBus -#ifndef CONFIG_IDF_TARGET_ESP32S2 +#endif +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) #define B_32_I1_400_3 NeoPixelBrightnessBus #endif //TM1814 (RGBW) #define B_32_RN_TM1_4 NeoPixelBrightnessBus +#ifndef CONFIG_IDF_TARGET_ESP32C3 #define B_32_I0_TM1_4 NeoPixelBrightnessBus -#ifndef CONFIG_IDF_TARGET_ESP32S2 +#endif +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) #define B_32_I1_TM1_4 NeoPixelBrightnessBus #endif //Bit Bang theoratically possible, but very undesirable and not needed (no pin restrictions on RMT and I2S) @@ -181,23 +189,31 @@ class PolyBus { #endif #ifdef ARDUINO_ARCH_ESP32 case I_32_RN_NEO_3: (static_cast(busPtr))->Begin(); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_3: (static_cast(busPtr))->Begin(); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_3: (static_cast(busPtr))->Begin(); break; #endif case I_32_RN_NEO_4: (static_cast(busPtr))->Begin(); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_4: (static_cast(busPtr))->Begin(); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_4: (static_cast(busPtr))->Begin(); break; #endif case I_32_RN_400_3: (static_cast(busPtr))->Begin(); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_400_3: (static_cast(busPtr))->Begin(); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_400_3: (static_cast(busPtr))->Begin(); break; #endif case I_32_RN_TM1_4: beginTM1814(busPtr); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_TM1_4: beginTM1814(busPtr); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_TM1_4: beginTM1814(busPtr); break; #endif // ESP32 can (and should, to avoid inadvertantly driving the chip select signal) specify the pins used for SPI, but only in begin() @@ -236,23 +252,31 @@ class PolyBus { #endif #ifdef ARDUINO_ARCH_ESP32 case I_32_RN_NEO_3: busPtr = new B_32_RN_NEO_3(len, pins[0], (NeoBusChannel)channel); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_3: busPtr = new B_32_I0_NEO_3(len, pins[0]); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_3: busPtr = new B_32_I1_NEO_3(len, pins[0]); break; #endif case I_32_RN_NEO_4: busPtr = new B_32_RN_NEO_4(len, pins[0], (NeoBusChannel)channel); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_4: busPtr = new B_32_I0_NEO_4(len, pins[0]); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_4: busPtr = new B_32_I1_NEO_4(len, pins[0]); break; #endif case I_32_RN_400_3: busPtr = new B_32_RN_400_3(len, pins[0], (NeoBusChannel)channel); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_400_3: busPtr = new B_32_I0_400_3(len, pins[0]); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_400_3: busPtr = new B_32_I1_400_3(len, pins[0]); break; #endif case I_32_RN_TM1_4: busPtr = new B_32_RN_TM1_4(len, pins[0], (NeoBusChannel)channel); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_TM1_4: busPtr = new B_32_I0_TM1_4(len, pins[0]); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_TM1_4: busPtr = new B_32_I1_TM1_4(len, pins[0]); break; #endif #endif @@ -292,23 +316,31 @@ class PolyBus { #endif #ifdef ARDUINO_ARCH_ESP32 case I_32_RN_NEO_3: (static_cast(busPtr))->Show(); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_3: (static_cast(busPtr))->Show(); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_3: (static_cast(busPtr))->Show(); break; #endif case I_32_RN_NEO_4: (static_cast(busPtr))->Show(); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_4: (static_cast(busPtr))->Show(); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_4: (static_cast(busPtr))->Show(); break; #endif case I_32_RN_400_3: (static_cast(busPtr))->Show(); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_400_3: (static_cast(busPtr))->Show(); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_400_3: (static_cast(busPtr))->Show(); break; #endif case I_32_RN_TM1_4: (static_cast(busPtr))->Show(); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_TM1_4: (static_cast(busPtr))->Show(); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_TM1_4: (static_cast(busPtr))->Show(); break; #endif #endif @@ -345,23 +377,31 @@ class PolyBus { #endif #ifdef ARDUINO_ARCH_ESP32 case I_32_RN_NEO_3: return (static_cast(busPtr))->CanShow(); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_3: return (static_cast(busPtr))->CanShow(); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_3: return (static_cast(busPtr))->CanShow(); break; #endif case I_32_RN_NEO_4: return (static_cast(busPtr))->CanShow(); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_4: return (static_cast(busPtr))->CanShow(); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_4: return (static_cast(busPtr))->CanShow(); break; #endif case I_32_RN_400_3: return (static_cast(busPtr))->CanShow(); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_400_3: return (static_cast(busPtr))->CanShow(); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_400_3: return (static_cast(busPtr))->CanShow(); break; #endif case I_32_RN_TM1_4: return (static_cast(busPtr))->CanShow(); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_TM1_4: return (static_cast(busPtr))->CanShow(); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_TM1_4: return (static_cast(busPtr))->CanShow(); break; #endif #endif @@ -422,23 +462,31 @@ class PolyBus { #endif #ifdef ARDUINO_ARCH_ESP32 case I_32_RN_NEO_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; #endif case I_32_RN_NEO_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; #endif case I_32_RN_400_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_400_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_400_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; #endif case I_32_RN_TM1_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_TM1_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_TM1_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; #endif #endif @@ -475,23 +523,31 @@ class PolyBus { #endif #ifdef ARDUINO_ARCH_ESP32 case I_32_RN_NEO_3: (static_cast(busPtr))->SetBrightness(b); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_3: (static_cast(busPtr))->SetBrightness(b); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_3: (static_cast(busPtr))->SetBrightness(b); break; #endif case I_32_RN_NEO_4: (static_cast(busPtr))->SetBrightness(b); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_4: (static_cast(busPtr))->SetBrightness(b); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_4: (static_cast(busPtr))->SetBrightness(b); break; #endif case I_32_RN_400_3: (static_cast(busPtr))->SetBrightness(b); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_400_3: (static_cast(busPtr))->SetBrightness(b); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_400_3: (static_cast(busPtr))->SetBrightness(b); break; #endif case I_32_RN_TM1_4: (static_cast(busPtr))->SetBrightness(b); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_TM1_4: (static_cast(busPtr))->SetBrightness(b); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_TM1_4: (static_cast(busPtr))->SetBrightness(b); break; #endif #endif @@ -529,23 +585,31 @@ class PolyBus { #endif #ifdef ARDUINO_ARCH_ESP32 case I_32_RN_NEO_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; #endif case I_32_RN_NEO_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; #endif case I_32_RN_400_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_400_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_400_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; #endif case I_32_RN_TM1_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_TM1_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_TM1_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; #endif #endif @@ -600,23 +664,31 @@ class PolyBus { #endif #ifdef ARDUINO_ARCH_ESP32 case I_32_RN_NEO_3: delete (static_cast(busPtr)); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_3: delete (static_cast(busPtr)); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_3: delete (static_cast(busPtr)); break; #endif case I_32_RN_NEO_4: delete (static_cast(busPtr)); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_NEO_4: delete (static_cast(busPtr)); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_NEO_4: delete (static_cast(busPtr)); break; #endif case I_32_RN_400_3: delete (static_cast(busPtr)); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_400_3: delete (static_cast(busPtr)); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_400_3: delete (static_cast(busPtr)); break; #endif case I_32_RN_TM1_4: delete (static_cast(busPtr)); break; + #ifndef CONFIG_IDF_TARGET_ESP32C3 case I_32_I0_TM1_4: delete (static_cast(busPtr)); break; - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #endif + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) case I_32_I1_TM1_4: delete (static_cast(busPtr)); break; #endif #endif @@ -692,4 +764,4 @@ class PolyBus { } }; -#endif \ No newline at end of file +#endif diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 4afdf15607..3211dd2cc1 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -571,7 +571,7 @@ void WLED::initConnection() if (staticIP[0] != 0 && staticGateway[0] != 0) { WiFi.config(staticIP, staticGateway, staticSubnet, IPAddress(1, 1, 1, 1)); } else { - WiFi.config(0U, 0U, 0U); + WiFi.config(IPAddress((uint32_t)0), IPAddress((uint32_t)0), IPAddress((uint32_t)0)); } lastReconnectAttempt = millis(); @@ -800,4 +800,4 @@ void WLED::handleStatusLED() } #endif -} \ No newline at end of file +}