move ws LEDs preview buffer into PSRAM

* set DYNAMICBUFFER_USE_PSRAM in build_flags => enable PSRAM support in AsyncWebServerWLED
This commit is contained in:
Frank
2026-02-20 15:26:03 +01:00
parent 269a6a2a86
commit a1555c43a0
2 changed files with 12 additions and 0 deletions

View File

@@ -5,6 +5,10 @@
*/
#ifdef WLED_ENABLE_WEBSOCKETS
#ifdef DYNAMICBUFFER_USE_PSRAM
#warning "DYNAMICBUFFER_USE_PSRAM is experimental"
#endif
static volatile uint16_t wsLiveClientId = 0; // WLEDMM added "static"
static volatile unsigned long wsLastLiveTime = 0; // WLEDMM
//uint8_t* wsFrameBuffer = nullptr;
@@ -222,7 +226,11 @@ static bool sendLiveLedsWs(uint32_t wsClient) // WLEDMM added "static"
#ifdef ESP8266
constexpr size_t MAX_LIVE_LEDS_WS = 256U;
#else
#if !defined(BOARD_HAS_PSRAM) || !defined(DYNAMICBUFFER_USE_PSRAM)
constexpr size_t MAX_LIVE_LEDS_WS = 4096U; //WLEDMM use 4096 as max matrix size
#else
constexpr size_t MAX_LIVE_LEDS_WS = 4096 * 2; //WLEDMM better preview on PSRAM boards
#endif
#endif
size_t used;// = strip.getLengthTotal();
size_t n;// = ((used -1)/MAX_LIVE_LEDS_WS) +1; //only serve every n'th LED if count over MAX_LIVE_LEDS_WS