Skip to content

Commit 0fae077

Browse files
committed
Add reportHeapNow function
1 parent 9b68e43 commit 0fae077

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Firmware/RTK_Surveyor/System.ino

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,15 +576,24 @@ bool createTestFile()
576576
return (false);
577577
}
578578

579+
//If debug option is on, print available heap
580+
void reportHeapNow()
581+
{
582+
if (settings.enableHeapReport == true)
583+
{
584+
lastHeapReport = millis();
585+
Serial.printf("FreeHeap: %d / HeapLowestPoint: %d / LargestBlock: %d\n\r", ESP.getFreeHeap(), xPortGetMinimumEverFreeHeapSize(), heap_caps_get_largest_free_block(MALLOC_CAP_8BIT));
586+
}
587+
}
588+
579589
//If debug option is on, print available heap
580590
void reportHeap()
581591
{
582592
if (settings.enableHeapReport == true)
583593
{
584594
if (millis() - lastHeapReport > 1000)
585595
{
586-
lastHeapReport = millis();
587-
Serial.printf("FreeHeap: %d / HeapLowestPoint: %d / LargestBlock: %d\n\r", ESP.getFreeHeap(), xPortGetMinimumEverFreeHeapSize(), heap_caps_get_largest_free_block(MALLOC_CAP_8BIT));
596+
reportHeapNow();
588597
}
589598
}
590599
}

0 commit comments

Comments
 (0)