Merge branch 'main' into fx-upd

This commit is contained in:
Blaz Kristan 2023-01-24 16:39:49 +01:00
commit 07cc26a144
8 changed files with 1775 additions and 1771 deletions

View File

@ -383,9 +383,9 @@ class UsermodTemperature : public Usermod {
void appendConfigData()
{
oappend(SET_F("addInfo('")); oappend(SET_F(FPSTR(_name))); oappend(SET_F(":")); oappend(SET_F(FPSTR(_parasite)));
oappend(SET_F("addInfo('")); oappend(String(FPSTR(_name)).c_str()); oappend(SET_F(":")); oappend(String(FPSTR(_parasite)).c_str());
oappend(SET_F("',1,'<i>(if no Vcc connected)</i>');")); // 0 is field type, 1 is actual field
oappend(SET_F("addInfo('")); oappend(SET_F(FPSTR(_name))); oappend(SET_F(":")); oappend(SET_F(FPSTR(_parasitePin)));
oappend(SET_F("addInfo('")); oappend(String(FPSTR(_name)).c_str()); oappend(SET_F(":")); oappend(String(FPSTR(_parasitePin)).c_str());
oappend(SET_F("',1,'<i>(for external MOSFET)</i>');")); // 0 is field type, 1 is actual field
}

View File

@ -184,7 +184,7 @@ class MultiRelay : public Usermod {
*/
MultiRelay() {
const int8_t defPins[] = {MULTI_RELAY_PINS};
for (int i=0; i<MULTI_RELAY_MAX_RELAYS; i++) {
for (size_t i=0; i<MULTI_RELAY_MAX_RELAYS; i++) {
_relay[i].pin = i<sizeof(defPins) ? defPins[i] : -1;
_relay[i].delay = 0;
_relay[i].mode = false;

View File

@ -4853,7 +4853,7 @@ uint16_t mode_2Dgameoflife(void) { // Written by Ewoud Wijma, inspired by https:
for (int y = 0; y < rows; y++) for (int x = 0; x < cols; x++) prevLeds[XY(x,y)] = CRGB::Black;
memset(crcBuffer, 0, sizeof(uint16_t)*crcBufferLen);
} else if (strip.now - SEGENV.step < FRAMETIME_FIXED * map(SEGMENT.speed,0,255,64,4)) { // warning: comparison between signed and unsigned integer expressions
} else if (strip.now - SEGENV.step < FRAMETIME_FIXED * (uint32_t)map(SEGMENT.speed,0,255,64,4)) {
// update only when appropriate time passes (in 42 FPS slots)
return FRAMETIME;
}
@ -5876,10 +5876,8 @@ uint16_t mode_2Dscrollingtext(void) {
++SEGENV.aux1 &= 0xFF; // color shift
SEGENV.step = millis() + map(SEGMENT.speed, 0, 255, 10*FRAMETIME_FIXED, 2*FRAMETIME_FIXED);
if (!SEGMENT.check2) {
// we need it 3 times
SEGMENT.fade_out(255 - (SEGMENT.custom1>>5)); // fade to background color
SEGMENT.fade_out(255 - (SEGMENT.custom1>>5)); // fade to background color
SEGMENT.fade_out(255 - (SEGMENT.custom1>>5)); // fade to background color
for (int y = 0; y < rows; y++) for (int x = 0; x < cols; x++ )
SEGMENT.blendPixelColorXY(x, y, SEGCOLOR(1), 255 - (SEGMENT.custom1>>1));
}
}
for (int i = 0; i < numberOfLetters; i++) {

View File

@ -64,6 +64,7 @@ void WS2812FX::setUpMatrix() {
Segment::maxHeight = 1;
panels = 0;
panel.clear(); // release memory allocated by panels
resetSegments();
return;
}
@ -107,8 +108,8 @@ void WS2812FX::setUpMatrix() {
panel.clear();
Segment::maxWidth = _length;
Segment::maxHeight = 1;
return;
}
resetSegments();
}
#else
isMatrix = false; // no matter what config says
@ -527,7 +528,7 @@ void Segment::drawCharacter(unsigned char chr, int16_t x, int16_t y, uint8_t w,
for (int j = 0; j<w; j++) { // character width
int16_t x0 = x + (w-1) - j;
if ((x0 >= 0 || x0 < cols) && ((bits>>(j+(8-w))) & 0x01)) { // bit set & drawing on-screen
addPixelColorXY(x0, y0, col);
setPixelColorXY(x0, y0, col);
}
}
}

View File

@ -1189,7 +1189,7 @@ TD .checkmark, TD .radiomark {
}
.bp {
margin-bottom: 5px;
margin-bottom: 8px;
}
/* segment & preset wrapper */

View File

@ -772,7 +772,7 @@ function populateSegments(s)
<tr>
<td><input class="noslide segn" id="seg${i}grp" type="number" min="1" max="255" value="${inst.grp}" oninput="updateLen(${i})" onkeydown="segEnter(${i})"></td>
<td><input class="noslide segn" id="seg${i}spc" type="number" min="0" max="255" value="${inst.spc}" oninput="updateLen(${i})" onkeydown="segEnter(${i})"></td>
<td><button class="btn btn-xs" onclick="setSeg(${i})"><i class="icons btn-icon" id="segc${i}">&#xe390;</i></button></td>
<td style="text-align:left;"><button class="btn btn-xs" onclick="setSeg(${i})"><i class="icons btn-icon" id="segc${i}">&#xe390;</i></button></td>
</tr>
</table>
<div class="h bp" id="seg${i}len"></div>
@ -1047,13 +1047,13 @@ function updateLen(s)
{
if (!gId(`seg${s}s`)) return;
var start = parseInt(gId(`seg${s}s`).value);
var stop = parseInt(gId(`seg${s}e`).value);
var len = stop - (cfg.comp.seglen?0:start);
var stop = parseInt(gId(`seg${s}e`).value) + (cfg.comp.seglen?start:0);
var len = stop - start;
if (isM) {
// matrix setup
let startY = parseInt(gId(`seg${s}sY`).value);
let stopY = parseInt(gId(`seg${s}eY`).value);
len *= (stopY-(cfg.comp.seglen?0:startY));
let stopY = parseInt(gId(`seg${s}eY`).value) + (cfg.comp.seglen?startY:0);
len *= (stopY-startY);
let tPL = gId(`seg${s}lbtm`);
if (stop-start>1 && stopY-startY>1) {
// 2D segment
@ -1662,19 +1662,23 @@ function toggleNodes()
function makeSeg()
{
var ns = 0;
var ns = 0, ct = 0;
var lu = lowestUnused;
let li = lastinfo;
if (lu > 0) {
var pend = parseInt(gId(`seg${lu -1}e`).value,10) + (cfg.comp.seglen?parseInt(gId(`seg${lu -1}s`).value,10):0);
if (pend < ledCount) ns = pend;
let xend = parseInt(gId(`seg${lu -1}e`).value,10) + (cfg.comp.seglen?parseInt(gId(`seg${lu -1}s`).value,10):0);
if (isM) {
ns = 0;
ct = mw;
} else {
if (xend < ledCount) ns = xend;
ct = ledCount-(cfg.comp.seglen?ns:0)
}
}
gId('segutil').scrollIntoView({
behavior: 'smooth',
block: 'start',
});
var ct = (isM?mw:ledCount)-(cfg.comp.seglen?ns:0);
//TODO: add calculation for Y in case of 2D matrix
var cn = `<div class="seg lstI expanded">
<div class="segin">
<input type="text" class="noslide" id="seg${lu}t" autocomplete="off" maxlength=32 value="" placeholder="New segment ${lu}"/>

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
*/
// version code in format yymmddb (b = daily build)
#define VERSION 2301170
#define VERSION 2301240
//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG