move main JSON doc into PSRAM (experimental)

this should move the main JSON doc into PSRAM on WROVER boards.
* free heap should increase by ~60kb
* PSRAM use should go up by the same amount.
This commit is contained in:
Frank
2023-05-04 17:09:43 +02:00
parent 7d0e627e14
commit 4341d36885

View File

@@ -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<JSON_BUFFER_SIZE> doc;
#endif
WLED_GLOBAL volatile uint8_t jsonBufferLock _INIT(0);
// enable additional debug output