From 8341a2115ea6dbaa8c3b9a23e941fe7b85ef746c Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Mon, 2 Nov 2020 12:25:30 +0100 Subject: [PATCH] stack memory debug information improved --- src/cyclic.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/cyclic.cpp b/src/cyclic.cpp index c57a0863..55cb4497 100644 --- a/src/cyclic.cpp +++ b/src/cyclic.cpp @@ -33,7 +33,10 @@ void doHousekeeping() { } } - // task storage debugging // + // heap and task storage debugging + ESP_LOGD(TAG, "Heap: Free:%d, Min:%d, Size:%d, Alloc:%d, StackHWM:%d", + ESP.getFreeHeap(), ESP.getMinFreeHeap(), ESP.getHeapSize(), + ESP.getMaxAllocHeap(), uxTaskGetStackHighWaterMark(NULL)); ESP_LOGD(TAG, "IRQhandler %d bytes left | Taskstate = %d", uxTaskGetStackHighWaterMark(irqHandlerTask), eTaskGetState(irqHandlerTask)); @@ -130,15 +133,7 @@ void doHousekeeping() { } // doHousekeeping() -// uptime counter 64bit to prevent millis() rollover after 49 days -uint64_t uptime() { - static uint32_t low32, high32; - uint32_t new_low32 = millis(); - if (new_low32 < low32) - high32++; - low32 = new_low32; - return (uint64_t)high32 << 32 | low32; -} +uint64_t uptime() { return _millis(); } uint32_t getFreeRAM() { #ifndef BOARD_HAS_PSRAM