diff --git a/CHANGELOG.md b/CHANGELOG.md index 69ddeabbd..dde3d4dec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ### Development versions after 0.11.1 release +#### Build 2012240 + +- Fixed display of usermod values in info screen +- 4 more effects now use FRAMETIME +- Remove unsupported environments from platformio.ini + #### Build 2012210 - Split index.htm in separate CSS + JS files (PR #1542) diff --git a/platformio.ini b/platformio.ini index 6efabe2b4..416bd52c3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,8 +16,6 @@ default_envs = travis_esp8266, travis_esp32 # Single binaries (uncomment your board) ; default_envs = nodemcuv2 -; default_envs = esp01 -; default_envs = esp01_1m_ota ; default_envs = esp01_1m_full ; default_envs = esp07 ; default_envs = d1_mini @@ -140,8 +138,6 @@ build_flags_all_features = build_flags_esp8266 = ${common.build_flags} ${esp8266.build_flags} build_flags_esp32 = ${common.build_flags} ${esp32.build_flags} -ldscript_512k = eagle.flash.512k.ld ;for older versions change this to eagle.flash.512k0.ld -ldscript_1m0m = eagle.flash.1m.ld ;for older versions change this to eagle.flash.1m0.ld ldscript_1m128k = eagle.flash.1m128.ld ldscript_2m512k = eagle.flash.2m512.ld ldscript_2m1m = eagle.flash.2m1m.ld @@ -232,26 +228,6 @@ board_build.ldscript = ${common.ldscript_4m1m} build_unflags = ${common.build_unflags} build_flags = ${common.build_flags_esp8266} -# Unsupported environment due to insufficient flash -[env:esp01] -board = esp01 -platform = ${common.platform_wled_default} -platform_packages = ${common.platform_packages} -board_build.ldscript = ${common.ldscript_512k} -build_unflags = ${common.build_unflags} -build_flags = ${common.build_flags_esp8266} -D WLED_DISABLE_OTA -D WLED_DISABLE_ALEXA -D WLED_DISABLE_BLYNK - -D WLED_DISABLE_CRONIXIE -D WLED_DISABLE_HUESYNC -D WLED_DISABLE_INFRARED -D WLED_DISABLE_MQTT -D WLED_DISABLE_WEBSOCKETS - -# Unsupported environment due to insufficient flash -[env:esp01_1m_ota] -board = esp01_1m -platform = ${common.platform_wled_default} -platform_packages = ${common.platform_packages} -board_build.ldscript = ${common.ldscript_1m0m} -build_unflags = ${common.build_unflags} -build_flags = ${common.build_flags_esp8266} -D WLED_DISABLE_ALEXA -D WLED_DISABLE_BLYNK -D WLED_DISABLE_CRONIXIE - -D WLED_DISABLE_HUESYNC -D WLED_DISABLE_INFRARED -D WLED_DISABLE_MQTT -D WLED_DISABLE_WEBSOCKETS - [env:esp01_1m_full] board = esp01_1m platform = ${common.platform_wled_default} diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 54849dcc2..e7c7c820a 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -594,7 +594,7 @@ uint16_t WS2812FX::mode_sparkle(void) { /* - * Lights all LEDs in the color. Flashes single white pixels randomly. + * Lights all LEDs in the color. Flashes single col 1 pixels randomly. (List name: Sparkle Dark) * Inspired by www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/ */ uint16_t WS2812FX::mode_flash_sparkle(void) { @@ -602,12 +602,14 @@ uint16_t WS2812FX::mode_flash_sparkle(void) { setPixelColor(i, color_from_palette(i, true, PALETTE_SOLID_WRAP, 0)); } - if(random8(5) == 0) { - SEGENV.aux0 = random16(SEGLEN); // aux0 stores the random led index - setPixelColor(SEGENV.aux0, SEGCOLOR(1)); - return 20; - } - return 20 + (uint16_t)(255-SEGMENT.speed); + if (now - SEGENV.aux0 > SEGENV.step) { + if(random8((255-SEGMENT.intensity) >> 4) == 0) { + setPixelColor(random16(SEGLEN), SEGCOLOR(1)); //flash + } + SEGENV.step = now; + SEGENV.aux0 = 255-SEGMENT.speed; + } + return FRAMETIME; } @@ -620,13 +622,16 @@ uint16_t WS2812FX::mode_hyper_sparkle(void) { setPixelColor(i, color_from_palette(i, true, PALETTE_SOLID_WRAP, 0)); } - if(random8(5) < 2) { - for(uint16_t i = 0; i < MAX(1, SEGLEN/3); i++) { - setPixelColor(random16(SEGLEN), SEGCOLOR(1)); + if (now - SEGENV.aux0 > SEGENV.step) { + if(random8((255-SEGMENT.intensity) >> 4) == 0) { + for(uint16_t i = 0; i < MAX(1, SEGLEN/3); i++) { + setPixelColor(random16(SEGLEN), SEGCOLOR(1)); + } } - return 20; + SEGENV.step = now; + SEGENV.aux0 = 255-SEGMENT.speed; } - return 20 + (uint16_t)(255-SEGMENT.speed); + return FRAMETIME; } @@ -637,22 +642,25 @@ uint16_t WS2812FX::mode_multi_strobe(void) { for(uint16_t i = 0; i < SEGLEN; i++) { setPixelColor(i, color_from_palette(i, true, PALETTE_SOLID_WRAP, 1)); } - //blink(SEGCOLOR(0), SEGCOLOR(1), true, true); - uint16_t delay = 50 + 20*(uint16_t)(255-SEGMENT.speed); - uint16_t count = 2 * ((SEGMENT.speed / 10) + 1); - if(SEGENV.step < count) { - if((SEGENV.step & 1) == 0) { - for(uint16_t i = 0; i < SEGLEN; i++) { - setPixelColor(i, SEGCOLOR(0)); - } - delay = 20; + SEGENV.aux0 = 50 + 20*(uint16_t)(255-SEGMENT.speed); + uint16_t count = 2 * ((SEGMENT.intensity / 10) + 1); + if(SEGENV.aux1 < count) { + if((SEGENV.aux1 & 1) == 0) { + fill(SEGCOLOR(0)); + SEGENV.aux0 = 15; } else { - delay = 50; + SEGENV.aux0 = 50; } } - SEGENV.step = (SEGENV.step + 1) % (count + 1); - return delay; + + if (now - SEGENV.aux0 > SEGENV.step) { + SEGENV.aux1++; + if (SEGENV.aux1 > count) SEGENV.aux1 = 0; + SEGENV.step = now; + } + + return FRAMETIME; } /* @@ -1620,40 +1628,42 @@ uint16_t WS2812FX::mode_oscillate(void) uint16_t WS2812FX::mode_lightning(void) { uint16_t ledstart = random16(SEGLEN); // Determine starting location of flash - uint16_t ledlen = 1 + random16(SEGLEN -ledstart); // Determine length of flash (not to go beyond NUM_LEDS-1) + uint16_t ledlen = 1 + random16(SEGLEN -ledstart); // Determine length of flash (not to go beyond NUM_LEDS-1) uint8_t bri = 255/random8(1, 3); - if (SEGENV.step == 0) + if (SEGENV.aux1 == 0) //init, leader flash { - SEGENV.aux0 = random8(3, 3 + SEGMENT.intensity/20); //number of flashes - bri = 52; - SEGENV.aux1 = 1; + SEGENV.aux1 = random8(4, 4 + SEGMENT.intensity/20); //number of flashes + SEGENV.aux1 *= 2; + + bri = 52; //leader has lower brightness + SEGENV.aux0 = 200; //200ms delay after leader } fill(SEGCOLOR(1)); - if (SEGENV.aux1) { + if (SEGENV.aux1 > 3 && !(SEGENV.aux1 & 0x01)) { //flash on even number >2 for (int i = ledstart; i < ledstart + ledlen; i++) { - if (SEGMENT.palette == 0) - { - setPixelColor(i,bri,bri,bri,bri); - } else { - setPixelColor(i,color_from_palette(i, true, PALETTE_SOLID_WRAP, 0, bri)); - } + setPixelColor(i,color_from_palette(i, true, PALETTE_SOLID_WRAP, 0, bri)); + } + SEGENV.aux1--; + + SEGENV.step = millis(); + //return random8(4, 10); // each flash only lasts one frame/every 24ms... originally 4-10 milliseconds + } else { + if (millis() - SEGENV.step > SEGENV.aux0) { + SEGENV.aux1--; + if (SEGENV.aux1 < 2) SEGENV.aux1 = 0; + + SEGENV.aux0 = (50 + random8(100)); //delay between flashes + if (SEGENV.aux1 == 2) { + SEGENV.aux0 = (random8(255 - SEGMENT.speed) * 100); // delay between strikes + } + SEGENV.step = millis(); } - SEGENV.aux1 = 0; - SEGENV.step++; - return random8(4, 10); // each flash only lasts 4-10 milliseconds } - - SEGENV.aux1 = 1; - if (SEGENV.step == 1) return (200); // longer delay until next flash after the leader - - if (SEGENV.step <= SEGENV.aux0) return (50 + random8(100)); // shorter delay between strokes - - SEGENV.step = 0; - return (random8(255 - SEGMENT.speed) * 100); // delay between strikes + return FRAMETIME; } diff --git a/wled00/data/index.js b/wled00/data/index.js index f3fb72af6..4a71cf9da 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -454,9 +454,8 @@ function populateInfo(i) else if (pwr > 0) {pwr = 50 * Math.round(pwr/50); pwru = pwr + " mA";} var urows=""; if (i.u) { - for (var k = 0; k < i.u.length; k++) + for (const [k, val] of Object.entries(i.u)) { - var val = i.u[k]; if (val[1]) { urows += inforow(k,val[0],val[1]); } else { diff --git a/wled00/wled.h b/wled00/wled.h index 789016336..457b0312c 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2012210 +#define VERSION 2012240 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG