diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 547eb29e2e..fe7c360a61 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -48,6 +48,7 @@ - fix(msgbox) add declaration for lv_msgbox_content_class - fix(txt) skip basic arabic vowel characters when processing conjunction - fix(proto) Remove redundant prototype declarations +- fix(refresh) Switch to portable format specifiers - fix(stm32) Mark unused variable in stm32 DMA2D driver ## v8.0.2 (16.07.2021) diff --git a/src/core/lv_refr.c b/src/core/lv_refr.c index 22df048bd0..a44060a5eb 100644 --- a/src/core/lv_refr.c +++ b/src/core/lv_refr.c @@ -307,7 +307,8 @@ void _lv_disp_refr_timer(lv_timer_t * tmr) uint32_t used_size = mon.total_size - mon.free_size;; uint32_t used_kb = used_size / 1024; uint32_t used_kb_tenth = (used_size - (used_kb * 1024)) / 102; - lv_label_set_text_fmt(mem_label, "%d.%d kB used (%d %%)\n%d%% frag.", used_kb, used_kb_tenth, mon.used_pct, + lv_label_set_text_fmt(mem_label, "%" LV_PRIu32 ".%" LV_PRIu32 " kB used (%d %%)\n" \ + "%d%% frag.", used_kb, used_kb_tenth, mon.used_pct, mon.frag_pct); } #endif diff --git a/src/misc/lv_printf.h b/src/misc/lv_printf.h index 43a33bbb56..304c5b9cc6 100644 --- a/src/misc/lv_printf.h +++ b/src/misc/lv_printf.h @@ -39,12 +39,15 @@ # include /* platform-specific printf format for int32_t, usually "d" or "ld" */ # define LV_PRId32 PRId32 +# define LV_PRIu32 PRIu32 # else # define LV_PRId32 "d" +# define LV_PRIu32 "u" # endif #else /* hope this is correct for ports without __has_include or without inttypes.h */ # define LV_PRId32 "d" +# define LV_PRIu32 "u" #endif #ifdef __cplusplus