allocate more PSRAM for JSON

This commit is contained in:
Frank
2024-10-28 10:30:01 +01:00
parent 7af3e27f64
commit 711c709900

View File

@@ -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