Skip to content

Commit eb3200b

Browse files
committed
align JSON release info with upstream 0_15 (update page, JSON "info")
align with upstream /json/info * info.release * info.arch * info.clock * info.flash
1 parent a25e608 commit eb3200b

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

wled00/json.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -897,9 +897,10 @@ String restartCode2Info(esp_reset_reason_t reason) {
897897
void serializeInfo(JsonObject root)
898898
{
899899
root[F("ver")] = versionString;
900-
root[F("rel")] = releaseString; //WLEDMM to add bin name
901900
root[F("vid")] = VERSION;
902-
//root[F("cn")] = WLED_CODENAME;
901+
//root[F("cn")] = F(WLED_CODENAME); //WLEDMM removed
902+
root[F("release")] = FPSTR(releaseString);
903+
root[F("rel")] = FPSTR(releaseString); //WLEDMM to add bin name
903904

904905
JsonObject leds = root.createNestedObject("leds");
905906
leds[F("count")] = strip.getLengthTotal();
@@ -1018,12 +1019,15 @@ void serializeInfo(JsonObject root)
10181019
wifi_info[F("txPower")] = (int) WiFi.getTxPower();
10191020
wifi_info[F("sleep")] = (bool) WiFi.getSleep();
10201021
#endif
1021-
#if !defined(CONFIG_IDF_TARGET_ESP32C2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32S3)
1022+
//#if !defined(CONFIG_IDF_TARGET_ESP32C2) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32S3)
1023+
#if CONFIG_IDF_TARGET_ESP32
10221024
root[F("arch")] = "esp32";
10231025
#else
10241026
root[F("arch")] = ESP.getChipModel();
10251027
#endif
10261028
root[F("core")] = ESP.getSdkVersion();
1029+
root[F("clock")] = ESP.getCpuFreqMHz();
1030+
root[F("flash")] = (ESP.getFlashChipSize()/1024)/1024;
10271031
//root[F("maxalloc")] = ESP.getMaxAllocHeap();
10281032
#ifdef WLED_DEBUG
10291033
root[F("resetReason0")] = (int)rtc_get_reset_reason(0);
@@ -1043,6 +1047,8 @@ void serializeInfo(JsonObject root)
10431047
#else
10441048
root[F("arch")] = "esp8266";
10451049
root[F("core")] = ESP.getCoreVersion();
1050+
root[F("clock")] = ESP.getCpuFreqMHz();
1051+
root[F("flash")] = (ESP.getFlashChipSize()/1024)/1024;
10461052
//root[F("maxalloc")] = ESP.getMaxFreeBlockSize();
10471053
#ifdef WLED_DEBUG
10481054
root[F("resetReason")] = (int)ESP.getResetInfoPtr()->reason;

wled00/wled.h

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
// version code in format yymmddb (b = daily build)
11-
#define VERSION 2405170
11+
#define VERSION 2405220
1212

1313
// WLEDMM - you can check for this define in usermods, to only enabled WLEDMM specific code in the "right" fork. Its not defined in AC WLED.
1414
#define _MoonModules_WLED_
@@ -271,16 +271,17 @@ using PSRAMDynamicJsonDocument = BasicJsonDocument<PSRAM_Allocator>;
271271
// int arr[]{0,1,2} becomes WLED_GLOBAL int arr[] _INIT_N(({0,1,2}));
272272

273273
#ifndef WLED_DEFINE_GLOBAL_VARS
274-
# define WLED_GLOBAL extern
275-
# define _INIT(x)
276-
# define _INIT_N(x)
274+
#define WLED_GLOBAL extern
275+
#define _INIT(x)
276+
#define _INIT_N(x)
277+
#define _INIT_PROGMEM(x)
277278
#else
278-
# define WLED_GLOBAL
279-
# define _INIT(x) = x
280-
281-
//needed to ignore commas in array definitions
282-
#define UNPACK( ... ) __VA_ARGS__
283-
# define _INIT_N(x) UNPACK x
279+
#define WLED_GLOBAL
280+
#define _INIT(x) = x
281+
//needed to ignore commas in array definitions
282+
#define UNPACK( ... ) __VA_ARGS__
283+
#define _INIT_N(x) UNPACK x
284+
#define _INIT_PROGMEM(x) PROGMEM = x
284285
#endif
285286

286287
#define STRINGIFY(X) #X
@@ -290,9 +291,13 @@ using PSRAMDynamicJsonDocument = BasicJsonDocument<PSRAM_Allocator>;
290291
#define WLED_VERSION "dev"
291292
#endif
292293

294+
#ifndef WLED_RELEASE_NAME
295+
#define WLED_RELEASE_NAME mdev_release
296+
#endif
297+
293298
// Global Variable definitions
294299
WLED_GLOBAL char versionString[] _INIT(TOSTRING(WLED_VERSION));
295-
WLED_GLOBAL char releaseString[] _INIT(TOSTRING(WLED_RELEASE_NAME)); //WLEDMM: to show on update page
300+
WLED_GLOBAL char releaseString[] _INIT_PROGMEM(TOSTRING(WLED_RELEASE_NAME)); //WLEDMM: to show on update page // somehow this will not work if using "const char releaseString[]
296301
#define WLED_CODENAME "Hoshi"
297302

298303
// AP and OTA default passwords (for maximum security change them!)

wled00/xml.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ void getSettingsJS(AsyncWebServerRequest* request, byte subPage, char* dest) //W
846846
olen -= 2; //delete ";
847847
oappend(versionString);
848848
oappend(SET_F(" "));
849-
oappend(releaseString);
849+
oappend((char*)FPSTR(releaseString));
850850
oappend(SET_F(".bin<br>("));
851851
#if defined(CONFIG_IDF_TARGET_ESP32C3)
852852
oappend(SET_F("ESP32-C3"));

0 commit comments

Comments
 (0)