Skip to content

Commit 0ea31cb

Browse files
committed
Fix indefinite realtime terminated by new packet (fixes wled#2356 )
Add custom Aircoookie fork of ESP32 core (reduces bin size by >100kB)
1 parent b626c76 commit 0ea31cb

File tree

8 files changed

+464
-464
lines changed

8 files changed

+464
-464
lines changed

platformio.ini

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
; default_envs = travis_esp8266, travis_esp32
1313

1414
# Release binaries
15-
default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, esp32dev, esp32_eth, esp32_eth_ota1mapp, esp32s2_saola, esp32c3
15+
default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, esp32dev, esp32_eth, esp32s2_saola, esp32c3
1616

1717
# Build everything
1818
; default_envs = esp32dev, esp8285_4CH_MagicHome, codm-controller-0.6-rev2, codm-controller-0.6, esp32s2_saola, d1_mini_5CH_Shojo_PCB, d1_mini, sp501e, travis_esp8266, travis_esp32, nodemcuv2, esp32_eth, anavi_miracle_controller, esp07, esp01_1m_full, m5atom, h803wf, d1_mini_ota, heltec_wifi_kit_8, esp8285_H801, d1_mini_debug, wemos_shield_esp32, elekstube_ips
@@ -204,9 +204,11 @@ lib_deps =
204204
makuna/NeoPixelBus @ 2.6.7 # 2.6.5/2.6.6 and newer do not compile on ESP core < 3.0.0
205205

206206
[esp32]
207-
#platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2/platform-tasmota-espressif32-2.0.2.zip
207+
#platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.3/platform-espressif32-2.0.2.3.zip
208208
209209

210+
platform_packages = framework-arduinoespressif32 @ https://github.com/Aircoookie/arduino-esp32.git#1.0.6.4
211+
210212
build_flags = -g
211213
-DARDUINO_ARCH_ESP32
212214
#-DCONFIG_LITTLEFS_FOR_IDF_3_2
@@ -320,26 +322,23 @@ lib_deps = ${esp8266.lib_deps}
320322
[env:esp32dev]
321323
board = esp32dev
322324
platform = ${esp32.platform}
325+
platform_packages = ${esp32.platform_packages}
323326
build_unflags = ${common.build_unflags}
324-
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32 -D WLED_DISABLE_BLYNK #-D WLED_DISABLE_BROWNOUT_DET
327+
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32 #-D WLED_DISABLE_BLYNK #-D WLED_DISABLE_BROWNOUT_DET
325328
lib_deps = ${esp32.lib_deps}
326329
monitor_filters = esp32_exception_decoder
327330
board_build.partitions = ${esp32.default_partitions}
328331

329332
[env:esp32_eth]
330333
board = esp32-poe
331334
platform = ${esp32.platform}
335+
platform_packages = ${esp32.platform_packages}
332336
upload_speed = 921600
333337
build_unflags = ${common.build_unflags}
334338
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32_Ethernet -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1
335339
lib_deps = ${esp32.lib_deps}
336340
board_build.partitions = ${esp32.default_partitions}
337341

338-
# ESP32 ETH build that fits in old 1M app space (disables Blynk and Hue sync)
339-
[env:esp32_eth_ota1mapp]
340-
extends = env:esp32_eth
341-
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32_Ethernet_OTA -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1 -D WLED_DISABLE_BLYNK -D WLED_DISABLE_HUESYNC
342-
343342
[env:esp32s2_saola]
344343
board = esp32-s2-saola-1
345344
platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.2/platform-tasmota-espressif32-2.0.2.zip

wled00/FX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2346,7 +2346,7 @@ uint16_t WS2812FX::mode_ripple_rainbow(void) {
23462346
// incandescent bulbs change color as they get dim down.
23472347
#define COOL_LIKE_INCANDESCENT 1
23482348

2349-
CRGB WS2812FX::twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
2349+
CRGB IRAM_ATTR WS2812FX::twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
23502350
{
23512351
// Overall twinkle speed (changed)
23522352
uint16_t ticks = ms / SEGENV.aux0;

wled00/FX.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,9 +671,13 @@ class WS2812FX {
671671
setPixelSegment(uint8_t n),
672672
gamma8(uint8_t),
673673
gamma8_cal(uint8_t, float),
674-
sin_gap(uint16_t),
675674
get_random_wheel_index(uint8_t);
676675

676+
inline uint8_t sin_gap(uint16_t in) {
677+
if (in & 0x100) return 0;
678+
return sin8(in + 192); // correct phase shift of sine so that it starts and stops at 0
679+
}
680+
677681
int8_t
678682
tristate_square8(uint8_t x, uint8_t pulsewidth, uint8_t attdec);
679683

wled00/FX_fcn.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -937,12 +937,6 @@ uint16_t IRAM_ATTR WS2812FX::triwave16(uint16_t in)
937937
return 0xFFFF - (in - 0x8000)*2;
938938
}
939939

940-
uint8_t IRAM_ATTR WS2812FX::sin_gap(uint16_t in) {
941-
if (in & 0x100) return 0;
942-
//if (in > 255) return 0;
943-
return sin8(in + 192); //correct phase shift of sine so that it starts and stops at 0
944-
}
945-
946940
/*
947941
* Generates a tristate square wave w/ attac & decay
948942
* @param x input value 0-255

wled00/html_other.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ charset="utf-8"><meta name="theme-color" content="#222222"><title>
8585
WLED Live Preview</title><style>
8686
body{margin:0}#canv{background:#000;filter:brightness(175%);width:100%;height:100%;position:absolute}
8787
</style></head><body><div id="canv"><script>
88-
function updatePreview(e){var n="linear-gradient(90deg,",t=e.length;for(i=2;i<t;i+=3)n+=`rgb(${e[i]},${e[i+1]},${e[i+2]})`,i<t-3&&(n+=",");n+=")",document.getElementById("canv").style.background=n}function getLiveJson(e){try{if("[object ArrayBuffer]"===toString.call(e.data)){let e=new Uint8Array(event.data);if(76!=e[0])return;updatePreview(e)}}catch(e){console.error("Peek WS error:",e)}}var ws=top.window.ws;ws&&ws.readyState===WebSocket.OPEN?(console.info("Peek uses top WS"),ws.send("{'lv':true}")):(console.info("Peek WS opening"),(ws=new WebSocket("ws://"+document.location.host+"/ws")).onopen=function(){console.info("Peek WS open"),ws.send("{'lv':true}")}),ws.binaryType="arraybuffer",ws.addEventListener("message",getLiveJson)
88+
function updatePreview(e){var n="linear-gradient(90deg,",o=e.length;for(i=2;i<o;i+=3)n+=`rgb(${e[i]},${e[i+1]},${e[i+2]})`,i<o-3&&(n+=",");n+=")",document.getElementById("canv").style.background=n}function getLiveJson(e){try{if("[object ArrayBuffer]"===toString.call(e.data)){let e=new Uint8Array(event.data);if(76!=e[0])return;updatePreview(e)}}catch(e){console.error("Peek WS error:",e)}}var ws=top.window.ws;ws&&ws.readyState===WebSocket.OPEN?(console.info("Peek uses top WS"),ws.send("{'lv':true}")):(console.info("Peek WS opening"),(ws=new WebSocket(("https:"==window.location.protocol?"wss":"ws")+"://"+document.location.host+"/ws")).onopen=function(){console.info("Peek WS open"),ws.send("{'lv':true}")}),ws.binaryType="arraybuffer",ws.addEventListener("message",getLiveJson)
8989
</script></body></html>)=====";
9090
9191

0 commit comments

Comments
 (0)