PSRAM: you can have it, and eat it or not eat it

*This patch allows to compile with BOARD_HAS_PSRAM, but not set WLED_USE_PSRAM - reserved pins will be protected, and PSRAM usage will be shown in info.
* if you add `-D WLED_USE_PSRAM_JSON` then PSRAM will be used for some JSON buffers, but not for LEDs and Segments.
This commit is contained in:
Frank
2023-04-19 17:58:50 +02:00
parent e2d3800fc3
commit d90ee766f6
7 changed files with 12 additions and 11 deletions

View File

@@ -254,7 +254,7 @@ void WLED::loop()
#ifdef ARDUINO_ARCH_ESP32
DEBUG_PRINTF("%s min free stack %d\n", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL)); //WLEDMM
#endif
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_PSRAM)
#if defined(ARDUINO_ARCH_ESP32) && defined(BOARD_HAS_PSRAM)
if (psramFound()) {
//DEBUG_PRINT(F("Total PSRAM: ")); DEBUG_PRINT(ESP.getPsramSize()/1024); DEBUG_PRINTLN("kB");
DEBUG_PRINT(F("Free PSRAM: ")); DEBUG_PRINT(ESP.getFreePsram()/1024); DEBUG_PRINTLN("kB");
@@ -468,7 +468,8 @@ void WLED::setup()
DEBUG_PRINTF("%s min free stack %d\n", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL)); //WLEDMM
#endif
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_PSRAM)
#if defined(ARDUINO_ARCH_ESP32) && defined(BOARD_HAS_PSRAM)
psramInit();
if (psramFound()) {
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32S3)
// GPIO16/GPIO17 reserved for SPI RAM
@@ -485,7 +486,7 @@ void WLED::setup()
DEBUG_PRINTLN(F("No PSRAM found."));
#endif
#if defined(ARDUINO_ARCH_ESP32) && defined(BOARD_HAS_PSRAM) && !defined(WLED_USE_PSRAM)
DEBUG_PRINTLN(F("PSRAM not used."));
DEBUG_PRINTLN(F("PSRAM not used for LEDs."));
#endif
//DEBUG_PRINT(F("LEDs inited. heap usage ~"));