Change WLEDSR to WLEDMM in comments

This commit is contained in:
Ewoud
2022-11-09 12:14:42 +01:00
parent f2adc5eff4
commit c3c3ff39b5
24 changed files with 98 additions and 98 deletions

View File

@@ -1083,7 +1083,7 @@ uint16_t mode_running_random(void) {
uint8_t z = it % zoneSize;
bool nzone = (!z && it != SEGENV.aux1);
for (int i=SEGLEN-1; i >= 0; i--) { // WLEDSR bugfix
for (int i=SEGLEN-1; i >= 0; i--) { // WLEDMM bugfix
if (nzone || z >= zoneSize) {
uint8_t lastrand = PRNG16 >> 8;
int16_t diff = 0;
@@ -1724,7 +1724,7 @@ uint16_t mode_random_chase(void)
uint32_t color = SEGENV.step;
random16_set_seed(SEGENV.aux0);
for (int i = SEGLEN -1; i >= 0; i--) { // WLEDSR bugfix
for (int i = SEGLEN -1; i >= 0; i--) { // WLEDMM bugfix
uint8_t r = random8(6) != 0 ? (color >> 16 & 0xFF) : random8();
uint8_t g = random8(6) != 0 ? (color >> 8 & 0xFF) : random8();
uint8_t b = random8(6) != 0 ? (color & 0xFF) : random8();
@@ -5347,7 +5347,7 @@ static const char _data_FX_MODE_2DPOLARLIGHTS[] PROGMEM = "Polar Lights@Speed,Sc
uint16_t mode_2DPulser(void) { // By: ldirko https://editor.soulmatelights.com/gallery/878-pulse-test , modifed by: Andrew Tuline
if (!strip.isMatrix) return mode_static(); // not a 2D set-up
const uint16_t cols = SEGMENT.virtualWidth(); // WLEDSR bugfix
const uint16_t cols = SEGMENT.virtualWidth(); // WLEDMM bugfix
const uint16_t rows = SEGMENT.virtualHeight();
if (SEGENV.call == 0) {
@@ -5358,7 +5358,7 @@ uint16_t mode_2DPulser(void) { // By: ldirko https://edi
SEGMENT.fadeToBlackBy(8 - (SEGMENT.intensity>>5));
uint32_t a = strip.now / (18 - SEGMENT.speed / 16);
uint16_t x = (a / 14) % cols; // WLEDSR bugfix
uint16_t x = (a / 14) % cols; // WLEDMM bugfix
uint16_t y = map((sin8(a * 5) + sin8(a * 4) + sin8(a * 2)), 0, 765, rows-1, 0);
SEGMENT.setPixelColorXY(x, y, ColorFromPalette(SEGPALETTE, map(y, 0, rows-1, 0, 255), 255, LINEARBLEND));

View File

@@ -317,7 +317,7 @@
#define FX_MODE_WAVESINS 184
#define FX_MODE_ROCKTAVES 185
#define FX_MODE_2DAKEMI 186
#define FX_MODE_CUSTOMEFFECT 187 //WLEDSR Custom Effects
#define FX_MODE_CUSTOMEFFECT 187 //WLEDMM Custom Effects
#define MODE_COUNT 188
@@ -326,9 +326,9 @@ typedef enum mapping1D2D {
M12_pBar = 1,
M12_pArc = 2,
M12_pCorner = 3,
M12_jMap = 4, //WLEDSR jMap
M12_sCircle = 5, //WLEDSR jMap
M12_sBlock = 6 //WLEDSR jMap
M12_jMap = 4, //WLEDMM jMap
M12_sCircle = 5, //WLEDMM jMap
M12_sBlock = 6 //WLEDMM jMap
} mapping1D2D_t;
// segment, 72 bytes
@@ -382,7 +382,7 @@ typedef struct Segment {
byte* data;
CRGB* leds;
static CRGB *_globalLeds;
void *jMap; //WLEDSR jMap
void *jMap; //WLEDMM jMap
private:
union {
@@ -473,7 +473,7 @@ typedef struct Segment {
}
Segment(uint16_t sStartX, uint16_t sStopX, uint16_t sStartY, uint16_t sStopY) : Segment(sStartX, sStopX) {
Serial.println("Segment"); //WLEDSR jMap
Serial.println("Segment"); //WLEDMM jMap
startY = sStartY;
stopY = sStopY;
}
@@ -576,8 +576,8 @@ typedef struct Segment {
uint16_t virtualWidth(void) const;
uint16_t virtualHeight(void) const;
uint16_t nrOfVStrips(void) const;
void createjMap(); //WLEDSR jMap
void deletejMap(); //WLEDSR jMap
void createjMap(); //WLEDMM jMap
void deletejMap(); //WLEDMM jMap
#ifndef WLED_DISABLE_2D
uint16_t XY(uint16_t x, uint16_t y); // support function to get relative index within segment (for leds[])
void setPixelColorXY(int x, int y, uint32_t c); // set relative pixel within segment with color

View File

@@ -109,7 +109,7 @@ void WS2812FX::setUpMatrix() {
}
// absolute matrix version of setPixelColor()
void IRAM_ATTR_YN WS2812FX::setPixelColorXY(int x, int y, uint32_t col) //WLEDSR: IRAM_ATTR conditionaly
void IRAM_ATTR_YN WS2812FX::setPixelColorXY(int x, int y, uint32_t col) //WLEDMM: IRAM_ATTR conditionaly
{
#ifndef WLED_DISABLE_2D
if (!isMatrix) return; // not a matrix set-up
@@ -141,13 +141,13 @@ uint32_t WS2812FX::getPixelColorXY(uint16_t x, uint16_t y) {
#ifndef WLED_DISABLE_2D
// XY(x,y) - gets pixel index within current segment (often used to reference leds[] array element)
uint16_t IRAM_ATTR_YN Segment::XY(uint16_t x, uint16_t y) { //WLEDSR: IRAM_ATTR conditionaly
uint16_t IRAM_ATTR_YN Segment::XY(uint16_t x, uint16_t y) { //WLEDMM: IRAM_ATTR conditionaly
uint16_t width = virtualWidth(); // segment width in logical pixels
uint16_t height = virtualHeight(); // segment height in logical pixels
return (x%width) + (y%height) * width;
}
void IRAM_ATTR_YN Segment::setPixelColorXY(int x, int y, uint32_t col) //WLEDSR: IRAM_ATTR conditionaly
void IRAM_ATTR_YN Segment::setPixelColorXY(int x, int y, uint32_t col) //WLEDMM: IRAM_ATTR conditionaly
{
if (!strip.isMatrix) return; // not a matrix set-up
if (x >= virtualWidth() || y >= virtualHeight() || x<0 || y<0) return; // if pixel would fall out of virtual segment just exit

View File

@@ -89,7 +89,7 @@ Segment::Segment(const Segment &orig) {
if (orig.data) { if (allocateData(orig._dataLen)) memcpy(data, orig.data, orig._dataLen); }
if (orig._t) { _t = new Transition(orig._t->_dur, orig._t->_briT, orig._t->_cctT, orig._t->_colorT); }
if (orig.leds && !Segment::_globalLeds) { leds = (CRGB*)malloc(sizeof(CRGB)*length()); if (leds) memcpy(leds, orig.leds, sizeof(CRGB)*length()); }
jMap = nullptr; //WLEDSR jMap
jMap = nullptr; //WLEDMM jMap
}
// move constructor
@@ -101,7 +101,7 @@ Segment::Segment(Segment &&orig) noexcept {
orig._dataLen = 0;
orig._t = nullptr;
orig.leds = nullptr;
orig.jMap = nullptr; //WLEDSR jMap
orig.jMap = nullptr; //WLEDMM jMap
}
// copy assignment
@@ -126,7 +126,7 @@ Segment& Segment::operator= (const Segment &orig) {
if (orig.data) { if (allocateData(orig._dataLen)) memcpy(data, orig.data, orig._dataLen); }
if (orig._t) { _t = new Transition(orig._t->_dur, orig._t->_briT, orig._t->_cctT, orig._t->_colorT); }
if (orig.leds && !Segment::_globalLeds) { leds = (CRGB*)malloc(sizeof(CRGB)*length()); if (leds) memcpy(leds, orig.leds, sizeof(CRGB)*length()); }
jMap = nullptr; //WLEDSR jMap
jMap = nullptr; //WLEDMM jMap
}
return *this;
}
@@ -145,7 +145,7 @@ Segment& Segment::operator= (Segment &&orig) noexcept {
orig._dataLen = 0;
orig._t = nullptr;
orig.leds = nullptr;
orig.jMap = nullptr; //WLEDSR jMap
orig.jMap = nullptr; //WLEDMM jMap
}
return *this;
}
@@ -465,10 +465,10 @@ uint16_t Segment::nrOfVStrips() const {
case M12_pBar:
vLen = virtualWidth();
break;
case M12_sCircle: //WLEDSR
case M12_sCircle: //WLEDMM
vLen = (virtualWidth() + virtualHeight()) / 6; // take third of the average width
break;
case M12_sBlock: //WLEDSR
case M12_sBlock: //WLEDMM
vLen = (virtualWidth() + virtualHeight()) / 8; // take half of the average width
break;
}
@@ -477,7 +477,7 @@ uint16_t Segment::nrOfVStrips() const {
return vLen;
}
//WLEDSR jMap
//WLEDMM jMap
struct XandY {
uint8_t x;
uint8_t y;
@@ -609,7 +609,7 @@ class JMapC {
} //updatejMapDoc
}; //class JMapC
//WLEDSR jMap
//WLEDMM jMap
void Segment::createjMap() {
if (!jMap) {
Serial.println("createjMap");
@@ -617,7 +617,7 @@ void Segment::createjMap() {
}
}
//WLEDSR jMap
//WLEDMM jMap
void Segment::deletejMap() {
//Should be called from ~Segment but causes crash (and ~Segment is called quite often...)
if (jMap) {
@@ -641,15 +641,15 @@ uint16_t Segment::virtualLength() const {
case M12_pArc:
vLen = max(vW,vH); // get the longest dimension
break;
case M12_jMap: //WLEDSR jMap
case M12_jMap: //WLEDMM jMap
if (jMap)
vLen = ((JMapC *)jMap)->length();
break;
case M12_sCircle: //WLEDSR
case M12_sCircle: //WLEDMM
vLen = max(vW,vH); // get the longest dimension
// vLen = (virtualWidth() + virtualHeight()) * 3;
break;
case M12_sBlock: //WLEDSR
case M12_sBlock: //WLEDMM
if (nrOfVStrips()>1)
vLen = max(vW,vH) * 4;//0.5; // get the longest dimension
else
@@ -665,7 +665,7 @@ uint16_t Segment::virtualLength() const {
return vLength;
}
//WLEDSR used for M12_sBlock
//WLEDMM used for M12_sBlock
void xyFromBlock(uint16_t &x,uint16_t &y, uint16_t i, uint16_t vW, uint16_t vH, uint16_t vStrip) {
float i2;
if (i<=SEGLEN*0.25) { //top, left to right
@@ -691,7 +691,7 @@ void xyFromBlock(uint16_t &x,uint16_t &y, uint16_t i, uint16_t vW, uint16_t vH,
}
void IRAM_ATTR_YN Segment::setPixelColor(int i, uint32_t col) //WLEDSR: IRAM_ATTR conditionaly
void IRAM_ATTR_YN Segment::setPixelColor(int i, uint32_t col) //WLEDMM: IRAM_ATTR conditionaly
{
int vStrip = i>>16; // hack to allow running on virtual strips (2D segment columns/rows)
i &= 0xFFFF;
@@ -723,11 +723,11 @@ void IRAM_ATTR_YN Segment::setPixelColor(int i, uint32_t col) //WLEDSR: IRAM_ATT
for (int x = 0; x <= i; x++) setPixelColorXY(x, i, col);
for (int y = 0; y < i; y++) setPixelColorXY(i, y, col);
break;
case M12_jMap: //WLEDSR jMap
case M12_jMap: //WLEDMM jMap
if (jMap)
((JMapC *)jMap)->setPixelColor(i, col);
break;
case M12_sCircle: //WLEDSR
case M12_sCircle: //WLEDMM
if (vStrip > 0)
{
int x = roundf(sin_t(360*i/SEGLEN*DEG_TO_RAD) * vW * (vStrip+1)/nrOfVStrips());
@@ -737,7 +737,7 @@ void IRAM_ATTR_YN Segment::setPixelColor(int i, uint32_t col) //WLEDSR: IRAM_ATT
else // pArc -> circle
drawArc(vW/2, vH/2, i/2, col);
break;
case M12_sBlock: //WLEDSR
case M12_sBlock: //WLEDMM
if (vStrip > 0)
{
//vStrip+1 is distance from centre, i is how much of the square is filled
@@ -862,11 +862,11 @@ uint32_t Segment::getPixelColor(int i)
// use longest dimension
return vW>vH ? getPixelColorXY(i, 0) : getPixelColorXY(0, i);
break;
case M12_jMap: //WLEDSR jMap
case M12_jMap: //WLEDMM jMap
if (jMap)
return ((JMapC *)jMap)->getPixelColor(i);
break;
case M12_sCircle: //WLEDSR
case M12_sCircle: //WLEDMM
if (vStrip > 0)
{
int x = roundf(sin_t(360*i/SEGLEN*DEG_TO_RAD) * vW * (vStrip+1)/nrOfVStrips());
@@ -876,7 +876,7 @@ uint32_t Segment::getPixelColor(int i)
else
return vW>vH ? getPixelColorXY(i, 0) : getPixelColorXY(0, i);
break;
case M12_sBlock: //WLEDSR
case M12_sBlock: //WLEDMM
if (vStrip > 0)
{
uint16_t x=0,y=0;

View File

@@ -96,7 +96,7 @@
#define USERMOD_ID_ANALOG_CLOCK 33 //Usermod "Analog_Clock.h"
#define USERMOD_ID_PING_PONG_CLOCK 34 //Usermod "usermod_v2_ping_pong_clock.h"
#define USERMOD_ID_ADS1115 35 //Usermod "usermod_ads1115.h"
//WLEDSR
//WLEDMM
#define USERMOD_ID_CUSTOMEFFECTS 36 //Usermod "usermod_v2_customeffects.h"
#define USERMOD_ID_WEATHER 37 //Usermod "usermod_v2_weather.h"
#define USERMOD_ID_GAMES 38 //Usermod "usermod_v2_games.h"
@@ -431,7 +431,7 @@
#define HW_PIN_CSSPI SS
#endif
// WLEDSR: IRAM_ATTR for 8266 causes error: section `.text1' will not fit in region `iram1_0_seg'
// WLEDMM: IRAM_ATTR for 8266 causes error: section `.text1' will not fit in region `iram1_0_seg'
// error only in MM, not in upstream... tbd: find out why
#ifdef ARDUINO_ARCH_ESP32
#define IRAM_ATTR_YN IRAM_ATTR

View File

@@ -51,7 +51,7 @@
setTimeout(()=>{h.appendChild(l)},100);
</script>
<link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="../../usermods/customeffects/customeffects.css"> <!--WLEDSR Custom Effects -->
<link rel="stylesheet" href="../../usermods/customeffects/customeffects.css"> <!--WLEDMM Custom Effects -->
</head>
<body>
@@ -366,7 +366,7 @@
</div>
</div>
<!-- WLEDSR Custom Effects -->
<!-- WLEDMM Custom Effects -->
<div id="ceEditor" class="modal">
<div id="kceEditor">Loading...</div><br>
</div>
@@ -386,6 +386,6 @@
</div>
<i id="roverstar" class="icons huge" onclick="setLor(0)">&#xe410;</i><br>
<script src="index.js"></script>
<script src="../../usermods/customeffects/customeffects.js"></script> <!--WLEDSR Custom Effects-->
<script src="../../usermods/customeffects/customeffects.js"></script> <!--WLEDMM Custom Effects-->
</body>
</html>

View File

@@ -642,7 +642,7 @@ function populateInfo(i)
var cn="";
var heap = i.freeheap/1000;
heap = heap.toFixed(1);
var theap = (i.totalheap>0)?i.totalheap/1000:-1; theap = theap.toFixed(1); //WLEDSR - total heap is not available on 8266
var theap = (i.totalheap>0)?i.totalheap/1000:-1; theap = theap.toFixed(1); //WLEDMM - total heap is not available on 8266
var pwr = i.leds.pwr;
var pwru = "Not calculated";
if (pwr > 1000) {pwr /= 1000; pwr = pwr.toFixed((pwr > 10) ? 0 : 1); pwru = pwr + " A";}
@@ -661,7 +661,7 @@ function populateInfo(i)
if (i.ver.includes("-bl")) vcn = "Supāku";
if (i.cn) vcn = i.cn;
//WLEDSR: add total heap and total PSRAM, and build number, add bin name
//WLEDMM: add total heap and total PSRAM, and build number, add bin name
if (i.ver.includes(".14.1-")) vcn = "Sitting Ducks"; // easter egg
if ((i.ver.includes("14.0."))&&(i.ver.includes("_MM"))) vcn = "Lupo";
cn += `v${i.ver} &nbsp;<i>"${vcn}"</i><p>(WLEDMM_${i.ver}_${i.rel}.bin)</p><p><em>build ${i.vid}</em></p><table>
@@ -672,7 +672,7 @@ ${inforow("Signal strength",i.wifi.signal +"% ("+ i.wifi.rssi, " dBm)")}
${inforow("Uptime",getRuntimeStr(i.uptime))}
${inforow("Estimated current",pwru)}
${inforow("Average FPS",i.leds.fps)}
<!-- WLEDSR begin-->
<!-- WLEDMM begin-->
<tr><td colspan=2><hr style="height:1px;border-width:0;color:SeaGreen;background-color:SeaGreen"></td></tr>
${inforow("MAC address",i.mac)}
${inforow("Filesystem",i.fs.u + "/" + i.fs.t + " kB (" +Math.round(i.fs.u*100/i.fs.t) + "%)")}
@@ -688,7 +688,7 @@ ${i.e32model?inforow(i.e32model,i.e32cores +" core(s)"," "+i.e32speed+" Mhz"):""
${i.e32flash?inforow("Flash "+i.e32flash+" MB"+", mode "+i.e32flashmode+i.e32flashtext,i.e32flashspeed," Mhz"):""}
${i.e32core0code?inforow("Core0 rst reason",i.e32core0code, " "+i.e32core0text):""}
${i.e32core1code?inforow("Core1 rst reason",i.e32core1code, " "+i.e32core1text):""}
<!-- WLEDSR end-->
<!-- WLEDMM end-->
</table>`;
gId('kv').innerHTML = cn;
// update all sliders in Info
@@ -732,7 +732,7 @@ function populateSegments(s)
rvYck = `<label class="check revchkl">Reverse<input type="checkbox" id="seg${i}rY" onchange="setRevY(${i})" ${inst.rY?"checked":""}><span class="checkmark"></span></label>`;
miYck = `<label class="check revchkl">Mirror<input type="checkbox" id="seg${i}mY" onchange="setMiY(${i})" ${inst.mY?"checked":""}><span class="checkmark"></span></label>`;
}
// WLEDSR: jMap
// WLEDMM: jMap
let map2D = `<div id="seg${i}map2D" data-map="map2D" class="lbl-s hide">Expand 1D FX<br>
<div class="sel-p"><select class="sel-p" id="seg${i}mp12" onchange="setMp12(${i})">
<option value="0" ${inst.mp12==0?' selected':''}>Pixels</option>
@@ -752,7 +752,7 @@ function populateSegments(s)
<option value="3" ${inst.ssim==3?' selected':''}>U14_3</option>
</select></div>
</div>`;
//WLEDSR Custom Effects
//WLEDMM Custom Effects
let fxName = eJson.find((o)=>{return o.id==selectedFx}).name;
let cusEff = `<button class="btn" onclick="toggleCEEditor('${inst.n?inst.n:"default"}', ${i})">Custom Effect Editor</button><br>`;
cn += `<div class="seg lstI ${i==s.mainseg ? 'selected' : ''} ${exp ? "expanded":""}" id="seg${i}">
@@ -854,7 +854,7 @@ function populateEffects()
});
for (let ef of effects) {
// WLEDSR: add slider and color control to setFX (used by requestjson)
// WLEDMM: add slider and color control to setFX (used by requestjson)
let id = ef.id;
let nm = ef.name+" ";
let fd = "";
@@ -1366,7 +1366,7 @@ function readState(s,command=false)
return true;
}
// WLEDSR: control HTML elements for Slider and Color Control
// WLEDMM: control HTML elements for Slider and Color Control
// Technical notes
// ===============
// If an effect name is followed by an @, slider and color control is effective.
@@ -1623,7 +1623,7 @@ function toggleSync()
function toggleLiveview()
{
//WLEDSR adding liveview2D support
//WLEDMM adding liveview2D support
if (isInfo && isM) toggleInfo();
if (isNodes && isM) toggleNodes();
isLv = !isLv;

View File

@@ -46,10 +46,10 @@
if (leds[0] != 76 || leds[1] != 2 || !ctx) return; //'L', set in ws.cpp
let mW = leds[2]; // matrix width
let mH = leds[3]; // matrix height
let pPL = Math.min(c.width / mW, (c.height-10) / mH); // pixels per LED (width of circle) WLEDSR -10 for prompts
let pPL = Math.min(c.width / mW, (c.height-10) / mH); // pixels per LED (width of circle) WLEDMM -10 for prompts
let lOf = Math.floor((c.width - pPL*mW)/2); //left offeset (to center matrix)
var i = 6;
ctx.clearRect(0, 0, c.width, c.height); //WLEDSR
ctx.clearRect(0, 0, c.width, c.height); //WLEDMM
for (y=0.5;y<mH;y++) for (x=0.5; x<mW; x++) {
ctx.fillStyle = `rgb(${leds[i]},${leds[i+1]},${leds[i+2]})`;
ctx.beginPath();
@@ -57,7 +57,7 @@
ctx.fill();
i+=3;
}
//WLEDSR show preset and playlist id
//WLEDMM show preset and playlist id
ctx.fillStyle = `rgb(255,255,255)`;
if (leds[4] != 0) ctx.fillText("preset " + leds[4].toString(), lOf, mH*pPL+10);
if (leds[5] != 255) ctx.fillText("playlist " + leds[5].toString(), lOf + 70, mH*pPL+10);

View File

@@ -63,7 +63,7 @@
localStorage.setItem('locIp', locip);
}
}
//WLEDSR: add ldS and move loadJS there (like in settings_um)
//WLEDMM: add ldS and move loadJS there (like in settings_um)
ldS();
}
</script>

View File

@@ -55,7 +55,7 @@
}
}
ldS();
if (!numM) gId("um").innerHTML = ""; //WLEDSR: Do not display no usermods installed
if (!numM) gId("um").innerHTML = ""; //WLEDMM: Do not display no usermods installed
}
// https://stackoverflow.com/questions/3885817/how-do-i-check-that-a-number-is-float-or-integer
function isF(n) { return n === +n && n !== (n|0); }
@@ -200,7 +200,7 @@
getPins(json);
urows="";
if (isO(umCfg)) {
//WLEDSR: read url parameter. e.g. um=AudioReactive and if set only add the usermod with the same name
//WLEDMM: read url parameter. e.g. um=AudioReactive and if set only add the usermod with the same name
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const userMod = urlParams.get('um')
@@ -214,7 +214,7 @@
}
if (userMod != null && urows==="") urows = "Usermods configuration not found.<br>Press <i>Save</i> to initialize defaults.";
}
//WLEDSR: only show globalGPIOs if no usermod info is shown (url without um parameter)
//WLEDMM: only show globalGPIOs if no usermod info is shown (url without um parameter)
gId("globalGPIOs").style.display = urows===""?"block":"none";
gId("um").innerHTML = urows;
@@ -242,7 +242,7 @@
<span id="lssuc" style="color:green; display:none">&#10004; Configuration saved!</span>
<span id="lserr" style="color:red; display:none">&#9888; Could not load configuration.</span>
</div>
<div id="globalGPIOs" style="display:none;"> <!--WLEDSR: show in ldS-->
<div id="globalGPIOs" style="display:none;"> <!--WLEDMM: show in ldS-->
<hr>
<h2>Usermod Setup</h2>
Global I<sup>2</sup>C GPIOs (HW)<br>

View File

@@ -491,7 +491,7 @@ function populateInfo(i)
var cn="";
var heap = i.freeheap/1000;
heap = heap.toFixed(1);
var theap = (i.totalheap>0)?i.totalheap/1000:-1; theap = theap.toFixed(1); //WLEDSR - total heap is not available on 8266
var theap = (i.totalheap>0)?i.totalheap/1000:-1; theap = theap.toFixed(1); //WLEDMM - total heap is not available on 8266
var pwr = i.leds.pwr;
var pwru = "Not calculated";
if (pwr > 1000) {pwr /= 1000; pwr = pwr.toFixed((pwr > 10) ? 0 : 1); pwru = pwr + " A";}
@@ -510,7 +510,7 @@ function populateInfo(i)
if (i.ver.includes("-bl")) vcn = "Supāku";
if (i.cn) vcn = i.cn;
//WLEDSR: add total heap and total PSRAM, and build number
//WLEDMM: add total heap and total PSRAM, and build number
if (i.ver.includes("14.1-")) vcn = "Sitting Ducks"; // easter egg
if (i.ver.includes("14.0-mdev")) vcn = "Lupo";
cn += `v${i.ver} &nbsp;<i>"${vcn}"</i><p><em>build ${i.vid}</em></p><table>
@@ -520,7 +520,7 @@ ${inforow("Signal strength",i.wifi.signal +"% ("+ i.wifi.rssi, " dBm)")}
${inforow("Uptime",getRuntimeStr(i.uptime))}
${inforow("Estimated current",pwru)}
${inforow("Average FPS",i.leds.fps)}
<!-- WLEDSR begin-->
<!-- WLEDMM begin-->
<tr><td colspan=2><hr style="height:1px;border-width:0;color:SeaGreen;background-color:SeaGreen"></td></tr>
${inforow("MAC address",i.mac)}
${inforow("Filesystem",i.fs.u + "/" + i.fs.t + " kB (" +Math.round(i.fs.u*100/i.fs.t) + "%)")}
@@ -531,7 +531,7 @@ ${i.tpram?inforow("Total PSRAM",(i.tpram/1024).toFixed(1)," kB"):""}
${i.psusedram?((i.tpram-i.psusedram)>16383?inforow("Max Used PSRAM",((i.tpram-i.psusedram)/1024).toFixed(1)," kB"):inforow("Max Used PSRAM",(i.tpram-i.psusedram)," B")):""}
${i.e32model?inforow(i.e32model,i.e32cores +" core(s)"," "+i.e32speed+" Mhz"):""}
${i.e32flash?inforow("Flash "+i.e32flash+" MB"+", mode "+i.e32flashmode+i.e32flashtext,i.e32flashspeed," Mhz"):""}
<!-- WLEDSR end-->
<!-- WLEDMM end-->
</table>`;
gId('kv').innerHTML = cn;
}
@@ -654,7 +654,7 @@ function populateEffects()
});
for (let i = 0; i < effects.length; i++) {
// WLEDSR: add slider and color control to setEffect (used by requestjson)
// WLEDMM: add slider and color control to setEffect (used by requestjson)
if (effects[i].name.indexOf("RSVD") < 0) {
var posAt = effects[i].name.indexOf("@");
var extra = '';

View File

@@ -16,7 +16,7 @@
<body onload="GetV()">
<h2>MoonMod WLED Software Update</h2>
<form method='POST' action='/update' id='uf' enctype='multipart/form-data' onsubmit="U()">
Installed bin: <span class="sip">##VERSION##</span><br> <!--WLEDSR: show bin name-->
Installed bin: <span class="sip">##VERSION##</span><br> <!--WLEDMM: show bin name-->
Download the latest binary: <a href="https://github.com/MoonModules/WLED/releases" target="_blank">
<img src="https://img.shields.io/github/release/MoonModules/WLED.svg?style=flat-square"></a><br>
<input type='file' name='update' required><br> <!--should have accept='.bin', but it prevents file upload from android app-->

View File

@@ -2,7 +2,7 @@
#include "palettes.h"
// begin WLEDSR
// begin WLEDMM
#ifdef ARDUINO_ARCH_ESP32
#include <Esp.h>
// get the right RTC.H for each MCU
@@ -23,7 +23,7 @@
#include <Esp.h>
#include <user_interface.h>
#endif
// end WLEDSR
// end WLEDMM
/*
* JSON API (De)serialization
@@ -34,7 +34,7 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId)
byte id = elem["id"] | it;
if (id >= strip.getMaxSegments()) return;
//WLEDSR: add compatibility for SR presets
//WLEDMM: add compatibility for SR presets
#ifndef WLED_DISABLE_2D
// Serial.printf("before %d: %s %s %s %s\n", id, elem["start"].as<std::string>().c_str(), elem["stop"].as<std::string>().c_str(), elem["startY"].as<std::string>().c_str(), elem["stopY"].as<std::string>().c_str());
if (strip.isMatrix && !elem["start"].isNull() && !elem["stop"].isNull() && elem["startY"].isNull() && elem["stopY"].isNull()) {
@@ -123,7 +123,7 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId)
uint8_t soundSim = elem["ssim"] | seg.soundSim;
uint8_t map1D2D = elem["mp12"] | seg.map1D2D;
//WLEDSR jMap
//WLEDMM jMap
if (map1D2D == M12_jMap && !seg.jMap)
seg.createjMap();
if (map1D2D != M12_jMap && seg.jMap)
@@ -156,7 +156,7 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId)
if (elem["on"].is<const char*>() && elem["on"].as<const char*>()[0] == 't') on = !on;
seg.setOption(SEG_OPTION_ON, on); // use transition
//WLEDSR Custom Effects (but general usable)
//WLEDMM Custom Effects (but general usable)
bool reset = elem["reset"];
if (reset)
seg.markForReset();
@@ -593,7 +593,7 @@ void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segme
}
}
// begin WLEDSR
// begin WLEDMM
#ifdef ARDUINO_ARCH_ESP32
static String resetCode2Info(int reason) {
switch(reason) {
@@ -649,12 +649,12 @@ static String resetCode2Info(int reason) {
}
}
#endif
// end WLEDSR
// end WLEDMM
void serializeInfo(JsonObject root)
{
root[F("ver")] = versionString;
root[F("rel")] = releaseString; //WLEDSR to add bin name
root[F("rel")] = releaseString; //WLEDMM to add bin name
root[F("vid")] = VERSION;
//root[F("cn")] = WLED_CODENAME;
@@ -770,11 +770,11 @@ void serializeInfo(JsonObject root)
//root[F("maxalloc")] = ESP.getMaxAllocHeap();
#ifdef WLED_DEBUG
root[F("resetReason0")] = (int)rtc_get_reset_reason(0);
if(ESP.getChipCores() > 1) // WLEDSR
if(ESP.getChipCores() > 1) // WLEDMM
root[F("resetReason1")] = (int)rtc_get_reset_reason(1);
#endif
root[F("lwip")] = 0; //deprecated
root[F("totalheap")] = ESP.getHeapSize(); //WLEDSR
root[F("totalheap")] = ESP.getHeapSize(); //WLEDMM
#else
root[F("arch")] = "esp8266";
root[F("core")] = ESP.getCoreVersion();
@@ -786,24 +786,24 @@ void serializeInfo(JsonObject root)
#endif
root[F("freeheap")] = ESP.getFreeHeap();
//WLEDSR: conditional on esp32
//WLEDMM: conditional on esp32
#if defined(ARDUINO_ARCH_ESP32)
root[F("minfreeheap")] = ESP.getMinFreeHeap();
#endif
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_PSRAM) && defined(BOARD_HAS_PSRAM)
if (psramFound()) {
root[F("tpram")] = ESP.getPsramSize(); //WLEDSR
root[F("tpram")] = ESP.getPsramSize(); //WLEDMM
root[F("psram")] = ESP.getFreePsram();
root[F("psusedram")] = ESP.getMinFreePsram();
}
#else
// for testing
// root[F("tpram")] = 4194304; //WLEDSR
// root[F("tpram")] = 4194304; //WLEDMM
// root[F("psram")] = 4193000;
// root[F("psusedram")] = 3083000;
#endif
// begin WLEDSR
// begin WLEDMM
#ifdef ARDUINO_ARCH_ESP32
root[F("e32core0code")] = (int)rtc_get_reset_reason(0);
root[F("e32core0text")] = resetCode2Info(rtc_get_reset_reason(0));
@@ -832,7 +832,7 @@ void serializeInfo(JsonObject root)
root[F("e32core0code")] = (int)ESP.getResetInfoPtr()->reason;
root[F("e32core0text")] = F("");
#endif
// end WLEDSR
// end WLEDMM
root[F("uptime")] = millis()/1000 + rolloverMillis*4294967;

View File

@@ -127,7 +127,7 @@ void handlePresets()
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S2)
// this does not make sense on single core
core = xPortGetCoreID();
// begin WLEDSR specific
// begin WLEDMM specific
// loopTask (arduino main loop) sometimes runs on core #1
if ((core == 1) && (strncmp(pcTaskGetTaskName(NULL), "loopTask", 8) == 0)) {
DEBUG_PRINTF("[applyPreset] called from loopTask on core %d; forcing core = 0\n", (int)core);
@@ -138,7 +138,7 @@ void handlePresets()
DEBUG_PRINTF("[applyPreset] called from async_tcp on core %d; forcing core = 1\n", (int)core);
core = 1;
}
// end WLEDSR specific
// end WLEDMM specific
#endif
#endif
//only allow use of fileDoc from the core responsible for network requests (AKA HTTP JSON API)

View File

@@ -160,7 +160,7 @@
#include "../usermods/ADS1115_v2/usermod_ads1115.h"
#endif
//WLEDSR Custom Effects
//WLEDMM Custom Effects
#ifdef USERMOD_CUSTOMEFFECTS
#include "../usermods/customeffects/usermod_v2_customeffects.h"
#endif
@@ -324,7 +324,7 @@ void registerUsermods()
usermods.add(new ADS1115Usermod());
#endif
//WLEDSR Custom Effects
//WLEDMM Custom Effects
#ifdef USERMOD_CUSTOMEFFECTS
usermods.add(new CustomEffectsUserMod());
#endif

View File

@@ -226,7 +226,7 @@ using PSRAMDynamicJsonDocument = BasicJsonDocument<PSRAM_Allocator>;
// Global Variable definitions
WLED_GLOBAL char versionString[] _INIT(TOSTRING(WLED_VERSION));
WLED_GLOBAL char releaseString[] _INIT(TOSTRING(WLED_RELEASE_NAME)); //WLEDSR: to show on update page
WLED_GLOBAL char releaseString[] _INIT(TOSTRING(WLED_RELEASE_NAME)); //WLEDMM: to show on update page
#define WLED_CODENAME "Hoshi"
// AP and OTA default passwords (for maximum security change them!)

View File

@@ -45,18 +45,18 @@ void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t
request->_tempFile = WLED_FS.open(finalname, "w");
DEBUG_PRINT(F("Uploading "));
DEBUG_PRINTLN(finalname);
if (finalname.equals("/presets.json")) presetsModifiedTime = toki.second(); // WLEDSR
if (finalname.equals("/presets.json")) presetsModifiedTime = toki.second(); // WLEDMM
}
if (len) {
request->_tempFile.write(data,len);
}
if (final) {
request->_tempFile.close();
if (filename.equalsIgnoreCase("/cfg.json") || filename.equalsIgnoreCase("cfg.json")) { // WLEDSR
if (filename.equalsIgnoreCase("/cfg.json") || filename.equalsIgnoreCase("cfg.json")) { // WLEDMM
request->send(200, "text/plain", F("Configuration restore successful.\nRebooting..."));
doReboot = true;
} else {
if (filename.equals("/presets.json") || filename.equals("presets.json")) { // WLEDSR
if (filename.equals("/presets.json") || filename.equals("presets.json")) { // WLEDMM
request->send(200, "text/plain", F("Presets File Uploaded!"));
} else
request->send(200, "text/plain", F("File Uploaded!"));

View File

@@ -151,7 +151,7 @@ bool sendLiveLedsWs(uint32_t wsClient)
uint16_t used = strip.getLengthTotal();
const uint16_t MAX_LIVE_LEDS_WS = strip.isMatrix ? 1024 : 256;
uint16_t n = ((used -1)/MAX_LIVE_LEDS_WS) +1; //only serve every n'th LED if count over MAX_LIVE_LEDS_WS
uint16_t pos = (strip.isMatrix ? 6 : 2); //WLEDSR 6 instead of 4
uint16_t pos = (strip.isMatrix ? 6 : 2); //WLEDMM 6 instead of 4
uint16_t bufSize = pos + (used/n)*3;
AsyncWebSocketMessageBuffer * wsBuf = ws.makeBuffer(bufSize);
if (!wsBuf) return false; //out of memory
@@ -163,8 +163,8 @@ bool sendLiveLedsWs(uint32_t wsClient)
buffer[1] = 2; //version
buffer[2] = strip.matrixWidth;
buffer[3] = strip.matrixHeight;
buffer[4] = currentPreset; //WLEDSR
buffer[5] = currentPlaylist; //WLEDSR
buffer[4] = currentPreset; //WLEDMM
buffer[5] = currentPlaylist; //WLEDMM
}
#endif

View File

@@ -719,7 +719,7 @@ void getSettingsJS(byte subPage, char* dest)
if (subPage == 9) // update
{
//WLEDSR: show bin name
//WLEDMM: show bin name
sappends('m',SET_F("(\"sip\")[0]"),(char*)F("WLEDMM_"));
olen -= 2; //delete ";
oappend(versionString);