Merge branch 'MoonModules:mdev' into SmartMatrix

This commit is contained in:
netmindz
2023-10-24 21:38:45 +01:00
committed by GitHub
10 changed files with 3808 additions and 3724 deletions

View File

@@ -51,8 +51,9 @@ void WS2812FX::setUpMatrix() {
}
}
// safety check
if (Segment::maxWidth * Segment::maxHeight > MAX_LEDS || Segment::maxWidth <= 1 || Segment::maxHeight <= 1) {
// safety check
// WLEDMM no chech on Segment::maxWidth * Segment::maxHeight > MAX_LEDS ||
if (Segment::maxWidth <= 1 || Segment::maxHeight <= 1) {
DEBUG_PRINTF("2D Bounds error. %d x %d\n", Segment::maxWidth, Segment::maxHeight);
isMatrix = false;
Segment::maxWidth = _length;
@@ -158,7 +159,7 @@ void WS2812FX::setUpMatrix() {
} else { // memory allocation error
customMappingTableSize = 0;
USER_PRINTLN(F("Ledmap alloc error."));
isMatrix = false;
isMatrix = false; //WLEDMM does not like this done in teh background while end users are confused whats happened...
panels = 0;
panel.clear();
Segment::maxWidth = _length;

View File

@@ -1129,14 +1129,13 @@ function populateNodes(i,n)
//WLEDMM starts here
nodesData = []; //WLEDMM reset nodes
var nodesDone = 0;
function showPanel(panel) {
return "(" + panel.x + "," + panel.y + ") - " + panel.w + "x" + panel.h + " " + (panel.b?1:0) + (panel.r?1:0) + (panel.v?1:0) + (panel.s?1:0);
}
function checkNode(nodeNr) {
// console.log(nodeNr, nodesData[nodeNr]);
console.log("CheckNode", nodeNr, nodesData[nodeNr]);
let errFound = false;
//warnings
@@ -1207,7 +1206,7 @@ function populateNodes(i,n)
gId(`fx${nodeNr}`).innerText = effects[state.seg[0].fx];
//store data
nodesData[nodeNr] = {};
if (!nodesData[nodeNr]) nodesData[nodeNr] = {};
nodesData[nodeNr].info = info;
//if the node has a matrix, show matrix info
@@ -1226,9 +1225,6 @@ function populateNodes(i,n)
gId(`gcc${nodeNr}`).innerText = cfg.light.gc.col > 1;
gId(`fps${nodeNr}`).innerText = cfg.hw.led.fps;
//store data
// nodesData[nodeNr].cfg = cfg;
//if the node has a matrix, show matrix info
if (cfg.hw.led.matrix) {
gId(`pnl0${nodeNr}`).innerText = showPanel(cfg.hw.led.matrix.panels[0]); //show the first panel
@@ -1238,12 +1234,15 @@ function populateNodes(i,n)
if (ip == lastinfo.ip) {
let panelIndex = 0; //loop over panels
for (let i=0; i<nnodes; i++) { //loop over all nodes found
if (panelIndex < cfg.hw.led.matrix.panels.length && nodesData[i] && nodesData[i].info.ip != lastinfo.ip) { //loop over panels of self: assign each panel to a different node
//nodesData[i] does not exist if not all fetches done
if (panelIndex < cfg.hw.led.matrix.panels.length && n.nodes[i].ip != lastinfo.ip) { //loop over panels of self: assign each panel to a different node
let panelX = cfg.hw.led.matrix.panels[panelIndex];
gId(`pnlX${i}`).innerText = showPanel(panelX);
//store data
//nodesData[i] does not exist if not all fetches done
if (!nodesData[i]) nodesData[i] = {};
nodesData[i].cfg = structuredClone(cfg); //structuredClone: by value, not by reference so we can make changex
@@ -1281,10 +1280,18 @@ function populateNodes(i,n)
}
}
}
nodesDone++;
callback(parms);
});
});
callback(nodeNr);
}, function(nodeNr, text) {console.log("cfg error", nodeNr, n.nodes[nodeNr].name, text);callback(nodeNr);}); //also callback on error
}, function(nodeNr, text) {
//to show nodes which failed in providing json info
let ip = n.nodes[nodeNr].ip;
let name = n.nodes[nodeNr].name;
let url = `<button class="btn" ${(ip == lastinfo.ip)?'style="background-color: red;"':''} title="${ip}" onclick="location.assign('http://${ip}');">${name}</button>`;
gId(`ins${nodeNr}`).innerHTML = url;
gId(`ip${nodeNr}`).innerText = ip;
console.log("json error", nodeNr, ip, name, text);
callback(nodeNr); //also callback on error
});
} //fetchInfoAndCfg
if (n.nodes) {
@@ -1304,14 +1311,17 @@ function populateNodes(i,n)
urows += `</tr>`;
//show other nodes e.g. {name: "MM 32 L", type: 32, ip: "192.168.121.249", age: 1, vid: 2305080}
var nodesDone = 0;
for (let o of n.nodes) {
if (o.name) {
if (o.ip) { //in ap mode no ip...
fetchInfoAndCfg(o.ip, nnodes, -1, function() {
fetchInfoAndCfg(o.ip, nnodes, -1, function(nodeNr) {
nodesDone++;
console.log("nodesDone", nodesDone, nodeNr, n.nodes.length, nnodes, n.nodes[nodeNr].name);
//if all done
if (nodesDone == nnodes ) {
for (let i=0; i<nnodes; i++) {
if (gId(`ip${i}`).innerText != lastinfo.ip) //not self
if (nodesDone == n.nodes.length ) {
for (let i=0; i<n.nodes.length; i++) {
if (n.nodes[i].ip != lastinfo.ip && nodesData[i] && nodesData[i].info && nodesData[i].cfg) //not self and data has been collected (no errors getting files)
checkNode(i);
}
}

View File

@@ -9,7 +9,7 @@
// Autogenerated from wled00/data/cpal/cpal.htm, do not edit!!
const uint16_t PAGE_cpal_L = 4721;
const uint8_t PAGE_cpal[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xbd, 0x3b, 0x7f, 0x73, 0xdb, 0xb6,
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xbd, 0x3b, 0x7f, 0x73, 0xdb, 0xb6,
0x92, 0xff, 0xe7, 0x53, 0x20, 0x4c, 0x5f, 0x42, 0xd6, 0x14, 0x45, 0xd2, 0xb6, 0x64, 0x4b, 0xa2,
0x3b, 0xa9, 0x93, 0x77, 0xce, 0x8d, 0xdd, 0x64, 0x5e, 0x7c, 0x6e, 0x7b, 0x3e, 0xbf, 0x31, 0x4d,
0x42, 0x12, 0x1b, 0x8a, 0xe0, 0x03, 0x21, 0xd9, 0xae, 0xac, 0xef, 0x7e, 0xbb, 0x00, 0x48, 0x91,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@
// Autogenerated from wled00/data/style.css, do not edit!!
const uint16_t PAGE_settingsCss_length = 847;
const uint8_t PAGE_settingsCss[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xad, 0x55, 0xc1, 0x8e, 0x9b, 0x30,
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xad, 0x55, 0xc1, 0x8e, 0x9b, 0x30,
0x10, 0xfd, 0x15, 0xaa, 0x68, 0xa5, 0xad, 0x14, 0x10, 0x10, 0xc8, 0xa6, 0x46, 0x95, 0xaa, 0xde,
0x7b, 0xab, 0xaa, 0x4a, 0xd5, 0x1e, 0x0c, 0x1e, 0x82, 0x15, 0x63, 0x23, 0xdb, 0x74, 0x49, 0x11,
0xff, 0x5e, 0xdb, 0xc0, 0x42, 0xb2, 0x68, 0x7b, 0xa9, 0xa2, 0x44, 0xc4, 0x63, 0xc6, 0x6f, 0xde,
@@ -67,7 +67,7 @@ const uint8_t PAGE_settingsCss[] PROGMEM = {
// Autogenerated from wled00/data/settings.htm, do not edit!!
const uint16_t PAGE_settings_length = 1267;
const uint8_t PAGE_settings[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xad, 0x56, 0xe1, 0x6e, 0xdb, 0x36,
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xad, 0x56, 0xe1, 0x6e, 0xdb, 0x36,
0x10, 0xfe, 0xef, 0xa7, 0x60, 0xd8, 0x2d, 0x91, 0x50, 0x59, 0x76, 0xdc, 0x61, 0xd8, 0x64, 0x4b,
0x45, 0x9b, 0xa4, 0x6d, 0x86, 0x04, 0x09, 0x90, 0xa4, 0xdd, 0xb0, 0x0d, 0x28, 0x4d, 0x9e, 0x6c,
0x36, 0x12, 0x29, 0x90, 0x94, 0x13, 0xcf, 0xf5, 0x7b, 0xec, 0x69, 0xf6, 0x30, 0x7b, 0x92, 0x1d,
@@ -153,7 +153,7 @@ const uint8_t PAGE_settings[] PROGMEM = {
// Autogenerated from wled00/data/settings_wifi.htm, do not edit!!
const uint16_t PAGE_settings_wifi_length = 2275;
const uint8_t PAGE_settings_wifi[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xad, 0x58, 0xff, 0x53, 0xdb, 0x3a,
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xad, 0x58, 0xff, 0x53, 0xdb, 0x3a,
0x12, 0xff, 0xdd, 0x7f, 0x85, 0xd0, 0xbb, 0xe9, 0xd8, 0x83, 0xe3, 0x10, 0xd2, 0xf6, 0xf5, 0x20,
0x4e, 0x0f, 0x42, 0x1e, 0x70, 0x8f, 0x42, 0xae, 0x61, 0xca, 0xdc, 0xf4, 0x3a, 0xef, 0x19, 0x5b,
0x49, 0x54, 0x6c, 0xc9, 0x67, 0xc9, 0x09, 0x0c, 0xe4, 0x7f, 0x7f, 0xbb, 0x92, 0x13, 0xe2, 0x40,
@@ -302,7 +302,7 @@ const uint8_t PAGE_settings_wifi[] PROGMEM = {
// Autogenerated from wled00/data/settings_leds.htm, do not edit!!
const uint16_t PAGE_settings_leds_length = 7962;
const uint8_t PAGE_settings_leds[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xdd, 0x3c, 0x6b, 0x77, 0xe2, 0xc6,
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xdd, 0x3c, 0x6b, 0x77, 0xe2, 0xc6,
0x92, 0xdf, 0xf9, 0x15, 0x6d, 0x25, 0x71, 0xa4, 0x20, 0x83, 0xc4, 0xc3, 0xc1, 0x80, 0xf0, 0x1a,
0xcf, 0x23, 0xbe, 0xd7, 0x1e, 0xfb, 0x80, 0x27, 0x73, 0xf7, 0x24, 0x73, 0x32, 0x42, 0x6a, 0x40,
0x63, 0x21, 0x71, 0x25, 0x61, 0x8f, 0xd7, 0xf6, 0xfe, 0xa6, 0xfd, 0x0d, 0xfb, 0xcb, 0xb6, 0xaa,
@@ -806,7 +806,7 @@ const uint8_t PAGE_settings_leds[] PROGMEM = {
// Autogenerated from wled00/data/settings_dmx.htm, do not edit!!
const uint16_t PAGE_settings_dmx_length = 1601;
const uint8_t PAGE_settings_dmx[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0x95, 0x57, 0x6d, 0x57, 0xdb, 0x36,
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x95, 0x57, 0x6d, 0x57, 0xdb, 0x36,
0x14, 0xfe, 0x9e, 0x5f, 0xa1, 0xea, 0x43, 0xb1, 0x0f, 0xae, 0x9d, 0xc0, 0xe8, 0xd6, 0x60, 0x9b,
0x8d, 0x94, 0x01, 0x3b, 0xc0, 0x38, 0x4d, 0xbb, 0x6e, 0x67, 0xdd, 0xd9, 0x51, 0xec, 0x9b, 0x58,
0xc5, 0x96, 0x3c, 0x49, 0x4e, 0xa0, 0xb4, 0xff, 0x7d, 0x57, 0x72, 0xe2, 0x04, 0x0a, 0x7d, 0xf9,
@@ -913,7 +913,7 @@ const uint8_t PAGE_settings_dmx[] PROGMEM = {
// Autogenerated from wled00/data/settings_ui.htm, do not edit!!
const uint16_t PAGE_settings_ui_length = 3201;
const uint8_t PAGE_settings_ui[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xad, 0x59, 0x6b, 0x73, 0xdb, 0x36,
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xad, 0x59, 0x6b, 0x73, 0xdb, 0x36,
0x16, 0xfd, 0xae, 0x5f, 0x81, 0x20, 0x19, 0x57, 0x1a, 0xb3, 0xb4, 0x9c, 0x74, 0x66, 0x13, 0x49,
0x94, 0x37, 0x76, 0xdc, 0xc4, 0x1d, 0xa7, 0xc9, 0x46, 0xf6, 0xb6, 0x3b, 0x59, 0x8f, 0x4b, 0x91,
0x90, 0x84, 0x98, 0x24, 0x58, 0x02, 0xf4, 0x63, 0x15, 0xfd, 0xf7, 0x3d, 0x17, 0x20, 0x25, 0x4a,
@@ -1120,7 +1120,7 @@ const uint8_t PAGE_settings_ui[] PROGMEM = {
// Autogenerated from wled00/data/settings_sync.htm, do not edit!!
const uint16_t PAGE_settings_sync_length = 3750;
const uint8_t PAGE_settings_sync[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xad, 0x5a, 0xeb, 0x72, 0xdb, 0x36,
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xad, 0x5a, 0xeb, 0x72, 0xdb, 0x36,
0x16, 0xfe, 0xcf, 0xa7, 0x40, 0xd8, 0x99, 0x54, 0xaa, 0x65, 0xdd, 0x6c, 0x39, 0x8e, 0x2d, 0x32,
0x2b, 0x5b, 0x8e, 0xad, 0xae, 0x2f, 0x8a, 0xe4, 0xb4, 0xe9, 0x74, 0x3b, 0x1d, 0x88, 0x84, 0x24,
0xda, 0x24, 0xc1, 0x12, 0xa0, 0x2f, 0x93, 0xe6, 0x3d, 0xf6, 0x69, 0xf6, 0x61, 0xf6, 0x49, 0xf6,
@@ -1361,7 +1361,7 @@ const uint8_t PAGE_settings_sync[] PROGMEM = {
// Autogenerated from wled00/data/settings_time.htm, do not edit!!
const uint16_t PAGE_settings_time_length = 3305;
const uint8_t PAGE_settings_time[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xd5, 0x1a, 0x6b, 0x57, 0xdb, 0x38,
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xd5, 0x1a, 0x6b, 0x57, 0xdb, 0x38,
0xf6, 0x7b, 0x7e, 0x85, 0x50, 0x7b, 0x98, 0x78, 0x70, 0x9e, 0x90, 0x16, 0x92, 0xd8, 0xdd, 0x10,
0xd2, 0x42, 0x4b, 0x02, 0x67, 0x92, 0x0e, 0xbb, 0xd3, 0xf6, 0x4c, 0x15, 0x5b, 0x49, 0x0c, 0x8e,
0xe4, 0xb5, 0x65, 0x02, 0x4b, 0xf9, 0xef, 0x7b, 0x25, 0x39, 0xce, 0xd3, 0xd0, 0x76, 0x66, 0x3f,
@@ -1574,7 +1574,7 @@ const uint8_t PAGE_settings_time[] PROGMEM = {
// Autogenerated from wled00/data/settings_sec.htm, do not edit!!
const uint16_t PAGE_settings_sec_length = 2483;
const uint8_t PAGE_settings_sec[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xad, 0x58, 0xff, 0x72, 0xd3, 0x48,
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xad, 0x58, 0xff, 0x72, 0xd3, 0x48,
0x12, 0xfe, 0xdf, 0x4f, 0x31, 0x1e, 0xaa, 0x58, 0xeb, 0x50, 0xe4, 0x10, 0xa8, 0x3d, 0x08, 0x96,
0xb9, 0x84, 0x84, 0x25, 0x57, 0x09, 0x49, 0x61, 0xb3, 0xdc, 0x15, 0x47, 0x51, 0x63, 0x69, 0x6c,
0x0d, 0x96, 0x34, 0xda, 0x99, 0x51, 0x8c, 0x8f, 0xdd, 0xf7, 0xb8, 0xa7, 0xb9, 0x87, 0xb9, 0x27,
@@ -1736,7 +1736,7 @@ const uint8_t PAGE_settings_sec[] PROGMEM = {
// Autogenerated from wled00/data/settings_um.htm, do not edit!!
const uint16_t PAGE_settings_um_length = 3215;
const uint8_t PAGE_settings_um[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xcd, 0x59, 0xed, 0x72, 0xdb, 0xc6,
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xcd, 0x59, 0xed, 0x72, 0xdb, 0xc6,
0x15, 0xfd, 0xaf, 0xa7, 0x80, 0x36, 0xae, 0x04, 0x0c, 0x21, 0x90, 0x8a, 0x93, 0x19, 0x9b, 0x20,
0xa8, 0xda, 0xb2, 0x1d, 0xab, 0xb5, 0x23, 0x4d, 0x64, 0x27, 0xe9, 0xc8, 0xaa, 0x05, 0x12, 0x4b,
0x12, 0x36, 0xb8, 0x8b, 0x00, 0x0b, 0x7d, 0x94, 0xd2, 0x5b, 0xf4, 0x7f, 0x3a, 0xed, 0x2b, 0xf4,
@@ -1943,7 +1943,7 @@ const uint8_t PAGE_settings_um[] PROGMEM = {
// Autogenerated from wled00/data/settings_2D.htm, do not edit!!
const uint16_t PAGE_settings_2D_length = 3766;
const uint8_t PAGE_settings_2D[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xc5, 0x5a, 0xeb, 0x76, 0xdb, 0x36,
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xc5, 0x5a, 0xeb, 0x76, 0xdb, 0x36,
0x12, 0xfe, 0xaf, 0xa7, 0x80, 0xd9, 0xae, 0x4b, 0xda, 0xd4, 0xcd, 0x4d, 0x7b, 0x5a, 0x49, 0xa4,
0xd6, 0x97, 0x34, 0xf6, 0x1e, 0x3b, 0xd1, 0xb1, 0x5c, 0x3b, 0x39, 0x6d, 0x4f, 0x43, 0x93, 0xa0,
0x84, 0x84, 0x02, 0x58, 0x12, 0xf2, 0xa5, 0x8e, 0xdf, 0x63, 0x9f, 0x66, 0x1f, 0x66, 0x9f, 0x64,
@@ -2185,7 +2185,7 @@ const uint8_t PAGE_settings_2D[] PROGMEM = {
// Autogenerated from wled00/data/settings_pin.htm, do not edit!!
const uint16_t PAGE_settings_pin_length = 460;
const uint8_t PAGE_settings_pin[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0x5d, 0x92, 0x4b, 0x6f, 0x13, 0x31,
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x5d, 0x92, 0x4b, 0x6f, 0x13, 0x31,
0x14, 0x85, 0xf7, 0xf3, 0x2b, 0xcc, 0xdd, 0x34, 0x41, 0x49, 0xa6, 0x54, 0x2c, 0x8a, 0x6a, 0x8f,
0x50, 0xa0, 0x0b, 0x36, 0x25, 0x52, 0xd9, 0xa0, 0xaa, 0xaa, 0x1c, 0xfb, 0x4e, 0x62, 0xd5, 0x8f,
0xc1, 0x8f, 0x84, 0x80, 0xfa, 0xdf, 0xb9, 0x9e, 0x69, 0x0b, 0x62, 0x33, 0xf6, 0xb9, 0xb6, 0xcf,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@
*/
// version code in format yymmddb (b = daily build)
#define VERSION 2310150
#define VERSION 2310240
//WLEDMM + Moustachauve/Wled-Native
// You can define custom product info from build flags.

View File

@@ -194,9 +194,19 @@ static bool sendLiveLedsWs(uint32_t wsClient) // WLEDMM added "static"
constexpr size_t MAX_LIVE_LEDS_WS = 4096U; //WLEDMM use 4096 as max matrix size
#endif
size_t n = ((used -1)/MAX_LIVE_LEDS_WS) +1; //only serve every n'th LED if count over MAX_LIVE_LEDS_WS
//WLEDMM skipping lines done right
#ifndef WLED_DISABLE_2D
if (strip.isMatrix) {
if (Segment::maxWidth * Segment::maxHeight > MAX_LIVE_LEDS_WS*4)
n = 4;
else if (Segment::maxWidth * Segment::maxHeight > MAX_LIVE_LEDS_WS)
n = 2;
else
n = 1;
}
#endif
size_t pos = (strip.isMatrix ? 4 : 2);
size_t bufSize = pos + (used/n)*3;
//WLEDMM: no skipLines
if ((bufSize < 1) || (used < 1)) return(false); // WLEDMM should not happen
//AsyncWebSocketMessageBuffer * wsBuf = ws.makeBuffer(bufSize);
@@ -225,19 +235,24 @@ static bool sendLiveLedsWs(uint32_t wsClient) // WLEDMM added "static"
wsBuf->lock(); // protect buffer from being cleaned by another WS instance
buffer[0] = 'L';
buffer[1] = 1; //version
#ifndef WLED_DISABLE_2D
if (strip.isMatrix) {
buffer[1] = 2; //version
buffer[2] = min(Segment::maxWidth, (uint16_t) 255); // WLEDMM prevent overflow on buffer type uint8_t
buffer[3] = min(Segment::maxHeight, (uint16_t) 255);
//WLEDMM: no skipLines
}
#endif
#ifndef WLED_DISABLE_2D
if (strip.isMatrix) {
buffer[1] = 2; //version
//WLEDMM skipping lines done right
buffer[2] = MIN(Segment::maxWidth/n, (uint16_t) 255); // WLEDMM prevent overflow on buffer type uint8_t
buffer[3] = MIN(Segment::maxHeight/n, (uint16_t) 255);
}
#endif
uint8_t stripBrightness = strip.getBrightness();
for (size_t i = 0; pos < bufSize -2; i += n)
{
//WLEDMM: no skipLines
//WLEDMM skipping lines done right
#ifndef WLED_DISABLE_2D
if (strip.isMatrix && n > 1) {
if ((i/Segment::maxWidth)%(n)) i += Segment::maxWidth * (n-1);
}
#endif
uint32_t c = restoreColorLossy(strip.getPixelColor(i), stripBrightness); // WLEDMM full bright preview - does _not_ recover ABL reductions
// WLEDMM begin: preview with color gamma correction
if (gammaCorrectPreview) {