From 2a53f415eaad48e2529bf53ffe0e2cb4aa91b21d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Dec 2025 18:55:26 +0000 Subject: [PATCH] Add hasPSRAM and psramSize fields to /info endpoint - Added hasPSRAM boolean field indicating if hardware has PSRAM - Added psramSize field with total PSRAM size in MB - Kept existing psram field for backward compatibility (free PSRAM in bytes) - All fields only included for ESP32 architecture - Tests passed and firmware builds successfully Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com> --- wled00/json.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wled00/json.cpp b/wled00/json.cpp index 08468df5..bbb8c0c7 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -839,8 +839,16 @@ void serializeInfo(JsonObject root) #endif root[F("freeheap")] = getFreeHeapSize(); - #if defined(BOARD_HAS_PSRAM) - root[F("psram")] = ESP.getFreePsram(); + #ifdef ARDUINO_ARCH_ESP32 + // Report PSRAM information + bool hasPsram = psramFound(); + root[F("hasPSRAM")] = hasPsram; + if (hasPsram) { + #if defined(BOARD_HAS_PSRAM) + root[F("psram")] = ESP.getFreePsram(); // Free PSRAM in bytes (backward compatibility) + #endif + root[F("psramSize")] = ESP.getPsramSize() / (1024 * 1024); // Total PSRAM size in MB + } #endif root[F("uptime")] = millis()/1000 + rolloverMillis*4294967;