From 711c70990092368896cfd0265e9b8a10053a0e03 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:30:01 +0100 Subject: [PATCH] allocate more PSRAM for JSON --- wled00/wled.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wled00/wled.h b/wled00/wled.h index b58584c5..781a55e6 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -814,7 +814,11 @@ WLED_GLOBAL int8_t spi_sclk _INIT(HW_PIN_CLOCKSPI); #ifndef WLED_DEFINE_GLOBAL_VARS WLED_GLOBAL PSRAMDynamicJsonDocument doc; #else - WLED_GLOBAL PSRAMDynamicJsonDocument doc(JSON_BUFFER_SIZE); + #if defined(CONFIG_IDF_TARGET_ESP32S2) || !defined(BOARD_HAS_PSRAM) + WLED_GLOBAL PSRAMDynamicJsonDocument doc(JSON_BUFFER_SIZE); // S2 has very small RAM - lets not push our luck too far + #else + WLED_GLOBAL PSRAMDynamicJsonDocument doc(JSON_BUFFER_SIZE * 2 ); // initially "doc" is allocated in RAM, and later pushed into PSRAM when the drivers is ready + #endif //#warning trying to always use dynamic JSON in PSRAM #endif #else