Skip to content

Commit

Permalink
Change WLEDSR to WLEDMM in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ewoudwijma committed Nov 9, 2022
1 parent f2adc5e commit c3c3ff3
Show file tree
Hide file tree
Showing 24 changed files with 98 additions and 98 deletions.
2 changes: 1 addition & 1 deletion pio-scripts/output_bins.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def bin_rename_copy(source, target, env):
if release_name:
_create_dirs(["release"])
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)

# check if new target files exist and remove if necessary
Expand Down
8 changes: 4 additions & 4 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ default_partitions = tools/WLED_ESP32_4MB_1MB_FS.csv
lib_deps =
${env.lib_deps}
; 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
makuna/NeoPixelBus @ 2.6.9
https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
Expand Down Expand Up @@ -551,7 +551,7 @@ build_flags_min =
-D WLED_USE_MY_CONFIG
-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 USERMOD_CUSTOMEFFECTS ; WLEDSR usermod
-D USERMOD_CUSTOMEFFECTS ; WLEDMM usermod
; -D WLED_DEBUG ; lots of generic debug messages
; -D SR_DEBUG ; some extra debug messages from audioreactive

Expand All @@ -568,9 +568,9 @@ build_flags_max =
-D USERMOD_FOUR_LINE_DISPLAY
-D USERMOD_ROTARY_ENCODER_UI
-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_GAMES ; WLEDSR usermod
-D USERMOD_GAMES ; WLEDMM usermod

lib_deps_max =
OneWire@~2.3.5 ; used for USERMOD_FOUR_LINE_DISPLAY and USERMOD_DALLASTEMPERATURE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class FourLineDisplayUsermod : public Usermod {
isHW = (ioPin[0]==i2c_scl && ioPin[1]==i2c_sda);
//isHW = true;
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 } };
if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; return; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class FourLineDisplayUsermod : public Usermod {
// isHW = true;
if (isHW) po = PinOwner::HW_I2C; // allow multiple allocations of HW I2C bus pins
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; }
}

Expand Down
2 changes: 1 addition & 1 deletion usermods/usermod_v2_games/usermod_v2_games.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static const char _data_FX_MODE_IMUTest[] PROGMEM = "🎮 IMUTest@;;;2d";

#endif

//WLEDSR 3D to 2D mapping
//WLEDMM 3D to 2D mapping
struct Voxel {
float x;
float y;
Expand Down
8 changes: 4 additions & 4 deletions wled00/FX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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) {
Expand All @@ -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));

Expand Down
16 changes: 8 additions & 8 deletions wled00/FX.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -382,7 +382,7 @@ typedef struct Segment {
byte* data;
CRGB* leds;
static CRGB *_globalLeds;
void *jMap; //WLEDSR jMap
void *jMap; //WLEDMM jMap

private:
union {
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions wled00/FX_2Dfcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand 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
Expand Down
40 changes: 20 additions & 20 deletions wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -477,7 +477,7 @@ uint16_t Segment::nrOfVStrips() const {
return vLen;
}

//WLEDSR jMap
//WLEDMM jMap
struct XandY {
uint8_t x;
uint8_t y;
Expand Down Expand Up @@ -609,15 +609,15 @@ class JMapC {
} //updatejMapDoc
}; //class JMapC

//WLEDSR jMap
//WLEDMM jMap
void Segment::createjMap() {
if (!jMap) {
Serial.println("createjMap");
jMap = new JMapC();
}
}

//WLEDSR jMap
//WLEDMM jMap
void Segment::deletejMap() {
//Should be called from ~Segment but causes crash (and ~Segment is called quite often...)
if (jMap) {
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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());
Expand All @@ -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
Expand Down Expand Up @@ -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());
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions wled00/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions wled00/data/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -366,7 +366,7 @@
</div>
</div>

<!-- WLEDSR Custom Effects -->
<!-- WLEDMM Custom Effects -->
<div id="ceEditor" class="modal">
<div id="kceEditor">Loading...</div><br>
</div>
Expand All @@ -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>
Loading

0 comments on commit c3c3ff3

Please sign in to comment.