From 54778eb3037fc767e56d1eb99f5204b2d5f5455f Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 25 Feb 2019 06:50:20 +0100 Subject: [PATCH] update lv_conf files --- lv_conf_checker.h | 191 +++++++++++++++--------------------------- lv_conf_templ.h | 105 +++++++++++------------ lv_core/lv_disp.h | 40 +++++++++ lv_core/lv_indev.c | 11 +-- lv_hal/lv_hal_disp.h | 8 +- lv_hal/lv_hal_indev.h | 2 +- 6 files changed, 165 insertions(+), 192 deletions(-) diff --git a/lv_conf_checker.h b/lv_conf_checker.h index fa8748d8f886..a04afe74511c 100644 --- a/lv_conf_checker.h +++ b/lv_conf_checker.h @@ -6,6 +6,50 @@ #ifndef LV_CONF_CHECKER_H #define LV_CONF_CHECKER_H + +/*=================== + Graphical settings + *===================*/ + +/* Horizontal and vertical resolution of the library.*/ +#ifndef LV_HOR_RES_MAX +#define LV_HOR_RES_MAX (480) +#endif +#ifndef LV_VER_RES_MAX +#define LV_VER_RES_MAX (320) +#endif + +/*Color settings*/ +#ifndef LV_COLOR_DEPTH +#define LV_COLOR_DEPTH 16 /*Color depth: 1/8/16/32*/ +#endif +#ifndef LV_COLOR_16_SWAP +#define LV_COLOR_16_SWAP 0 /*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/ +#endif +#ifndef LV_COLOR_SCREEN_TRANSP +#define LV_COLOR_SCREEN_TRANSP 0 /*1: Enable screen transparency. Useful for OSD or other overlapping GUIs. Requires ARGB8888 colors*/ +#endif +#ifndef LV_COLOR_TRANSP +#define LV_COLOR_TRANSP LV_COLOR_LIME /*Images pixels with this color will not be drawn (with chroma keying)*/ +#endif + +/* Enable anti-aliasing (lines, and radiuses will be smoothed) */ +#ifndef LV_ANTIALIAS +#define LV_ANTIALIAS 1 /*1: Enable anti-aliasing*/ +#endif + + +/*Screen refresh period in milliseconds. LittlevGL will redraw the screen with this period*/ +#ifndef LV_REFR_PERIOD +#define LV_REFR_PERIOD 30 /*[ms]*/ +#endif + +/* Dot Per Inch: used to initialize default sizes. E.g. a button with width = LV_DPI / 2 -> half inch wide + * (Not so important, you can adjust it to modify default sizes and spaces)*/ +#ifndef LV_DPI +#define LV_DPI 100 /*[px]*/ +#endif + /*=================== Dynamic memory *===================*/ @@ -17,7 +61,7 @@ #endif #if LV_MEM_CUSTOM == 0 #ifndef LV_MEM_SIZE -# define LV_MEM_SIZE (64U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/ +# define LV_MEM_SIZE (16U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/ #endif #ifndef LV_MEM_ATTR # define LV_MEM_ATTR /*Complier prefix for big array declaration*/ @@ -57,96 +101,13 @@ #endif #endif /* LV_ENABLE_GC */ -/*=================== - Graphical settings - *===================*/ - -/* Horizontal and vertical resolution of the library.*/ -#ifndef LV_HOR_RES -//#define LV_HOR_RES (480) -#endif -#ifndef LV_VER_RES -//#define LV_VER_RES (320) -#endif - -/* Dot Per Inch: used to initialize default sizes. E.g. a button with width = LV_DPI / 2 -> half inch wide - * (Not so important, you can adjust it to modify default sizes and spaces)*/ -#ifndef LV_DPI -#define LV_DPI 100 -#endif - -/* Enable anti-aliasing (lines, and radiuses will be smoothed) */ -#ifndef LV_ANTIALIAS -#define LV_ANTIALIAS 1 /*1: Enable anti-aliasing*/ -#endif - -/*Screen refresh period in milliseconds*/ -#ifndef LV_REFR_PERIOD -#define LV_REFR_PERIOD 30 -#endif - -/*----------------- - * VDB settings - *----------------*/ - -/* VDB (Virtual Display Buffer) is an internal graphics buffer. - * The GUI will be drawn into this buffer first and then - * the buffer will be passed to your `disp_drv.disp_flush` function to - * copy it to your frame buffer. - * VDB is required for: buffered drawing, opacity, anti-aliasing and shadows - * Learn more: https://docs.littlevgl.com/#Drawing*/ - -/* Size of the VDB in pixels. Typical size: ~1/10 screen. Must be >= LV_HOR_RES - * Setting it to 0 will disable VDB and `disp_drv.disp_fill` and `disp_drv.disp_map` functions - * will be called to draw to the frame buffer directly*/ -#ifndef LV_VDB_SIZE -//#define LV_VDB_SIZE ((LV_VER_RES * LV_HOR_RES) / 10) -#endif - - /* Bit-per-pixel of VDB. Useful for monochrome or non-standard color format displays. - * Special formats are handled with `disp_drv.vdb_wr`)*/ -#ifndef LV_VDB_PX_BPP -#define LV_VDB_PX_BPP LV_COLOR_SIZE /*LV_COLOR_SIZE comes from LV_COLOR_DEPTH below to set 8, 16 or 32 bit pixel size automatically */ -#endif - - /* Place VDB to a specific address (e.g. in external RAM) - * 0: allocate automatically into RAM - * LV_VDB_ADR_INV: to replace it later with `lv_vdb_set_adr()`*/ -#ifndef LV_VDB_ADR -//#define LV_VDB_ADR 0 -#endif - -/* Use two Virtual Display buffers (VDB) to parallelize rendering and flushing - * The flushing should use DMA to write the frame buffer in the background */ -#ifndef LV_VDB_DOUBLE -#define LV_VDB_DOUBLE 0 -#endif - -/* Place VDB2 to a specific address (e.g. in external RAM) - * 0: allocate automatically into RAM - * LV_VDB_ADR_INV: to replace it later with `lv_vdb_set_adr()`*/ -#ifndef LV_VDB2_ADR -#define LV_VDB2_ADR 0 -#endif - -/* Using true double buffering in `disp_drv.disp_flush` you will always get the image of the whole screen. - * Your only task is to set the rendered image (`color_p` parameter) as frame buffer address or send it to your display. - * The best if you do in the blank period of you display to avoid tearing effect. - * Requires: - * - LV_VDB_SIZE = LV_HOR_RES * LV_VER_RES - * - LV_VDB_DOUBLE = 1 - */ -#ifndef LV_VDB_TRUE_DOUBLE_BUFFERED -#define LV_VDB_TRUE_DOUBLE_BUFFERED 0 -#endif - /*================= Misc. setting *=================*/ /*Input device settings*/ #ifndef LV_INDEV_READ_PERIOD -#define LV_INDEV_READ_PERIOD 50 /*Input device read period in milliseconds*/ +#define LV_INDEV_READ_PERIOD 30 /*Input device read period in milliseconds*/ #endif #ifndef LV_INDEV_POINT_MARKER #define LV_INDEV_POINT_MARKER 0 /*Mark the pressed points (required: USE_LV_REAL_DRAW = 1)*/ @@ -164,20 +125,6 @@ #define LV_INDEV_LONG_PRESS_REP_TIME 100 /*Repeated trigger period in long press [ms] */ #endif -/*Color settings*/ -#ifndef LV_COLOR_DEPTH -#define LV_COLOR_DEPTH 16 /*Color depth: 1/8/16/32*/ -#endif -#ifndef LV_COLOR_16_SWAP -#define LV_COLOR_16_SWAP 0 /*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/ -#endif -#ifndef LV_COLOR_SCREEN_TRANSP -#define LV_COLOR_SCREEN_TRANSP 0 /*1: Enable screen transparency. Useful for OSD or other overlapping GUIs. Requires ARGB8888 colors*/ -#endif -#ifndef LV_COLOR_TRANSP -#define LV_COLOR_TRANSP LV_COLOR_LIME /*Images pixels with this color will not be drawn (with chroma keying)*/ -#endif - /*Text settings*/ #ifndef LV_TXT_UTF8 #define LV_TXT_UTF8 1 /*Enable UTF-8 coded Unicode character usage */ @@ -208,14 +155,11 @@ #ifndef USE_LV_GPU #define USE_LV_GPU 1 /*1: Enable GPU interface*/ #endif -#ifndef USE_LV_REAL_DRAW -#define USE_LV_REAL_DRAW 1 /*1: Enable function which draw directly to the frame buffer instead of VDB (required if LV_VDB_SIZE = 0)*/ -#endif #ifndef USE_LV_FILESYSTEM #define USE_LV_FILESYSTEM 1 /*1: Enable file system (might be required for images*/ #endif -#ifndef USE_LV_MULTI_LANG -#define USE_LV_MULTI_LANG 0 /* Number of languages for labels to store (0: to disable this feature)*/ +#ifndef USE_LV_I18N +#define USE_LV_I18N 1 /*1: Enable InternationalizatioN (multi-language) support*/ #endif /*Compiler settings*/ @@ -225,9 +169,6 @@ #ifndef LV_ATTRIBUTE_TASK_HANDLER #define LV_ATTRIBUTE_TASK_HANDLER /* Define a custom attribute to `lv_task_handler` function */ #endif -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN /* With size optimization (-Os) the compiler might not align data to 4 or 8 byte boundary. This alignment will be explicitly applied where needed.*/ -#endif #ifndef LV_COMPILER_VLA_SUPPORTED #define LV_COMPILER_VLA_SUPPORTED 1 /* 1: Variable length array is supported*/ #endif @@ -241,13 +182,15 @@ #endif #if LV_TICK_CUSTOM == 1 #ifndef LV_TICK_CUSTOM_INCLUDE -#define LV_TICK_CUSTOM_INCLUDE "sonething.h" /*Header for the sys time function*/ +#define LV_TICK_CUSTOM_INCLUDE "something.h" /*Header for the sys time function*/ #endif #ifndef LV_TICK_CUSTOM_SYS_TIME_EXPR #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current systime in ms*/ #endif -#endif /*LV_TICK_CUSTOM*/ +#endif /*LV_TICK_CUSTOM*/ +typedef void * lv_disp_drv_user_data_t; /*Type of user data in the display driver*/ +typedef void * lv_indev_drv_user_data_t; /*Type of user data in the display driver*/ /*Log settings*/ #ifndef USE_LV_LOG @@ -257,14 +200,14 @@ /* How important log should be added: * LV_LOG_LEVEL_TRACE A lot of logs to give detailed information * LV_LOG_LEVEL_INFO Log important events - * LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't caused problem + * LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem * LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail */ #ifndef LV_LOG_LEVEL # define LV_LOG_LEVEL LV_LOG_LEVEL_WARN #endif -/* 1: Print the log with 'printf'; 0: user need to register a callback*/ +/* 1: Print the log with 'printf'; 0: user need to register a callback*/ #ifndef LV_LOG_PRINTF # define LV_LOG_PRINTF 0 #endif @@ -274,7 +217,7 @@ * THEME USAGE *================*/ #ifndef LV_THEME_LIVE_UPDATE -#define LV_THEME_LIVE_UPDATE 1 /*1: Allow theme switching at run time. Uses 8..10 kB of RAM*/ +#define LV_THEME_LIVE_UPDATE 0 /*1: Allow theme switching at run time. Uses 8..10 kB of RAM*/ #endif #ifndef USE_LV_THEME_TEMPL @@ -310,16 +253,16 @@ * To enable a built-in font use 1,2,4 or 8 values * which will determine the bit-per-pixel. Higher value means smoother fonts */ #ifndef USE_LV_FONT_DEJAVU_10 -#define USE_LV_FONT_DEJAVU_10 4 +#define USE_LV_FONT_DEJAVU_10 0 #endif #ifndef USE_LV_FONT_DEJAVU_10_LATIN_SUP -#define USE_LV_FONT_DEJAVU_10_LATIN_SUP 4 +#define USE_LV_FONT_DEJAVU_10_LATIN_SUP 0 #endif #ifndef USE_LV_FONT_DEJAVU_10_CYRILLIC -#define USE_LV_FONT_DEJAVU_10_CYRILLIC 4 +#define USE_LV_FONT_DEJAVU_10_CYRILLIC 0 #endif #ifndef USE_LV_FONT_SYMBOL_10 -#define USE_LV_FONT_SYMBOL_10 4 +#define USE_LV_FONT_SYMBOL_10 0 #endif #ifndef USE_LV_FONT_DEJAVU_20 @@ -336,29 +279,29 @@ #endif #ifndef USE_LV_FONT_DEJAVU_30 -#define USE_LV_FONT_DEJAVU_30 4 +#define USE_LV_FONT_DEJAVU_30 0 #endif #ifndef USE_LV_FONT_DEJAVU_30_LATIN_SUP -#define USE_LV_FONT_DEJAVU_30_LATIN_SUP 4 +#define USE_LV_FONT_DEJAVU_30_LATIN_SUP 0 #endif #ifndef USE_LV_FONT_DEJAVU_30_CYRILLIC -#define USE_LV_FONT_DEJAVU_30_CYRILLIC 4 +#define USE_LV_FONT_DEJAVU_30_CYRILLIC 0 #endif #ifndef USE_LV_FONT_SYMBOL_30 -#define USE_LV_FONT_SYMBOL_30 4 +#define USE_LV_FONT_SYMBOL_30 0 #endif #ifndef USE_LV_FONT_DEJAVU_40 -#define USE_LV_FONT_DEJAVU_40 4 +#define USE_LV_FONT_DEJAVU_40 0 #endif #ifndef USE_LV_FONT_DEJAVU_40_LATIN_SUP -#define USE_LV_FONT_DEJAVU_40_LATIN_SUP 4 +#define USE_LV_FONT_DEJAVU_40_LATIN_SUP 0 #endif #ifndef USE_LV_FONT_DEJAVU_40_CYRILLIC -#define USE_LV_FONT_DEJAVU_40_CYRILLIC 4 +#define USE_LV_FONT_DEJAVU_40_CYRILLIC 0 #endif #ifndef USE_LV_FONT_SYMBOL_40 -#define USE_LV_FONT_SYMBOL_40 4 +#define USE_LV_FONT_SYMBOL_40 0 #endif #ifndef USE_LV_FONT_MONOSPACE_8 diff --git a/lv_conf_templ.h b/lv_conf_templ.h index 79064806724b..80c7bc397137 100644 --- a/lv_conf_templ.h +++ b/lv_conf_templ.h @@ -9,8 +9,35 @@ #if 0 /*Set it to "1" to enable content*/ + #ifndef LV_CONF_H #define LV_CONF_H + +/*=================== + Graphical settings + *===================*/ + +/* Horizontal and vertical resolution of the library.*/ +#define LV_HOR_RES_MAX (480) +#define LV_VER_RES_MAX (320) + +/*Color settings*/ +#define LV_COLOR_DEPTH 16 /*Color depth: 1/8/16/32*/ +#define LV_COLOR_16_SWAP 0 /*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/ +#define LV_COLOR_SCREEN_TRANSP 0 /*1: Enable screen transparency. Useful for OSD or other overlapping GUIs. Requires ARGB8888 colors*/ +#define LV_COLOR_TRANSP LV_COLOR_LIME /*Images pixels with this color will not be drawn (with chroma keying)*/ + +/* Enable anti-aliasing (lines, and radiuses will be smoothed) */ +#define LV_ANTIALIAS 1 /*1: Enable anti-aliasing*/ + + +/*Screen refresh period in milliseconds. LittlevGL will redraw the screen with this period*/ +#define LV_REFR_PERIOD 30 /*[ms]*/ + +/* Dot Per Inch: used to initialize default sizes. E.g. a button with width = LV_DPI / 2 -> half inch wide + * (Not so important, you can adjust it to modify default sizes and spaces)*/ +#define LV_DPI 100 /*[px]*/ + /*=================== Dynamic memory *===================*/ @@ -19,7 +46,7 @@ * to store the graphical objects and other data */ #define LV_MEM_CUSTOM 0 /*1: use custom malloc/free, 0: use the built-in lv_mem_alloc/lv_mem_free*/ #if LV_MEM_CUSTOM == 0 -# define LV_MEM_SIZE (64U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/ +# define LV_MEM_SIZE (16U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/ # define LV_MEM_ATTR /*Complier prefix for big array declaration*/ # define LV_MEM_ADR 0 /*Set an address for memory pool instead of allocation it as an array. Can be in external SRAM too.*/ # define LV_MEM_AUTO_DEFRAG 1 /*Automatically defrag on free*/ @@ -38,42 +65,18 @@ # define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ #endif /* LV_ENABLE_GC */ -/*=================== - Graphical settings - *===================*/ - -/* Horizontal and vertical resolution of the library.*/ -#define LV_HOR_RES_MAX (480) -#define LV_VER_RES_MAX (320) - -/* Dot Per Inch: used to initialize default sizes. E.g. a button with width = LV_DPI / 2 -> half inch wide - * (Not so important, you can adjust it to modify default sizes and spaces)*/ -#define LV_DPI 100 - -/* Enable anti-aliasing (lines, and radiuses will be smoothed) */ -#define LV_ANTIALIAS 1 /*1: Enable anti-aliasing*/ - -/*Screen refresh period in milliseconds*/ -#define LV_REFR_PERIOD 30 - /*================= Misc. setting *=================*/ /*Input device settings*/ -#define LV_INDEV_READ_PERIOD 50 /*Input device read period in milliseconds*/ +#define LV_INDEV_READ_PERIOD 30 /*Input device read period in milliseconds*/ #define LV_INDEV_POINT_MARKER 0 /*Mark the pressed points (required: USE_LV_REAL_DRAW = 1)*/ #define LV_INDEV_DRAG_LIMIT 10 /*Drag threshold in pixels */ -#define LV_INDEV_DRAG_THROW 20 /*Drag throw slow-down in [%] (must be > 0). Greater value means faster slow-down */ +#define LV_INDEV_DRAG_THROW 20 /*Drag throw slow-down in [%]. Greater value means faster slow-down */ #define LV_INDEV_LONG_PRESS_TIME 400 /*Long press time in milliseconds*/ #define LV_INDEV_LONG_PRESS_REP_TIME 100 /*Repeated trigger period in long press [ms] */ -/*Color settings*/ -#define LV_COLOR_DEPTH 16 /*Color depth: 1/8/16/32*/ -#define LV_COLOR_16_SWAP 0 /*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/ -#define LV_COLOR_SCREEN_TRANSP 0 /*1: Enable screen transparency. Useful for OSD or other overlapping GUIs. Requires ARGB8888 colors*/ -#define LV_COLOR_TRANSP LV_COLOR_LIME /*Images pixels with this color will not be drawn (with chroma keying)*/ - /*Text settings*/ #define LV_TXT_UTF8 1 /*Enable UTF-8 coded Unicode character usage */ #define LV_TXT_BREAK_CHARS " ,.;:-_" /*Can break texts on these chars*/ @@ -86,24 +89,24 @@ #define USE_LV_SHADOW 1 /*1: Enable shadows*/ #define USE_LV_GROUP 1 /*1: Enable object groups (for keyboards)*/ #define USE_LV_GPU 1 /*1: Enable GPU interface*/ -#define USE_LV_REAL_DRAW 1 /*1: Enable function which draw directly to the frame buffer instead of VDB (required if LV_VDB_SIZE = 0)*/ #define USE_LV_FILESYSTEM 1 /*1: Enable file system (might be required for images*/ -#define USE_LV_MULTI_LANG 0 /* Number of languages for labels to store (0: to disable this feature)*/ +#define USE_LV_I18N 1 /*1: Enable InternationalizatioN (multi-language) support*/ /*Compiler settings*/ #define LV_ATTRIBUTE_TICK_INC /* Define a custom attribute to `lv_tick_inc` function */ #define LV_ATTRIBUTE_TASK_HANDLER /* Define a custom attribute to `lv_task_handler` function */ -#define LV_ATTRIBUTE_MEM_ALIGN /* With size optimization (-Os) the compiler might not align data to 4 or 8 byte boundary. This alignment will be explicitly applied where needed.*/ #define LV_COMPILER_VLA_SUPPORTED 1 /* 1: Variable length array is supported*/ #define LV_COMPILER_NON_CONST_INIT_SUPPORTED 1 /* 1: Initialization with non constant values are supported */ /*HAL settings*/ #define LV_TICK_CUSTOM 0 /*1: use a custom tick source (removing the need to manually update the tick with `lv_tick_inc`) */ #if LV_TICK_CUSTOM == 1 -#define LV_TICK_CUSTOM_INCLUDE "something.h" /*Header for the sys time function*/ +#define LV_TICK_CUSTOM_INCLUDE "something.h" /*Header for the sys time function*/ #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current systime in ms*/ -#endif /*LV_TICK_CUSTOM*/ +#endif /*LV_TICK_CUSTOM*/ +typedef void * lv_disp_drv_user_data_t; /*Type of user data in the display driver*/ +typedef void * lv_indev_drv_user_data_t; /*Type of user data in the display driver*/ /*Log settings*/ #define USE_LV_LOG 1 /*Enable/disable the log module*/ @@ -111,19 +114,19 @@ /* How important log should be added: * LV_LOG_LEVEL_TRACE A lot of logs to give detailed information * LV_LOG_LEVEL_INFO Log important events - * LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't caused problem + * LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem * LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail */ # define LV_LOG_LEVEL LV_LOG_LEVEL_WARN -/* 1: Print the log with 'printf'; 0: user need to register a callback*/ +/* 1: Print the log with 'printf'; 0: user need to register a callback*/ # define LV_LOG_PRINTF 0 #endif /*USE_LV_LOG*/ /*================ * THEME USAGE *================*/ -#define LV_THEME_LIVE_UPDATE 1 /*1: Allow theme switching at run time. Uses 8..10 kB of RAM*/ +#define LV_THEME_LIVE_UPDATE 0 /*1: Allow theme switching at run time. Uses 8..10 kB of RAM*/ #define USE_LV_THEME_TEMPL 0 /*Just for test*/ #define USE_LV_THEME_DEFAULT 1 /*Built mainly from the built-in styles. Consumes very few RAM*/ @@ -141,25 +144,25 @@ /* More info about fonts: https://docs.littlevgl.com/#Fonts * To enable a built-in font use 1,2,4 or 8 values * which will determine the bit-per-pixel. Higher value means smoother fonts */ -#define USE_LV_FONT_DEJAVU_10 4 -#define USE_LV_FONT_DEJAVU_10_LATIN_SUP 4 -#define USE_LV_FONT_DEJAVU_10_CYRILLIC 4 -#define USE_LV_FONT_SYMBOL_10 4 +#define USE_LV_FONT_DEJAVU_10 0 +#define USE_LV_FONT_DEJAVU_10_LATIN_SUP 0 +#define USE_LV_FONT_DEJAVU_10_CYRILLIC 0 +#define USE_LV_FONT_SYMBOL_10 0 #define USE_LV_FONT_DEJAVU_20 4 #define USE_LV_FONT_DEJAVU_20_LATIN_SUP 4 #define USE_LV_FONT_DEJAVU_20_CYRILLIC 4 #define USE_LV_FONT_SYMBOL_20 4 -#define USE_LV_FONT_DEJAVU_30 4 -#define USE_LV_FONT_DEJAVU_30_LATIN_SUP 4 -#define USE_LV_FONT_DEJAVU_30_CYRILLIC 4 -#define USE_LV_FONT_SYMBOL_30 4 +#define USE_LV_FONT_DEJAVU_30 0 +#define USE_LV_FONT_DEJAVU_30_LATIN_SUP 0 +#define USE_LV_FONT_DEJAVU_30_CYRILLIC 0 +#define USE_LV_FONT_SYMBOL_30 0 -#define USE_LV_FONT_DEJAVU_40 4 -#define USE_LV_FONT_DEJAVU_40_LATIN_SUP 4 -#define USE_LV_FONT_DEJAVU_40_CYRILLIC 4 -#define USE_LV_FONT_SYMBOL_40 4 +#define USE_LV_FONT_DEJAVU_40 0 +#define USE_LV_FONT_DEJAVU_40_LATIN_SUP 0 +#define USE_LV_FONT_DEJAVU_40_CYRILLIC 0 +#define USE_LV_FONT_SYMBOL_40 0 #define USE_LV_FONT_MONOSPACE_8 1 @@ -339,13 +342,6 @@ /************************* * Non-user section *************************/ - -#if LV_INDEV_DRAG_THROW <= 0 -#warning "LV_INDEV_DRAG_THROW must be greater than 0" -#undef LV_INDEV_DRAG_THROW -#define LV_INDEV_DRAG_THROW 1 -#endif - #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/ # define _CRT_SECURE_NO_WARNINGS #endif @@ -357,4 +353,5 @@ #endif /*LV_CONF_H*/ + #endif /*End of "Content enable"*/ diff --git a/lv_core/lv_disp.h b/lv_core/lv_disp.h index def7bceed30c..e304fc43e2b0 100644 --- a/lv_core/lv_disp.h +++ b/lv_core/lv_disp.h @@ -62,10 +62,50 @@ lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp); */ void lv_disp_assign_screen(lv_disp_t * disp, lv_obj_t * scr); +/*------------------------------------------------ + * To improve backward compatibility + * Recommended only if you have one display + *------------------------------------------------*/ + +/** + * Get the active screen of the default display + * @return pointer to the active screen + */ +static inline lv_obj_t * lv_scr_act(void) +{ + return lv_disp_get_scr_act(lv_disp_get_default()); + +} + +/** + * Get the top layer of the default display + * @return pointer to the top layer + */ +static inline lv_obj_t * lv_top_layer(void) +{ + return lv_disp_get_layer_top(lv_disp_get_default()); +} + +/** + * Get the active screen of the deafult display + * @return pointer to the sys layer + */ +static inline lv_obj_t * lv_sys_layer(void) +{ + return lv_disp_get_layer_sys(lv_disp_get_default()); +} + /********************** * MACROS **********************/ +/*------------------------------------------------ + * To improve backward compatibility + * Recommended only if you have one display + *------------------------------------------------*/ + +#define LV_HOR_RES (lv_disp_get_hor_res(lv_disp_get_default());) +#define LV_VER_RES (lv_disp_get_ver_res(lv_disp_get_default());) #ifdef __cplusplus } /* extern "C" */ diff --git a/lv_core/lv_indev.c b/lv_core/lv_indev.c index 989277c64549..15ddf39ad676 100644 --- a/lv_core/lv_indev.c +++ b/lv_core/lv_indev.c @@ -550,15 +550,8 @@ static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data) /*Still the same point is pressed*/ if(i->proc.last_point.x == i->proc.act_point.x && i->proc.last_point.y == i->proc.act_point.y && - data->state == LV_INDEV_STATE_PR) { -#if LV_INDEV_POINT_MARKER != 0 - lv_area_t area; - area.x1 = i->proc.act_point.x - (LV_INDEV_POINT_MARKER >> 1); - area.y1 = i->proc.act_point.y - (LV_INDEV_POINT_MARKER >> 1); - area.x2 = i->proc.act_point.x + ((LV_INDEV_POINT_MARKER >> 1) | 0x1); - area.y2 = i->proc.act_point.y + ((LV_INDEV_POINT_MARKER >> 1) | 0x1); - lv_rfill(&area, NULL, LV_COLOR_MAKE(0xFF, 0, 0), LV_OPA_COVER); -#endif + data->state == LV_INDEV_STATE_PR) + { indev_proc_press(&i->proc); } else { /*If a new point comes always make a release*/ diff --git a/lv_hal/lv_hal_disp.h b/lv_hal/lv_hal_disp.h index 0fed2c4549a0..4b820e49c45a 100644 --- a/lv_hal/lv_hal_disp.h +++ b/lv_hal/lv_hal_disp.h @@ -69,22 +69,22 @@ typedef struct _disp_drv_t { /* MANDATORY: Write the internal buffer (VDB) to the display. 'lv_flush_ready()' has to be called when finished */ void (*flush_cb)(struct _disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p); - lv_disp_user_data_t flush_user_data; + lv_disp_drv_user_data_t flush_user_data; /* OPTIONAL: Extend the invalidated areas to match with the display drivers requirements * E.g. round `y` to, 8, 16 ..) on a monochrome display*/ void (*rounder_cb)(struct _disp_drv_t * disp_drv, lv_area_t * area); - lv_disp_user_data_t rounder_user_data; + lv_disp_drv_user_data_t rounder_user_data; /* OPTIONAL: Set a pixel in a buffer according to the special requirements of the display * Can be used for color format not supported in LittelvGL. E.g. 2 bit -> 4 gray scales * Note: Much slower then drawing with supported color formats. */ void (*set_px_cb)(struct _disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, lv_color_t color, lv_opa_t opa); - lv_disp_user_data_t set_px_user_data; + lv_disp_drv_user_data_t set_px_user_data; /* OPTIONAL: Called after every refresh cycle to tell the rendering and flushing time + the number of flushed pixels */ void (*monitor_cb)(struct _disp_drv_t * disp_drv, uint32_t time, uint32_t px); - lv_disp_user_data_t monitor_user_data; + lv_disp_drv_user_data_t monitor_user_data; #if USE_LV_GPU /*OPTIONAL: Blend two memories using opacity (GPU only)*/ diff --git a/lv_hal/lv_hal_indev.h b/lv_hal/lv_hal_indev.h index ed488ba96dd5..7fb63870614e 100644 --- a/lv_hal/lv_hal_indev.h +++ b/lv_hal/lv_hal_indev.h @@ -72,7 +72,7 @@ typedef struct { typedef struct _lv_indev_drv_t { lv_hal_indev_type_t type; /*Input device type*/ bool (*read_cb)(struct _lv_indev_drv_t * indev_drv, lv_indev_data_t *data); /*Function pointer to read_cb data. Return 'true' if there is still data to be read_cb (buffered)*/ - lv_indev_user_data_t read_user_data; /*Pointer to user defined data, passed in 'lv_indev_data_t' on read*/ + lv_indev_drv_user_data_t read_user_data; /*Pointer to user defined data, passed in 'lv_indev_data_t' on read*/ struct _disp_t * disp; /*Pointer to the assigned display*/ } lv_indev_drv_t;