From 310dc029a0bb2d54b0594fb35afff857221e0a59 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Wed, 3 May 2023 20:40:41 +0200 Subject: [PATCH] main: access minimumEverFreeHeap only when needed --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 72ca845..6fdd6c8 100644 --- a/main.cpp +++ b/main.cpp @@ -882,8 +882,8 @@ public: if (print_memory_usage) { auto currentFreeHeap = xPortGetFreeHeapSize(); - auto minimumEverFreeHeap = xPortGetMinimumEverFreeHeapSize(); if (currentFreeHeap != lastFreeHeapSize) { + auto minimumEverFreeHeap = xPortGetMinimumEverFreeHeapSize(); // 14KiB is the LVGL memory size used in InfiniTime constexpr uint32_t pinetime_heap_memory = configTOTAL_HEAP_SIZE; uint32_t mem_used = pinetime_heap_memory - currentFreeHeap;