diff --git a/RFLink/99_helper.cpp b/RFLink/99_helper.cpp index 7d2a5a3..db0893e 100644 --- a/RFLink/99_helper.cpp +++ b/RFLink/99_helper.cpp @@ -18,5 +18,26 @@ void SerialPrint(int value) Serial.print(value); } +void SerialPrintFreeHeap() +{ + Serial.print(ESP.getFreeHeap()); +} + +void SerialPrintMaxAllocHeap() +{ + Serial.print(ESP.getMaxAllocHeap()); +} + +void SerialPrintFreeMemInfo() +{ + Serial.print("8bit aligned, Free = "); + Serial.print(heap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)); + Serial.print(", Max block = "); + Serial.print(heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)); + Serial.print(", 32bit aligned, Free = "); + Serial.print(heap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_32BIT)); + Serial.print(", Max block = "); + Serial.print(heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL | MALLOC_CAP_32BIT)); +} } diff --git a/RFLink/99_helper.h b/RFLink/99_helper.h index 8121f50..155fc1b 100644 --- a/RFLink/99_helper.h +++ b/RFLink/99_helper.h @@ -12,6 +12,9 @@ extern "C" { void SerialPrintLn(const char* msg); void SerialPrintMsg(const char* msg); void SerialPrint(int value); +void SerialPrintFreeHeap(); +void SerialPrintMaxAllocHeap(); +void SerialPrintFreeMemInfo(); #ifdef __cplusplus } #endif