From cb6607a169c7da72c009e1e4ba6219c64da5e3f2 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Sat, 24 Apr 2021 22:24:14 +0200 Subject: [PATCH] Added new partition scheme for ESP32 WROVER (code size >1.3M) Updated bus_wrapper for ESP32-S2 (use #define ARDUINO_ARCH_ESP32S2) Removed DallasTemperature.h from Temperature usermod. --- partitions_wrover.csv | 6 + platformio.ini | 10 +- usermods/Temperature/usermod_temperature.h | 3 +- wled00/bus_wrapper.h | 149 +++++++++++++++++++++ wled00/const.h | 14 +- 5 files changed, 174 insertions(+), 8 deletions(-) create mode 100644 partitions_wrover.csv diff --git a/partitions_wrover.csv b/partitions_wrover.csv new file mode 100644 index 00000000..a179a89d --- /dev/null +++ b/partitions_wrover.csv @@ -0,0 +1,6 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0x180000, +app1, app, ota_1, 0x190000,0x180000, +spiffs, data, spiffs, 0x310000,0xF0000, diff --git a/platformio.ini b/platformio.ini index 160e8d02..217d90c0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -47,7 +47,7 @@ extra_configs = # arduino core 2.7.0 = platformIO 2.5.0 # ------------------------------------------------------------------------------ arduino_core_2_6_3 = espressif8266@2.3.3 -arduino_core_2_7_4 = espressif8266@2.6.2 +arduino_core_2_7_4 = espressif8266@^2.6.2 # Development platforms arduino_core_develop = https://github.com/platformio/platform-espressif8266#develop @@ -150,6 +150,12 @@ build_flags = -g -DARDUINO_ARCH_ESP32 -DCONFIG_LITTLEFS_FOR_IDF_3_2 +[esp32s2] +build_flags = -g + -DARDUINO_ARCH_ESP32 + -DARDUINO_ARCH_ESP32S2 + -DCONFIG_LITTLEFS_FOR_IDF_3_2 + [scripts_defaults] extra_scripts = pre:pio-scripts/set_version.py @@ -192,7 +198,7 @@ lib_deps = U8g2@~2.27.2 #For Dallas sensor uncomment following 2 lines OneWire@~2.3.5 - milesburton/DallasTemperature@^3.9.0 + ; milesburton/DallasTemperature@^3.9.0 #For BME280 sensor uncomment following #BME280@~3.0.0 ; adafruit/Adafruit BMP280 Library @ 2.1.0 diff --git a/usermods/Temperature/usermod_temperature.h b/usermods/Temperature/usermod_temperature.h index 176fc3dd..cd2211ba 100644 --- a/usermods/Temperature/usermod_temperature.h +++ b/usermods/Temperature/usermod_temperature.h @@ -2,7 +2,8 @@ #include "wled.h" -#include //DS18B20 +//#include //DS18B20 +#include "OneWire.h" //Pin defaults for QuinLed Dig-Uno if not overriden #ifndef TEMPERATURE_PIN diff --git a/wled00/bus_wrapper.h b/wled00/bus_wrapper.h index a5e34c7f..81698709 100644 --- a/wled00/bus_wrapper.h +++ b/wled00/bus_wrapper.h @@ -131,45 +131,61 @@ #define B_32_R1_NEO_3 NeoPixelBrightnessBus #define B_32_R2_NEO_3 NeoPixelBrightnessBus #define B_32_R3_NEO_3 NeoPixelBrightnessBus +#ifndef ARDUINO_ARCH_ESP32S2 #define B_32_R4_NEO_3 NeoPixelBrightnessBus #define B_32_R5_NEO_3 NeoPixelBrightnessBus #define B_32_R6_NEO_3 NeoPixelBrightnessBus #define B_32_R7_NEO_3 NeoPixelBrightnessBus +#endif #define B_32_I0_NEO_3 NeoPixelBrightnessBus +#ifndef ARDUINO_ARCH_ESP32S2 #define B_32_I1_NEO_3 NeoPixelBrightnessBus +#endif //RGBW #define B_32_R0_NEO_4 NeoPixelBrightnessBus #define B_32_R1_NEO_4 NeoPixelBrightnessBus #define B_32_R2_NEO_4 NeoPixelBrightnessBus #define B_32_R3_NEO_4 NeoPixelBrightnessBus +#ifndef ARDUINO_ARCH_ESP32S2 #define B_32_R4_NEO_4 NeoPixelBrightnessBus #define B_32_R5_NEO_4 NeoPixelBrightnessBus #define B_32_R6_NEO_4 NeoPixelBrightnessBus #define B_32_R7_NEO_4 NeoPixelBrightnessBus +#endif #define B_32_I0_NEO_4 NeoPixelBrightnessBus +#ifndef ARDUINO_ARCH_ESP32S2 #define B_32_I1_NEO_4 NeoPixelBrightnessBus +#endif //400Kbps #define B_32_R0_400_3 NeoPixelBrightnessBus #define B_32_R1_400_3 NeoPixelBrightnessBus #define B_32_R2_400_3 NeoPixelBrightnessBus #define B_32_R3_400_3 NeoPixelBrightnessBus +#ifndef ARDUINO_ARCH_ESP32S2 #define B_32_R4_400_3 NeoPixelBrightnessBus #define B_32_R5_400_3 NeoPixelBrightnessBus #define B_32_R6_400_3 NeoPixelBrightnessBus #define B_32_R7_400_3 NeoPixelBrightnessBus +#endif #define B_32_I0_400_3 NeoPixelBrightnessBus +#ifndef ARDUINO_ARCH_ESP32S2 #define B_32_I1_400_3 NeoPixelBrightnessBus +#endif //TM1814 (RGBW) #define B_32_R0_TM1_4 NeoPixelBrightnessBus #define B_32_R1_TM1_4 NeoPixelBrightnessBus #define B_32_R2_TM1_4 NeoPixelBrightnessBus #define B_32_R3_TM1_4 NeoPixelBrightnessBus +#ifndef ARDUINO_ARCH_ESP32S2 #define B_32_R4_TM1_4 NeoPixelBrightnessBus #define B_32_R5_TM1_4 NeoPixelBrightnessBus #define B_32_R6_TM1_4 NeoPixelBrightnessBus #define B_32_R7_TM1_4 NeoPixelBrightnessBus +#endif #define B_32_I0_TM1_4 NeoPixelBrightnessBus +#ifndef ARDUINO_ARCH_ESP32S2 #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) #endif @@ -237,42 +253,58 @@ class PolyBus { case I_32_R1_NEO_3: (static_cast(busPtr))->Begin(); break; case I_32_R2_NEO_3: (static_cast(busPtr))->Begin(); break; case I_32_R3_NEO_3: (static_cast(busPtr))->Begin(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_3: (static_cast(busPtr))->Begin(); break; case I_32_R5_NEO_3: (static_cast(busPtr))->Begin(); break; case I_32_R6_NEO_3: (static_cast(busPtr))->Begin(); break; case I_32_R7_NEO_3: (static_cast(busPtr))->Begin(); break; + #endif case I_32_I0_NEO_3: (static_cast(busPtr))->Begin(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_3: (static_cast(busPtr))->Begin(); break; + #endif case I_32_R0_NEO_4: (static_cast(busPtr))->Begin(); break; case I_32_R1_NEO_4: (static_cast(busPtr))->Begin(); break; case I_32_R2_NEO_4: (static_cast(busPtr))->Begin(); break; case I_32_R3_NEO_4: (static_cast(busPtr))->Begin(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_4: (static_cast(busPtr))->Begin(); break; case I_32_R5_NEO_4: (static_cast(busPtr))->Begin(); break; case I_32_R6_NEO_4: (static_cast(busPtr))->Begin(); break; case I_32_R7_NEO_4: (static_cast(busPtr))->Begin(); break; + #endif case I_32_I0_NEO_4: (static_cast(busPtr))->Begin(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_4: (static_cast(busPtr))->Begin(); break; + #endif case I_32_R0_400_3: (static_cast(busPtr))->Begin(); break; case I_32_R1_400_3: (static_cast(busPtr))->Begin(); break; case I_32_R2_400_3: (static_cast(busPtr))->Begin(); break; case I_32_R3_400_3: (static_cast(busPtr))->Begin(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_400_3: (static_cast(busPtr))->Begin(); break; case I_32_R5_400_3: (static_cast(busPtr))->Begin(); break; case I_32_R6_400_3: (static_cast(busPtr))->Begin(); break; case I_32_R7_400_3: (static_cast(busPtr))->Begin(); break; + #endif case I_32_I0_400_3: (static_cast(busPtr))->Begin(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_400_3: (static_cast(busPtr))->Begin(); break; + #endif case I_32_R0_TM1_4: beginTM1814(busPtr); break; case I_32_R1_TM1_4: beginTM1814(busPtr); break; case I_32_R2_TM1_4: beginTM1814(busPtr); break; case I_32_R3_TM1_4: beginTM1814(busPtr); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_TM1_4: beginTM1814(busPtr); break; case I_32_R5_TM1_4: beginTM1814(busPtr); break; case I_32_R6_TM1_4: beginTM1814(busPtr); break; case I_32_R7_TM1_4: beginTM1814(busPtr); break; + #endif case I_32_I0_TM1_4: beginTM1814(busPtr); break; + #ifndef ARDUINO_ARCH_ESP32S2 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() case I_HS_DOT_3: (static_cast(busPtr))->Begin(pins[1], -1, pins[0], -1); break; case I_HS_DOT_4: (static_cast(busPtr))->Begin(pins[1], -1, pins[0], -1); break; @@ -314,42 +346,58 @@ class PolyBus { case I_32_R1_NEO_3: busPtr = new B_32_R1_NEO_3(len, pins[0]); break; case I_32_R2_NEO_3: busPtr = new B_32_R2_NEO_3(len, pins[0]); break; case I_32_R3_NEO_3: busPtr = new B_32_R3_NEO_3(len, pins[0]); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_3: busPtr = new B_32_R4_NEO_3(len, pins[0]); break; case I_32_R5_NEO_3: busPtr = new B_32_R5_NEO_3(len, pins[0]); break; case I_32_R6_NEO_3: busPtr = new B_32_R6_NEO_3(len, pins[0]); break; case I_32_R7_NEO_3: busPtr = new B_32_R7_NEO_3(len, pins[0]); break; + #endif case I_32_I0_NEO_3: busPtr = new B_32_I0_NEO_3(len, pins[0]); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_3: busPtr = new B_32_I1_NEO_3(len, pins[0]); break; + #endif case I_32_R0_NEO_4: busPtr = new B_32_R0_NEO_4(len, pins[0]); break; case I_32_R1_NEO_4: busPtr = new B_32_R1_NEO_4(len, pins[0]); break; case I_32_R2_NEO_4: busPtr = new B_32_R2_NEO_4(len, pins[0]); break; case I_32_R3_NEO_4: busPtr = new B_32_R3_NEO_4(len, pins[0]); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_4: busPtr = new B_32_R4_NEO_4(len, pins[0]); break; case I_32_R5_NEO_4: busPtr = new B_32_R5_NEO_4(len, pins[0]); break; case I_32_R6_NEO_4: busPtr = new B_32_R6_NEO_4(len, pins[0]); break; case I_32_R7_NEO_4: busPtr = new B_32_R7_NEO_4(len, pins[0]); break; + #endif case I_32_I0_NEO_4: busPtr = new B_32_I0_NEO_4(len, pins[0]); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_4: busPtr = new B_32_I1_NEO_4(len, pins[0]); break; + #endif case I_32_R0_400_3: busPtr = new B_32_R0_400_3(len, pins[0]); break; case I_32_R1_400_3: busPtr = new B_32_R1_400_3(len, pins[0]); break; case I_32_R2_400_3: busPtr = new B_32_R2_400_3(len, pins[0]); break; case I_32_R3_400_3: busPtr = new B_32_R3_400_3(len, pins[0]); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_400_3: busPtr = new B_32_R4_400_3(len, pins[0]); break; case I_32_R5_400_3: busPtr = new B_32_R5_400_3(len, pins[0]); break; case I_32_R6_400_3: busPtr = new B_32_R6_400_3(len, pins[0]); break; case I_32_R7_400_3: busPtr = new B_32_R7_400_3(len, pins[0]); break; + #endif case I_32_I0_400_3: busPtr = new B_32_I0_400_3(len, pins[0]); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_400_3: busPtr = new B_32_I1_400_3(len, pins[0]); break; + #endif case I_32_R0_TM1_4: busPtr = new B_32_R0_TM1_4(len, pins[0]); break; case I_32_R1_TM1_4: busPtr = new B_32_R1_TM1_4(len, pins[0]); break; case I_32_R2_TM1_4: busPtr = new B_32_R2_TM1_4(len, pins[0]); break; case I_32_R3_TM1_4: busPtr = new B_32_R3_TM1_4(len, pins[0]); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_TM1_4: busPtr = new B_32_R4_TM1_4(len, pins[0]); break; case I_32_R5_TM1_4: busPtr = new B_32_R5_TM1_4(len, pins[0]); break; case I_32_R6_TM1_4: busPtr = new B_32_R6_TM1_4(len, pins[0]); break; case I_32_R7_TM1_4: busPtr = new B_32_R7_TM1_4(len, pins[0]); break; + #endif case I_32_I0_TM1_4: busPtr = new B_32_I0_TM1_4(len, pins[0]); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_TM1_4: busPtr = new B_32_I1_TM1_4(len, pins[0]); break; + #endif #endif // for 2-wire: pins[1] is clk, pins[0] is dat. begin expects (len, clk, dat) case I_HS_DOT_3: busPtr = new B_HS_DOT_3(len, pins[1], pins[0]); break; @@ -392,42 +440,58 @@ class PolyBus { case I_32_R1_NEO_3: (static_cast(busPtr))->Show(); break; case I_32_R2_NEO_3: (static_cast(busPtr))->Show(); break; case I_32_R3_NEO_3: (static_cast(busPtr))->Show(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_3: (static_cast(busPtr))->Show(); break; case I_32_R5_NEO_3: (static_cast(busPtr))->Show(); break; case I_32_R6_NEO_3: (static_cast(busPtr))->Show(); break; case I_32_R7_NEO_3: (static_cast(busPtr))->Show(); break; + #endif case I_32_I0_NEO_3: (static_cast(busPtr))->Show(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_3: (static_cast(busPtr))->Show(); break; + #endif case I_32_R0_NEO_4: (static_cast(busPtr))->Show(); break; case I_32_R1_NEO_4: (static_cast(busPtr))->Show(); break; case I_32_R2_NEO_4: (static_cast(busPtr))->Show(); break; case I_32_R3_NEO_4: (static_cast(busPtr))->Show(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_4: (static_cast(busPtr))->Show(); break; case I_32_R5_NEO_4: (static_cast(busPtr))->Show(); break; case I_32_R6_NEO_4: (static_cast(busPtr))->Show(); break; case I_32_R7_NEO_4: (static_cast(busPtr))->Show(); break; + #endif case I_32_I0_NEO_4: (static_cast(busPtr))->Show(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_4: (static_cast(busPtr))->Show(); break; + #endif case I_32_R0_400_3: (static_cast(busPtr))->Show(); break; case I_32_R1_400_3: (static_cast(busPtr))->Show(); break; case I_32_R2_400_3: (static_cast(busPtr))->Show(); break; case I_32_R3_400_3: (static_cast(busPtr))->Show(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_400_3: (static_cast(busPtr))->Show(); break; case I_32_R5_400_3: (static_cast(busPtr))->Show(); break; case I_32_R6_400_3: (static_cast(busPtr))->Show(); break; case I_32_R7_400_3: (static_cast(busPtr))->Show(); break; + #endif case I_32_I0_400_3: (static_cast(busPtr))->Show(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_400_3: (static_cast(busPtr))->Show(); break; + #endif case I_32_R0_TM1_4: (static_cast(busPtr))->Show(); break; case I_32_R1_TM1_4: (static_cast(busPtr))->Show(); break; case I_32_R2_TM1_4: (static_cast(busPtr))->Show(); break; case I_32_R3_TM1_4: (static_cast(busPtr))->Show(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_TM1_4: (static_cast(busPtr))->Show(); break; case I_32_R5_TM1_4: (static_cast(busPtr))->Show(); break; case I_32_R6_TM1_4: (static_cast(busPtr))->Show(); break; case I_32_R7_TM1_4: (static_cast(busPtr))->Show(); break; + #endif case I_32_I0_TM1_4: (static_cast(busPtr))->Show(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_TM1_4: (static_cast(busPtr))->Show(); break; + #endif #endif case I_HS_DOT_3: (static_cast(busPtr))->Show(); break; case I_SS_DOT_3: (static_cast(busPtr))->Show(); break; @@ -467,42 +531,58 @@ class PolyBus { case I_32_R1_NEO_3: return (static_cast(busPtr))->CanShow(); break; case I_32_R2_NEO_3: return (static_cast(busPtr))->CanShow(); break; case I_32_R3_NEO_3: return (static_cast(busPtr))->CanShow(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_3: return (static_cast(busPtr))->CanShow(); break; case I_32_R5_NEO_3: return (static_cast(busPtr))->CanShow(); break; case I_32_R6_NEO_3: return (static_cast(busPtr))->CanShow(); break; case I_32_R7_NEO_3: return (static_cast(busPtr))->CanShow(); break; + #endif case I_32_I0_NEO_3: return (static_cast(busPtr))->CanShow(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_3: return (static_cast(busPtr))->CanShow(); break; + #endif case I_32_R0_NEO_4: return (static_cast(busPtr))->CanShow(); break; case I_32_R1_NEO_4: return (static_cast(busPtr))->CanShow(); break; case I_32_R2_NEO_4: return (static_cast(busPtr))->CanShow(); break; case I_32_R3_NEO_4: return (static_cast(busPtr))->CanShow(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_4: return (static_cast(busPtr))->CanShow(); break; case I_32_R5_NEO_4: return (static_cast(busPtr))->CanShow(); break; case I_32_R6_NEO_4: return (static_cast(busPtr))->CanShow(); break; case I_32_R7_NEO_4: return (static_cast(busPtr))->CanShow(); break; + #endif case I_32_I0_NEO_4: return (static_cast(busPtr))->CanShow(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_4: return (static_cast(busPtr))->CanShow(); break; + #endif case I_32_R0_400_3: return (static_cast(busPtr))->CanShow(); break; case I_32_R1_400_3: return (static_cast(busPtr))->CanShow(); break; case I_32_R2_400_3: return (static_cast(busPtr))->CanShow(); break; case I_32_R3_400_3: return (static_cast(busPtr))->CanShow(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_400_3: return (static_cast(busPtr))->CanShow(); break; case I_32_R5_400_3: return (static_cast(busPtr))->CanShow(); break; case I_32_R6_400_3: return (static_cast(busPtr))->CanShow(); break; case I_32_R7_400_3: return (static_cast(busPtr))->CanShow(); break; + #endif case I_32_I0_400_3: return (static_cast(busPtr))->CanShow(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_400_3: return (static_cast(busPtr))->CanShow(); break; + #endif case I_32_R0_TM1_4: return (static_cast(busPtr))->CanShow(); break; case I_32_R1_TM1_4: return (static_cast(busPtr))->CanShow(); break; case I_32_R2_TM1_4: return (static_cast(busPtr))->CanShow(); break; case I_32_R3_TM1_4: return (static_cast(busPtr))->CanShow(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_TM1_4: return (static_cast(busPtr))->CanShow(); break; case I_32_R5_TM1_4: return (static_cast(busPtr))->CanShow(); break; case I_32_R6_TM1_4: return (static_cast(busPtr))->CanShow(); break; case I_32_R7_TM1_4: return (static_cast(busPtr))->CanShow(); break; + #endif case I_32_I0_TM1_4: return (static_cast(busPtr))->CanShow(); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_TM1_4: return (static_cast(busPtr))->CanShow(); break; + #endif #endif case I_HS_DOT_3: return (static_cast(busPtr))->CanShow(); break; case I_SS_DOT_3: return (static_cast(busPtr))->CanShow(); break; @@ -561,42 +641,58 @@ class PolyBus { case I_32_R1_NEO_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_R2_NEO_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_R3_NEO_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_R5_NEO_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_R6_NEO_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_R7_NEO_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; + #endif case I_32_I0_NEO_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; + #endif case I_32_R0_NEO_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; case I_32_R1_NEO_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; case I_32_R2_NEO_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; case I_32_R3_NEO_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; case I_32_R5_NEO_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; case I_32_R6_NEO_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; case I_32_R7_NEO_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; + #endif case I_32_I0_NEO_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; + #endif case I_32_R0_400_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_R1_400_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_R2_400_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_R3_400_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_400_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_R5_400_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_R6_400_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_R7_400_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; + #endif case I_32_I0_400_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_400_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; + #endif case I_32_R0_TM1_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; case I_32_R1_TM1_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; case I_32_R2_TM1_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; case I_32_R3_TM1_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_TM1_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; case I_32_R5_TM1_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; case I_32_R6_TM1_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; case I_32_R7_TM1_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; + #endif case I_32_I0_TM1_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_TM1_4: (static_cast(busPtr))->SetPixelColor(pix, col); break; + #endif #endif case I_HS_DOT_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_SS_DOT_3: (static_cast(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; @@ -636,42 +732,58 @@ class PolyBus { case I_32_R1_NEO_3: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R2_NEO_3: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R3_NEO_3: (static_cast(busPtr))->SetBrightness(b); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_3: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R5_NEO_3: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R6_NEO_3: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R7_NEO_3: (static_cast(busPtr))->SetBrightness(b); break; + #endif case I_32_I0_NEO_3: (static_cast(busPtr))->SetBrightness(b); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_3: (static_cast(busPtr))->SetBrightness(b); break; + #endif case I_32_R0_NEO_4: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R1_NEO_4: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R2_NEO_4: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R3_NEO_4: (static_cast(busPtr))->SetBrightness(b); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_4: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R5_NEO_4: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R6_NEO_4: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R7_NEO_4: (static_cast(busPtr))->SetBrightness(b); break; + #endif case I_32_I0_NEO_4: (static_cast(busPtr))->SetBrightness(b); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_4: (static_cast(busPtr))->SetBrightness(b); break; + #endif case I_32_R0_400_3: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R1_400_3: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R2_400_3: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R3_400_3: (static_cast(busPtr))->SetBrightness(b); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_400_3: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R5_400_3: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R6_400_3: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R7_400_3: (static_cast(busPtr))->SetBrightness(b); break; + #endif case I_32_I0_400_3: (static_cast(busPtr))->SetBrightness(b); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_400_3: (static_cast(busPtr))->SetBrightness(b); break; + #endif case I_32_R0_TM1_4: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R1_TM1_4: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R2_TM1_4: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R3_TM1_4: (static_cast(busPtr))->SetBrightness(b); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_TM1_4: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R5_TM1_4: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R6_TM1_4: (static_cast(busPtr))->SetBrightness(b); break; case I_32_R7_TM1_4: (static_cast(busPtr))->SetBrightness(b); break; + #endif case I_32_I0_TM1_4: (static_cast(busPtr))->SetBrightness(b); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_TM1_4: (static_cast(busPtr))->SetBrightness(b); break; + #endif #endif case I_HS_DOT_3: (static_cast(busPtr))->SetBrightness(b); break; case I_SS_DOT_3: (static_cast(busPtr))->SetBrightness(b); break; @@ -712,42 +824,58 @@ class PolyBus { case I_32_R1_NEO_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R2_NEO_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R3_NEO_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R5_NEO_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R6_NEO_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R7_NEO_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #endif case I_32_I0_NEO_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #endif case I_32_R0_NEO_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R1_NEO_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R2_NEO_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R3_NEO_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R5_NEO_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R6_NEO_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R7_NEO_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #endif case I_32_I0_NEO_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #endif case I_32_R0_400_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R1_400_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R2_400_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R3_400_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_400_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R5_400_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R6_400_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R7_400_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #endif case I_32_I0_400_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_400_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #endif case I_32_R0_TM1_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R1_TM1_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R2_TM1_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R3_TM1_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_TM1_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R5_TM1_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R6_TM1_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_32_R7_TM1_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #endif case I_32_I0_TM1_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_TM1_4: col = (static_cast(busPtr))->GetPixelColor(pix); break; + #endif #endif case I_HS_DOT_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; case I_SS_DOT_3: col = (static_cast(busPtr))->GetPixelColor(pix); break; @@ -801,42 +929,58 @@ class PolyBus { case I_32_R1_NEO_3: delete (static_cast(busPtr)); break; case I_32_R2_NEO_3: delete (static_cast(busPtr)); break; case I_32_R3_NEO_3: delete (static_cast(busPtr)); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_3: delete (static_cast(busPtr)); break; case I_32_R5_NEO_3: delete (static_cast(busPtr)); break; case I_32_R6_NEO_3: delete (static_cast(busPtr)); break; case I_32_R7_NEO_3: delete (static_cast(busPtr)); break; + #endif case I_32_I0_NEO_3: delete (static_cast(busPtr)); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_3: delete (static_cast(busPtr)); break; + #endif case I_32_R0_NEO_4: delete (static_cast(busPtr)); break; case I_32_R1_NEO_4: delete (static_cast(busPtr)); break; case I_32_R2_NEO_4: delete (static_cast(busPtr)); break; case I_32_R3_NEO_4: delete (static_cast(busPtr)); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_NEO_4: delete (static_cast(busPtr)); break; case I_32_R5_NEO_4: delete (static_cast(busPtr)); break; case I_32_R6_NEO_4: delete (static_cast(busPtr)); break; case I_32_R7_NEO_4: delete (static_cast(busPtr)); break; + #endif case I_32_I0_NEO_4: delete (static_cast(busPtr)); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_NEO_4: delete (static_cast(busPtr)); break; + #endif case I_32_R0_400_3: delete (static_cast(busPtr)); break; case I_32_R1_400_3: delete (static_cast(busPtr)); break; case I_32_R2_400_3: delete (static_cast(busPtr)); break; case I_32_R3_400_3: delete (static_cast(busPtr)); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_400_3: delete (static_cast(busPtr)); break; case I_32_R5_400_3: delete (static_cast(busPtr)); break; case I_32_R6_400_3: delete (static_cast(busPtr)); break; case I_32_R7_400_3: delete (static_cast(busPtr)); break; + #endif case I_32_I0_400_3: delete (static_cast(busPtr)); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_400_3: delete (static_cast(busPtr)); break; + #endif case I_32_R0_TM1_4: delete (static_cast(busPtr)); break; case I_32_R1_TM1_4: delete (static_cast(busPtr)); break; case I_32_R2_TM1_4: delete (static_cast(busPtr)); break; case I_32_R3_TM1_4: delete (static_cast(busPtr)); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_R4_TM1_4: delete (static_cast(busPtr)); break; case I_32_R5_TM1_4: delete (static_cast(busPtr)); break; case I_32_R6_TM1_4: delete (static_cast(busPtr)); break; case I_32_R7_TM1_4: delete (static_cast(busPtr)); break; + #endif case I_32_I0_TM1_4: delete (static_cast(busPtr)); break; + #ifndef ARDUINO_ARCH_ESP32S2 case I_32_I1_TM1_4: delete (static_cast(busPtr)); break; + #endif #endif case I_HS_DOT_3: delete (static_cast(busPtr)); break; case I_SS_DOT_3: delete (static_cast(busPtr)); break; @@ -891,7 +1035,12 @@ class PolyBus { } #else //ESP32 uint8_t offset = num; //RMT bus # == bus index in BusManager + #ifndef ARDUINO_ARCH_ESP32S2 if (offset > 9) return I_NONE; + #else + if (offset > 4) return I_NONE; + if (offset > 3) offset += 4; // skip 4 unsupported RMT methods + #endif switch (busType) { case TYPE_WS2812_RGB: case TYPE_WS2812_WWA: diff --git a/wled00/const.h b/wled00/const.h index ae42d429..9592127f 100644 --- a/wled00/const.h +++ b/wled00/const.h @@ -14,11 +14,15 @@ #define WLED_MAX_USERMODS 4 #ifndef WLED_MAX_BUSSES -#ifdef ESP8266 -#define WLED_MAX_BUSSES 3 -#else -#define WLED_MAX_BUSSES 10 -#endif + #ifdef ESP8266 + #define WLED_MAX_BUSSES 3 + #else + #ifdef ARDUINO_ARCH_ESP32S2 + #define WLED_MAX_BUSSES 5 + #else + #define WLED_MAX_BUSSES 10 + #endif + #endif #endif //Usermod IDs