Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 65511b2

Browse filesBrowse files
committed
Add separate method to get free PSRAM and report only internal in getFreeHeap
1 parent 14d6f6e commit 65511b2
Copy full SHA for 65511b2

File tree

Expand file treeCollapse file tree

2 files changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-1
lines changed

‎cores/esp32/Esp.cpp

Copy file name to clipboardExpand all lines: cores/esp32/Esp.cpp
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,12 @@ void EspClass::restart(void)
114114

115115
uint32_t EspClass::getFreeHeap(void)
116116
{
117-
return esp_get_free_heap_size();
117+
return heap_caps_get_free_size(MALLOC_CAP_INTERNAL);
118+
}
119+
120+
uint32_t EspClass::getFreePsram(void)
121+
{
122+
return heap_caps_get_free_size(MALLOC_CAP_SPIRAM);
118123
}
119124

120125
uint8_t EspClass::getChipRevision(void)

‎cores/esp32/Esp.h

Copy file name to clipboardExpand all lines: cores/esp32/Esp.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class EspClass
5757
~EspClass() {}
5858
void restart();
5959
uint32_t getFreeHeap();
60+
uint32_t getFreePsram();
6061
uint8_t getChipRevision();
6162
uint8_t getCpuFreqMHz(){ return CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ; }
6263
uint32_t getCycleCount();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.