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