@@ -26,7 +26,8 @@ void XML_response(Print& dest)
2626 );
2727}
2828
29- static void extractPin (Print& settingsScript, const JsonObject &obj, const char *key) {
29+ static void extractPin (Print& settingsScript, const JsonObject &obj, const char *key)
30+ {
3031 if (obj[key].is <JsonArray>()) {
3132 JsonArray pins = obj[key].as <JsonArray>();
3233 for (JsonVariant pv : pins) {
@@ -37,6 +38,22 @@ static void extractPin(Print& settingsScript, const JsonObject &obj, const char
3738 }
3839}
3940
41+ void fillWLEDVersion (char *buf, size_t len)
42+ {
43+ if (!buf || len == 0 ) return ;
44+
45+ snprintf_P (buf,len,PSTR (" WLED %s (%d)<br>\\\" %s\\\" <br>(Processor: %s)" ),
46+ versionString,
47+ VERSION,
48+ releaseString,
49+ #if defined(ARDUINO_ARCH_ESP32)
50+ ESP.getChipModel ()
51+ #else
52+ " ESP8266"
53+ #endif
54+ );
55+ }
56+
4057// print used pins by scanning JsonObject (1 level deep)
4158static void fillUMPins (Print& settingsScript, const JsonObject &mods)
4259{
@@ -72,7 +89,8 @@ static void fillUMPins(Print& settingsScript, const JsonObject &mods)
7289 }
7390}
7491
75- void appendGPIOinfo (Print& settingsScript) {
92+ void appendGPIOinfo (Print& settingsScript)
93+ {
7694 settingsScript.print (F (" d.um_p=[-1" )); // has to have 1 element
7795 if (i2c_sda > -1 && i2c_scl > -1 ) {
7896 settingsScript.printf_P (PSTR (" ,%d,%d" ), i2c_sda, i2c_scl);
@@ -594,7 +612,7 @@ void getSettingsJS(byte subPage, Print& settingsScript)
594612 printSetFormCheckbox (settingsScript,PSTR (" AO" ),aOtaEnabled);
595613 printSetFormCheckbox (settingsScript,PSTR (" SU" ),otaSameSubnet);
596614 char tmp_buf[128 ];
597- snprintf_P (tmp_buf,sizeof (tmp_buf), PSTR ( " WLED %s (build %d) " ),versionString,VERSION );
615+ fillWLEDVersion (tmp_buf,sizeof (tmp_buf));
598616 printSetClassElementHTML (settingsScript,PSTR (" sip" ),0 ,tmp_buf);
599617 settingsScript.printf_P (PSTR (" sd=\" %s\" ;" ), serverDescription);
600618 // hide settings if not compiled
@@ -656,16 +674,7 @@ void getSettingsJS(byte subPage, Print& settingsScript)
656674 if (subPage == SUBPAGE_UPDATE) // update
657675 {
658676 char tmp_buf[128 ];
659- snprintf_P (tmp_buf,sizeof (tmp_buf),PSTR (" WLED %s<br>%s<br>(%s build %d)" ),
660- versionString,
661- releaseString,
662- #if defined(ARDUINO_ARCH_ESP32)
663- ESP.getChipModel (),
664- #else
665- " esp8266" ,
666- #endif
667- VERSION);
668-
677+ fillWLEDVersion (tmp_buf,sizeof (tmp_buf));
669678 printSetClassElementHTML (settingsScript,PSTR (" sip" ),0 ,tmp_buf);
670679 #ifndef ARDUINO_ARCH_ESP32
671680 settingsScript.print (F (" toggle('rev');" )); // hide revert button on ESP8266
0 commit comments