bblanchon / cpp4arduino

Samples files for cpp4arduino.com
https://cpp4arduino.com
48 stars 6 forks source link

Trying to use HeapFragmention lib, but getting compiler err : 'ummHeapInfo' was not declared #3

Closed chess-levin closed 2 years ago

chess-levin commented 2 years ago

Hi, i want to try your HeapFragmentation library for my esp8266 wemos d1 mini project.

But I can't compile your HeapFragmentation lib. ummHeapInfo is not declared. Could you help me?

Compiling .pio\build\esp12e\lib128\HeapFragmentation\MemoryInfo.Esp8266.cpp.o
lib\HeapFragmentation\MemoryInfo.Esp8266.cpp: In function 'size_t getTotalAvailableMemory()':
lib\HeapFragmentation\MemoryInfo.Esp8266.cpp:14:10: error: 'ummHeapInfo' was not declared in this scope
   14 |   return ummHeapInfo.freeBlocks * block_size;
      |          ^~~~~~~~~~~
lib\HeapFragmentation\MemoryInfo.Esp8266.cpp: In function 'size_t getLargestAvailableBlock()':
lib\HeapFragmentation\MemoryInfo.Esp8266.cpp:19:10: error: 'ummHeapInfo' was not declared in this scope
   19 |   return ummHeapInfo.maxFreeContiguousBlocks * block_size;
      |          ^~~~~~~~~~~
*** [.pio\build\esp12e\lib128\HeapFragmentation\MemoryInfo.Esp8266.cpp.o] Error 1
bblanchon commented 2 years ago

Hi @chess-levin,

Thank you for reporting this issue; it is now fixed. Note that, on ESP8266, you can call ESP.getHeapFragmentation() to get the fragmentation percent.

Best regards, Benoit