Skip to content

Commit 30711d7

Browse files
committed
minor update to printing free memory
1 parent 5028cb6 commit 30711d7

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

components/espp

Submodule espp updated 109 files

ecad/Box Electronics v25.xlsx

-628 Bytes
Binary file not shown.

ecad/Box-3 Electronics v5.xlsx

-626 Bytes
Binary file not shown.

main/heap_utils.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66
void print_heap_state() {
77
fmt::print(" Biggest / Free / Total\n"
88
"DRAM : [{:8d} / {:8d} / {:8d}]\n"
9-
"PSRAM : [{:8d} / {:8d} / {:8d}]\n",
9+
"PSRAM : [{:8d} / {:8d} / {:8d}]\n"
10+
"DMA : [{:8d} / {:8d} / {:8d}]\n",
1011
heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL),
1112
heap_caps_get_free_size(MALLOC_CAP_INTERNAL),
1213
heap_caps_get_total_size(MALLOC_CAP_INTERNAL),
1314
heap_caps_get_largest_free_block(MALLOC_CAP_SPIRAM),
1415
heap_caps_get_free_size(MALLOC_CAP_SPIRAM),
15-
heap_caps_get_total_size(MALLOC_CAP_SPIRAM));
16+
heap_caps_get_total_size(MALLOC_CAP_SPIRAM),
17+
heap_caps_get_largest_free_block(MALLOC_CAP_DMA),
18+
heap_caps_get_free_size(MALLOC_CAP_DMA),
19+
heap_caps_get_total_size(MALLOC_CAP_DMA));
1620
}

main/main.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,7 @@ extern "C" void app_main(void) {
145145

146146
// Cart handles platform specific code, state management, etc.
147147
{
148-
fmt::print("Before emulation, minimum free heap: {}\n", heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT));
149-
fmt::print("Before emulation, free (default): {}\n", heap_caps_get_free_size(MALLOC_CAP_DEFAULT));
150-
fmt::print("Before emulation, free (8-bit): {}\n", heap_caps_get_free_size(MALLOC_CAP_8BIT));
151-
fmt::print("Before emulation, free (DMA): {}\n", heap_caps_get_free_size(MALLOC_CAP_DMA));
152-
fmt::print("Before emulation, free (8-bit|DMA): {}\n", heap_caps_get_free_size(MALLOC_CAP_8BIT | MALLOC_CAP_DMA));
148+
print_heap_state();
153149

154150
std::unique_ptr<Cart> cart(make_cart(selected_rom));
155151

0 commit comments

Comments
 (0)