Skip to content

Commit 1bda6ba

Browse files
committed
align improv chip and version reporting with upstream
* allows for easier support of other MCUs (p4, c6, etc) * removes a second place where the version strings had to be maintained * use the same codename "next step" for v14.8
1 parent a1a7eb6 commit 1bda6ba

2 files changed

Lines changed: 14 additions & 17 deletions

File tree

wled00/data/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ function populateInfo(i)
708708
if (i.ver.includes("0.14.3-b")) vcn = "Fried Chicken";
709709
if (i.ver.includes("14.5.")) vcn = "Small Step";
710710
if (i.ver.includes("14.6.")) vcn = "New Light";
711-
if (i.ver.includes("14.7.")) vcn = "Next Step";
711+
if ((i.ver.includes("14.7."))||(i.ver.includes("14.8."))) vcn = "Next Step";
712712

713713
cn += `v${i.ver} &nbsp;<i>"${vcn}"</i><p>(WLEDMM ${i.rel}.bin)</p><p><em>build ${i.vid}</em></p><table>
714714
${urows}

wled00/improv.cpp

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -194,25 +194,22 @@ void sendImprovIPRPCResult(ImprovRPCType type) {
194194
}
195195

196196
void sendImprovInfoResponse() {
197-
const char* bString =
198-
#ifdef ESP8266
199-
"esp8266"
200-
#elif CONFIG_IDF_TARGET_ESP32C3
201-
"esp32-c3"
202-
#elif CONFIG_IDF_TARGET_ESP32S2
203-
"esp32-s2"
204-
#elif CONFIG_IDF_TARGET_ESP32S3
205-
"esp32-s3"
206-
#else // ESP32
207-
"esp32"
208-
#endif
209-
;
210-
197+
char bString[32] = { '\0' };
198+
#ifdef ESP8266
199+
strcpy(bString, "esp8266");
200+
#else // ESP32
201+
strncpy(bString, ESP.getChipModel(), 31);
202+
#if CONFIG_IDF_TARGET_ESP32
203+
bString[5] = '\0'; // disregard chip revision for classic ESP32
204+
#else
205+
bString[31] = '\0'; // just in case
206+
#endif
207+
strlwr(bString); // convert to lower case
208+
#endif
211209
//Use serverDescription if it has been changed from the default "WLED", else mDNS name
212210
bool useMdnsName = (strcmp(serverDescription, "WLED") == 0 && strlen(cmDNS) > 0);
213211
char vString[32] = { '\0' };
214-
//snprintf_P(vString, sizeof(vString)-1, PSTR("0.14.1-b34.42/%i"),VERSION); // upstream baseline
215-
snprintf_P(vString, sizeof(vString)-1, PSTR("14.7.1/%i"),VERSION); // WLEDMM version
212+
sprintf_P(vString, PSTR("%s/%i"), versionString, VERSION);
216213
const char *str[4] = {"WLED", vString, bString, useMdnsName ? cmDNS : serverDescription};
217214

218215
sendImprovRPCResult(ImprovRPCType::Request_Info, 4, str);

0 commit comments

Comments
 (0)