Jak najít number of free bytes v ESP32 memory / heap?

Tento přístup funguje pro Arduino / PlatformIO i ESP-IDF projects.

esp32_heap_free_example.cpp
#include <esp_heap_caps.h>

uint32_t freeHeapBytes = heap_caps_get_free_size(MALLOC_CAP_DEFAULT);
esp32_heap_free_example.cpp
#include <esp_heap_caps.h>

uint32_t freeHeapBytes = heap_caps_get_free_size(MALLOC_CAP_DEFAULT);

Podívejte se na podobné články podle kategorie: ESP8266/ESP32