Add separate method to get free PSRAM and report only internal in getFreeHeap

This commit is contained in:
me-no-dev 2018-08-18 16:34:41 +02:00
parent 14d6f6e7e6
commit 65511b23d3
2 changed files with 7 additions and 1 deletions

View File

@ -114,7 +114,12 @@ void EspClass::restart(void)
uint32_t EspClass::getFreeHeap(void)
{
return esp_get_free_heap_size();
return heap_caps_get_free_size(MALLOC_CAP_INTERNAL);
}
uint32_t EspClass::getFreePsram(void)
{
return heap_caps_get_free_size(MALLOC_CAP_SPIRAM);
}
uint8_t EspClass::getChipRevision(void)

View File

@ -57,6 +57,7 @@ public:
~EspClass() {}
void restart();
uint32_t getFreeHeap();
uint32_t getFreePsram();
uint8_t getChipRevision();
uint8_t getCpuFreqMHz(){ return CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ; }
uint32_t getCycleCount();