Revert "Fix printf formats"

This reverts commit ca968032a8.
This commit is contained in:
clydebarrow 2024-06-13 20:52:26 +00:00
parent ca968032a8
commit c2be8b0847

View File

@ -15,7 +15,7 @@ size_t lv_millis(void) { return esphome::millis(); }
void *lv_custom_mem_alloc(size_t size) { void *lv_custom_mem_alloc(size_t size) {
auto *ptr = malloc(size); // NOLINT auto *ptr = malloc(size); // NOLINT
if (ptr == nullptr) { 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; return ptr;
} }
@ -32,22 +32,28 @@ void *lv_custom_mem_alloc(size_t size) {
ptr = heap_caps_malloc(size, cap_bits); ptr = heap_caps_malloc(size, cap_bits);
} }
if (ptr == nullptr) { 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; return nullptr;
} }
#ifdef ESPHOME_LOG_HAS_VERBOSE
esphome::esph_log_v(TAG, "allocate %zu - > %p", size, ptr); esphome::esph_log_v(TAG, "allocate %zu - > %p", size, ptr);
#endif
return ptr; return ptr;
} }
void lv_custom_mem_free(void *ptr) { void lv_custom_mem_free(void *ptr) {
#ifdef ESPHOME_LOG_HAS_VERBOSE
esphome::esph_log_v(TAG, "free %p", ptr); esphome::esph_log_v(TAG, "free %p", ptr);
#endif
if (ptr == nullptr) if (ptr == nullptr)
return; return;
heap_caps_free(ptr); heap_caps_free(ptr);
} }
void *lv_custom_mem_realloc(void *ptr, size_t size) { 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); return heap_caps_realloc(ptr, size, cap_bits);
} }
#endif #endif