diff --git a/main/ugv_main.c b/main/ugv_main.c index a602fc4..bf4625f 100644 --- a/main/ugv_main.c +++ b/main/ugv_main.c @@ -160,11 +160,13 @@ void loop(void) { do { u8g2_DrawRFrame(&u8g2, 0, 0, OLED_W, OLED_H, 4); - uint32_t free_heap = xPortGetFreeHeapSize(); + multi_heap_info_t heap_info; + heap_caps_get_info(&heap_info, MALLOC_CAP_DEFAULT); u8g2_SetFont(&u8g2, u8g2_font_4x6_mf); u8g2_DrawStr(&u8g2, 4, 8, "Hello World!"); - char buf[40]; - snprintf(buf, 40, "free heap: %d", free_heap); + char buf[32]; + memset(buf, 0, 32); + snprintf(buf, 32, "heap allc/free %d/%d", heap_info.total_allocated_bytes, heap_info.total_free_bytes); u8g2_DrawStr(&u8g2, 4, 8 + 8, buf); if (packet.buffer_len) {