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
This commit is contained in:
@@ -897,9 +897,10 @@ String restartCode2Info(esp_reset_reason_t reason) {
|
|||||||
void serializeInfo(JsonObject root)
|
void serializeInfo(JsonObject root)
|
||||||
{
|
{
|
||||||
root[F("ver")] = versionString;
|
root[F("ver")] = versionString;
|
||||||
root[F("rel")] = releaseString; //WLEDMM to add bin name
|
|
||||||
root[F("vid")] = VERSION;
|
root[F("vid")] = VERSION;
|
||||||
//root[F("cn")] = WLED_CODENAME;
|
//root[F("cn")] = F(WLED_CODENAME); //WLEDMM removed
|
||||||
|
root[F("release")] = FPSTR(releaseString);
|
||||||
|
root[F("rel")] = FPSTR(releaseString); //WLEDMM to add bin name
|
||||||
|
|
||||||
JsonObject leds = root.createNestedObject("leds");
|
JsonObject leds = root.createNestedObject("leds");
|
||||||
leds[F("count")] = strip.getLengthTotal();
|
leds[F("count")] = strip.getLengthTotal();
|
||||||
@@ -1018,12 +1019,15 @@ void serializeInfo(JsonObject root)
|
|||||||
wifi_info[F("txPower")] = (int) WiFi.getTxPower();
|
wifi_info[F("txPower")] = (int) WiFi.getTxPower();
|
||||||
wifi_info[F("sleep")] = (bool) WiFi.getSleep();
|
wifi_info[F("sleep")] = (bool) WiFi.getSleep();
|
||||||
#endif
|
#endif
|
||||||
#if !defined(CONFIG_IDF_TARGET_ESP32C2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32S3)
|
//#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)
|
||||||
|
#if CONFIG_IDF_TARGET_ESP32
|
||||||
root[F("arch")] = "esp32";
|
root[F("arch")] = "esp32";
|
||||||
#else
|
#else
|
||||||
root[F("arch")] = ESP.getChipModel();
|
root[F("arch")] = ESP.getChipModel();
|
||||||
#endif
|
#endif
|
||||||
root[F("core")] = ESP.getSdkVersion();
|
root[F("core")] = ESP.getSdkVersion();
|
||||||
|
root[F("clock")] = ESP.getCpuFreqMHz();
|
||||||
|
root[F("flash")] = (ESP.getFlashChipSize()/1024)/1024;
|
||||||
//root[F("maxalloc")] = ESP.getMaxAllocHeap();
|
//root[F("maxalloc")] = ESP.getMaxAllocHeap();
|
||||||
#ifdef WLED_DEBUG
|
#ifdef WLED_DEBUG
|
||||||
root[F("resetReason0")] = (int)rtc_get_reset_reason(0);
|
root[F("resetReason0")] = (int)rtc_get_reset_reason(0);
|
||||||
@@ -1043,6 +1047,8 @@ void serializeInfo(JsonObject root)
|
|||||||
#else
|
#else
|
||||||
root[F("arch")] = "esp8266";
|
root[F("arch")] = "esp8266";
|
||||||
root[F("core")] = ESP.getCoreVersion();
|
root[F("core")] = ESP.getCoreVersion();
|
||||||
|
root[F("clock")] = ESP.getCpuFreqMHz();
|
||||||
|
root[F("flash")] = (ESP.getFlashChipSize()/1024)/1024;
|
||||||
//root[F("maxalloc")] = ESP.getMaxFreeBlockSize();
|
//root[F("maxalloc")] = ESP.getMaxFreeBlockSize();
|
||||||
#ifdef WLED_DEBUG
|
#ifdef WLED_DEBUG
|
||||||
root[F("resetReason")] = (int)ESP.getResetInfoPtr()->reason;
|
root[F("resetReason")] = (int)ESP.getResetInfoPtr()->reason;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// version code in format yymmddb (b = daily build)
|
// version code in format yymmddb (b = daily build)
|
||||||
#define VERSION 2405170
|
#define VERSION 2405220
|
||||||
|
|
||||||
// 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.
|
// 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.
|
||||||
#define _MoonModules_WLED_
|
#define _MoonModules_WLED_
|
||||||
@@ -271,16 +271,17 @@ using PSRAMDynamicJsonDocument = BasicJsonDocument<PSRAM_Allocator>;
|
|||||||
// int arr[]{0,1,2} becomes WLED_GLOBAL int arr[] _INIT_N(({0,1,2}));
|
// int arr[]{0,1,2} becomes WLED_GLOBAL int arr[] _INIT_N(({0,1,2}));
|
||||||
|
|
||||||
#ifndef WLED_DEFINE_GLOBAL_VARS
|
#ifndef WLED_DEFINE_GLOBAL_VARS
|
||||||
# define WLED_GLOBAL extern
|
#define WLED_GLOBAL extern
|
||||||
# define _INIT(x)
|
#define _INIT(x)
|
||||||
# define _INIT_N(x)
|
#define _INIT_N(x)
|
||||||
|
#define _INIT_PROGMEM(x)
|
||||||
#else
|
#else
|
||||||
# define WLED_GLOBAL
|
#define WLED_GLOBAL
|
||||||
# define _INIT(x) = x
|
#define _INIT(x) = x
|
||||||
|
//needed to ignore commas in array definitions
|
||||||
//needed to ignore commas in array definitions
|
#define UNPACK( ... ) __VA_ARGS__
|
||||||
#define UNPACK( ... ) __VA_ARGS__
|
#define _INIT_N(x) UNPACK x
|
||||||
# define _INIT_N(x) UNPACK x
|
#define _INIT_PROGMEM(x) PROGMEM = x
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define STRINGIFY(X) #X
|
#define STRINGIFY(X) #X
|
||||||
@@ -290,9 +291,13 @@ using PSRAMDynamicJsonDocument = BasicJsonDocument<PSRAM_Allocator>;
|
|||||||
#define WLED_VERSION "dev"
|
#define WLED_VERSION "dev"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef WLED_RELEASE_NAME
|
||||||
|
#define WLED_RELEASE_NAME mdev_release
|
||||||
|
#endif
|
||||||
|
|
||||||
// Global Variable definitions
|
// Global Variable definitions
|
||||||
WLED_GLOBAL char versionString[] _INIT(TOSTRING(WLED_VERSION));
|
WLED_GLOBAL char versionString[] _INIT(TOSTRING(WLED_VERSION));
|
||||||
WLED_GLOBAL char releaseString[] _INIT(TOSTRING(WLED_RELEASE_NAME)); //WLEDMM: to show on update page
|
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[]
|
||||||
#define WLED_CODENAME "Hoshi"
|
#define WLED_CODENAME "Hoshi"
|
||||||
|
|
||||||
// AP and OTA default passwords (for maximum security change them!)
|
// AP and OTA default passwords (for maximum security change them!)
|
||||||
|
|||||||
@@ -846,7 +846,7 @@ void getSettingsJS(AsyncWebServerRequest* request, byte subPage, char* dest) //W
|
|||||||
olen -= 2; //delete ";
|
olen -= 2; //delete ";
|
||||||
oappend(versionString);
|
oappend(versionString);
|
||||||
oappend(SET_F(" "));
|
oappend(SET_F(" "));
|
||||||
oappend(releaseString);
|
oappend((char*)FPSTR(releaseString));
|
||||||
oappend(SET_F(".bin<br>("));
|
oappend(SET_F(".bin<br>("));
|
||||||
#if defined(CONFIG_IDF_TARGET_ESP32C3)
|
#if defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||||
oappend(SET_F("ESP32-C3"));
|
oappend(SET_F("ESP32-C3"));
|
||||||
|
|||||||
Reference in New Issue
Block a user