We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d42f94a commit 49fbff4Copy full SHA for 49fbff4
cores/esp32/Esp.cpp
@@ -134,9 +134,7 @@ void EspClass::restart(void)
134
135
uint32_t EspClass::getHeapSize(void)
136
{
137
- multi_heap_info_t info;
138
- heap_caps_get_info(&info, MALLOC_CAP_INTERNAL);
139
- return info.total_free_bytes + info.total_allocated_bytes;
+ return heap_caps_get_total_size(MALLOC_CAP_INTERNAL);
140
}
141
142
uint32_t EspClass::getFreeHeap(void)
@@ -157,9 +155,7 @@ uint32_t EspClass::getMaxAllocHeap(void)
157
155
uint32_t EspClass::getPsramSize(void)
158
156
159
if(psramFound()){
160
161
- heap_caps_get_info(&info, MALLOC_CAP_SPIRAM);
162
+ return heap_caps_get_total_size(MALLOC_CAP_SPIRAM)
163
164
return 0;
165
0 commit comments