Hardware pin defaults in i2c and spi pin dropdowns

bugfix: replace oappend(SET_F(name)); by oappend(_name);

const.h: remove unset of 8266 variables as no behind the scene actions, this is just bad behavior and the pin drop downs will show this bad behavior

xml.cpp: show hardware defaults as ⍼ in dropdowns (better icon needed)
This commit is contained in:
Ewoud
2023-01-15 17:08:39 +01:00
parent 6ad22e16c0
commit 474243938c
11 changed files with 22 additions and 28 deletions

View File

@@ -616,8 +616,8 @@ public:
void changeCustom(uint8_t par, bool increase) {
uint8_t val = 0;
#ifdef USERMOD_FOUR_LINE_DISPLAY
uint8_t val = 0;
if (display && display->wakeDisplay()) {
display->redraw(true);
// Throw away wake up input
@@ -629,11 +629,13 @@ public:
if (applyToAll) {
uint8_t id = strip.getFirstSelectedSegId();
Segment& sid = strip.getSegment(id);
#ifdef USERMOD_FOUR_LINE_DISPLAY
switch (par) {
case 3: val = sid.custom3 = max(min((increase ? sid.custom3+fadeAmount : sid.custom3-fadeAmount), 255), 0); break;
case 2: val = sid.custom2 = max(min((increase ? sid.custom2+fadeAmount : sid.custom2-fadeAmount), 255), 0); break;
default: val = sid.custom1 = max(min((increase ? sid.custom1+fadeAmount : sid.custom1-fadeAmount), 255), 0); break;
}
#endif
for (byte i=0; i<strip.getSegmentsNum(); i++) {
Segment& seg = strip.getSegment(i);
if (!seg.isActive() || i == id) continue;
@@ -644,12 +646,14 @@ public:
}
}
} else {
#ifdef USERMOD_FOUR_LINE_DISPLAY
Segment& seg = strip.getMainSegment();
switch (par) {
case 3: val = seg.custom3 = max(min((increase ? seg.custom3+fadeAmount : seg.custom3-fadeAmount), 255), 0); break;
case 2: val = seg.custom2 = max(min((increase ? seg.custom2+fadeAmount : seg.custom2-fadeAmount), 255), 0); break;
default: val = seg.custom1 = max(min((increase ? seg.custom1+fadeAmount : seg.custom1-fadeAmount), 255), 0); break;
}
#endif
}
lampUdated();
#ifdef USERMOD_FOUR_LINE_DISPLAY
@@ -868,7 +872,7 @@ public:
//WLEDMM: add appendConfigData
void appendConfigData()
{
oappend(SET_F("addHB('")); oappend(SET_F(_name)); oappend("');");
oappend(SET_F("addHB('")); oappend(_name); oappend("');");
#ifdef ENCODER_DT_PIN
oappend(SET_F("xOption('Rotary-Encoder:DT-pin',1,' ⎌',")); oappendi(ENCODER_DT_PIN); oappend(");");