Merge branch 'MoonModules:mdev' into mdev
This commit is contained in:
@@ -78,12 +78,15 @@ default_envs =
|
|||||||
esp32_pico_4MB_V4_S ;; PICO D4 board
|
esp32_pico_4MB_V4_S ;; PICO D4 board
|
||||||
esp32_4MB_V4_S_HUB75 ;; esp32 4MB - HUB75 supported
|
esp32_4MB_V4_S_HUB75 ;; esp32 4MB - HUB75 supported
|
||||||
esp32_4MB_V4_HUB75_forum ;; esp32 4MB - HUB75 supported (forum pinout)
|
esp32_4MB_V4_HUB75_forum ;; esp32 4MB - HUB75 supported (forum pinout)
|
||||||
|
esp32_4MB_V4_S ;; without HUB75 driver - might work better with I2S microphones
|
||||||
esp32_4MB_M_eth ;; esp32 4MB with ethernet support
|
esp32_4MB_M_eth ;; esp32 4MB with ethernet support
|
||||||
esp32_4MB_V4_S_eth ;; esp32 4MB "V4" build with ethernet support
|
esp32_4MB_V4_S_eth ;; esp32 4MB "V4" build with ethernet support
|
||||||
; esp32_4MB_PSRAM_REV3_S ;; WROVER-E experimental, optimized for WROVER-E with "revision3" chip
|
; esp32_4MB_PSRAM_REV3_S ;; WROVER-E experimental, optimized for WROVER-E with "revision3" chip
|
||||||
esp32_4MB_PSRAM_S ;; esp32 WROVER with PSRAM; HUB75 supported
|
esp32_4MB_PSRAM_S ;; esp32 WROVER with PSRAM; HUB75 supported
|
||||||
esp32_16MB_V4_S ;; esp32 16MB - HUB75 supported, optimized for speed
|
esp32_16MB_V4_S ;; esp32 16MB - without HUB75 driver, optimized for speed
|
||||||
esp32_16MB_V4_M ;; esp32 16MB - HUB75 supported
|
esp32_16MB_V4_M ;; esp32 16MB - without HUB75 driver
|
||||||
|
esp32_16MB_V4_S_HUB75 ;; esp32 16MB - HUB75 supported, optimized for speed
|
||||||
|
; esp32_16MB_V4_M_HUB75 ;; esp32 16MB - HUB75 supported
|
||||||
esp32_16MB_V4_M_debug ;; esp32 16MB - for out-of-the-box debugging
|
esp32_16MB_V4_M_debug ;; esp32 16MB - for out-of-the-box debugging
|
||||||
;;
|
;;
|
||||||
esp32S3_4MB_S ;; experimental, for HD-WF2 (HUB75 supported)
|
esp32S3_4MB_S ;; experimental, for HD-WF2 (HUB75 supported)
|
||||||
@@ -1852,8 +1855,35 @@ lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compila
|
|||||||
; RAM: [=== ] 25.5% (used 83396 bytes from 327680 bytes)
|
; RAM: [=== ] 25.5% (used 83396 bytes from 327680 bytes)
|
||||||
; Flash: [==========] 98.2% (used 1543949 bytes from 1572864 bytes)
|
; Flash: [==========] 98.2% (used 1543949 bytes from 1572864 bytes)
|
||||||
|
|
||||||
[env:esp32_4MB_V4_S] ;; legacy alias
|
[env:esp32_4MB_V4_S] ;; without HUB75 driver - might work better with I2S microphones
|
||||||
extends = env:esp32_4MB_V4_S_HUB75
|
extends = esp32_4MB_V4_S_base
|
||||||
|
;; board_build.partitions = ${esp32.default_partitions} ;; compatible with upstream
|
||||||
|
build_unflags = ${esp32_4MB_V4_S_base.build_unflags}
|
||||||
|
${common_mm.DMXin_build_flags} ;; exceeds flash size limits
|
||||||
|
build_flags = ${esp32_4MB_V4_S_base.esp32_build_flags}
|
||||||
|
-D WLED_RELEASE_NAME=esp32_4MB_V4_S
|
||||||
|
-D WLED_WATCHDOG_TIMEOUT=0 #-D WLED_DISABLE_BROWNOUT_DET
|
||||||
|
-D ARDUINO_USB_CDC_ON_BOOT=0 ; needed for arduino-esp32 >=2.0.4; avoids errors on startup
|
||||||
|
-D WLEDMM_FASTPATH ; WLEDMM experimental option. Reduces audio lag (latency), and allows for faster LED framerates. May break compatibility with previous versions.
|
||||||
|
-D WLEDMM_SAVE_FLASH
|
||||||
|
-D WLED_DISABLE_LOXONE
|
||||||
|
-D WLED_DISABLE_ALEXA
|
||||||
|
-D WLED_DISABLE_HUESYNC
|
||||||
|
-D WLED_DISABLE_MQTT
|
||||||
|
-D WLED_DISABLE_INFRARED
|
||||||
|
-D WLED_DISABLE_ESPNOW ;; might help in case of WiFi connectivity problems
|
||||||
|
-D WLED_ENABLE_PIXELFORGE
|
||||||
|
-D WLEDMM_SAVE_FLASH
|
||||||
|
; -D WLED_DEBUG
|
||||||
|
; -D SR_DEBUG
|
||||||
|
; -D MIC_LOGGER
|
||||||
|
;; -D SR_DMTYPE=254 ;; HUB75 driver needs the I2S unit - this sets AR default mode to 'Network Receive Only' to prevent driver conflicts.
|
||||||
|
;; -D WLED_DISABLE_PARTICLESYSTEM1D
|
||||||
|
;; -D WLED_DISABLE_PARTICLESYSTEM2D
|
||||||
|
lib_deps = ${esp32_4MB_V4_S_base.esp32_lib_deps}
|
||||||
|
lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
|
||||||
|
${common_mm.DMXin_lib_ignore}
|
||||||
|
${common_mm.HUB75_lib_ignore}
|
||||||
|
|
||||||
; standard MM build for classic esp32; HUB75 not included
|
; standard MM build for classic esp32; HUB75 not included
|
||||||
[env:esp32_4MB_V4_M]
|
[env:esp32_4MB_V4_M]
|
||||||
@@ -2012,13 +2042,13 @@ board_build.flash_mode = qio ; (dio = dual i/o; more compatible than qio = quad
|
|||||||
; Flash: [==========] 98.1% (used 1863653 bytes from 1900544 bytes)
|
; Flash: [==========] 98.1% (used 1863653 bytes from 1900544 bytes)
|
||||||
|
|
||||||
;; V4 build for 16MB flash, optimized for speed; HUB75 supported
|
;; V4 build for 16MB flash, optimized for speed; HUB75 supported
|
||||||
[env:esp32_16MB_V4_S]
|
[env:esp32_16MB_V4_S_HUB75]
|
||||||
extends = esp32_4MB_V4_S_base
|
extends = esp32_4MB_V4_S_base
|
||||||
build_unflags = ${esp32_4MB_V4_S_base.build_unflags}
|
build_unflags = ${esp32_4MB_V4_S_base.build_unflags}
|
||||||
${Speed_Flags.build_unflags} ;; to override -Os
|
${Speed_Flags.build_unflags} ;; to override -Os
|
||||||
build_flags = ${esp32_4MB_V4_S_base.esp32_build_flags}
|
build_flags = ${esp32_4MB_V4_S_base.esp32_build_flags}
|
||||||
${Speed_Flags.build_flags_V4} ;; optimize for speed instead of size
|
${Speed_Flags.build_flags_V4} ;; optimize for speed instead of size
|
||||||
-D WLED_RELEASE_NAME=esp32_16MB_V4_S
|
-D WLED_RELEASE_NAME=esp32_16MB_V4_S_HUB75
|
||||||
-D WLED_WATCHDOG_TIMEOUT=0 #-D WLED_DISABLE_BROWNOUT_DET
|
-D WLED_WATCHDOG_TIMEOUT=0 #-D WLED_DISABLE_BROWNOUT_DET
|
||||||
-D ARDUINO_USB_CDC_ON_BOOT=0 ; needed for arduino-esp32 >=2.0.4; avoids errors on startup
|
-D ARDUINO_USB_CDC_ON_BOOT=0 ; needed for arduino-esp32 >=2.0.4; avoids errors on startup
|
||||||
-D WLEDMM_FASTPATH ; WLEDMM experimental option. Reduces audio lag (latency), and allows for faster LED framerates. May break compatibility with previous versions.
|
-D WLEDMM_FASTPATH ; WLEDMM experimental option. Reduces audio lag (latency), and allows for faster LED framerates. May break compatibility with previous versions.
|
||||||
@@ -2041,11 +2071,27 @@ board_build.partitions = ${esp32.extreme_partitions} ;; WLED extended for 16MB f
|
|||||||
; RAM: [== ] 23.7% (used 77704 bytes from 327680 bytes)
|
; RAM: [== ] 23.7% (used 77704 bytes from 327680 bytes)
|
||||||
; Flash: [======== ] 84.4% (used 1770341 bytes from 2097152 bytes)
|
; Flash: [======== ] 84.4% (used 1770341 bytes from 2097152 bytes)
|
||||||
|
|
||||||
|
;; same as above, but without HUB75 driver - better for I2S audio input
|
||||||
|
[env:esp32_16MB_V4_S]
|
||||||
|
extends = env:esp32_16MB_V4_S_HUB75
|
||||||
|
build_unflags = ${env:esp32_16MB_V4_S_HUB75.build_unflags}
|
||||||
|
-D WLED_RELEASE_NAME=esp32_16MB_V4_S_HUB75
|
||||||
|
-D WLED_ENABLE_HUB75MATRIX ;; remove HUB driver
|
||||||
|
-D WLEDMM_SLOWPATH ;; not necessary without HUB75
|
||||||
|
-D SR_DMTYPE=254 ;; not necessary without HUB75
|
||||||
|
build_flags = ${env:esp32_16MB_V4_S_HUB75.build_flags}
|
||||||
|
-D WLED_RELEASE_NAME=esp32_16MB_V4_S
|
||||||
|
lib_deps = ${esp32_4MB_V4_S_base.esp32_lib_deps}
|
||||||
|
${common_mm.animartrix_lib_deps}
|
||||||
|
lib_ignore =
|
||||||
|
${common_mm.HUB75_lib_ignore} ;; remove HUB driver dependancy
|
||||||
|
|
||||||
|
|
||||||
; compiled with ESP-IDF 4.4.1; HUB75 included (may have PIN conflicts)
|
; compiled with ESP-IDF 4.4.1; HUB75 included (may have PIN conflicts)
|
||||||
[env:esp32_16MB_V4_M]
|
[env:esp32_16MB_V4_M_HUB75]
|
||||||
extends = esp32_4MB_V4_M_base
|
extends = esp32_4MB_V4_M_base
|
||||||
build_flags = ${esp32_4MB_V4_M_base.esp32_build_flags}
|
build_flags = ${esp32_4MB_V4_M_base.esp32_build_flags}
|
||||||
-D WLED_RELEASE_NAME=esp32_16MB_V4_M
|
-D WLED_RELEASE_NAME=esp32_16MB_V4_M_HUB75
|
||||||
-D WLED_WATCHDOG_TIMEOUT=0 #-D WLED_DISABLE_BROWNOUT_DET
|
-D WLED_WATCHDOG_TIMEOUT=0 #-D WLED_DISABLE_BROWNOUT_DET
|
||||||
-D ARDUINO_USB_CDC_ON_BOOT=0 ; needed for arduino-esp32 >=2.0.4; avoids errors on startup
|
-D ARDUINO_USB_CDC_ON_BOOT=0 ; needed for arduino-esp32 >=2.0.4; avoids errors on startup
|
||||||
;; -D WLED_ENABLE_DMX ;; disabled because it does not work with ESP-IDF 4.4.x (buggy driver in SparkFunDMX)
|
;; -D WLED_ENABLE_DMX ;; disabled because it does not work with ESP-IDF 4.4.x (buggy driver in SparkFunDMX)
|
||||||
@@ -2070,6 +2116,22 @@ board_build.partitions = ${esp32.extreme_partitions} ;; WLED extended for 16MB f
|
|||||||
; RAM: [=== ] 25.7% (used 84104 bytes from 327680 bytes)
|
; RAM: [=== ] 25.7% (used 84104 bytes from 327680 bytes)
|
||||||
; Flash: [======== ] 80.7% (used 1692269 bytes from 2097152 bytes)
|
; Flash: [======== ] 80.7% (used 1692269 bytes from 2097152 bytes)
|
||||||
|
|
||||||
|
;; same as above, but without HUB75 driver - better for I2S audio input
|
||||||
|
[env:esp32_16MB_V4_M]
|
||||||
|
extends = env:esp32_16MB_V4_M_HUB75
|
||||||
|
build_unflags = ${env:esp32_16MB_V4_M_HUB75.build_unflags}
|
||||||
|
-D WLED_RELEASE_NAME=esp32_16MB_V4_M_HUB75
|
||||||
|
-D WLED_ENABLE_HUB75MATRIX ;; remove HUB driver
|
||||||
|
-D WLEDMM_SLOWPATH ;; not necessary without HUB75
|
||||||
|
-D SR_DMTYPE=254 ;; not necessary without HUB75
|
||||||
|
build_flags = ${env:esp32_16MB_V4_M_HUB75.build_flags}
|
||||||
|
-D WLED_RELEASE_NAME=esp32_16MB_V4_M
|
||||||
|
lib_deps = ${esp32_4MB_V4_M_base.esp32_lib_deps}
|
||||||
|
${common_mm.animartrix_lib_deps}
|
||||||
|
lib_ignore =
|
||||||
|
${common_mm.HUB75_lib_ignore} ;; remove HUB driver dependancy
|
||||||
|
|
||||||
|
|
||||||
[env:esp32_16MB_V4_M_debug]
|
[env:esp32_16MB_V4_M_debug]
|
||||||
extends = esp32_4MB_V4_M_base
|
extends = esp32_4MB_V4_M_base
|
||||||
build_unflags = ${common.build_unflags}
|
build_unflags = ${common.build_unflags}
|
||||||
|
|||||||
@@ -3012,24 +3012,29 @@ static const char _data_FX_MODE_TRI_STATIC_PATTERN[] PROGMEM = "Solid Pattern Tr
|
|||||||
|
|
||||||
uint16_t spots_base(uint16_t threshold)
|
uint16_t spots_base(uint16_t threshold)
|
||||||
{
|
{
|
||||||
if (SEGLEN == 1) return mode_oops();
|
if (SEGLEN <= 1) return mode_oops();
|
||||||
if (!SEGMENT.check2) SEGMENT.fill(SEGCOLOR(1));
|
if (!SEGMENT.check2) SEGMENT.fill(SEGCOLOR(1));
|
||||||
|
|
||||||
uint16_t maxZones = SEGLEN >> 2;
|
// constants for fixed point scaling
|
||||||
uint16_t zones = 1 + ((SEGMENT.intensity * maxZones) >> 8);
|
constexpr uint8_t ZONELEN_FP_SHIFT = 3;
|
||||||
uint16_t zoneLen = SEGLEN / zones;
|
constexpr uint32_t ZONELEN_FP_SCALE = 1U << ZONELEN_FP_SHIFT;
|
||||||
uint16_t offset = (SEGLEN - zones * zoneLen) >> 1;
|
|
||||||
|
|
||||||
for (int z = 0; z < zones; z++)
|
unsigned maxZones = max(1, SEGLEN >> 2); // prevents "0 zones"
|
||||||
|
unsigned zones = 1U + ((uint32_t(SEGMENT.intensity) * maxZones) >> 8);
|
||||||
|
unsigned zoneLen = uint32_t(SEGLEN) / zones;
|
||||||
|
unsigned zoneLen8 = (uint32_t(SEGLEN) * ZONELEN_FP_SCALE) / zones; // zoneLength * 8 (fixed‑point) -> avoids gaps at right/left sides
|
||||||
|
unsigned offset = (uint32_t(SEGLEN) - ((zones * zoneLen8) >> ZONELEN_FP_SHIFT)) >> 1;
|
||||||
|
|
||||||
|
for (unsigned z = 0; z < zones; z++)
|
||||||
{
|
{
|
||||||
uint16_t pos = offset + z * zoneLen;
|
unsigned pos = offset + ((z * zoneLen8) >> ZONELEN_FP_SHIFT);
|
||||||
for (int i = 0; i < zoneLen; i++)
|
for (unsigned i = 0; i < zoneLen; i++)
|
||||||
{
|
{
|
||||||
uint16_t wave = triwave16((i * 0xFFFF) / zoneLen);
|
unsigned wave = triwave16((i * 0xFFFF) / zoneLen);
|
||||||
if (wave > threshold) {
|
if (wave > threshold) {
|
||||||
uint16_t index = 0 + pos + i;
|
int index = pos + i;
|
||||||
uint8_t s = (wave - threshold)*255 / (0xFFFF - threshold);
|
unsigned s = ((wave - threshold)*255 / (0xFFFF - threshold)) & 0xFF; // & 0xFF prevents overflow in next line
|
||||||
SEGMENT.setPixelColor(index, color_blend(SEGMENT.color_from_palette(index, true, PALETTE_SOLID_WRAP, 0), SEGCOLOR(1), 255-s));
|
SEGMENT.setPixelColor(index, color_blend(SEGMENT.color_from_palette(index, true, PALETTE_SOLID_WRAP, 0), SEGCOLOR(1), uint8_t(255-s)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3054,7 +3059,7 @@ uint16_t mode_spots_fade()
|
|||||||
uint16_t tr = (t >> 1) + (t >> 2);
|
uint16_t tr = (t >> 1) + (t >> 2);
|
||||||
return spots_base(tr);
|
return spots_base(tr);
|
||||||
}
|
}
|
||||||
static const char _data_FX_MODE_SPOTS_FADE[] PROGMEM = "Spots Fade@Spread,Width,,,,,Overlay;!,!;!";
|
static const char _data_FX_MODE_SPOTS_FADE[] PROGMEM = "Spots Fade@Speed,Width,,,,,Overlay;!,!;!";
|
||||||
|
|
||||||
|
|
||||||
//each needs 12 bytes
|
//each needs 12 bytes
|
||||||
@@ -9455,7 +9460,7 @@ uint16_t mode_particlefireworks(void) {
|
|||||||
return FRAMETIME;
|
return FRAMETIME;
|
||||||
}
|
}
|
||||||
#undef NUMBEROFSOURCES
|
#undef NUMBEROFSOURCES
|
||||||
static const char _data_FX_MODE_PARTICLEFIREWORKS[] PROGMEM = "PS Fireworks@Launches,Explosion Size,Fuse,Blur,Gravity,Cylinder,Ground,Fast;;!;2;pal=11,ix=200,sx=180,c1=196,c2=0,c3=10,o3=1";
|
static const char _data_FX_MODE_PARTICLEFIREWORKS[] PROGMEM = "PS Fireworks@Launches,Explosion Size,Fuse,Blur,Gravity,Cylinder,Ground,Fast;;!;2;pal=11,ix=200,sx=180,c1=196,c2=220,c3=10,o3=1";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Particle Volcano
|
Particle Volcano
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
|
|||||||
//int ap_pskl = ap[F("pskl")];
|
//int ap_pskl = ap[F("pskl")];
|
||||||
|
|
||||||
CJSON(apChannel, ap[F("chan")]);
|
CJSON(apChannel, ap[F("chan")]);
|
||||||
if (apChannel > 13 || apChannel < 1) apChannel = 1;
|
if (apChannel > 13 || apChannel < 1) apChannel = 6; // reset to default if invalid
|
||||||
|
|
||||||
CJSON(apHide, ap[F("hide")]);
|
CJSON(apHide, ap[F("hide")]);
|
||||||
if (apHide > 1) apHide = 1;
|
if (apHide > 1) apHide = 1;
|
||||||
|
|||||||
@@ -30,13 +30,15 @@ function peek(c) {
|
|||||||
ctx.clearRect(0, 0, c.width, c.height); //WLEDMM
|
ctx.clearRect(0, 0, c.width, c.height); //WLEDMM
|
||||||
function colorAmp(color) {
|
function colorAmp(color) {
|
||||||
if (color == 0) return 0;
|
if (color == 0) return 0;
|
||||||
return 25+225*color/255;
|
//return color; // no enhancement
|
||||||
|
//return 25+225*color/255; // legacy WLEDMM. problem: strong jump from 0 to 25 -> wrong colors
|
||||||
|
return Math.sqrt(color/255) * 255; // Square root provides gentle and jump-free enhancement of lower brightness pixels
|
||||||
} //WLEDMM in range 55 - 205
|
} //WLEDMM in range 55 - 205
|
||||||
for (y=0.5;y<mH;y++) for (x=0.5; x<mW; x++) {
|
for (y=0.5;y<mH;y++) for (x=0.5; x<mW; x++) {
|
||||||
if (leds[i]!= 0 || leds[i+1]!= 0 || leds[i+2]!= 0) { //WLEDMM: do not show blacks
|
if (leds[i]!= 0 || leds[i+1]!= 0 || leds[i+2]!= 0) { //WLEDMM: do not show blacks
|
||||||
ctx.fillStyle = `rgb(${colorAmp(leds[i])},${colorAmp(leds[i+1])},${colorAmp(leds[i+2])})`;
|
ctx.fillStyle = `rgb(${colorAmp(leds[i])},${colorAmp(leds[i+1])},${colorAmp(leds[i+2])})`;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.arc(x*pPL+lOf, y*pPL, pPL*0.4, 0, 2 * Math.PI);
|
ctx.arc(x*pPL+lOf, y*pPL, pPL*0.45, 0, 2 * Math.PI); // WLEDMM legacy radius was 0.4 -> 0.45
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
}
|
}
|
||||||
i+=3;
|
i+=3;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
function gId(n){return d.getElementById(n);}
|
function gId(n){return d.getElementById(n);}
|
||||||
function hideNoIR(){gId("irOnOff2").style.display="none";} //WLEDMM
|
function hideNoIR(){gId("irOnOff2").style.display="none";} //WLEDMM
|
||||||
function hideHub75() {
|
function hideHub75() {
|
||||||
|
window.hub75Hidden = true; // Track that Hub75 should be hidden
|
||||||
var s = d.getElementsByTagName("select");
|
var s = d.getElementsByTagName("select");
|
||||||
for (i=0; i<s.length; i++) {
|
for (i=0; i<s.length; i++) {
|
||||||
// is the field a LED type?
|
// is the field a LED type?
|
||||||
@@ -464,6 +465,7 @@ ${i+1}:
|
|||||||
<div id="dig${i}a" style="display:inline"><br>Auto-calculate white channel from RGB:<br><select name="AW${i}"><option value=0>None</option><option value=1>Brighter</option><option value=2>Accurate</option><option value=3>Dual</option><option value=4>Max</option></select> </div>
|
<div id="dig${i}a" style="display:inline"><br>Auto-calculate white channel from RGB:<br><select name="AW${i}"><option value=0>None</option><option value=1>Brighter</option><option value=2>Accurate</option><option value=3>Dual</option><option value=4>Max</option></select> </div>
|
||||||
</div>`;
|
</div>`;
|
||||||
f.insertAdjacentHTML("beforeend", cn);
|
f.insertAdjacentHTML("beforeend", cn);
|
||||||
|
if (window.hub75Hidden) hideHub75(); // remove Hub75 options if not supported
|
||||||
}
|
}
|
||||||
if (n==-1) {
|
if (n==-1) {
|
||||||
o[--i].remove();--i;
|
o[--i].remove();--i;
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
d.um_p = [];
|
d.um_p = [];
|
||||||
d.rsvd = [];
|
d.rsvd = [];
|
||||||
d.ro_gpio = [];
|
d.ro_gpio = [];
|
||||||
|
d.h_pins = [];
|
||||||
|
d.x_pins = [];
|
||||||
var umCfg = {};
|
var umCfg = {};
|
||||||
var pins = [], pinO = [], owner;
|
var pins = [], pinO = [], owner;
|
||||||
var loc = false, locip;
|
var loc = false, locip;
|
||||||
@@ -56,6 +58,8 @@
|
|||||||
// function check(o,k) {} //WLEDMM not needed as we use dropdowns
|
// function check(o,k) {} //WLEDMM not needed as we use dropdowns
|
||||||
function getPins(o) {
|
function getPins(o) {
|
||||||
if (isO(o)) {
|
if (isO(o)) {
|
||||||
|
// If this object is a bus instance, extract the "type" field
|
||||||
|
let busType = o.type !== undefined ? o.type : -1;
|
||||||
for (const [k,v] of Object.entries(o)) {
|
for (const [k,v] of Object.entries(o)) {
|
||||||
if (isO(v)) {
|
if (isO(v)) {
|
||||||
owner = k;
|
owner = k;
|
||||||
@@ -63,6 +67,10 @@
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (k.replace("[]","").substr(-3)=="pin") {
|
if (k.replace("[]","").substr(-3)=="pin") {
|
||||||
|
// Skip pin arrays for special bus types where pin array doesn't contain GPIO numbers, but allow all other entries
|
||||||
|
if (busType >= 80 && busType < 96) continue; // Network buses - pin array stores IP address
|
||||||
|
if (busType >= 100 && busType <= 110) continue; // HUB75 buses - pin array stores chain length
|
||||||
|
|
||||||
if (Array.isArray(v)) {
|
if (Array.isArray(v)) {
|
||||||
for (var i=0; i<v.length; i++) if (v[i]>=0) { pins.push(v[i]); pinO.push(owner); }
|
for (var i=0; i<v.length; i++) if (v[i]>=0) { pins.push(v[i]); pinO.push(owner); }
|
||||||
} else {
|
} else {
|
||||||
@@ -269,6 +277,8 @@
|
|||||||
// console.log("pinPost option", c, c.value, d.ro_gpio.includes(c.value));
|
// console.log("pinPost option", c, c.value, d.ro_gpio.includes(c.value));
|
||||||
for (let j=0; j<d.ro_gpio.length; j++) if (d.ro_gpio[j] == c.value) c.text += " read only 🟠"; //if (d.ro_gpio.includes(c.value)) not working ???
|
for (let j=0; j<d.ro_gpio.length; j++) if (d.ro_gpio[j] == c.value) c.text += " read only 🟠"; //if (d.ro_gpio.includes(c.value)) not working ???
|
||||||
for (let j=0; j<d.rsvd.length; j++) if (d.rsvd[j] == c.value) {c.text += " reserved 🟣"; c.disabled=true;} //now always disabled as post is done last if (d.rsvd.includes(c.value))
|
for (let j=0; j<d.rsvd.length; j++) if (d.rsvd[j] == c.value) {c.text += " reserved 🟣"; c.disabled=true;} //now always disabled as post is done last if (d.rsvd.includes(c.value))
|
||||||
|
for (let j=0; j<d.h_pins.length; j++) if (d.h_pins[j] == c.value && c.text.length <= 4) {c.text += " HUB75 🔴"; c.disabled=true;} // HUB75 pins
|
||||||
|
for (let j=0; j<d.x_pins.length; j++) if (d.x_pins[j] == c.value && c.text.length <= 4) {c.text += " DMX 🔴"; c.disabled=true;} // DMX pins
|
||||||
//remove pins > max_gpio
|
//remove pins > max_gpio
|
||||||
if (c.value > d.max_gpio) {
|
if (c.value > d.max_gpio) {
|
||||||
select.removeChild(c);
|
select.removeChild(c);
|
||||||
@@ -278,7 +288,7 @@
|
|||||||
//https://www.javascripttutorial.net/javascript-dom/javascript-remove-items-from-a-select-conditionally/
|
//https://www.javascripttutorial.net/javascript-dom/javascript-remove-items-from-a-select-conditionally/
|
||||||
if (c.text.length <= 4) c.text += " 🟢"; //2 digit number space and ⍼/⎌. If no reserved/read only/other um, then pin can be freely used (green)
|
if (c.text.length <= 4) c.text += " 🟢"; //2 digit number space and ⍼/⎌. If no reserved/read only/other um, then pin can be freely used (green)
|
||||||
for (let jj=0; jj<d.dt_pins.length; jj++) if (d.dt_pins[jj] == c.value) c.text += ((jj<9)?` D${jj}`:((jj==9)?` RX`:` TX`)); //WLEDMM: Add D0-D8, RX/TX to name
|
for (let jj=0; jj<d.dt_pins.length; jj++) if (d.dt_pins[jj] == c.value) c.text += ((jj<9)?` D${jj}`:((jj==9)?` RX`:` TX`)); //WLEDMM: Add D0-D8, RX/TX to name
|
||||||
for (let jj=0; jj<d.a_pins.length; jj++) if (d.a_pins[jj] == c.value) c.text += ` A${jj}`; //WLEDMM: Add A0-A10
|
for (let jj=0; jj<d.a_pins.length; jj++) if (d.a_pins[jj] == c.value) c.text += ` A${jj}`; //WLEDMM: Add A0-A10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,23 +10,9 @@
|
|||||||
#define UDP_IN_MAXSIZE 1472
|
#define UDP_IN_MAXSIZE 1472
|
||||||
#define PRESUMED_NETWORK_DELAY 3 //how many ms could it take on avg to reach the receiver? This will be added to transmitted times
|
#define PRESUMED_NETWORK_DELAY 3 //how many ms could it take on avg to reach the receiver? This will be added to transmitted times
|
||||||
|
|
||||||
void notify(byte callMode, bool followUp)
|
static void do_notify(byte callMode, bool followUp) { // WLEDMM split into two functions, to avoid stack smashing - do_notify needs 1200 bytes on stack
|
||||||
{
|
// DEBUG_PRINTF("[%8u %s]\tnotify(%d, %s)\tmin stack %d\n", millis(), pcTaskGetTaskName(NULL), callMode, followUp?"true ":"false", uxTaskGetStackHighWaterMark(NULL));
|
||||||
if (!udpConnected) return;
|
byte udpOut[WLEDPACKETSIZE] = {0};
|
||||||
if (!syncGroups) return;
|
|
||||||
switch (callMode)
|
|
||||||
{
|
|
||||||
case CALL_MODE_INIT: return;
|
|
||||||
case CALL_MODE_DIRECT_CHANGE: if (!notifyDirect) return; break;
|
|
||||||
case CALL_MODE_BUTTON: if (!notifyButton) return; break;
|
|
||||||
case CALL_MODE_BUTTON_PRESET: if (!notifyButton) return; break;
|
|
||||||
case CALL_MODE_NIGHTLIGHT: if (!notifyDirect) return; break;
|
|
||||||
case CALL_MODE_HUE: if (!notifyHue) return; break;
|
|
||||||
case CALL_MODE_PRESET_CYCLE: if (!notifyDirect) return; break;
|
|
||||||
case CALL_MODE_ALEXA: if (!notifyAlexa) return; break;
|
|
||||||
default: return;
|
|
||||||
}
|
|
||||||
byte udpOut[WLEDPACKETSIZE];
|
|
||||||
Segment& mainseg = strip.getMainSegment();
|
Segment& mainseg = strip.getMainSegment();
|
||||||
udpOut[0] = 0; //0: wled notifier protocol 1: WARLS protocol
|
udpOut[0] = 0; //0: wled notifier protocol 1: WARLS protocol
|
||||||
udpOut[1] = callMode;
|
udpOut[1] = callMode;
|
||||||
@@ -150,6 +136,27 @@ void notify(byte callMode, bool followUp)
|
|||||||
notificationCount = followUp ? notificationCount + 1 : 0;
|
notificationCount = followUp ? notificationCount + 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WLEDMM wrapper function to avoid stack smashing - do_notify needs 1200 bytes on stack, but its not actually sending anything on most notify() calls
|
||||||
|
void notify(byte callMode, bool followUp)
|
||||||
|
{
|
||||||
|
if (!udpConnected) return;
|
||||||
|
if (!syncGroups) return;
|
||||||
|
switch (callMode)
|
||||||
|
{
|
||||||
|
case CALL_MODE_INIT: return;
|
||||||
|
case CALL_MODE_DIRECT_CHANGE: if (!notifyDirect) return; break;
|
||||||
|
case CALL_MODE_BUTTON: if (!notifyButton) return; break;
|
||||||
|
case CALL_MODE_BUTTON_PRESET: if (!notifyButton) return; break;
|
||||||
|
case CALL_MODE_NIGHTLIGHT: if (!notifyDirect) return; break;
|
||||||
|
case CALL_MODE_HUE: if (!notifyHue) return; break;
|
||||||
|
case CALL_MODE_PRESET_CYCLE: if (!notifyDirect) return; break;
|
||||||
|
case CALL_MODE_ALEXA: if (!notifyAlexa) return; break;
|
||||||
|
default: return;
|
||||||
|
}
|
||||||
|
do_notify(callMode, followUp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// WLEDMM cache current main segment: updated in realtimeLock, reset in exitRealtime, used in setRealTimePixel
|
// WLEDMM cache current main segment: updated in realtimeLock, reset in exitRealtime, used in setRealTimePixel
|
||||||
static Segment* theMainSeg = nullptr;
|
static Segment* theMainSeg = nullptr;
|
||||||
static int theMainSegLength = 0;
|
static int theMainSegLength = 0;
|
||||||
@@ -736,6 +743,7 @@ void refreshNodeList()
|
|||||||
void sendSysInfoUDP()
|
void sendSysInfoUDP()
|
||||||
{
|
{
|
||||||
if (!udp2Connected) return;
|
if (!udp2Connected) return;
|
||||||
|
// DEBUG_PRINTF("[%8u %s]\tsendSysInfoUDP()\tmin stack %d\n", millis(), pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL));
|
||||||
|
|
||||||
IPAddress ip = Network.localIP();
|
IPAddress ip = Network.localIP();
|
||||||
if (!ip || ip == IPAddress(255,255,255,255)) ip = IPAddress(4,3,2,1);
|
if (!ip || ip == IPAddress(255,255,255,255)) ip = IPAddress(4,3,2,1);
|
||||||
|
|||||||
@@ -287,6 +287,30 @@ void appendGPIOinfo() {
|
|||||||
char a_pins[64] = { '\0' }; // fix warning: output 45 bytes into a destination of size 30
|
char a_pins[64] = { '\0' }; // fix warning: output 45 bytes into a destination of size 30
|
||||||
snprintf(a_pins, 64, "d.a_pins=[%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d];", pinManager.getADCPin(PM_ADC1, 0), pinManager.getADCPin(PM_ADC1, 1), pinManager.getADCPin(PM_ADC1, 2), pinManager.getADCPin(PM_ADC1, 3), pinManager.getADCPin(PM_ADC1, 4), pinManager.getADCPin(PM_ADC1, 5), pinManager.getADCPin(PM_ADC1, 6), pinManager.getADCPin(PM_ADC1, 7), pinManager.getADCPin(PM_ADC1, 8), pinManager.getADCPin(PM_ADC1, 9), pinManager.getADCPin(PM_ADC1, 10));
|
snprintf(a_pins, 64, "d.a_pins=[%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d];", pinManager.getADCPin(PM_ADC1, 0), pinManager.getADCPin(PM_ADC1, 1), pinManager.getADCPin(PM_ADC1, 2), pinManager.getADCPin(PM_ADC1, 3), pinManager.getADCPin(PM_ADC1, 4), pinManager.getADCPin(PM_ADC1, 5), pinManager.getADCPin(PM_ADC1, 6), pinManager.getADCPin(PM_ADC1, 7), pinManager.getADCPin(PM_ADC1, 8), pinManager.getADCPin(PM_ADC1, 9), pinManager.getADCPin(PM_ADC1, 10));
|
||||||
oappend(a_pins);
|
oappend(a_pins);
|
||||||
|
|
||||||
|
// WLEDMM add HUB75 pins, as they are not stored directly in cfg.json
|
||||||
|
strcpy(ro_gpio, "d.h_pins=["); // WLEDMM we re-use this array, instead of creating an addition one; 140 bytes is more than enough for 14 pins.
|
||||||
|
bool isFirstPin = true;
|
||||||
|
for(int pinNr = 0; pinNr < WLED_NUM_PINS; pinNr++) {
|
||||||
|
if ((pinManager.isPinOk(pinNr)) && (pinManager.getPinOwner(pinNr) == PinOwner::HUB75)) {
|
||||||
|
sprintf(pinString, "%s%d", isFirstPin ? "" : ",", pinNr);
|
||||||
|
strcat(ro_gpio, pinString); isFirstPin = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
oappend(ro_gpio);
|
||||||
|
oappend(SET_F("];"));
|
||||||
|
|
||||||
|
// WLEDMM same procedure for DMX pins
|
||||||
|
strcpy(ro_gpio, "d.x_pins=["); // WLEDMM we re-use this array, instead of creating an addition one; 140 bytes is more than enough for max 4 pins.
|
||||||
|
isFirstPin = true;
|
||||||
|
for(int pinNr = 0; pinNr < WLED_NUM_PINS; pinNr++) {
|
||||||
|
if ((pinManager.isPinOk(pinNr)) && (pinManager.getPinOwner(pinNr) == PinOwner::DMX || pinManager.getPinOwner(pinNr) == PinOwner::DMX_INPUT)) {
|
||||||
|
sprintf(pinString, "%s%d", isFirstPin ? "" : ",", pinNr);
|
||||||
|
strcat(ro_gpio, pinString); isFirstPin = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
oappend(ro_gpio);
|
||||||
|
oappend(SET_F("];"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//get values for settings form in javascript
|
//get values for settings form in javascript
|
||||||
|
|||||||
Reference in New Issue
Block a user