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

@@ -712,23 +712,28 @@ void getSettingsJS(AsyncWebServerRequest* request, byte subPage, char* dest) //W
oappend(SET_F("d.getElementsByName(\"if:SCLK:pin\")[1].value=")); oappendi(spi_sclk); oappend(";");
//WLEDMM: add help info showing defaults
oappend(SET_F("addInfo('if:SDA:pin',0,'', 'SDA');"));
oappend(SET_F("xOption('if:SDA:pin',1,' ⍼',")); oappendi(SDA); oappend(");");
#ifdef HW_PIN_SDA
oappend(SET_F("xOption('if:SDA:pin',1,' ⎌',")); oappendi(HW_PIN_SDA); oappend(");");
#endif
oappend(SET_F("addInfo('if:SCL:pin',0,'', 'SCL');"));
oappend(SET_F("xOption('if:SCL:pin',1,' ⍼',")); oappendi(SCL); oappend(");");
oappend(SET_F("disableROPins('if:SCL:pin',1);"));
#ifdef HW_PIN_SCL
oappend(SET_F("xOption('if:SCL:pin',1,' ⎌',")); oappendi(HW_PIN_SCL); oappend(");");
#endif
oappend(SET_F("addInfo('if:MOSI:pin',0,'', 'MOSI');"));
oappend(SET_F("xOption('if:MOSI:pin',1,' ⍼',")); oappendi(MOSI); oappend(");");
#ifdef HW_PIN_MOSISPI //WLEDMM renamed from HW_PIN_DATASPI
oappend(SET_F("xOption('if:MOSI:pin',1,' ⎌',")); oappendi(HW_PIN_MOSISPI); oappend(");");
#endif
oappend(SET_F("addInfo('if:MISO:pin',0,'', 'MISO');"));
oappend(SET_F("xOption('if:MISO:pin',1,' ⍼',")); oappendi(MISO); oappend(");");
#ifdef HW_PIN_MISOSPI
oappend(SET_F("xOption('if:MISO:pin',1,' ⎌',")); oappendi(HW_PIN_MISOSPI); oappend(");");
#endif
oappend(SET_F("addInfo('if:SCLK:pin',0,'', 'SCLK');"));
oappend(SET_F("xOption('if:SCLK:pin',1,' ⍼',")); oappendi(SCK); oappend(");");
oappend(SET_F("disableROPins('if:SCLK:pin',1);"));
#ifdef HW_PIN_CLOCKSPI
oappend(SET_F("xOption('if:SCLK:pin',1,' ⎌',")); oappendi(HW_PIN_CLOCKSPI); oappend(");");