diff --git a/lv_conf_template.h b/lv_conf_template.h index 88d7aefad..b177367c4 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -217,10 +217,16 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ /*1: Show CPU usage and FPS count in the right bottom corner*/ #define LV_USE_PERF_MONITOR 0 +#if LV_USE_PERF_MONITOR +#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT +#endif /*1: Show the used memory and the memory fragmentation in the left bottom corner * Requires LV_MEM_CUSTOM = 0*/ #define LV_USE_MEM_MONITOR 0 +#if LV_USE_PERF_MONITOR +#define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT +#endif /*1: Draw random colored rectangles over the redrawn areas*/ #define LV_USE_REFR_DEBUG 0 diff --git a/src/core/lv_refr.c b/src/core/lv_refr.c index 0708b7031..e9442d45e 100644 --- a/src/core/lv_refr.c +++ b/src/core/lv_refr.c @@ -253,7 +253,7 @@ void _lv_disp_refr_timer(lv_timer_t * tmr) lv_obj_set_style_pad_right(perf_label, 3, 0); lv_obj_set_style_text_align(perf_label, LV_TEXT_ALIGN_RIGHT, 0); lv_label_set_text(perf_label, "?"); - lv_obj_align(perf_label, LV_ALIGN_BOTTOM_RIGHT, 0, 0); + lv_obj_align(perf_label, LV_USE_PERF_MONITOR_POS, 0, 0); } static uint32_t perf_last_time = 0; @@ -296,7 +296,7 @@ void _lv_disp_refr_timer(lv_timer_t * tmr) lv_obj_set_style_pad_left(mem_label, 3, 0); lv_obj_set_style_pad_right(mem_label, 3, 0); lv_label_set_text(mem_label, "?"); - lv_obj_align(mem_label, LV_ALIGN_BOTTOM_LEFT, 0, 0); + lv_obj_align(mem_label, LV_USE_MEM_MONITOR_POS, 0, 0); } static uint32_t mem_last_time = 0; diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index bcff1e14d..6e9087a61 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -553,6 +553,15 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ # define LV_USE_PERF_MONITOR 0 # endif #endif +#if LV_USE_PERF_MONITOR +#ifndef LV_USE_PERF_MONITOR_POS +# ifdef CONFIG_LV_USE_PERF_MONITOR_POS +# define LV_USE_PERF_MONITOR_POS CONFIG_LV_USE_PERF_MONITOR_POS +# else +# define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT +# endif +#endif +#endif /*1: Show the used memory and the memory fragmentation in the left bottom corner * Requires LV_MEM_CUSTOM = 0*/ @@ -563,6 +572,15 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ # define LV_USE_MEM_MONITOR 0 # endif #endif +#if LV_USE_PERF_MONITOR +#ifndef LV_USE_MEM_MONITOR_POS +# ifdef CONFIG_LV_USE_MEM_MONITOR_POS +# define LV_USE_MEM_MONITOR_POS CONFIG_LV_USE_MEM_MONITOR_POS +# else +# define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT +# endif +#endif +#endif /*1: Draw random colored rectangles over the redrawn areas*/ #ifndef LV_USE_REFR_DEBUG