main: access minimumEverFreeHeap only when needed
This commit is contained in:
parent
7c2ea617f9
commit
310dc029a0
1 changed files with 1 additions and 1 deletions
2
main.cpp
2
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;
|
||||
|
|
Loading…
Reference in a new issue