Files
Filaman/src/debug.h
Jan Philipp Ecker 8343fe887b Introduces new heap debugging feature and fixes some memory leaks in website feature
Introduces a new define HEAP_DEBUG_MESSAGE(location) that can be used to instrument the code to get heap information output on the Serial output. It can be enabled via the define ENABLE_HEAP_DEBUGGING. Also fixes some memory leaks in the website part of the project.
2025-07-26 22:14:58 +02:00

12 lines
397 B
C

#include <Arduino.h>
#ifdef ENABLE_HEAP_DEBUGGING
#define HEAP_DEBUG_MESSAGE(location) printHeapDebugData(location);
#else
#define HEAP_DEBUG_MESSAGE(location)
#endif
inline void printHeapDebugData(String location){
Serial.println("Heap: " + String(ESP.getMinFreeHeap()/1024) + "\t" + String(ESP.getFreeHeap()/1024) + "\t" + String(ESP.getMaxAllocHeap()/1024) + "\t" + location);
}