diff --git a/platformio_tubes.ini b/platformio_tubes.ini index 16cde038b1..39b499cff4 100644 --- a/platformio_tubes.ini +++ b/platformio_tubes.ini @@ -76,6 +76,7 @@ build_flags = -D WLED_RELEASE_NAME=DIG2GO_TUBES ${env:esp32_quinled_dig2go.build_flags} -D FASTLED_ESP32_SPI_BUS=HSPI -D NUM_STRIPS=1 -D DEFAULT_LED_COUNT=150 + -D CHRISTMAS # REMOVE lib_ignore = ESPAsyncTCP ESPAsyncUDP @@ -147,15 +148,14 @@ build_flags = ${env:esp32c3dev.build_flags} [env:esp32-c3-athom_tubes] extends = env:esp32-c3-athom platform = espressif32@6.8.1 +upload_speed = 115200 platform_packages = ;platform = ${tubes_no_mic.platform} ;platform_packages = ${tubes_no_mic.platform_packages} build_unflags = ${env:esp32-c3-athom.build_unflags} ${tubes_no_mic.build_unflags} -build_flags = ${common.build_flags} ${esp32c3.build_flags} -D WLED_RELEASE_NAME=ESP32-C3_ATHOM_TUBES +build_flags = ${env:esp32-c3-athom.build_flags} -D WLED_RELEASE_NAME=ESP32-C3_ATHOM_TUBES ${tubes_no_mic.build_flags} - -D LEDPIN=10 - -D BTNPIN=9 -D FASTLED_ESP32_SPI_BUS=HSPI -D NUM_STRIPS=1 -D DEFAULT_LED_COUNT=150 -D WLED_WIFI_POWER_SETTING=WIFI_POWER_8_5dBm @@ -164,3 +164,39 @@ lib_ignore = ${env:esp32-c3-athom.lib_ignore} ${tubes_no_mic.lib_ignore} lib_deps = ${tubes_no_mic.lib_deps} + + +# ------------------------------------------------------------------------------ +# ESP32 GLEDOPTO +# +# LEDs: GRB @ pin 16 +# Button: GPIO 0 +# SR: i2S SD 26, WS 5, SCK 21, MCLK unused +# ------------------------------------------------------------------------------ +[env:esp32-gledopto] +extends = env:esp32dev +lib_ignore = IRremoteESP8266 + ${env:esp32c3dev.lib_ignore} ; ok to keep this line if it exists, harmless +build_flags = + -D LEDPIN=16 + -D BTNPIN=0 + -D WLED_DISABLE_INFRARED + -D IRTYPE=0 + +[env:esp32-gledopto_tubes] +extends = env:esp32-gledopto +platform = platformio/espressif32 @ 6.7.0 +platform_packages = + framework-arduinoespressif32@3.20016.0 ; Arduino-ESP32 2.0.16 +build_unflags = ${env:esp32-gledopto.build_unflags} + ${tubes_no_mic.build_unflags} +build_flags = ${env:esp32-gledopto.build_flags} + ${tubes_no_mic.build_flags} + -D FASTLED_ESP32_SPI_BUS=HSPI + -D NUM_STRIPS=1 -D DEFAULT_LED_COUNT=150 + -D WLED_WIFI_POWER_SETTING=WIFI_POWER_8_5dBm + -D LOLIN_WIFI_FIX +lib_ignore = ${env:esp32-gledopto.lib_ignore} + ${tubes_no_mic.lib_ignore} +lib_deps = ${env:esp32-gledopto.lib_deps} + ${tubes_no_mic.lib_deps} diff --git a/usermods/Tubes/Tubes.h b/usermods/Tubes/Tubes.h index 5c59f730eb..ebd34b6c4e 100644 --- a/usermods/Tubes/Tubes.h +++ b/usermods/Tubes/Tubes.h @@ -20,10 +20,17 @@ #define MASTER_PIN 25 #define LEGACY_PIN 32 // DigUno Q4 +#ifndef NUM_STRIPS +#define NUM_STRIPS 1 +#endif + +#ifndef MAX_REAL_LEDS +#define MAX_REAL_LEDS (DEFAULT_LED_COUNT * NUM_STRIPS) +#endif class TubesUsermod : public Usermod { private: - PatternController controller = PatternController(); + PatternController controller = PatternController(MAX_REAL_LEDS); DebugController debug = DebugController(controller); Master master = Master(controller); bool isLegacy = false; diff --git a/usermods/Tubes/controller.h b/usermods/Tubes/controller.h index b0f0b9ba52..aca749f21a 100644 --- a/usermods/Tubes/controller.h +++ b/usermods/Tubes/controller.h @@ -155,6 +155,11 @@ class PatternController : public MessageReceiver { } } + // Compatibility ctor for older call sites that pass a real LED count. + PatternController(uint16_t real_led_count) : PatternController() { + (void)real_led_count; + } + bool isMasterRole() const { #if defined(GOLDEN) || defined(CHRISTMAS) || defined(RUBY) return true; @@ -689,9 +694,10 @@ class PatternController : public MessageReceiver { uint colors[4] = {18, 58, 71, 111}; next_state.palette_id = colors[r]; #elif defined(CHRISTMAS) // 81, 107 are too bright - uint r = random8(0, 20); - uint colors[20] = {/*gold:*/18, 58, 71, 111, + uint r = random8(0, 26); + uint colors[26] = {/*gold:*/18, 58, 71, 111, /*yes:*/25, 34, 61, 63, 81, 112, + /*yesx2:*/25, 34, 61, 63, 81, 112, /*best yes:*/25, 34, 34, 61, 63, 81, 112, /*maybe:*/81, 28, 107}; next_state.palette_id = colors[r]; @@ -1495,4 +1501,4 @@ class PatternController : public MessageReceiver { } -}; \ No newline at end of file +};