From d63b716cd0f57b67514e39d9630b4e31f17780ad Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 11 Dec 2023 11:22:39 +0100 Subject: [PATCH] Slightly reduce json buffer size on boards with PSRAM Found out that the main JSON 'doc' is still living in normal RAM, even when PSRAM is available... This results is very low RAM especially on -S2. This change tries to find a balance between "need large json buffer" and "other features become unstable when free RAM is low". --- wled00/const.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wled00/const.h b/wled00/const.h index 2f2105084d..b06c4aa84a 100644 --- a/wled00/const.h +++ b/wled00/const.h @@ -423,12 +423,12 @@ #if defined(BOARD_HAS_PSRAM) && (defined(WLED_USE_PSRAM) || defined(WLED_USE_PSRAM_JSON)) #if defined(ARDUINO_ARCH_ESP32S2) || defined(ARDUINO_ARCH_ESP32C3) #if defined(ARDUINO_ARCH_ESP32C3) - #define JSON_BUFFER_SIZE 46000 // WLEDMM - max 46KB on -C3 with PSRAM (chip has 400kb RAM) + #define JSON_BUFFER_SIZE 44000 // WLEDMM - max 44KB on -C3 with PSRAM (chip has 400kb RAM) #else - #define JSON_BUFFER_SIZE 36000 // WLEDMM - max 36KB on -S2 with PSRAM (chip has 320kb RAM) + #define JSON_BUFFER_SIZE 32000 // WLEDMM - max 32KB on -S2 with PSRAM (chip has 320kb RAM) #endif #else - #define JSON_BUFFER_SIZE 56000 // WLEDMM (was 60000) slightly reduced to avoid build error "region dram0_0_seg overflowed" + #define JSON_BUFFER_SIZE 54000 // WLEDMM (was 60000) slightly reduced to avoid build error "region dram0_0_seg overflowed" #endif #else #define JSON_BUFFER_SIZE 24576