mirror of
https://github.com/wled/WLED.git
synced 2026-04-20 06:04:29 +00:00
minor improvements
* use WLED_HAVE_RTC_MEMORY_HEAP * fix typo in comment
This commit is contained in:
@@ -809,7 +809,7 @@ static void *validateFreeHeap(void *buffer) {
|
||||
|
||||
void *d_malloc(size_t size) {
|
||||
void *buffer = nullptr;
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C5) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32C61) || defined(CONFIG_IDF_TARGET_ESP32P4)
|
||||
#if defined(WLED_HAVE_RTC_MEMORY_HEAP)
|
||||
// the newer ESP32 variants have byte-accessible fast RTC memory that can be used as heap, access speed is on-par with DRAM
|
||||
// the system does prefer normal DRAM until full, since free RTC memory is ~7.5k only, its below the minimum heap threshold and needs to be allocated explicitly
|
||||
// use RTC RAM for small allocations or if DRAM is running low to improve fragmentation
|
||||
|
||||
@@ -296,11 +296,12 @@ void WLED::loop()
|
||||
DEBUG_PRINTF_P(PSTR("PSRAM: Free: %7u bytes | Largest block: %6u bytes\n"), psram_free, psram_largest);
|
||||
#endif
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||
// 32-bit DRAM (not byte accessible, only available on ESP32)
|
||||
// 32-bit DRAM aka IRAM (not byte accessible, only available on ESP32)
|
||||
size_t dram32_free = heap_caps_get_free_size(MALLOC_CAP_32BIT | MALLOC_CAP_INTERNAL) - dram_free; // returns all 32bit DRAM, subtract 8bit DRAM
|
||||
//size_t dram32_largest = heap_caps_get_largest_free_block(MALLOC_CAP_32BIT | MALLOC_CAP_INTERNAL); // returns largest DRAM block -> not useful
|
||||
DEBUG_PRINTF_P(PSTR("DRAM 32-bit: Free: %7u bytes | Largest block: N/A\n"), dram32_free);
|
||||
#else
|
||||
#endif
|
||||
#if defined(WLED_HAVE_RTC_MEMORY_HEAP)
|
||||
// Fast RTC Memory (not available on ESP32)
|
||||
size_t rtcram_free = heap_caps_get_free_size(MALLOC_CAP_RTCRAM);
|
||||
size_t rtcram_largest = heap_caps_get_largest_free_block(MALLOC_CAP_RTCRAM);
|
||||
|
||||
@@ -78,7 +78,7 @@ constexpr unsigned WLED_BOARD = NODE_TYPE_ID_ESP8266;
|
||||
#define WLED_HAVE_RTC_MEMORY_HEAP 1 // has byte-accessible fast RTC memory that can be used as heap
|
||||
// no 4byte-accessible IRAM heap
|
||||
|
||||
#define WLED_HAS_PARALLEL_I2S 1 // esp32-S3 supports I2S parallel leds driver (NeoPixelBus)
|
||||
#define WLED_HAS_PARALLEL_I2S 1 // esp32-S2 supports I2S parallel leds driver (NeoPixelBus)
|
||||
|
||||
constexpr unsigned WLED_BOARD = NODE_TYPE_ID_ESP32S2;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user