From c2be8b0847aa90a0502fdda3bb81690b26dcf193 Mon Sep 17 00:00:00 2001 From: clydebarrow <366188+clydebarrow@users.noreply.github.com> Date: Thu, 13 Jun 2024 20:52:26 +0000 Subject: [PATCH] Revert "Fix printf formats" This reverts commit ca968032a8309c3aee57334e755a97bbe3ff54c6. --- esphome/components/lvgl/lvgl_esphome.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/esphome/components/lvgl/lvgl_esphome.cpp b/esphome/components/lvgl/lvgl_esphome.cpp index 4bdd62542f..20093d94cd 100644 --- a/esphome/components/lvgl/lvgl_esphome.cpp +++ b/esphome/components/lvgl/lvgl_esphome.cpp @@ -15,7 +15,7 @@ size_t lv_millis(void) { return esphome::millis(); } void *lv_custom_mem_alloc(size_t size) { auto *ptr = malloc(size); // NOLINT if (ptr == nullptr) { - esphome::esph_log_e(TAG, "Failed to allocate %zu bytes", size); + esphome::esph_log_e(TAG, "Failed to allocate %u bytes", size); } return ptr; } @@ -32,22 +32,28 @@ void *lv_custom_mem_alloc(size_t size) { ptr = heap_caps_malloc(size, cap_bits); } if (ptr == nullptr) { - esphome::esph_log_e(TAG, "Failed to allocate %zu bytes", size); + esphome::esph_log_e(TAG, "Failed to allocate %u bytes", size); return nullptr; } +#ifdef ESPHOME_LOG_HAS_VERBOSE esphome::esph_log_v(TAG, "allocate %zu - > %p", size, ptr); +#endif return ptr; } void lv_custom_mem_free(void *ptr) { +#ifdef ESPHOME_LOG_HAS_VERBOSE esphome::esph_log_v(TAG, "free %p", ptr); +#endif if (ptr == nullptr) return; heap_caps_free(ptr); } void *lv_custom_mem_realloc(void *ptr, size_t size) { - esphome::esph_log_v(TAG, "realloc %p: %zu", ptr, size); +#ifdef ESPHOME_LOG_HAS_VERBOSE + esphome::esph_log_v(TAG, "realloc %p: %u", ptr, size); +#endif return heap_caps_realloc(ptr, size, cap_bits); } #endif