diff --git a/wled00/wled.h b/wled00/wled.h index 03492ab9..fc835252 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2305030 +#define VERSION 2305040 // May-the-4th be with you ;-) //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG @@ -733,8 +733,19 @@ WLED_GLOBAL int8_t spi_sclk _INIT(-1); WLED_GLOBAL int8_t spi_sclk _INIT(HW_PIN_CLOCKSPI); #endif +#if defined(BOARD_HAS_PSRAM) && (defined(WLED_USE_PSRAM_JSON) || defined(WLED_USE_PSRAM)) +// put the main JSON "doc" into PSRAM +#ifndef WLED_DEFINE_GLOBAL_VARS +extern PSRAMDynamicJsonDocument doc; +#else +PSRAMDynamicJsonDocument doc(JSON_BUFFER_SIZE); // call constructor - fingers crossed that PSRAM is already initialized at this point ... +#endif + +#else // standard: use global (.bss) RAM // global ArduinoJson buffer WLED_GLOBAL StaticJsonDocument doc; +#endif + WLED_GLOBAL volatile uint8_t jsonBufferLock _INIT(0); // enable additional debug output