From 9233918b930d2485fb7dbe3fceaa89d8f159365e Mon Sep 17 00:00:00 2001 From: _VIFEXTech <1290176185@qq.com> Date: Fri, 26 Nov 2021 19:20:43 +0800 Subject: [PATCH] feat(Kconfig): add monitor position configuration (#2834) * fix(Kconfig) remove duplicate LV_BUILD_EXAMPLES configuration * feat(Kconfig) add monitor position configuration Co-authored-by: pengyiqiang --- Kconfig | 54 +++++++++++++++++++++++++++++++++++++++++-- src/lv_conf_kconfig.h | 44 +++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 2 deletions(-) diff --git a/Kconfig b/Kconfig index 559dac0f6..717280583 100644 --- a/Kconfig +++ b/Kconfig @@ -321,12 +321,62 @@ menu "LVGL configuration" menu "Others" config LV_USE_PERF_MONITOR - bool "Show CPU usage and FPS count in the right bottom corner." + bool "Show CPU usage and FPS count." + + choice + prompt "Performance monitor position." + depends on LV_USE_PERF_MONITOR + default LV_PERF_MONITOR_ALIGN_BOTTOM_RIGHT + + config LV_PERF_MONITOR_ALIGN_TOP_LEFT + bool "Top left" + config LV_PERF_MONITOR_ALIGN_TOP_MID + bool "Top middle" + config LV_PERF_MONITOR_ALIGN_TOP_RIGHT + bool "Top right" + config LV_PERF_MONITOR_ALIGN_BOTTOM_LEFT + bool "Bottom left" + config LV_PERF_MONITOR_ALIGN_BOTTOM_MID + bool "Bottom middle" + config LV_PERF_MONITOR_ALIGN_BOTTOM_RIGHT + bool "Bottom right" + config LV_PERF_MONITOR_ALIGN_LEFT_MID + bool "Left middle" + config LV_PERF_MONITOR_ALIGN_RIGHT_MID + bool "Right middle" + config LV_PERF_MONITOR_ALIGN_BOTTOM_CENTER + bool "Center" + endchoice config LV_USE_MEM_MONITOR - bool "Show the used memory and the memory fragmentation in the left bottom corner." + bool "Show the used memory and the memory fragmentation." depends on !LV_MEM_CUSTOM + choice + prompt "Memory monitor position." + depends on LV_USE_MEM_MONITOR + default LV_MEM_MONITOR_ALIGN_BOTTOM_LEFT + + config LV_MEM_MONITOR_ALIGN_TOP_LEFT + bool "Top left" + config LV_MEM_MONITOR_ALIGN_TOP_MID + bool "Top middle" + config LV_MEM_MONITOR_ALIGN_TOP_RIGHT + bool "Top right" + config LV_MEM_MONITOR_ALIGN_BOTTOM_LEFT + bool "Bottom left" + config LV_MEM_MONITOR_ALIGN_BOTTOM_MID + bool "Bottom middle" + config LV_MEM_MONITOR_ALIGN_BOTTOM_RIGHT + bool "Bottom right" + config LV_MEM_MONITOR_ALIGN_LEFT_MID + bool "Left middle" + config LV_MEM_MONITOR_ALIGN_RIGHT_MID + bool "Right middle" + config LV_MEM_MONITOR_ALIGN_BOTTOM_CENTER + bool "Center" + endchoice + config LV_USE_REFR_DEBUG bool "Draw random colored rectangles over the redrawn areas." diff --git a/src/lv_conf_kconfig.h b/src/lv_conf_kconfig.h index d12803875..7424789eb 100644 --- a/src/lv_conf_kconfig.h +++ b/src/lv_conf_kconfig.h @@ -131,6 +131,50 @@ extern "C" { # define CONFIG_LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO #endif +/*------------------ + * MONITOR POSITION + *-----------------*/ + +#ifdef CONFIG_LV_PERF_MONITOR_ALIGN_TOP_LEFT +# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_LEFT +#elif defined(CONFIG_LV_USE_PERF_MONITOR_ALIGN_TOP_MID) +# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_MID +#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_TOP_RIGHT) +# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_RIGHT +#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_BOTTOM_LEFT) +# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_LEFT +#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_BOTTOM_MID) +# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_MID +#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_BOTTOM_RIGHT) +# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT +#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_LEFT_MID) +# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_LEFT_MID +#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_RIGHT_MID) +# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_RIGHT_MID +#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_CENTER) +# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_CENTER +#endif + +#ifdef CONFIG_LV_MEM_MONITOR_ALIGN_TOP_LEFT +# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_LEFT +#elif defined(CONFIG_LV_USE_MEM_MONITOR_ALIGN_TOP_MID) +# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_MID +#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_TOP_RIGHT) +# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_RIGHT +#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_BOTTOM_LEFT) +# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT +#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_BOTTOM_MID) +# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_MID +#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_BOTTOM_RIGHT) +# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT +#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_LEFT_MID) +# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_LEFT_MID +#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_RIGHT_MID) +# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_RIGHT_MID +#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_CENTER) +# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_CENTER +#endif + #ifdef __cplusplus } /*extern "C"*/ #endif