optimize the lvgl of minimal configuration

This commit is contained in:
Wang_Weigen 2022-06-07 17:00:20 +08:00
parent 4d20855da3
commit 8c23dc14d6
2 changed files with 247 additions and 99 deletions

View File

@ -1,7 +1,13 @@
# Kconfig file for LVGL v8.0 # Kconfig file for LVGL v8.0
menuconfig LIB_LV menuconfig LIB_LV
bool "Enable LittleVGL " bool "Enable LittleVGL "
default n default n
menu "LVGL configuration"
config LV_CONF_MINIMAL
bool "LVGL minimal configuration."
default n
endmenu
if 0 if 0
menu "LVGL configuration" menu "LVGL configuration"

View File

@ -410,48 +410,111 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/
*================*/ *================*/
/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ /*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/
#ifndef LV_CONF_MINIMAL
#define LV_USE_ARC 1 #define LV_USE_ARC 1
# else
#define LV_USE_ANIMIMG 1 #define LV_USE_ARC 0
#define LV_USE_BAR 1
#define LV_USE_BTN 1
#define LV_USE_BTNMATRIX 1
#define LV_USE_CANVAS 1
#define LV_USE_CHECKBOX 1
#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/
#define LV_USE_IMG 1 /*Requires: lv_label*/
#define LV_USE_LABEL 1
#if LV_USE_LABEL
# define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/
# define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/
#endif #endif
#define LV_USE_LINE 1 #ifndef LV_CONF_MINIMAL
#define LV_USE_ANIMIMG 1
#define LV_USE_ROLLER 1 /*Requires: lv_label*/ # else
#if LV_USE_ROLLER #define LV_USE_ANIMIMG 0
# define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/
#endif #endif
#define LV_USE_SLIDER 1 /*Requires: lv_bar*/ #ifndef LV_CONF_MINIMAL
#define LV_USE_BAR 1
#define LV_USE_SWITCH 1 # else
#define LV_USE_BAR 0
#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/
#if LV_USE_TEXTAREA != 0
# define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/
#endif #endif
#define LV_USE_TABLE 1 #ifndef LV_CONF_MINIMAL
#define LV_USE_BTN 1
# else
#define LV_USE_BTN 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_BTNMATRIX 1
# else
#define LV_USE_BTNMATRIX 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_CANVAS 1
# else
#define LV_USE_CANVAS 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_CHECKBOX 1
# else
#define LV_USE_CHECKBOX 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/
# else
#define LV_USE_DROPDOWN 0 /*Requires: lv_label*/
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_IMG 1 /*Requires: lv_label*/
# else
#define LV_USE_IMG 0 /*Requires: lv_label*/
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_LABEL 1
#if LV_USE_LABEL
# define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/
# define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/
#endif
# else
#define LV_USE_LABEL 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_LINE 1
# else
#define LV_USE_LINE 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_ROLLER 1 /*Requires: lv_label*/
#if LV_USE_ROLLER
# define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/
#endif
# else
#define LV_USE_ROLLER 0 /*Requires: lv_label*/
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_SLIDER 1 /*Requires: lv_bar*/
# else
#define LV_USE_SLIDER 0 /*Requires: lv_bar*/
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_SWITCH 1
# else
#define LV_USE_SWITCH 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/
#if LV_USE_TEXTAREA != 0
# define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/
#endif
# else
#define LV_USE_TEXTAREA 0 /*Requires: lv_label*/
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_TABLE 1
# else
#define LV_USE_TABLE 0
#endif
/*================== /*==================
* EXTRA COMPONENTS * EXTRA COMPONENTS
@ -460,72 +523,138 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/
/*----------- /*-----------
* Widgets * Widgets
*----------*/ *----------*/
#define LV_USE_CALENDAR 1 #ifndef LV_CONF_MINIMAL
#if LV_USE_CALENDAR #define LV_USE_CALENDAR 1
# define LV_CALENDAR_WEEK_STARTS_MONDAY 0 #if LV_USE_CALENDAR
# if LV_CALENDAR_WEEK_STARTS_MONDAY # define LV_CALENDAR_WEEK_STARTS_MONDAY 0
# define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} # if LV_CALENDAR_WEEK_STARTS_MONDAY
# else # define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"}
# define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} # else
# endif # define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"}
# endif
# define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} # define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
# define LV_USE_CALENDAR_HEADER_ARROW 1 # define LV_USE_CALENDAR_HEADER_ARROW 1
# define LV_USE_CALENDAR_HEADER_DROPDOWN 1 # define LV_USE_CALENDAR_HEADER_DROPDOWN 1
#endif /*LV_USE_CALENDAR*/ #endif /*LV_USE_CALENDAR*/
# else
#define LV_USE_CHART 1 #define LV_USE_CALENDAR 0
#define LV_USE_COLORWHEEL 1
#define LV_USE_IMGBTN 1
#define LV_USE_KEYBOARD 1
#define LV_USE_LED 1
#define LV_USE_LIST 1
#define LV_USE_METER 1
#define LV_USE_MSGBOX 1
#define LV_USE_SPINBOX 1
#define LV_USE_SPINNER 1
#define LV_USE_TABVIEW 1
#define LV_USE_TILEVIEW 1
#define LV_USE_WIN 1
#define LV_USE_SPAN 1
#if LV_USE_SPAN
/*A line text can contain maximum num of span descriptor */
# define LV_SPAN_SNIPPET_STACK_SIZE 64
#endif #endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_CHART 1
# else
#define LV_USE_CHART 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_COLORWHEEL 1
# else
#define LV_USE_COLORWHEEL 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_IMGBTN 1
# else
#define LV_USE_IMGBTN 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_KEYBOARD 1
# else
#define LV_USE_KEYBOARD 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_LED 1
# else
#define LV_USE_LED 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_LIST 1
# else
#define LV_USE_LIST 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_METER 1
# else
#define LV_USE_METER 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_MSGBOX 1
# else
#define LV_USE_MSGBOX 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_SPINBOX 1
# else
#define LV_USE_SPINBOX 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_SPINNER 1
# else
#define LV_USE_SPINNER 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_TABVIEW 1
# else
#define LV_USE_TABVIEW 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_TILEVIEW 1
# else
#define LV_USE_TILEVIEW 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_WIN 1
# else
#define LV_USE_WIN 0
#endif
#ifndef LV_CONF_MINIMAL
#define LV_USE_SPAN 1
#if LV_USE_SPAN
/*A line text can contain maximum num of span descriptor */
# define LV_SPAN_SNIPPET_STACK_SIZE 64
#endif
# else
#define LV_USE_SPAN 0
#endif
/*----------- /*-----------
* Themes * Themes
*----------*/ *----------*/
#ifndef LV_CONF_MINIMAL
/*A simple, impressive and very complete theme*/
#define LV_USE_THEME_DEFAULT 1
#if LV_USE_THEME_DEFAULT
/*A simple, impressive and very complete theme*/ /*0: Light mode; 1: Dark mode*/
#define LV_USE_THEME_DEFAULT 1 # define LV_THEME_DEFAULT_DARK 0
#if LV_USE_THEME_DEFAULT
/*0: Light mode; 1: Dark mode*/ /*1: Enable grow on press*/
# define LV_THEME_DEFAULT_DARK 0 # define LV_THEME_DEFAULT_GROW 1
/*1: Enable grow on press*/ /*Default transition time in [ms]*/
# define LV_THEME_DEFAULT_GROW 1 # define LV_THEME_DEFAULT_TRANSITION_TIME 80
#endif /*LV_USE_THEME_DEFAULT*/
/*Default transition time in [ms]*/ # else
# define LV_THEME_DEFAULT_TRANSITION_TIME 80 #define LV_USE_THEME_DEFAULT 0
#endif /*LV_USE_THEME_DEFAULT*/ #endif
/*A very simple theme that is a good starting point for a custom theme*/ /*A very simple theme that is a good starting point for a custom theme*/
#define LV_USE_THEME_BASIC 1 #ifndef LV_CONF_MINIMAL
#define LV_USE_THEME_BASIC 1
# else
#define LV_USE_THEME_BASIC 0
#endif
/*A theme designed for monochrome displays*/ /*A theme designed for monochrome displays*/
#define LV_USE_THEME_MONO 1 #define LV_USE_THEME_MONO 1
@ -535,11 +664,18 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/
*----------*/ *----------*/
/*A layout similar to Flexbox in CSS.*/ /*A layout similar to Flexbox in CSS.*/
#define LV_USE_FLEX 1 #ifndef LV_CONF_MINIMAL
#define LV_USE_FLEX 1
# else
#define LV_USE_FLEX 0
#endif
/*A layout similar to Grid in CSS.*/ /*A layout similar to Grid in CSS.*/
#define LV_USE_GRID 1 #ifndef LV_CONF_MINIMAL
#define LV_USE_GRID 1
# else
#define LV_USE_GRID 0
#endif
/*--------------------- /*---------------------
* 3rd party libraries * 3rd party libraries
*--------------------*/ *--------------------*/
@ -588,16 +724,22 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/
*----------*/ *----------*/
/*1: Enable API to take snapshot for object*/ /*1: Enable API to take snapshot for object*/
#define LV_USE_SNAPSHOT 1 #ifndef LV_CONF_MINIMAL
#define LV_USE_SNAPSHOT 1
# else
#define LV_USE_SNAPSHOT 0
#endif
/*================== /*==================
* EXAMPLES * EXAMPLES
*==================*/ *==================*/
/*Enable the examples to be built with the library*/ /*Enable the examples to be built with the library*/
#define LV_BUILD_EXAMPLES 1 #ifndef LV_CONF_MINIMAL
#define LV_BUILD_EXAMPLES 1
# else
#define LV_BUILD_EXAMPLES 0
#endif
/*--END OF LV_CONF_H--*/ /*--END OF LV_CONF_H--*/
#endif /*LV_CONF_H*/ #endif /*LV_CONF_H*/