Change WLEDSR to WLEDMM in comments
This commit is contained in:
@@ -35,7 +35,7 @@ def bin_rename_copy(source, target, env):
|
|||||||
if release_name:
|
if release_name:
|
||||||
_create_dirs(["release"])
|
_create_dirs(["release"])
|
||||||
version = _get_cpp_define_value(env, "WLED_VERSION")
|
version = _get_cpp_define_value(env, "WLED_VERSION")
|
||||||
release_file = "{}release{}WLEDMM_{}_{}.bin".format(OUTPUT_DIR, os.path.sep, version, release_name) #WLEDSR: add MM postfix to WLED
|
release_file = "{}release{}WLEDMM_{}_{}.bin".format(OUTPUT_DIR, os.path.sep, version, release_name) #WLEDMM: add MM postfix to WLED
|
||||||
shutil.copy(str(target[0]), release_file)
|
shutil.copy(str(target[0]), release_file)
|
||||||
|
|
||||||
# check if new target files exist and remove if necessary
|
# check if new target files exist and remove if necessary
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ default_partitions = tools/WLED_ESP32_4MB_1MB_FS.csv
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
; https://github.com/lorol/LITTLEFS.git
|
; https://github.com/lorol/LITTLEFS.git
|
||||||
; WLEDSR specific: use patched version of lorol LittleFS
|
; WLEDMM specific: use patched version of lorol LittleFS
|
||||||
https://github.com/softhack007/LITTLEFS-threadsafe.git#master
|
https://github.com/softhack007/LITTLEFS-threadsafe.git#master
|
||||||
makuna/NeoPixelBus @ 2.6.9
|
makuna/NeoPixelBus @ 2.6.9
|
||||||
https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
|
https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
|
||||||
@@ -551,7 +551,7 @@ build_flags_min =
|
|||||||
-D WLED_USE_MY_CONFIG
|
-D WLED_USE_MY_CONFIG
|
||||||
-D USERMOD_AUDIOREACTIVE
|
-D USERMOD_AUDIOREACTIVE
|
||||||
-D UM_AUDIOREACTIVE_USE_NEW_FFT ; use latest (upstream) FFTLib, instead of older library midified by blazoncek. Slightly faster, more accurate, needs 2KB RAM extra
|
-D UM_AUDIOREACTIVE_USE_NEW_FFT ; use latest (upstream) FFTLib, instead of older library midified by blazoncek. Slightly faster, more accurate, needs 2KB RAM extra
|
||||||
-D USERMOD_CUSTOMEFFECTS ; WLEDSR usermod
|
-D USERMOD_CUSTOMEFFECTS ; WLEDMM usermod
|
||||||
; -D WLED_DEBUG ; lots of generic debug messages
|
; -D WLED_DEBUG ; lots of generic debug messages
|
||||||
; -D SR_DEBUG ; some extra debug messages from audioreactive
|
; -D SR_DEBUG ; some extra debug messages from audioreactive
|
||||||
|
|
||||||
@@ -568,9 +568,9 @@ build_flags_max =
|
|||||||
-D USERMOD_FOUR_LINE_DISPLAY
|
-D USERMOD_FOUR_LINE_DISPLAY
|
||||||
-D USERMOD_ROTARY_ENCODER_UI
|
-D USERMOD_ROTARY_ENCODER_UI
|
||||||
-D USERMOD_AUTO_SAVE
|
-D USERMOD_AUTO_SAVE
|
||||||
-D USERMOD_WEATHER ; WLEDSR usermod
|
-D USERMOD_WEATHER ; WLEDMM usermod
|
||||||
-D USERMOD_MPU6050_IMU ; gyro/accelero for USERMOD_GAMES (ONLY WORKS IF USERMOD_FOUR_LINE_DISPLAY NOT INCLUDED - I2C SHARING BUG)
|
-D USERMOD_MPU6050_IMU ; gyro/accelero for USERMOD_GAMES (ONLY WORKS IF USERMOD_FOUR_LINE_DISPLAY NOT INCLUDED - I2C SHARING BUG)
|
||||||
-D USERMOD_GAMES ; WLEDSR usermod
|
-D USERMOD_GAMES ; WLEDMM usermod
|
||||||
|
|
||||||
lib_deps_max =
|
lib_deps_max =
|
||||||
OneWire@~2.3.5 ; used for USERMOD_FOUR_LINE_DISPLAY and USERMOD_DALLASTEMPERATURE
|
OneWire@~2.3.5 ; used for USERMOD_FOUR_LINE_DISPLAY and USERMOD_DALLASTEMPERATURE
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ class FourLineDisplayUsermod : public Usermod {
|
|||||||
isHW = (ioPin[0]==i2c_scl && ioPin[1]==i2c_sda);
|
isHW = (ioPin[0]==i2c_scl && ioPin[1]==i2c_sda);
|
||||||
//isHW = true;
|
//isHW = true;
|
||||||
if (isHW) po = PinOwner::HW_I2C; // allow multiple allocations of HW I2C bus pins
|
if (isHW) po = PinOwner::HW_I2C; // allow multiple allocations of HW I2C bus pins
|
||||||
if (ioPin[0] < 0 || ioPin[1] < 0) { type=NONE; return; } //WLEDSR bugfix - ensure that "final" GPIO are valid
|
if (ioPin[0] < 0 || ioPin[1] < 0) { type=NONE; return; } //WLEDMM bugfix - ensure that "final" GPIO are valid
|
||||||
PinManagerPinType pins[2] = { { ioPin[0], true }, { ioPin[1], true } };
|
PinManagerPinType pins[2] = { { ioPin[0], true }, { ioPin[1], true } };
|
||||||
if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; return; }
|
if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; return; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ class FourLineDisplayUsermod : public Usermod {
|
|||||||
// isHW = true;
|
// isHW = true;
|
||||||
if (isHW) po = PinOwner::HW_I2C; // allow multiple allocations of HW I2C bus pins
|
if (isHW) po = PinOwner::HW_I2C; // allow multiple allocations of HW I2C bus pins
|
||||||
PinManagerPinType pins[2] = { {ioPin[0], true }, { ioPin[1], true } };
|
PinManagerPinType pins[2] = { {ioPin[0], true }, { ioPin[1], true } };
|
||||||
if (ioPin[0] < 0 || ioPin[1] < 0) { type=NONE; return; } //WLEDSR bugfix - ensure that "final" GPIO are valid
|
if (ioPin[0] < 0 || ioPin[1] < 0) { type=NONE; return; } //WLEDMM bugfix - ensure that "final" GPIO are valid
|
||||||
if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; return; }
|
if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; return; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ static const char _data_FX_MODE_IMUTest[] PROGMEM = "🎮 IMUTest@;;;2d";
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//WLEDSR 3D to 2D mapping
|
//WLEDMM 3D to 2D mapping
|
||||||
struct Voxel {
|
struct Voxel {
|
||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
|
|||||||
@@ -1083,7 +1083,7 @@ uint16_t mode_running_random(void) {
|
|||||||
|
|
||||||
uint8_t z = it % zoneSize;
|
uint8_t z = it % zoneSize;
|
||||||
bool nzone = (!z && it != SEGENV.aux1);
|
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) {
|
if (nzone || z >= zoneSize) {
|
||||||
uint8_t lastrand = PRNG16 >> 8;
|
uint8_t lastrand = PRNG16 >> 8;
|
||||||
int16_t diff = 0;
|
int16_t diff = 0;
|
||||||
@@ -1724,7 +1724,7 @@ uint16_t mode_random_chase(void)
|
|||||||
uint32_t color = SEGENV.step;
|
uint32_t color = SEGENV.step;
|
||||||
random16_set_seed(SEGENV.aux0);
|
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 r = random8(6) != 0 ? (color >> 16 & 0xFF) : random8();
|
||||||
uint8_t g = random8(6) != 0 ? (color >> 8 & 0xFF) : random8();
|
uint8_t g = random8(6) != 0 ? (color >> 8 & 0xFF) : random8();
|
||||||
uint8_t b = random8(6) != 0 ? (color & 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
|
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
|
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();
|
const uint16_t rows = SEGMENT.virtualHeight();
|
||||||
|
|
||||||
if (SEGENV.call == 0) {
|
if (SEGENV.call == 0) {
|
||||||
@@ -5358,7 +5358,7 @@ uint16_t mode_2DPulser(void) { // By: ldirko https://edi
|
|||||||
SEGMENT.fadeToBlackBy(8 - (SEGMENT.intensity>>5));
|
SEGMENT.fadeToBlackBy(8 - (SEGMENT.intensity>>5));
|
||||||
|
|
||||||
uint32_t a = strip.now / (18 - SEGMENT.speed / 16);
|
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);
|
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));
|
SEGMENT.setPixelColorXY(x, y, ColorFromPalette(SEGPALETTE, map(y, 0, rows-1, 0, 255), 255, LINEARBLEND));
|
||||||
|
|
||||||
|
|||||||
16
wled00/FX.h
16
wled00/FX.h
@@ -317,7 +317,7 @@
|
|||||||
#define FX_MODE_WAVESINS 184
|
#define FX_MODE_WAVESINS 184
|
||||||
#define FX_MODE_ROCKTAVES 185
|
#define FX_MODE_ROCKTAVES 185
|
||||||
#define FX_MODE_2DAKEMI 186
|
#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
|
#define MODE_COUNT 188
|
||||||
|
|
||||||
@@ -326,9 +326,9 @@ typedef enum mapping1D2D {
|
|||||||
M12_pBar = 1,
|
M12_pBar = 1,
|
||||||
M12_pArc = 2,
|
M12_pArc = 2,
|
||||||
M12_pCorner = 3,
|
M12_pCorner = 3,
|
||||||
M12_jMap = 4, //WLEDSR jMap
|
M12_jMap = 4, //WLEDMM jMap
|
||||||
M12_sCircle = 5, //WLEDSR jMap
|
M12_sCircle = 5, //WLEDMM jMap
|
||||||
M12_sBlock = 6 //WLEDSR jMap
|
M12_sBlock = 6 //WLEDMM jMap
|
||||||
} mapping1D2D_t;
|
} mapping1D2D_t;
|
||||||
|
|
||||||
// segment, 72 bytes
|
// segment, 72 bytes
|
||||||
@@ -382,7 +382,7 @@ typedef struct Segment {
|
|||||||
byte* data;
|
byte* data;
|
||||||
CRGB* leds;
|
CRGB* leds;
|
||||||
static CRGB *_globalLeds;
|
static CRGB *_globalLeds;
|
||||||
void *jMap; //WLEDSR jMap
|
void *jMap; //WLEDMM jMap
|
||||||
|
|
||||||
private:
|
private:
|
||||||
union {
|
union {
|
||||||
@@ -473,7 +473,7 @@ typedef struct Segment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Segment(uint16_t sStartX, uint16_t sStopX, uint16_t sStartY, uint16_t sStopY) : Segment(sStartX, sStopX) {
|
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;
|
startY = sStartY;
|
||||||
stopY = sStopY;
|
stopY = sStopY;
|
||||||
}
|
}
|
||||||
@@ -576,8 +576,8 @@ typedef struct Segment {
|
|||||||
uint16_t virtualWidth(void) const;
|
uint16_t virtualWidth(void) const;
|
||||||
uint16_t virtualHeight(void) const;
|
uint16_t virtualHeight(void) const;
|
||||||
uint16_t nrOfVStrips(void) const;
|
uint16_t nrOfVStrips(void) const;
|
||||||
void createjMap(); //WLEDSR jMap
|
void createjMap(); //WLEDMM jMap
|
||||||
void deletejMap(); //WLEDSR jMap
|
void deletejMap(); //WLEDMM jMap
|
||||||
#ifndef WLED_DISABLE_2D
|
#ifndef WLED_DISABLE_2D
|
||||||
uint16_t XY(uint16_t x, uint16_t y); // support function to get relative index within segment (for leds[])
|
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
|
void setPixelColorXY(int x, int y, uint32_t c); // set relative pixel within segment with color
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ void WS2812FX::setUpMatrix() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// absolute matrix version of setPixelColor()
|
// 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
|
#ifndef WLED_DISABLE_2D
|
||||||
if (!isMatrix) return; // not a matrix set-up
|
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
|
#ifndef WLED_DISABLE_2D
|
||||||
|
|
||||||
// XY(x,y) - gets pixel index within current segment (often used to reference leds[] array element)
|
// 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 width = virtualWidth(); // segment width in logical pixels
|
||||||
uint16_t height = virtualHeight(); // segment height in logical pixels
|
uint16_t height = virtualHeight(); // segment height in logical pixels
|
||||||
return (x%width) + (y%height) * width;
|
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 (!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
|
if (x >= virtualWidth() || y >= virtualHeight() || x<0 || y<0) return; // if pixel would fall out of virtual segment just exit
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ Segment::Segment(const Segment &orig) {
|
|||||||
if (orig.data) { if (allocateData(orig._dataLen)) memcpy(data, orig.data, orig._dataLen); }
|
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._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()); }
|
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
|
// move constructor
|
||||||
@@ -101,7 +101,7 @@ Segment::Segment(Segment &&orig) noexcept {
|
|||||||
orig._dataLen = 0;
|
orig._dataLen = 0;
|
||||||
orig._t = nullptr;
|
orig._t = nullptr;
|
||||||
orig.leds = nullptr;
|
orig.leds = nullptr;
|
||||||
orig.jMap = nullptr; //WLEDSR jMap
|
orig.jMap = nullptr; //WLEDMM jMap
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy assignment
|
// 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.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._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()); }
|
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;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -145,7 +145,7 @@ Segment& Segment::operator= (Segment &&orig) noexcept {
|
|||||||
orig._dataLen = 0;
|
orig._dataLen = 0;
|
||||||
orig._t = nullptr;
|
orig._t = nullptr;
|
||||||
orig.leds = nullptr;
|
orig.leds = nullptr;
|
||||||
orig.jMap = nullptr; //WLEDSR jMap
|
orig.jMap = nullptr; //WLEDMM jMap
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -465,10 +465,10 @@ uint16_t Segment::nrOfVStrips() const {
|
|||||||
case M12_pBar:
|
case M12_pBar:
|
||||||
vLen = virtualWidth();
|
vLen = virtualWidth();
|
||||||
break;
|
break;
|
||||||
case M12_sCircle: //WLEDSR
|
case M12_sCircle: //WLEDMM
|
||||||
vLen = (virtualWidth() + virtualHeight()) / 6; // take third of the average width
|
vLen = (virtualWidth() + virtualHeight()) / 6; // take third of the average width
|
||||||
break;
|
break;
|
||||||
case M12_sBlock: //WLEDSR
|
case M12_sBlock: //WLEDMM
|
||||||
vLen = (virtualWidth() + virtualHeight()) / 8; // take half of the average width
|
vLen = (virtualWidth() + virtualHeight()) / 8; // take half of the average width
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -477,7 +477,7 @@ uint16_t Segment::nrOfVStrips() const {
|
|||||||
return vLen;
|
return vLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
//WLEDSR jMap
|
//WLEDMM jMap
|
||||||
struct XandY {
|
struct XandY {
|
||||||
uint8_t x;
|
uint8_t x;
|
||||||
uint8_t y;
|
uint8_t y;
|
||||||
@@ -609,7 +609,7 @@ class JMapC {
|
|||||||
} //updatejMapDoc
|
} //updatejMapDoc
|
||||||
}; //class JMapC
|
}; //class JMapC
|
||||||
|
|
||||||
//WLEDSR jMap
|
//WLEDMM jMap
|
||||||
void Segment::createjMap() {
|
void Segment::createjMap() {
|
||||||
if (!jMap) {
|
if (!jMap) {
|
||||||
Serial.println("createjMap");
|
Serial.println("createjMap");
|
||||||
@@ -617,7 +617,7 @@ void Segment::createjMap() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//WLEDSR jMap
|
//WLEDMM jMap
|
||||||
void Segment::deletejMap() {
|
void Segment::deletejMap() {
|
||||||
//Should be called from ~Segment but causes crash (and ~Segment is called quite often...)
|
//Should be called from ~Segment but causes crash (and ~Segment is called quite often...)
|
||||||
if (jMap) {
|
if (jMap) {
|
||||||
@@ -641,15 +641,15 @@ uint16_t Segment::virtualLength() const {
|
|||||||
case M12_pArc:
|
case M12_pArc:
|
||||||
vLen = max(vW,vH); // get the longest dimension
|
vLen = max(vW,vH); // get the longest dimension
|
||||||
break;
|
break;
|
||||||
case M12_jMap: //WLEDSR jMap
|
case M12_jMap: //WLEDMM jMap
|
||||||
if (jMap)
|
if (jMap)
|
||||||
vLen = ((JMapC *)jMap)->length();
|
vLen = ((JMapC *)jMap)->length();
|
||||||
break;
|
break;
|
||||||
case M12_sCircle: //WLEDSR
|
case M12_sCircle: //WLEDMM
|
||||||
vLen = max(vW,vH); // get the longest dimension
|
vLen = max(vW,vH); // get the longest dimension
|
||||||
// vLen = (virtualWidth() + virtualHeight()) * 3;
|
// vLen = (virtualWidth() + virtualHeight()) * 3;
|
||||||
break;
|
break;
|
||||||
case M12_sBlock: //WLEDSR
|
case M12_sBlock: //WLEDMM
|
||||||
if (nrOfVStrips()>1)
|
if (nrOfVStrips()>1)
|
||||||
vLen = max(vW,vH) * 4;//0.5; // get the longest dimension
|
vLen = max(vW,vH) * 4;//0.5; // get the longest dimension
|
||||||
else
|
else
|
||||||
@@ -665,7 +665,7 @@ uint16_t Segment::virtualLength() const {
|
|||||||
return vLength;
|
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) {
|
void xyFromBlock(uint16_t &x,uint16_t &y, uint16_t i, uint16_t vW, uint16_t vH, uint16_t vStrip) {
|
||||||
float i2;
|
float i2;
|
||||||
if (i<=SEGLEN*0.25) { //top, left to right
|
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)
|
int vStrip = i>>16; // hack to allow running on virtual strips (2D segment columns/rows)
|
||||||
i &= 0xFFFF;
|
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 x = 0; x <= i; x++) setPixelColorXY(x, i, col);
|
||||||
for (int y = 0; y < i; y++) setPixelColorXY(i, y, col);
|
for (int y = 0; y < i; y++) setPixelColorXY(i, y, col);
|
||||||
break;
|
break;
|
||||||
case M12_jMap: //WLEDSR jMap
|
case M12_jMap: //WLEDMM jMap
|
||||||
if (jMap)
|
if (jMap)
|
||||||
((JMapC *)jMap)->setPixelColor(i, col);
|
((JMapC *)jMap)->setPixelColor(i, col);
|
||||||
break;
|
break;
|
||||||
case M12_sCircle: //WLEDSR
|
case M12_sCircle: //WLEDMM
|
||||||
if (vStrip > 0)
|
if (vStrip > 0)
|
||||||
{
|
{
|
||||||
int x = roundf(sin_t(360*i/SEGLEN*DEG_TO_RAD) * vW * (vStrip+1)/nrOfVStrips());
|
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
|
else // pArc -> circle
|
||||||
drawArc(vW/2, vH/2, i/2, col);
|
drawArc(vW/2, vH/2, i/2, col);
|
||||||
break;
|
break;
|
||||||
case M12_sBlock: //WLEDSR
|
case M12_sBlock: //WLEDMM
|
||||||
if (vStrip > 0)
|
if (vStrip > 0)
|
||||||
{
|
{
|
||||||
//vStrip+1 is distance from centre, i is how much of the square is filled
|
//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
|
// use longest dimension
|
||||||
return vW>vH ? getPixelColorXY(i, 0) : getPixelColorXY(0, i);
|
return vW>vH ? getPixelColorXY(i, 0) : getPixelColorXY(0, i);
|
||||||
break;
|
break;
|
||||||
case M12_jMap: //WLEDSR jMap
|
case M12_jMap: //WLEDMM jMap
|
||||||
if (jMap)
|
if (jMap)
|
||||||
return ((JMapC *)jMap)->getPixelColor(i);
|
return ((JMapC *)jMap)->getPixelColor(i);
|
||||||
break;
|
break;
|
||||||
case M12_sCircle: //WLEDSR
|
case M12_sCircle: //WLEDMM
|
||||||
if (vStrip > 0)
|
if (vStrip > 0)
|
||||||
{
|
{
|
||||||
int x = roundf(sin_t(360*i/SEGLEN*DEG_TO_RAD) * vW * (vStrip+1)/nrOfVStrips());
|
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
|
else
|
||||||
return vW>vH ? getPixelColorXY(i, 0) : getPixelColorXY(0, i);
|
return vW>vH ? getPixelColorXY(i, 0) : getPixelColorXY(0, i);
|
||||||
break;
|
break;
|
||||||
case M12_sBlock: //WLEDSR
|
case M12_sBlock: //WLEDMM
|
||||||
if (vStrip > 0)
|
if (vStrip > 0)
|
||||||
{
|
{
|
||||||
uint16_t x=0,y=0;
|
uint16_t x=0,y=0;
|
||||||
|
|||||||
@@ -96,7 +96,7 @@
|
|||||||
#define USERMOD_ID_ANALOG_CLOCK 33 //Usermod "Analog_Clock.h"
|
#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_PING_PONG_CLOCK 34 //Usermod "usermod_v2_ping_pong_clock.h"
|
||||||
#define USERMOD_ID_ADS1115 35 //Usermod "usermod_ads1115.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_CUSTOMEFFECTS 36 //Usermod "usermod_v2_customeffects.h"
|
||||||
#define USERMOD_ID_WEATHER 37 //Usermod "usermod_v2_weather.h"
|
#define USERMOD_ID_WEATHER 37 //Usermod "usermod_v2_weather.h"
|
||||||
#define USERMOD_ID_GAMES 38 //Usermod "usermod_v2_games.h"
|
#define USERMOD_ID_GAMES 38 //Usermod "usermod_v2_games.h"
|
||||||
@@ -431,7 +431,7 @@
|
|||||||
#define HW_PIN_CSSPI SS
|
#define HW_PIN_CSSPI SS
|
||||||
#endif
|
#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
|
// error only in MM, not in upstream... tbd: find out why
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
#define IRAM_ATTR_YN IRAM_ATTR
|
#define IRAM_ATTR_YN IRAM_ATTR
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
setTimeout(()=>{h.appendChild(l)},100);
|
setTimeout(()=>{h.appendChild(l)},100);
|
||||||
</script>
|
</script>
|
||||||
<link rel="stylesheet" href="index.css">
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
@@ -366,7 +366,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- WLEDSR Custom Effects -->
|
<!-- WLEDMM Custom Effects -->
|
||||||
<div id="ceEditor" class="modal">
|
<div id="ceEditor" class="modal">
|
||||||
<div id="kceEditor">Loading...</div><br>
|
<div id="kceEditor">Loading...</div><br>
|
||||||
</div>
|
</div>
|
||||||
@@ -386,6 +386,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<i id="roverstar" class="icons huge" onclick="setLor(0)"></i><br>
|
<i id="roverstar" class="icons huge" onclick="setLor(0)"></i><br>
|
||||||
<script src="index.js"></script>
|
<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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -642,7 +642,7 @@ function populateInfo(i)
|
|||||||
var cn="";
|
var cn="";
|
||||||
var heap = i.freeheap/1000;
|
var heap = i.freeheap/1000;
|
||||||
heap = heap.toFixed(1);
|
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 pwr = i.leds.pwr;
|
||||||
var pwru = "Not calculated";
|
var pwru = "Not calculated";
|
||||||
if (pwr > 1000) {pwr /= 1000; pwr = pwr.toFixed((pwr > 10) ? 0 : 1); pwru = pwr + " A";}
|
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.ver.includes("-bl")) vcn = "Supāku";
|
||||||
if (i.cn) vcn = i.cn;
|
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.1-")) vcn = "Sitting Ducks"; // easter egg
|
||||||
if ((i.ver.includes("14.0."))&&(i.ver.includes("_MM"))) vcn = "Lupo";
|
if ((i.ver.includes("14.0."))&&(i.ver.includes("_MM"))) vcn = "Lupo";
|
||||||
cn += `v${i.ver} <i>"${vcn}"</i><p>(WLEDMM_${i.ver}_${i.rel}.bin)</p><p><em>build ${i.vid}</em></p><table>
|
cn += `v${i.ver} <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("Uptime",getRuntimeStr(i.uptime))}
|
||||||
${inforow("Estimated current",pwru)}
|
${inforow("Estimated current",pwru)}
|
||||||
${inforow("Average FPS",i.leds.fps)}
|
${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>
|
<tr><td colspan=2><hr style="height:1px;border-width:0;color:SeaGreen;background-color:SeaGreen"></td></tr>
|
||||||
${inforow("MAC address",i.mac)}
|
${inforow("MAC address",i.mac)}
|
||||||
${inforow("Filesystem",i.fs.u + "/" + i.fs.t + " kB (" +Math.round(i.fs.u*100/i.fs.t) + "%)")}
|
${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.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.e32core0code?inforow("Core0 rst reason",i.e32core0code, " "+i.e32core0text):""}
|
||||||
${i.e32core1code?inforow("Core1 rst reason",i.e32core1code, " "+i.e32core1text):""}
|
${i.e32core1code?inforow("Core1 rst reason",i.e32core1code, " "+i.e32core1text):""}
|
||||||
<!-- WLEDSR end-->
|
<!-- WLEDMM end-->
|
||||||
</table>`;
|
</table>`;
|
||||||
gId('kv').innerHTML = cn;
|
gId('kv').innerHTML = cn;
|
||||||
// update all sliders in Info
|
// 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>`;
|
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>`;
|
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>
|
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})">
|
<div class="sel-p"><select class="sel-p" id="seg${i}mp12" onchange="setMp12(${i})">
|
||||||
<option value="0" ${inst.mp12==0?' selected':''}>Pixels</option>
|
<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>
|
<option value="3" ${inst.ssim==3?' selected':''}>U14_3</option>
|
||||||
</select></div>
|
</select></div>
|
||||||
</div>`;
|
</div>`;
|
||||||
//WLEDSR Custom Effects
|
//WLEDMM Custom Effects
|
||||||
let fxName = eJson.find((o)=>{return o.id==selectedFx}).name;
|
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>`;
|
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}">
|
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) {
|
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 id = ef.id;
|
||||||
let nm = ef.name+" ";
|
let nm = ef.name+" ";
|
||||||
let fd = "";
|
let fd = "";
|
||||||
@@ -1366,7 +1366,7 @@ function readState(s,command=false)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// WLEDSR: control HTML elements for Slider and Color Control
|
// WLEDMM: control HTML elements for Slider and Color Control
|
||||||
// Technical notes
|
// Technical notes
|
||||||
// ===============
|
// ===============
|
||||||
// If an effect name is followed by an @, slider and color control is effective.
|
// If an effect name is followed by an @, slider and color control is effective.
|
||||||
@@ -1623,7 +1623,7 @@ function toggleSync()
|
|||||||
|
|
||||||
function toggleLiveview()
|
function toggleLiveview()
|
||||||
{
|
{
|
||||||
//WLEDSR adding liveview2D support
|
//WLEDMM adding liveview2D support
|
||||||
if (isInfo && isM) toggleInfo();
|
if (isInfo && isM) toggleInfo();
|
||||||
if (isNodes && isM) toggleNodes();
|
if (isNodes && isM) toggleNodes();
|
||||||
isLv = !isLv;
|
isLv = !isLv;
|
||||||
|
|||||||
@@ -46,10 +46,10 @@
|
|||||||
if (leds[0] != 76 || leds[1] != 2 || !ctx) return; //'L', set in ws.cpp
|
if (leds[0] != 76 || leds[1] != 2 || !ctx) return; //'L', set in ws.cpp
|
||||||
let mW = leds[2]; // matrix width
|
let mW = leds[2]; // matrix width
|
||||||
let mH = leds[3]; // matrix height
|
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)
|
let lOf = Math.floor((c.width - pPL*mW)/2); //left offeset (to center matrix)
|
||||||
var i = 6;
|
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++) {
|
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.fillStyle = `rgb(${leds[i]},${leds[i+1]},${leds[i+2]})`;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
ctx.fill();
|
ctx.fill();
|
||||||
i+=3;
|
i+=3;
|
||||||
}
|
}
|
||||||
//WLEDSR show preset and playlist id
|
//WLEDMM show preset and playlist id
|
||||||
ctx.fillStyle = `rgb(255,255,255)`;
|
ctx.fillStyle = `rgb(255,255,255)`;
|
||||||
if (leds[4] != 0) ctx.fillText("preset " + leds[4].toString(), lOf, mH*pPL+10);
|
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);
|
if (leds[5] != 255) ctx.fillText("playlist " + leds[5].toString(), lOf + 70, mH*pPL+10);
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
localStorage.setItem('locIp', locip);
|
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();
|
ldS();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ldS();
|
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
|
// 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); }
|
function isF(n) { return n === +n && n !== (n|0); }
|
||||||
@@ -200,7 +200,7 @@
|
|||||||
getPins(json);
|
getPins(json);
|
||||||
urows="";
|
urows="";
|
||||||
if (isO(umCfg)) {
|
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 queryString = window.location.search;
|
||||||
const urlParams = new URLSearchParams(queryString);
|
const urlParams = new URLSearchParams(queryString);
|
||||||
const userMod = urlParams.get('um')
|
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.";
|
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("globalGPIOs").style.display = urows===""?"block":"none";
|
||||||
|
|
||||||
gId("um").innerHTML = urows;
|
gId("um").innerHTML = urows;
|
||||||
@@ -242,7 +242,7 @@
|
|||||||
<span id="lssuc" style="color:green; display:none">✔ Configuration saved!</span>
|
<span id="lssuc" style="color:green; display:none">✔ Configuration saved!</span>
|
||||||
<span id="lserr" style="color:red; display:none">⚠ Could not load configuration.</span>
|
<span id="lserr" style="color:red; display:none">⚠ Could not load configuration.</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="globalGPIOs" style="display:none;"> <!--WLEDSR: show in ldS-->
|
<div id="globalGPIOs" style="display:none;"> <!--WLEDMM: show in ldS-->
|
||||||
<hr>
|
<hr>
|
||||||
<h2>Usermod Setup</h2>
|
<h2>Usermod Setup</h2>
|
||||||
Global I<sup>2</sup>C GPIOs (HW)<br>
|
Global I<sup>2</sup>C GPIOs (HW)<br>
|
||||||
|
|||||||
@@ -491,7 +491,7 @@ function populateInfo(i)
|
|||||||
var cn="";
|
var cn="";
|
||||||
var heap = i.freeheap/1000;
|
var heap = i.freeheap/1000;
|
||||||
heap = heap.toFixed(1);
|
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 pwr = i.leds.pwr;
|
||||||
var pwru = "Not calculated";
|
var pwru = "Not calculated";
|
||||||
if (pwr > 1000) {pwr /= 1000; pwr = pwr.toFixed((pwr > 10) ? 0 : 1); pwru = pwr + " A";}
|
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.ver.includes("-bl")) vcn = "Supāku";
|
||||||
if (i.cn) vcn = i.cn;
|
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.1-")) vcn = "Sitting Ducks"; // easter egg
|
||||||
if (i.ver.includes("14.0-mdev")) vcn = "Lupo";
|
if (i.ver.includes("14.0-mdev")) vcn = "Lupo";
|
||||||
cn += `v${i.ver} <i>"${vcn}"</i><p><em>build ${i.vid}</em></p><table>
|
cn += `v${i.ver} <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("Uptime",getRuntimeStr(i.uptime))}
|
||||||
${inforow("Estimated current",pwru)}
|
${inforow("Estimated current",pwru)}
|
||||||
${inforow("Average FPS",i.leds.fps)}
|
${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>
|
<tr><td colspan=2><hr style="height:1px;border-width:0;color:SeaGreen;background-color:SeaGreen"></td></tr>
|
||||||
${inforow("MAC address",i.mac)}
|
${inforow("MAC address",i.mac)}
|
||||||
${inforow("Filesystem",i.fs.u + "/" + i.fs.t + " kB (" +Math.round(i.fs.u*100/i.fs.t) + "%)")}
|
${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.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.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.e32flash?inforow("Flash "+i.e32flash+" MB"+", mode "+i.e32flashmode+i.e32flashtext,i.e32flashspeed," Mhz"):""}
|
||||||
<!-- WLEDSR end-->
|
<!-- WLEDMM end-->
|
||||||
</table>`;
|
</table>`;
|
||||||
gId('kv').innerHTML = cn;
|
gId('kv').innerHTML = cn;
|
||||||
}
|
}
|
||||||
@@ -654,7 +654,7 @@ function populateEffects()
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (let i = 0; i < effects.length; i++) {
|
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) {
|
if (effects[i].name.indexOf("RSVD") < 0) {
|
||||||
var posAt = effects[i].name.indexOf("@");
|
var posAt = effects[i].name.indexOf("@");
|
||||||
var extra = '';
|
var extra = '';
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<body onload="GetV()">
|
<body onload="GetV()">
|
||||||
<h2>MoonMod WLED Software Update</h2>
|
<h2>MoonMod WLED Software Update</h2>
|
||||||
<form method='POST' action='/update' id='uf' enctype='multipart/form-data' onsubmit="U()">
|
<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">
|
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>
|
<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-->
|
<input type='file' name='update' required><br> <!--should have accept='.bin', but it prevents file upload from android app-->
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "palettes.h"
|
#include "palettes.h"
|
||||||
|
|
||||||
// begin WLEDSR
|
// begin WLEDMM
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
#include <Esp.h>
|
#include <Esp.h>
|
||||||
// get the right RTC.H for each MCU
|
// get the right RTC.H for each MCU
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
#include <Esp.h>
|
#include <Esp.h>
|
||||||
#include <user_interface.h>
|
#include <user_interface.h>
|
||||||
#endif
|
#endif
|
||||||
// end WLEDSR
|
// end WLEDMM
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* JSON API (De)serialization
|
* JSON API (De)serialization
|
||||||
@@ -34,7 +34,7 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId)
|
|||||||
byte id = elem["id"] | it;
|
byte id = elem["id"] | it;
|
||||||
if (id >= strip.getMaxSegments()) return;
|
if (id >= strip.getMaxSegments()) return;
|
||||||
|
|
||||||
//WLEDSR: add compatibility for SR presets
|
//WLEDMM: add compatibility for SR presets
|
||||||
#ifndef WLED_DISABLE_2D
|
#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());
|
// 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()) {
|
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 soundSim = elem["ssim"] | seg.soundSim;
|
||||||
uint8_t map1D2D = elem["mp12"] | seg.map1D2D;
|
uint8_t map1D2D = elem["mp12"] | seg.map1D2D;
|
||||||
|
|
||||||
//WLEDSR jMap
|
//WLEDMM jMap
|
||||||
if (map1D2D == M12_jMap && !seg.jMap)
|
if (map1D2D == M12_jMap && !seg.jMap)
|
||||||
seg.createjMap();
|
seg.createjMap();
|
||||||
if (map1D2D != M12_jMap && seg.jMap)
|
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;
|
if (elem["on"].is<const char*>() && elem["on"].as<const char*>()[0] == 't') on = !on;
|
||||||
seg.setOption(SEG_OPTION_ON, on); // use transition
|
seg.setOption(SEG_OPTION_ON, on); // use transition
|
||||||
|
|
||||||
//WLEDSR Custom Effects (but general usable)
|
//WLEDMM Custom Effects (but general usable)
|
||||||
bool reset = elem["reset"];
|
bool reset = elem["reset"];
|
||||||
if (reset)
|
if (reset)
|
||||||
seg.markForReset();
|
seg.markForReset();
|
||||||
@@ -593,7 +593,7 @@ void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segme
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// begin WLEDSR
|
// begin WLEDMM
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
static String resetCode2Info(int reason) {
|
static String resetCode2Info(int reason) {
|
||||||
switch(reason) {
|
switch(reason) {
|
||||||
@@ -649,12 +649,12 @@ static String resetCode2Info(int reason) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// end WLEDSR
|
// end WLEDMM
|
||||||
|
|
||||||
void serializeInfo(JsonObject root)
|
void serializeInfo(JsonObject root)
|
||||||
{
|
{
|
||||||
root[F("ver")] = versionString;
|
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("vid")] = VERSION;
|
||||||
//root[F("cn")] = WLED_CODENAME;
|
//root[F("cn")] = WLED_CODENAME;
|
||||||
|
|
||||||
@@ -770,11 +770,11 @@ void serializeInfo(JsonObject root)
|
|||||||
//root[F("maxalloc")] = ESP.getMaxAllocHeap();
|
//root[F("maxalloc")] = ESP.getMaxAllocHeap();
|
||||||
#ifdef WLED_DEBUG
|
#ifdef WLED_DEBUG
|
||||||
root[F("resetReason0")] = (int)rtc_get_reset_reason(0);
|
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);
|
root[F("resetReason1")] = (int)rtc_get_reset_reason(1);
|
||||||
#endif
|
#endif
|
||||||
root[F("lwip")] = 0; //deprecated
|
root[F("lwip")] = 0; //deprecated
|
||||||
root[F("totalheap")] = ESP.getHeapSize(); //WLEDSR
|
root[F("totalheap")] = ESP.getHeapSize(); //WLEDMM
|
||||||
#else
|
#else
|
||||||
root[F("arch")] = "esp8266";
|
root[F("arch")] = "esp8266";
|
||||||
root[F("core")] = ESP.getCoreVersion();
|
root[F("core")] = ESP.getCoreVersion();
|
||||||
@@ -786,24 +786,24 @@ void serializeInfo(JsonObject root)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
root[F("freeheap")] = ESP.getFreeHeap();
|
root[F("freeheap")] = ESP.getFreeHeap();
|
||||||
//WLEDSR: conditional on esp32
|
//WLEDMM: conditional on esp32
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
root[F("minfreeheap")] = ESP.getMinFreeHeap();
|
root[F("minfreeheap")] = ESP.getMinFreeHeap();
|
||||||
#endif
|
#endif
|
||||||
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_PSRAM) && defined(BOARD_HAS_PSRAM)
|
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_PSRAM) && defined(BOARD_HAS_PSRAM)
|
||||||
if (psramFound()) {
|
if (psramFound()) {
|
||||||
root[F("tpram")] = ESP.getPsramSize(); //WLEDSR
|
root[F("tpram")] = ESP.getPsramSize(); //WLEDMM
|
||||||
root[F("psram")] = ESP.getFreePsram();
|
root[F("psram")] = ESP.getFreePsram();
|
||||||
root[F("psusedram")] = ESP.getMinFreePsram();
|
root[F("psusedram")] = ESP.getMinFreePsram();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// for testing
|
// for testing
|
||||||
// root[F("tpram")] = 4194304; //WLEDSR
|
// root[F("tpram")] = 4194304; //WLEDMM
|
||||||
// root[F("psram")] = 4193000;
|
// root[F("psram")] = 4193000;
|
||||||
// root[F("psusedram")] = 3083000;
|
// root[F("psusedram")] = 3083000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// begin WLEDSR
|
// begin WLEDMM
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
root[F("e32core0code")] = (int)rtc_get_reset_reason(0);
|
root[F("e32core0code")] = (int)rtc_get_reset_reason(0);
|
||||||
root[F("e32core0text")] = resetCode2Info(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("e32core0code")] = (int)ESP.getResetInfoPtr()->reason;
|
||||||
root[F("e32core0text")] = F("");
|
root[F("e32core0text")] = F("");
|
||||||
#endif
|
#endif
|
||||||
// end WLEDSR
|
// end WLEDMM
|
||||||
|
|
||||||
root[F("uptime")] = millis()/1000 + rolloverMillis*4294967;
|
root[F("uptime")] = millis()/1000 + rolloverMillis*4294967;
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ void handlePresets()
|
|||||||
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S2)
|
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||||
// this does not make sense on single core
|
// this does not make sense on single core
|
||||||
core = xPortGetCoreID();
|
core = xPortGetCoreID();
|
||||||
// begin WLEDSR specific
|
// begin WLEDMM specific
|
||||||
// loopTask (arduino main loop) sometimes runs on core #1
|
// loopTask (arduino main loop) sometimes runs on core #1
|
||||||
if ((core == 1) && (strncmp(pcTaskGetTaskName(NULL), "loopTask", 8) == 0)) {
|
if ((core == 1) && (strncmp(pcTaskGetTaskName(NULL), "loopTask", 8) == 0)) {
|
||||||
DEBUG_PRINTF("[applyPreset] called from loopTask on core %d; forcing core = 0\n", (int)core);
|
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);
|
DEBUG_PRINTF("[applyPreset] called from async_tcp on core %d; forcing core = 1\n", (int)core);
|
||||||
core = 1;
|
core = 1;
|
||||||
}
|
}
|
||||||
// end WLEDSR specific
|
// end WLEDMM specific
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
//only allow use of fileDoc from the core responsible for network requests (AKA HTTP JSON API)
|
//only allow use of fileDoc from the core responsible for network requests (AKA HTTP JSON API)
|
||||||
|
|||||||
@@ -160,7 +160,7 @@
|
|||||||
#include "../usermods/ADS1115_v2/usermod_ads1115.h"
|
#include "../usermods/ADS1115_v2/usermod_ads1115.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//WLEDSR Custom Effects
|
//WLEDMM Custom Effects
|
||||||
#ifdef USERMOD_CUSTOMEFFECTS
|
#ifdef USERMOD_CUSTOMEFFECTS
|
||||||
#include "../usermods/customeffects/usermod_v2_customeffects.h"
|
#include "../usermods/customeffects/usermod_v2_customeffects.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -324,7 +324,7 @@ void registerUsermods()
|
|||||||
usermods.add(new ADS1115Usermod());
|
usermods.add(new ADS1115Usermod());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//WLEDSR Custom Effects
|
//WLEDMM Custom Effects
|
||||||
#ifdef USERMOD_CUSTOMEFFECTS
|
#ifdef USERMOD_CUSTOMEFFECTS
|
||||||
usermods.add(new CustomEffectsUserMod());
|
usermods.add(new CustomEffectsUserMod());
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ using PSRAMDynamicJsonDocument = BasicJsonDocument<PSRAM_Allocator>;
|
|||||||
|
|
||||||
// Global Variable definitions
|
// Global Variable definitions
|
||||||
WLED_GLOBAL char versionString[] _INIT(TOSTRING(WLED_VERSION));
|
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"
|
#define WLED_CODENAME "Hoshi"
|
||||||
|
|
||||||
// AP and OTA default passwords (for maximum security change them!)
|
// AP and OTA default passwords (for maximum security change them!)
|
||||||
|
|||||||
@@ -45,18 +45,18 @@ void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t
|
|||||||
request->_tempFile = WLED_FS.open(finalname, "w");
|
request->_tempFile = WLED_FS.open(finalname, "w");
|
||||||
DEBUG_PRINT(F("Uploading "));
|
DEBUG_PRINT(F("Uploading "));
|
||||||
DEBUG_PRINTLN(finalname);
|
DEBUG_PRINTLN(finalname);
|
||||||
if (finalname.equals("/presets.json")) presetsModifiedTime = toki.second(); // WLEDSR
|
if (finalname.equals("/presets.json")) presetsModifiedTime = toki.second(); // WLEDMM
|
||||||
}
|
}
|
||||||
if (len) {
|
if (len) {
|
||||||
request->_tempFile.write(data,len);
|
request->_tempFile.write(data,len);
|
||||||
}
|
}
|
||||||
if (final) {
|
if (final) {
|
||||||
request->_tempFile.close();
|
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..."));
|
request->send(200, "text/plain", F("Configuration restore successful.\nRebooting..."));
|
||||||
doReboot = true;
|
doReboot = true;
|
||||||
} else {
|
} 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!"));
|
request->send(200, "text/plain", F("Presets File Uploaded!"));
|
||||||
} else
|
} else
|
||||||
request->send(200, "text/plain", F("File Uploaded!"));
|
request->send(200, "text/plain", F("File Uploaded!"));
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ bool sendLiveLedsWs(uint32_t wsClient)
|
|||||||
uint16_t used = strip.getLengthTotal();
|
uint16_t used = strip.getLengthTotal();
|
||||||
const uint16_t MAX_LIVE_LEDS_WS = strip.isMatrix ? 1024 : 256;
|
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 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;
|
uint16_t bufSize = pos + (used/n)*3;
|
||||||
AsyncWebSocketMessageBuffer * wsBuf = ws.makeBuffer(bufSize);
|
AsyncWebSocketMessageBuffer * wsBuf = ws.makeBuffer(bufSize);
|
||||||
if (!wsBuf) return false; //out of memory
|
if (!wsBuf) return false; //out of memory
|
||||||
@@ -163,8 +163,8 @@ bool sendLiveLedsWs(uint32_t wsClient)
|
|||||||
buffer[1] = 2; //version
|
buffer[1] = 2; //version
|
||||||
buffer[2] = strip.matrixWidth;
|
buffer[2] = strip.matrixWidth;
|
||||||
buffer[3] = strip.matrixHeight;
|
buffer[3] = strip.matrixHeight;
|
||||||
buffer[4] = currentPreset; //WLEDSR
|
buffer[4] = currentPreset; //WLEDMM
|
||||||
buffer[5] = currentPlaylist; //WLEDSR
|
buffer[5] = currentPlaylist; //WLEDMM
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -719,7 +719,7 @@ void getSettingsJS(byte subPage, char* dest)
|
|||||||
|
|
||||||
if (subPage == 9) // update
|
if (subPage == 9) // update
|
||||||
{
|
{
|
||||||
//WLEDSR: show bin name
|
//WLEDMM: show bin name
|
||||||
sappends('m',SET_F("(\"sip\")[0]"),(char*)F("WLEDMM_"));
|
sappends('m',SET_F("(\"sip\")[0]"),(char*)F("WLEDMM_"));
|
||||||
olen -= 2; //delete ";
|
olen -= 2; //delete ";
|
||||||
oappend(versionString);
|
oappend(versionString);
|
||||||
|
|||||||
Reference in New Issue
Block a user