From 67369eed223cdf697bae80e1f3b74bbe632f6daf Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 15 Dec 2020 20:13:53 +0100 Subject: [PATCH 01/62] Update dev version --- library.json | 2 +- library.properties | 2 +- lv_conf_template.h | 2 +- lvgl.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library.json b/library.json index d962711d9..ff0c61aac 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "lvgl", - "version": "7.8.1", + "version": "7.10.0", "keywords": "graphics, gui, embedded, tft, lvgl", "description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.", "repository": { diff --git a/library.properties b/library.properties index afe11b4cd..f737d9f4e 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=lvgl -version=7.8.1 +version=7.10.0 author=kisvegabor maintainer=kisvegabor,embeddedt,pete-pjb sentence=Full-featured Graphics Library for Embedded Systems diff --git a/lv_conf_template.h b/lv_conf_template.h index fddd29882..d1095f1ef 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -1,6 +1,6 @@ /** * @file lv_conf.h - * Configuration file for v7.8.1-dev + * Configuration file for v7.10.0-dev */ /* diff --git a/lvgl.h b/lvgl.h index 8aa6b1bc7..86a335c03 100644 --- a/lvgl.h +++ b/lvgl.h @@ -15,7 +15,7 @@ extern "C" { * CURRENT VERSION OF LVGL ***************************/ #define LVGL_VERSION_MAJOR 7 -#define LVGL_VERSION_MINOR 9 +#define LVGL_VERSION_MINOR 10 #define LVGL_VERSION_PATCH 0 #define LVGL_VERSION_INFO "dev" From 2ea03e3745e74dd78d2c31c3f6d01145beec511e Mon Sep 17 00:00:00 2001 From: Ashraf Kamel <38524812+ashrafkamel5@users.noreply.github.com> Date: Sun, 20 Dec 2020 14:25:25 +0200 Subject: [PATCH 02/62] add arabic keyboard (#1964) * add arabic keyboard * add arabic keyboard --- src/lv_widgets/lv_keyboard.c | 70 +++++++++++++++++++++++++++++++----- src/lv_widgets/lv_keyboard.h | 5 ++- 2 files changed, 66 insertions(+), 9 deletions(-) diff --git a/src/lv_widgets/lv_keyboard.c b/src/lv_widgets/lv_keyboard.c index ae40b4deb..bd84e48d5 100644 --- a/src/lv_widgets/lv_keyboard.c +++ b/src/lv_widgets/lv_keyboard.c @@ -37,40 +37,80 @@ static lv_signal_cb_t ancestor_signal; static const char * const default_kb_map_lc[] = {"1#", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", LV_SYMBOL_BACKSPACE, "\n", "ABC", "a", "s", "d", "f", "g", "h", "j", "k", "l", LV_SYMBOL_NEW_LINE, "\n", "_", "-", "z", "x", "c", "v", "b", "n", "m", ".", ",", ":", "\n", - LV_SYMBOL_CLOSE, LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, "" + LV_SYMBOL_CLOSE, +#if LV_USE_ARABIC_PERSIAN_CHARS == 1 + "أب", +#endif + LV_SYMBOL_LEFT," ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, "" }; static const lv_btnmatrix_ctrl_t default_kb_ctrl_lc_map[] = { LV_KEYBOARD_CTRL_BTN_FLAGS | 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, LV_KEYBOARD_CTRL_BTN_FLAGS | 6, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - LV_KEYBOARD_CTRL_BTN_FLAGS | 2, 2, 6, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 2 + LV_KEYBOARD_CTRL_BTN_FLAGS | 2, +#if LV_USE_ARABIC_PERSIAN_CHARS == 1 + LV_KEYBOARD_CTRL_BTN_FLAGS | 2, +#endif + 2, 6, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 2 }; static const char * const default_kb_map_uc[] = {"1#", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", LV_SYMBOL_BACKSPACE, "\n", "abc", "A", "S", "D", "F", "G", "H", "J", "K", "L", LV_SYMBOL_NEW_LINE, "\n", "_", "-", "Z", "X", "C", "V", "B", "N", "M", ".", ",", ":", "\n", - LV_SYMBOL_CLOSE, LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, "" + LV_SYMBOL_CLOSE, +#if LV_USE_ARABIC_PERSIAN_CHARS == 1 + "أب", +#endif + LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, "" }; static const lv_btnmatrix_ctrl_t default_kb_ctrl_uc_map[] = { LV_KEYBOARD_CTRL_BTN_FLAGS | 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, LV_KEYBOARD_CTRL_BTN_FLAGS | 6, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - LV_KEYBOARD_CTRL_BTN_FLAGS | 2, 2, 6, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 2 + LV_KEYBOARD_CTRL_BTN_FLAGS | 2, +#if LV_USE_ARABIC_PERSIAN_CHARS == 1 + LV_KEYBOARD_CTRL_BTN_FLAGS | 2, +#endif + 2, 6, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 2 }; +#if LV_USE_ARABIC_PERSIAN_CHARS == 1 +static const char * const default_kb_map_ar[] = +{ + "1#", "ض", "ص", "ث", "ق", "ف", "غ", "ع", "ه","خ", "ح","ج", "\n", + "ش", "س", "ي", "ب", "ل", "ا", "ت", "ن", "م", "ك", "ط", LV_SYMBOL_BACKSPACE, "\n", + "ذ", "ء", "ؤ", "ر", "ى", "ة", "و", "ز", "ظ", "د", "ز", "ظ", "د","\n", + LV_SYMBOL_CLOSE,"abc", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT,LV_SYMBOL_NEW_LINE,LV_SYMBOL_OK, "" +}; + +static const lv_btnmatrix_ctrl_t default_kb_ctrl_ar_map[] = { + LV_KEYBOARD_CTRL_BTN_FLAGS | 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + LV_KEYBOARD_CTRL_BTN_FLAGS | 2,LV_KEYBOARD_CTRL_BTN_FLAGS | 2,2, 6, 2, 3, LV_KEYBOARD_CTRL_BTN_FLAGS | 2 +}; +#endif static const char * const default_kb_map_spec[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", LV_SYMBOL_BACKSPACE, "\n", "abc", "+", "-", "/", "*", "=", "%", "!", "?", "#", "<", ">", "\n", "\\", "@", "$", "(", ")", "{", "}", "[", "]", ";", "\"", "'", "\n", - LV_SYMBOL_CLOSE, LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, "" + LV_SYMBOL_CLOSE, +#if LV_USE_ARABIC_PERSIAN_CHARS == 1 + "أب", +#endif + LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, "" }; static const lv_btnmatrix_ctrl_t default_kb_ctrl_spec_map[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - LV_KEYBOARD_CTRL_BTN_FLAGS | 2, 2, 6, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 2 + LV_KEYBOARD_CTRL_BTN_FLAGS | 2, +#if LV_USE_ARABIC_PERSIAN_CHARS == 1 + LV_KEYBOARD_CTRL_BTN_FLAGS | 2, +#endif + 2, 6, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 2 }; static const char * const default_kb_map_num[] = {"1", "2", "3", LV_SYMBOL_CLOSE, "\n", @@ -87,17 +127,23 @@ static const lv_btnmatrix_ctrl_t default_kb_ctrl_num_map[] = { }; /* clang-format on */ -static const char * * kb_map[4] = { +static const char * * kb_map[] = { (const char * *)default_kb_map_lc, (const char * *)default_kb_map_uc, (const char * *)default_kb_map_spec, (const char * *)default_kb_map_num +#if LV_USE_ARABIC_PERSIAN_CHARS == 1 + ,(const char * *)default_kb_map_ar +#endif }; -static const lv_btnmatrix_ctrl_t * kb_ctrl[4] = { +static const lv_btnmatrix_ctrl_t * kb_ctrl[] = { default_kb_ctrl_lc_map, default_kb_ctrl_uc_map, default_kb_ctrl_spec_map, default_kb_ctrl_num_map +#if LV_USE_ARABIC_PERSIAN_CHARS == 1 + ,default_kb_ctrl_ar_map +#endif }; /********************** @@ -354,6 +400,14 @@ void lv_keyboard_def_event_cb(lv_obj_t * kb, lv_event_t event) lv_btnmatrix_set_ctrl_map(kb, kb_ctrl[LV_KEYBOARD_MODE_TEXT_LOWER]); return; } +#if LV_USE_ARABIC_PERSIAN_CHARS == 1 + else if(strcmp(txt, "أب") == 0) { + ext->mode = LV_KEYBOARD_MODE_TEXT_ARABIC; + lv_btnmatrix_set_map(kb, kb_map[LV_KEYBOARD_MODE_TEXT_ARABIC]); + lv_btnmatrix_set_ctrl_map(kb, kb_ctrl[LV_KEYBOARD_MODE_TEXT_ARABIC]); + return; + } +#endif else if(strcmp(txt, "ABC") == 0) { ext->mode = LV_KEYBOARD_MODE_TEXT_UPPER; lv_btnmatrix_set_map(kb, kb_map[LV_KEYBOARD_MODE_TEXT_UPPER]); diff --git a/src/lv_widgets/lv_keyboard.h b/src/lv_widgets/lv_keyboard.h index 3edd344b0..3c3b4a429 100644 --- a/src/lv_widgets/lv_keyboard.h +++ b/src/lv_widgets/lv_keyboard.h @@ -43,7 +43,10 @@ enum { LV_KEYBOARD_MODE_TEXT_LOWER, LV_KEYBOARD_MODE_TEXT_UPPER, LV_KEYBOARD_MODE_SPECIAL, - LV_KEYBOARD_MODE_NUM, + LV_KEYBOARD_MODE_NUM +#if LV_USE_ARABIC_PERSIAN_CHARS == 1 + ,LV_KEYBOARD_MODE_TEXT_ARABIC +#endif }; typedef uint8_t lv_keyboard_mode_t; From f532be905118c6051b1612380a2ebe783461f628 Mon Sep 17 00:00:00 2001 From: Amir Gonnen Date: Wed, 23 Dec 2020 16:25:06 +0200 Subject: [PATCH 03/62] lvgl.h: Add lv_version functions (#1973) These static inline functions return the values of the VERSION macros, making them available for Micropython See also https://github.com/lvgl/lv_examples/pull/85#issuecomment-749506978 --- lvgl.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lvgl.h b/lvgl.h index 86a335c03..c56378100 100644 --- a/lvgl.h +++ b/lvgl.h @@ -121,6 +121,29 @@ extern "C" { * */ #define LV_VERSION_CHECK(x,y,z) (x == LVGL_VERSION_MAJOR && (y < LVGL_VERSION_MINOR || (y == LVGL_VERSION_MINOR && z <= LVGL_VERSION_PATCH))) +/** + * Wrapper functions for VERSION macros + */ + +static inline int lv_version_major() +{ + return LVGL_VERSION_MAJOR; +} + +static inline int lv_version_minor() +{ + return LVGL_VERSION_MINOR; +} + +static inline int lv_version_patch() +{ + return LVGL_VERSION_PATCH; +} + +static inline const char *lv_version_info() +{ + return LVGL_VERSION_INFO; +} #ifdef __cplusplus } From 6dd188422815eba79734534a9b0f5235ecde7fcd Mon Sep 17 00:00:00 2001 From: liebman Date: Wed, 30 Dec 2020 07:54:38 -0800 Subject: [PATCH 04/62] Fix kconfig warnings (#1967) * quote string defaults for Kconfig values to eliminate warnings * don't add \ in default for LV_TICK_CUSTOM_SYS_TIME_EXPR (tho its needed on linux and MacOS) as I can't test on Windows --- Kconfig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Kconfig b/Kconfig index adddb034e..f306fe790 100644 --- a/Kconfig +++ b/Kconfig @@ -112,19 +112,19 @@ menu "LVGL configuration" config LV_MEM_CUSTOM_INCLUDE string prompt "Header to include for the custom memory function" - default stdlib.h + default "stdlib.h" depends on LV_MEM_CUSTOM config LV_MEM_CUSTOM_ALLOC string prompt "Wrapper to malloc" - default malloc + default "malloc" depends on LV_MEM_CUSTOM config LV_MEM_CUSTOM_FREE string prompt "Wrapper to free" - default free + default "free" depends on LV_MEM_CUSTOM config LV_MEM_SIZE_BYTES @@ -286,13 +286,13 @@ menu "LVGL configuration" config LV_TICK_CUSTOM_INCLUDE string prompt "Header for the system time function" - default Arduino.h + default "Arduino.h" depends on LV_TICK_CUSTOM config LV_TICK_CUSTOM_SYS_TIME_EXPR string prompt "Expression evaluating to current system time in ms" - default "(millis())" + default "millis()" depends on LV_TICK_CUSTOM endmenu From f0c52b35112e7734d52a2e25101e0d58ff50cea7 Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Wed, 30 Dec 2020 11:01:24 -0500 Subject: [PATCH 05/62] Add note about base_dir functions requiring LV_USE_BIDI --- src/lv_core/lv_obj.c | 3 ++- src/lv_core/lv_obj.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index d962144d3..a549db952 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -1657,7 +1657,8 @@ void lv_obj_set_parent_event(lv_obj_t * obj, bool en) } /** - * Set the base direction of the object + * Set the base direction of the object. + * @note This only works if LV_USE_BIDI is enabled. * @param obj pointer to an object * @param dir the new base direction. `LV_BIDI_DIR_LTR/RTL/AUTO/INHERIT` */ diff --git a/src/lv_core/lv_obj.h b/src/lv_core/lv_obj.h index 2aabcd7ca..2328d9df0 100644 --- a/src/lv_core/lv_obj.h +++ b/src/lv_core/lv_obj.h @@ -775,6 +775,7 @@ void lv_obj_set_parent_event(lv_obj_t * obj, bool en); /** * Set the base direction of the object + * @note This only works if LV_USE_BIDI is enabled. * @param obj pointer to an object * @param dir the new base direction. `LV_BIDI_DIR_LTR/RTL/AUTO/INHERIT` */ From aba10b0170982fbe1f271f13b34af8a35b8e15ab Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 4 Jan 2021 09:42:50 +0100 Subject: [PATCH 06/62] fix(lv_conf_internal): be sure Kconfig defines are always uppercase fixes #1989 --- scripts/lv_conf_checker.py | 8 ++++---- src/lv_conf_internal.h | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/lv_conf_checker.py b/scripts/lv_conf_checker.py index bc3e008ec..d6173cf22 100755 --- a/scripts/lv_conf_checker.py +++ b/scripts/lv_conf_checker.py @@ -93,14 +93,14 @@ for i in fin.read().splitlines(): if r: line = re.sub('\(.*?\)', '', r[1], 1) #remove parentheses from macros - + line_upper = line.upper(); dr = re.sub('.*# *define', '', i, 1) d = "# define " + dr - + fout.write( f'#ifndef {line}\n' - f'# ifdef CONFIG_{line}\n' - f'# define {line} CONFIG_{line}\n' + f'# ifdef CONFIG_{line_upper}\n' + f'# define {line} CONFIG_{line_upper}\n' f'# else\n' f'{d}\n' f'# endif\n' diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index 1ad907688..0e5da5898 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -602,7 +602,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ * (I.e. no new image decoder is added) * With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images. * However the opened images might consume additional RAM. - * LV_IMG_CACHE_DEF_SIZE must be >= 1 */ + * Set it to 0 to disable caching */ #ifndef LV_IMG_CACHE_DEF_SIZE # ifdef CONFIG_LV_IMG_CACHE_DEF_SIZE # define LV_IMG_CACHE_DEF_SIZE CONFIG_LV_IMG_CACHE_DEF_SIZE @@ -1373,15 +1373,15 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif #ifndef lv_snprintf -# ifdef CONFIG_lv_snprintf -# define lv_snprintf CONFIG_lv_snprintf +# ifdef CONFIG_LV_SNPRINTF +# define lv_snprintf CONFIG_LV_SNPRINTF # else # define lv_snprintf snprintf # endif #endif #ifndef lv_vsnprintf -# ifdef CONFIG_lv_vsnprintf -# define lv_vsnprintf CONFIG_lv_vsnprintf +# ifdef CONFIG_LV_VSNPRINTF +# define lv_vsnprintf CONFIG_LV_VSNPRINTF # else # define lv_vsnprintf vsnprintf # endif From 3dbee9b5844102222d612d1a16a7bbfc02218310 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 4 Jan 2021 09:45:50 +0100 Subject: [PATCH 07/62] refactor(lv_conf_internal): simplify the uppercase conversation added in aba10b0 Reaeted to #1989 --- scripts/lv_conf_checker.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/lv_conf_checker.py b/scripts/lv_conf_checker.py index d6173cf22..357c528a3 100755 --- a/scripts/lv_conf_checker.py +++ b/scripts/lv_conf_checker.py @@ -93,14 +93,13 @@ for i in fin.read().splitlines(): if r: line = re.sub('\(.*?\)', '', r[1], 1) #remove parentheses from macros - line_upper = line.upper(); dr = re.sub('.*# *define', '', i, 1) d = "# define " + dr fout.write( f'#ifndef {line}\n' - f'# ifdef CONFIG_{line_upper}\n' - f'# define {line} CONFIG_{line_upper}\n' + f'# ifdef CONFIG_{line.upper()}\n' + f'# define {line} CONFIG_{line.upper()}\n' f'# else\n' f'{d}\n' f'# endif\n' From 26ab373b43d7c4d50bac9cb7d815943348a35c2b Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Mon, 4 Jan 2021 03:55:13 -0500 Subject: [PATCH 08/62] fix(layout): workaround overflow by implementing a recursion threshold (#1986) * fix(layout): workaround overflow by implementing a recursion threshold * Update CHANGELOG.md --- CHANGELOG.md | 1 + src/lv_widgets/lv_cont.c | 255 ++++++++++++++++++++------------------- 2 files changed, 135 insertions(+), 121 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60de130b8..cbf6cd671 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - fix(textarea) buffer overflow in password mode with UTF-8 characters - fix(textarea) cursor position after hiding character in password mode - fix(linemeter) draw critical lines with correct color +- fix(layout) stop layout after recursion threshold is reached ## v7.8.1 (Plannad at 15.12.2020) diff --git a/src/lv_widgets/lv_cont.c b/src/lv_widgets/lv_cont.c index 08a0e4e6f..c77076db6 100644 --- a/src/lv_widgets/lv_cont.c +++ b/src/lv_widgets/lv_cont.c @@ -27,6 +27,10 @@ *********************/ #define LV_OBJX_NAME "lv_cont" +#ifndef LV_LAYOUT_MAX_RECURSION +#define LV_LAYOUT_MAX_RECURSION 10 +#endif + /********************** * TYPEDEFS **********************/ @@ -664,142 +668,151 @@ static void lv_cont_refr_autofit(lv_obj_t * cont) return; } - lv_area_t tight_area; - lv_area_t ori; - lv_obj_t * child_i; + static int recursion_level = 0; + recursion_level++; + /*Ensure it won't keep recursing forever*/ + if(recursion_level <= LV_LAYOUT_MAX_RECURSION) { + lv_area_t tight_area; + lv_area_t ori; + lv_obj_t * child_i; - lv_obj_t * par = lv_obj_get_parent(cont); - lv_area_t parent_area; - lv_area_copy(&parent_area, &par->coords); - parent_area.x1 += lv_obj_get_style_pad_left(par, LV_OBJ_PART_MAIN); - parent_area.x2 -= lv_obj_get_style_pad_right(par, LV_OBJ_PART_MAIN); - parent_area.y1 += lv_obj_get_style_pad_top(par, LV_OBJ_PART_MAIN); - parent_area.y2 -= lv_obj_get_style_pad_bottom(par, LV_OBJ_PART_MAIN); + lv_obj_t * par = lv_obj_get_parent(cont); + lv_area_t parent_area; + lv_area_copy(&parent_area, &par->coords); + parent_area.x1 += lv_obj_get_style_pad_left(par, LV_OBJ_PART_MAIN); + parent_area.x2 -= lv_obj_get_style_pad_right(par, LV_OBJ_PART_MAIN); + parent_area.y1 += lv_obj_get_style_pad_top(par, LV_OBJ_PART_MAIN); + parent_area.y2 -= lv_obj_get_style_pad_bottom(par, LV_OBJ_PART_MAIN); - /*Search the side coordinates of the children*/ - lv_obj_get_coords(cont, &ori); - lv_obj_get_coords(cont, &tight_area); + /*Search the side coordinates of the children*/ + lv_obj_get_coords(cont, &ori); + lv_obj_get_coords(cont, &tight_area); - bool has_children = _lv_ll_is_empty(&cont->child_ll) ? false : true; + bool has_children = _lv_ll_is_empty(&cont->child_ll) ? false : true; - if(has_children) { - tight_area.x1 = LV_COORD_MAX; - tight_area.y1 = LV_COORD_MAX; - tight_area.x2 = LV_COORD_MIN; - tight_area.y2 = LV_COORD_MIN; + if(has_children) { + tight_area.x1 = LV_COORD_MAX; + tight_area.y1 = LV_COORD_MAX; + tight_area.x2 = LV_COORD_MIN; + tight_area.y2 = LV_COORD_MIN; - _LV_LL_READ(cont->child_ll, child_i) { - if(lv_obj_get_hidden(child_i) != false) continue; + _LV_LL_READ(cont->child_ll, child_i) { + if(lv_obj_get_hidden(child_i) != false) continue; - if(ext->fit_left != LV_FIT_PARENT) { - lv_style_int_t mleft = lv_obj_get_style_margin_left(child_i, LV_OBJ_PART_MAIN); - tight_area.x1 = LV_MATH_MIN(tight_area.x1, child_i->coords.x1 - mleft); + if(ext->fit_left != LV_FIT_PARENT) { + lv_style_int_t mleft = lv_obj_get_style_margin_left(child_i, LV_OBJ_PART_MAIN); + tight_area.x1 = LV_MATH_MIN(tight_area.x1, child_i->coords.x1 - mleft); + } + + if(ext->fit_right != LV_FIT_PARENT) { + lv_style_int_t mright = lv_obj_get_style_margin_right(child_i, LV_OBJ_PART_MAIN); + tight_area.x2 = LV_MATH_MAX(tight_area.x2, child_i->coords.x2 + mright); + } + + if(ext->fit_top != LV_FIT_PARENT) { + lv_style_int_t mtop = lv_obj_get_style_margin_top(child_i, LV_OBJ_PART_MAIN); + tight_area.y1 = LV_MATH_MIN(tight_area.y1, child_i->coords.y1 - mtop); + } + + if(ext->fit_bottom != LV_FIT_PARENT) { + lv_style_int_t mbottom = lv_obj_get_style_margin_bottom(child_i, LV_OBJ_PART_MAIN); + tight_area.y2 = LV_MATH_MAX(tight_area.y2, child_i->coords.y2 + mbottom); + } } - if(ext->fit_right != LV_FIT_PARENT) { - lv_style_int_t mright = lv_obj_get_style_margin_right(child_i, LV_OBJ_PART_MAIN); - tight_area.x2 = LV_MATH_MAX(tight_area.x2, child_i->coords.x2 + mright); - } - - if(ext->fit_top != LV_FIT_PARENT) { - lv_style_int_t mtop = lv_obj_get_style_margin_top(child_i, LV_OBJ_PART_MAIN); - tight_area.y1 = LV_MATH_MIN(tight_area.y1, child_i->coords.y1 - mtop); - } - - if(ext->fit_bottom != LV_FIT_PARENT) { - lv_style_int_t mbottom = lv_obj_get_style_margin_bottom(child_i, LV_OBJ_PART_MAIN); - tight_area.y2 = LV_MATH_MAX(tight_area.y2, child_i->coords.y2 + mbottom); - } + tight_area.x1 -= lv_obj_get_style_pad_left(cont, LV_CONT_PART_MAIN); + tight_area.x2 += lv_obj_get_style_pad_right(cont, LV_CONT_PART_MAIN); + tight_area.y1 -= lv_obj_get_style_pad_top(cont, LV_CONT_PART_MAIN); + tight_area.y2 += lv_obj_get_style_pad_bottom(cont, LV_CONT_PART_MAIN); } - tight_area.x1 -= lv_obj_get_style_pad_left(cont, LV_CONT_PART_MAIN); - tight_area.x2 += lv_obj_get_style_pad_right(cont, LV_CONT_PART_MAIN); - tight_area.y1 -= lv_obj_get_style_pad_top(cont, LV_CONT_PART_MAIN); - tight_area.y2 += lv_obj_get_style_pad_bottom(cont, LV_CONT_PART_MAIN); - } + lv_area_t new_area; + lv_area_copy(&new_area, &ori); - lv_area_t new_area; - lv_area_copy(&new_area, &ori); - - switch(ext->fit_left) { - case LV_FIT_TIGHT: - new_area.x1 = tight_area.x1; - break; - case LV_FIT_PARENT: - new_area.x1 = parent_area.x1; - break; - case LV_FIT_MAX: - new_area.x1 = has_children ? LV_MATH_MIN(tight_area.x1, parent_area.x1) : parent_area.x1; - break; - default: - break; - } - - switch(ext->fit_right) { - case LV_FIT_TIGHT: - new_area.x2 = tight_area.x2; - break; - case LV_FIT_PARENT: - new_area.x2 = parent_area.x2; - break; - case LV_FIT_MAX: - new_area.x2 = has_children ? LV_MATH_MAX(tight_area.x2, parent_area.x2) : parent_area.x2; - break; - default: - break; - } - - switch(ext->fit_top) { - case LV_FIT_TIGHT: - new_area.y1 = tight_area.y1; - break; - case LV_FIT_PARENT: - new_area.y1 = parent_area.y1; - break; - case LV_FIT_MAX: - new_area.y1 = has_children ? LV_MATH_MIN(tight_area.y1, parent_area.y1) : parent_area.y1; - break; - default: - break; - } - - switch(ext->fit_bottom) { - case LV_FIT_TIGHT: - new_area.y2 = tight_area.y2; - break; - case LV_FIT_PARENT: - new_area.y2 = parent_area.y2; - break; - case LV_FIT_MAX: - new_area.y2 = has_children ? LV_MATH_MAX(tight_area.y2, parent_area.y2) : parent_area.y2; - break; - default: - break; - } - - /*Do nothing if the coordinates are not changed*/ - if(cont->coords.x1 != new_area.x1 || cont->coords.y1 != new_area.y1 || cont->coords.x2 != new_area.x2 || - cont->coords.y2 != new_area.y2) { - - lv_obj_invalidate(cont); - lv_area_copy(&cont->coords, &new_area); - lv_obj_invalidate(cont); - - /*Notify the object about its new coordinates*/ - cont->signal_cb(cont, LV_SIGNAL_COORD_CHG, &ori); - - /*Inform the parent about the new coordinates*/ - par->signal_cb(par, LV_SIGNAL_CHILD_CHG, cont); - - if(lv_obj_get_auto_realign(cont)) { - lv_obj_realign(cont); + switch(ext->fit_left) { + case LV_FIT_TIGHT: + new_area.x1 = tight_area.x1; + break; + case LV_FIT_PARENT: + new_area.x1 = parent_area.x1; + break; + case LV_FIT_MAX: + new_area.x1 = has_children ? LV_MATH_MIN(tight_area.x1, parent_area.x1) : parent_area.x1; + break; + default: + break; } - /*Tell the children the parent's size has changed*/ - _LV_LL_READ(cont->child_ll, child_i) { - child_i->signal_cb(child_i, LV_SIGNAL_PARENT_SIZE_CHG, &ori); + switch(ext->fit_right) { + case LV_FIT_TIGHT: + new_area.x2 = tight_area.x2; + break; + case LV_FIT_PARENT: + new_area.x2 = parent_area.x2; + break; + case LV_FIT_MAX: + new_area.x2 = has_children ? LV_MATH_MAX(tight_area.x2, parent_area.x2) : parent_area.x2; + break; + default: + break; } + + switch(ext->fit_top) { + case LV_FIT_TIGHT: + new_area.y1 = tight_area.y1; + break; + case LV_FIT_PARENT: + new_area.y1 = parent_area.y1; + break; + case LV_FIT_MAX: + new_area.y1 = has_children ? LV_MATH_MIN(tight_area.y1, parent_area.y1) : parent_area.y1; + break; + default: + break; + } + + switch(ext->fit_bottom) { + case LV_FIT_TIGHT: + new_area.y2 = tight_area.y2; + break; + case LV_FIT_PARENT: + new_area.y2 = parent_area.y2; + break; + case LV_FIT_MAX: + new_area.y2 = has_children ? LV_MATH_MAX(tight_area.y2, parent_area.y2) : parent_area.y2; + break; + default: + break; + } + + /*Do nothing if the coordinates are not changed*/ + if(cont->coords.x1 != new_area.x1 || cont->coords.y1 != new_area.y1 || cont->coords.x2 != new_area.x2 || + cont->coords.y2 != new_area.y2) { + + lv_obj_invalidate(cont); + lv_area_copy(&cont->coords, &new_area); + lv_obj_invalidate(cont); + + /*Notify the object about its new coordinates*/ + cont->signal_cb(cont, LV_SIGNAL_COORD_CHG, &ori); + + /*Inform the parent about the new coordinates*/ + par->signal_cb(par, LV_SIGNAL_CHILD_CHG, cont); + + if(lv_obj_get_auto_realign(cont)) { + lv_obj_realign(cont); + } + + /*Tell the children the parent's size has changed*/ + _LV_LL_READ(cont->child_ll, child_i) { + child_i->signal_cb(child_i, LV_SIGNAL_PARENT_SIZE_CHG, &ori); + } + } + } else { + LV_LOG_ERROR("LV_LAYOUT_MAX_RECURSION reached! You may have encountered issue #1539."); } + + recursion_level--; } #endif From e5f58151ac9784ef9e7794980add91cf3e8a8ec2 Mon Sep 17 00:00:00 2001 From: robekras Date: Mon, 4 Jan 2021 10:47:34 +0100 Subject: [PATCH 09/62] Update lv_disp.c (#1990) Check d->scr_to_load for not beeing NULL. See forum post https://forum.lvgl.io/t/lv-scr-load-anim-does-not-work-properly/4057 --- src/lv_core/lv_disp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lv_core/lv_disp.c b/src/lv_core/lv_disp.c index 251f28c34..4e319dfdf 100644 --- a/src/lv_core/lv_disp.c +++ b/src/lv_core/lv_disp.c @@ -217,7 +217,7 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t lv_obj_t * act_scr = lv_scr_act(); - if(d->del_prev && act_scr != d->scr_to_load) { + if(d->del_prev && act_scr != d->scr_to_load && d->scr_to_load) { lv_obj_del(act_scr); lv_disp_load_scr(d->scr_to_load); lv_anim_del(d->scr_to_load, NULL); From ed5f91ab7261e2610e9cda6fe078d292e3ead5bb Mon Sep 17 00:00:00 2001 From: Jan Van Winkel Date: Mon, 4 Jan 2021 14:18:11 +0100 Subject: [PATCH 10/62] Add support for Zephyr intergartion (#1979) * Removed src/lv_conf_zephyr.h Removed src/lv_conf_zephyr.h as it is maintained in the Zephyr build it self. * CMakeLists.txt: Added support for Zephyr RTOS Added support to build LVGL as library for Zephyr RTOS * Added support to use LVGL repo as Zephyr module Added support to use the LVGL repository as a Zephyr module repository --- CHANGELOG.md | 1 + CMakeLists.txt | 27 ++++++++++++++++++++++++ src/lv_conf_zephyr.h | 49 -------------------------------------------- zephyr/module.yml | 2 ++ 4 files changed, 30 insertions(+), 49 deletions(-) delete mode 100644 src/lv_conf_zephyr.h create mode 100644 zephyr/module.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index cbf6cd671..762e870dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - feat(chart) add lv_chart_remove_series and lv_chart_hide_series - feat(img_cahce) allow disabling image cacheing - calendar: make get_day_of_week() public +- Added support for Zephyr integration ### Bugfixes - fix(draw_rect) free buffer used for arabic processing diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f9caf709..4f9d82570 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,33 @@ if (CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM) target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_ATTRIBUTE_FAST_MEM=IRAM_ATTR") endif() +elseif(ZEPHYR_BASE) + +if(CONFIG_LVGL) + +zephyr_include_directories(${ZEPHYR_BASE}/lib/gui/lvgl) + +target_include_directories(lvgl INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + +zephyr_compile_definitions(LV_CONF_KCONFIG_EXTERNAL_INCLUDE=) + +zephyr_compile_definitions_ifdef(CONFIG_LV_MEM_CUSTOM + LV_MEM_CUSTOM_ALLOC=${CONFIG_LV_MEM_CUSTOM_ALLOC} + ) +zephyr_compile_definitions_ifdef(CONFIG_LV_MEM_CUSTOM + LV_MEM_CUSTOM_FREE=${CONFIG_LV_MEM_CUSTOM_FREE} + ) +zephyr_compile_definitions_ifdef(CONFIG_LV_TICK_CUSTOM + LV_TICK_CUSTOM_SYS_TIME_EXPR=${CONFIG_LV_TICK_CUSTOM_SYS_TIME_EXPR} + ) + +zephyr_library() + +file(GLOB_RECURSE SOURCES src/*.c) +zephyr_library_sources(${SOURCES}) + +endif() # CONFIG_LVGL + else() message(FATAL_ERROR "Unknown platform.") endif() diff --git a/src/lv_conf_zephyr.h b/src/lv_conf_zephyr.h deleted file mode 100644 index e4e338f2b..000000000 --- a/src/lv_conf_zephyr.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2020 Jan Van Winkel - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifdef __ZEPHYR__ - - #include - - #define LV_MEM_CUSTOM 1 - - #define LV_MEMCPY_MEMSET_STD 1 - - #ifdef CONFIG_LVGL_MEM_POOL_HEAP_KERNEL - - #define LV_MEM_CUSTOM_INCLUDE "kernel.h" - #define LV_MEM_CUSTOM_ALLOC k_malloc - #define LV_MEM_CUTOM_FREE k_free - - #elif defined(CONFIG_LVGL_MEM_POOL_HEAP_LIB_C) - - #define LV_MEM_CUSTOM_INCLUDE "stdlib.h" - #define LV_MEM_CUSTOM_ALLOC malloc - #define LV_MEM_CUTOM_FREE free - - #else - - #define LV_MEM_CUSTOM_INCLUDE "lvgl_mem.h" - #define LV_MEM_CUSTOM_ALLOC lvgl_malloc - #define LV_MEM_CUTOM_FREE lvgl_free - - #endif - - #define LV_ENABLE_GC 0 - - #define LV_TICK_CUSTOM 1 - #define LV_TICK_CUSTOM_INCLUDE "kernel.h" - #define LV_TICK_CUSTOM_SYS_TIME_EXPR (k_uptime_get_32()) - - #define LV_SPRINTF_CUSTOM 1 - - #if LV_SPRINTF_CUSTOM - #define LV_SPRINTF_INCLUDE "stdio.h" - #define lv_snprintf snprintf - #define lv_vsnprintf vsnprintf - #endif - -#endif diff --git a/zephyr/module.yml b/zephyr/module.yml new file mode 100644 index 000000000..eb317c3ce --- /dev/null +++ b/zephyr/module.yml @@ -0,0 +1,2 @@ +build: + cmake: . From de44f74522d74e51c47129b9510644115476cc13 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 4 Jan 2021 15:11:23 +0100 Subject: [PATCH 11/62] fix(gauge): fix redraw with image needle fix #1993 --- CHANGELOG.md | 5 +++-- src/lv_widgets/lv_gauge.c | 12 +++--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 762e870dd..62001acaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## v7.9.0 +## v7.9.0 (Plann1d at 05.01.2020 ### New features - feat(chart) add lv_chart_remove_series and lv_chart_hide_series @@ -16,8 +16,9 @@ - fix(textarea) cursor position after hiding character in password mode - fix(linemeter) draw critical lines with correct color - fix(layout) stop layout after recursion threshold is reached +- fix(gauge) fix redraw with image needle -## v7.8.1 (Plannad at 15.12.2020) +## v7.8.1 ### Bugfixes - fix(lv_scr_load_anim) fix when multiple screen are loaded at tsame time with delay diff --git a/src/lv_widgets/lv_gauge.c b/src/lv_widgets/lv_gauge.c index 46bfd729c..ad3bcb066 100644 --- a/src/lv_widgets/lv_gauge.c +++ b/src/lv_widgets/lv_gauge.c @@ -197,15 +197,9 @@ void lv_gauge_set_value(lv_obj_t * gauge, uint8_t needle_id, int32_t value) int32_t old_value = ext->values[needle_id]; ext->values[needle_id] = value; - // lv_obj_invalidate(gauge); - - lv_style_int_t pad = lv_obj_get_style_pad_inner(gauge, LV_GAUGE_PART_NEEDLE); - lv_style_int_t left = lv_obj_get_style_pad_left(gauge, LV_GAUGE_PART_MAIN); - lv_style_int_t right = lv_obj_get_style_pad_right(gauge, LV_GAUGE_PART_MAIN); - lv_style_int_t top = lv_obj_get_style_pad_top(gauge, LV_GAUGE_PART_MAIN); - lv_coord_t r = (lv_obj_get_width(gauge) - left - right) / 2 - pad; - lv_coord_t x_ofs = gauge->coords.x1 + r + left + pad; - lv_coord_t y_ofs = gauge->coords.y1 + r + top + pad; + lv_coord_t r = lv_obj_get_width(gauge) / 2; + lv_coord_t x_ofs = gauge->coords.x1 + r; + lv_coord_t y_ofs = gauge->coords.y1 + r; uint16_t angle = lv_linemeter_get_scale_angle(gauge); int16_t angle_ofs = 90 + (360 - angle) / 2 + lv_gauge_get_angle_offset(gauge); lv_point_t p_mid; From 6ed420e04319b9111fbc4d38a2a8713a3a18b822 Mon Sep 17 00:00:00 2001 From: Carlos Diaz Date: Mon, 4 Jan 2021 08:27:38 -0600 Subject: [PATCH 12/62] Kconfig: Handle LV_SPRINTF_DISABLE_FLOAT (#1988) * Kconfig: Handle LV_SPRINTF_DISABLE_FLOAT * Update CHANGELOG * Remove debug code Co-authored-by: Gabor Kiss-Vamosi --- CHANGELOG.md | 2 ++ src/lv_conf_kconfig.h | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62001acaf..2cb04bd21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,9 +15,11 @@ - fix(textarea) buffer overflow in password mode with UTF-8 characters - fix(textarea) cursor position after hiding character in password mode - fix(linemeter) draw critical lines with correct color +- fix(kconfig) handle disable sprintf float correctly. - fix(layout) stop layout after recursion threshold is reached - fix(gauge) fix redraw with image needle + ## v7.8.1 ### Bugfixes diff --git a/src/lv_conf_kconfig.h b/src/lv_conf_kconfig.h index 5757c94db..289e581f2 100644 --- a/src/lv_conf_kconfig.h +++ b/src/lv_conf_kconfig.h @@ -400,6 +400,18 @@ extern "C" { #endif #endif +/*------------------ + * SPRINTF DISABLE FLOAT + *-----------------*/ + +#ifndef LV_SPRINTF_DISABLE_FLOAT +#ifndef CONFIG_LV_SPRINTF_DISABLE_FLOAT +#define LV_SPRINTF_DISABLE_FLOAT 0 +#else +#define LV_SPRINTF_DISABLE_FLOAT 1 +#endif +#endif + #ifdef __cplusplus } /* extern "C" */ #endif From 83c55c2a64eb92a0996815320abeb31fa2d42b5e Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 4 Jan 2021 18:15:37 +0100 Subject: [PATCH 13/62] Update ROADMAP.md --- docs/ROADMAP.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index df66c671b..efddec095 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -27,14 +27,12 @@ Planned to November/December 2020 - Simplified File system interface ([feat/new_fs_api](https://github.com/lvgl/lvgl/tree/feat/new-fs-api) branch) to make porting easier - Work in progress - Remove the align parameter from `lv_canvas_draw_text` -- Remove the copy paramter from create functions -- Style selectors and style-based states See [#1832](https://github.com/lvgl/lvgl/issues/1832) -- Add Object Orianted system [#1919](https://github.com/lvgl/lvgl/issues/1919) - -## v8.1 -- Add radio button widget +- Make the copy paramter obsolate in create functions +- Optimize and simplifie styles [#1832](https://github.com/lvgl/lvgl/issues/1832) +- Use a more generic inheritenace [#1919](https://github.com/lvgl/lvgl/issues/1919) ## v8.x +- Add radio button widget - Unit testing (gtest?). See [#1658](https://github.com/lvgl/lvgl/issues/1658) - Benchmarking (gem5?). See [#1660](https://github.com/lvgl/lvgl/issues/1660) @@ -47,10 +45,8 @@ Planned to November/December 2020 - Handle stride. See [#1858](https://github.com/lvgl/lvgl/issues/1858) - Make gradients more versatile - Make image transformations more versatile -- Allow snapshoting object to tranfrom them as images +- Allow snapshoting object to tranfrom them to images -## v10 -- Remove property level states ## Ideas From 998ad66c84258e5638ef5e3669934a481c3615f6 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 5 Jan 2021 15:46:57 +0100 Subject: [PATCH 14/62] fix(kconfig): fix redefinition of LV_SPRINTF_DISABLE_FLOAT if no Kconfig --- src/lv_conf_kconfig.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lv_conf_kconfig.h b/src/lv_conf_kconfig.h index 289e581f2..075d1da1e 100644 --- a/src/lv_conf_kconfig.h +++ b/src/lv_conf_kconfig.h @@ -404,12 +404,14 @@ extern "C" { * SPRINTF DISABLE FLOAT *-----------------*/ -#ifndef LV_SPRINTF_DISABLE_FLOAT -#ifndef CONFIG_LV_SPRINTF_DISABLE_FLOAT -#define LV_SPRINTF_DISABLE_FLOAT 0 -#else -#define LV_SPRINTF_DISABLE_FLOAT 1 -#endif +#if CONFIG_LV_CONF_SKIP || LV_CONF_SKIP +# ifndef LV_SPRINTF_DISABLE_FLOAT +# ifndef CONFIG_LV_SPRINTF_DISABLE_FLOAT +# define LV_SPRINTF_DISABLE_FLOAT 0 +# else +# define LV_SPRINTF_DISABLE_FLOAT 1 +# endif +# endif #endif #ifdef __cplusplus From 8ed224fd636bca30a06d53ea3e66967564caa520 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 5 Jan 2021 15:51:59 +0100 Subject: [PATCH 15/62] fix warning --- src/lv_conf_kconfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lv_conf_kconfig.h b/src/lv_conf_kconfig.h index 075d1da1e..3387eb599 100644 --- a/src/lv_conf_kconfig.h +++ b/src/lv_conf_kconfig.h @@ -404,7 +404,7 @@ extern "C" { * SPRINTF DISABLE FLOAT *-----------------*/ -#if CONFIG_LV_CONF_SKIP || LV_CONF_SKIP +#if defined(CONFIG_LV_CONF_SKIP) || defined(LV_CONF_SKIP) # ifndef LV_SPRINTF_DISABLE_FLOAT # ifndef CONFIG_LV_SPRINTF_DISABLE_FLOAT # define LV_SPRINTF_DISABLE_FLOAT 0 From e66f19e5ce008d885f68bd3bc95b119e8a9f1873 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 5 Jan 2021 15:57:36 +0100 Subject: [PATCH 16/62] Release v7.9.0 --- library.json | 2 +- library.properties | 2 +- lv_conf_template.h | 2 +- lvgl.h | 2 +- src/lv_draw/lv_draw_img.c | 2 +- src/lv_draw/lv_img_cache.c | 4 ++-- src/lv_widgets/lv_calendar.c | 2 +- src/lv_widgets/lv_chart.c | 6 +++--- src/lv_widgets/lv_cont.c | 7 ++++--- src/lv_widgets/lv_win.c | 12 ++++++------ src/lv_widgets/lv_win.h | 4 ++-- 11 files changed, 23 insertions(+), 22 deletions(-) diff --git a/library.json b/library.json index d962711d9..7755e2c3e 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "lvgl", - "version": "7.8.1", + "version": "7.9.0", "keywords": "graphics, gui, embedded, tft, lvgl", "description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.", "repository": { diff --git a/library.properties b/library.properties index afe11b4cd..e4f708613 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=lvgl -version=7.8.1 +version=7.9.0 author=kisvegabor maintainer=kisvegabor,embeddedt,pete-pjb sentence=Full-featured Graphics Library for Embedded Systems diff --git a/lv_conf_template.h b/lv_conf_template.h index fddd29882..2e72972df 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -1,6 +1,6 @@ /** * @file lv_conf.h - * Configuration file for v7.8.1-dev + * Configuration file for v7.9.0 */ /* diff --git a/lvgl.h b/lvgl.h index 8aa6b1bc7..686772af2 100644 --- a/lvgl.h +++ b/lvgl.h @@ -17,7 +17,7 @@ extern "C" { #define LVGL_VERSION_MAJOR 7 #define LVGL_VERSION_MINOR 9 #define LVGL_VERSION_PATCH 0 -#define LVGL_VERSION_INFO "dev" +#define LVGL_VERSION_INFO "" /********************* * INCLUDES diff --git a/src/lv_draw/lv_draw_img.c b/src/lv_draw/lv_draw_img.c index 0ad15f0c6..57610af08 100644 --- a/src/lv_draw/lv_draw_img.c +++ b/src/lv_draw/lv_draw_img.c @@ -656,7 +656,7 @@ static void show_error(const lv_area_t * coords, const lv_area_t * clip_area, co static void draw_cleanup(lv_img_cache_entry_t * cache) { -/*Automatically close images with no caching*/ + /*Automatically close images with no caching*/ #if LV_IMG_CACHE_DEF_SIZE == 0 lv_img_decoder_close(&cache->dec_dsc); #else diff --git a/src/lv_draw/lv_img_cache.c b/src/lv_draw/lv_img_cache.c index 2488865c3..087d36c27 100644 --- a/src/lv_draw/lv_img_cache.c +++ b/src/lv_draw/lv_img_cache.c @@ -37,14 +37,14 @@ * STATIC PROTOTYPES **********************/ #if LV_IMG_CACHE_DEF_SIZE == 0 -static lv_img_cache_entry_t cache_temp; + static lv_img_cache_entry_t cache_temp; #endif /********************** * STATIC VARIABLES **********************/ #if LV_IMG_CACHE_DEF_SIZE -static uint16_t entry_cnt; + static uint16_t entry_cnt; #endif /********************** diff --git a/src/lv_widgets/lv_calendar.c b/src/lv_widgets/lv_calendar.c index 5352e177d..0ec2e8811 100644 --- a/src/lv_widgets/lv_calendar.c +++ b/src/lv_widgets/lv_calendar.c @@ -641,7 +641,7 @@ static bool calculate_touched_day(lv_obj_t * calendar, const lv_point_t * touche ext->pressed_date.year = ext->showed_date.year - (ext->showed_date.month == 1 ? 1 : 0); ext->pressed_date.month = ext->showed_date.month == 1 ? 12 : (ext->showed_date.month - 1); ext->pressed_date.day = get_month_length(ext->pressed_date.year, ext->pressed_date.month) - - lv_calendar_get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1) + 1 + i_pos; + lv_calendar_get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1) + 1 + i_pos; } else if(i_pos < (lv_calendar_get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1) + get_month_length(ext->showed_date.year, ext->showed_date.month))) { diff --git a/src/lv_widgets/lv_chart.c b/src/lv_widgets/lv_chart.c index 73d85b3a0..47609d3e3 100644 --- a/src/lv_widgets/lv_chart.c +++ b/src/lv_widgets/lv_chart.c @@ -217,7 +217,7 @@ void lv_chart_remove_series(lv_obj_t * chart, lv_chart_series_t * series) { LV_ASSERT_OBJ(chart, LV_OBJX_NAME); LV_ASSERT_NULL(series); - + if(chart == NULL || series == NULL) return; lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart); if(!series->ext_buf_assigned && series->points) lv_mem_free(series->points); @@ -1180,7 +1180,7 @@ static void draw_series_line(lv_obj_t * chart, const lv_area_t * series_area, co /*Go through all data lines*/ _LV_LL_READ_BACK(ext->series_ll, ser) { - if (ser->hidden) continue; + if(ser->hidden) continue; line_dsc.color = ser->color; point_dsc.bg_color = ser->color; area_dsc.bg_color = ser->color; @@ -1317,7 +1317,7 @@ static void draw_series_column(lv_obj_t * chart, const lv_area_t * series_area, /*Draw the current point of all data line*/ _LV_LL_READ_BACK(ext->series_ll, ser) { - if (ser->hidden) continue; + if(ser->hidden) continue; lv_coord_t start_point = ext->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0; col_a.x1 = x_act; diff --git a/src/lv_widgets/lv_cont.c b/src/lv_widgets/lv_cont.c index c77076db6..94ab41894 100644 --- a/src/lv_widgets/lv_cont.c +++ b/src/lv_widgets/lv_cont.c @@ -28,7 +28,7 @@ #define LV_OBJX_NAME "lv_cont" #ifndef LV_LAYOUT_MAX_RECURSION -#define LV_LAYOUT_MAX_RECURSION 10 + #define LV_LAYOUT_MAX_RECURSION 10 #endif /********************** @@ -787,7 +787,7 @@ static void lv_cont_refr_autofit(lv_obj_t * cont) /*Do nothing if the coordinates are not changed*/ if(cont->coords.x1 != new_area.x1 || cont->coords.y1 != new_area.y1 || cont->coords.x2 != new_area.x2 || - cont->coords.y2 != new_area.y2) { + cont->coords.y2 != new_area.y2) { lv_obj_invalidate(cont); lv_area_copy(&cont->coords, &new_area); @@ -808,7 +808,8 @@ static void lv_cont_refr_autofit(lv_obj_t * cont) child_i->signal_cb(child_i, LV_SIGNAL_PARENT_SIZE_CHG, &ori); } } - } else { + } + else { LV_LOG_ERROR("LV_LAYOUT_MAX_RECURSION reached! You may have encountered issue #1539."); } diff --git a/src/lv_widgets/lv_win.c b/src/lv_widgets/lv_win.c index e087e2d19..f0c8c6457 100644 --- a/src/lv_widgets/lv_win.c +++ b/src/lv_widgets/lv_win.c @@ -598,21 +598,21 @@ static lv_design_res_t lv_win_header_design(lv_obj_t * header, const lv_area_t * case LV_TXT_FLAG_CENTER: txt_area.x1 = header->coords.x1 + header_left + btn_offset; txt_area.x2 = header->coords.x2 - header_right - btn_offset; - txt_area.y1 = header->coords.y1 + (lv_obj_get_height(header) - txt_size.y) / 2; - txt_area.y2 = txt_area.y1 + txt_size.y; + txt_area.y1 = header->coords.y1 + (lv_obj_get_height(header) - txt_size.y) / 2; + txt_area.y2 = txt_area.y1 + txt_size.y; break; case LV_TXT_FLAG_RIGHT: txt_area.x1 = header->coords.x1; txt_area.x2 = header->coords.x2 - header_right - btn_offset; - txt_area.y1 = header->coords.y1 + (lv_obj_get_height(header) - txt_size.y) / 2; + txt_area.y1 = header->coords.y1 + (lv_obj_get_height(header) - txt_size.y) / 2; txt_area.y2 = txt_area.y1 + txt_size.y; - break; + break; case LV_TXT_FLAG_FIT || LV_TXT_FLAG_EXPAND: txt_area.x1 = header->coords.x1; txt_area.x2 = header->coords.x2; - txt_area.y1 = header->coords.y1 + (lv_obj_get_height(header) - txt_size.y) / 2; + txt_area.y1 = header->coords.y1 + (lv_obj_get_height(header) - txt_size.y) / 2; txt_area.y2 = txt_area.y1 + txt_size.y; - break; + break; default: txt_area.x1 = header->coords.x1 + header_left + btn_offset; txt_area.x2 = txt_area.x1 + txt_size.x + btn_offset; diff --git a/src/lv_widgets/lv_win.h b/src/lv_widgets/lv_win.h index 3bf4bf71b..a0e599f49 100644 --- a/src/lv_widgets/lv_win.h +++ b/src/lv_widgets/lv_win.h @@ -177,7 +177,7 @@ void lv_win_set_anim_time(lv_obj_t * win, uint16_t anim_time); void lv_win_set_drag(lv_obj_t * win, bool en); /** - * Set alignment of title text in window header. + * Set alignment of title text in window header. * @param win pointer to a window object * @param alignment set the type of alignment with LV_TXT_FLAGS */ @@ -263,7 +263,7 @@ static inline bool lv_win_get_drag(const lv_obj_t * win) } /** - * Get the current alignment of title text in window header. + * Get the current alignment of title text in window header. * @param win pointer to a window object */ uint8_t lv_win_title_get_alignment(lv_obj_t * win); From e3ad7918e2090ab8472a9c50878546a5f9a44457 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 5 Jan 2021 16:04:29 +0100 Subject: [PATCH 17/62] Update master version --- library.json | 2 +- library.properties | 2 +- lv_conf_template.h | 2 +- lvgl.h | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/library.json b/library.json index 7755e2c3e..7cf76800b 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "lvgl", - "version": "7.9.0", + "version": "7.9.1", "keywords": "graphics, gui, embedded, tft, lvgl", "description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.", "repository": { diff --git a/library.properties b/library.properties index e4f708613..6e2998a24 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=lvgl -version=7.9.0 +version=7.9.1 author=kisvegabor maintainer=kisvegabor,embeddedt,pete-pjb sentence=Full-featured Graphics Library for Embedded Systems diff --git a/lv_conf_template.h b/lv_conf_template.h index 2e72972df..38e4bef06 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -1,6 +1,6 @@ /** * @file lv_conf.h - * Configuration file for v7.9.0 + * Configuration file for v7.9.1 */ /* diff --git a/lvgl.h b/lvgl.h index 686772af2..8cfe3f4eb 100644 --- a/lvgl.h +++ b/lvgl.h @@ -16,8 +16,8 @@ extern "C" { ***************************/ #define LVGL_VERSION_MAJOR 7 #define LVGL_VERSION_MINOR 9 -#define LVGL_VERSION_PATCH 0 -#define LVGL_VERSION_INFO "" +#define LVGL_VERSION_PATCH 1 +#define LVGL_VERSION_INFO "dev" /********************* * INCLUDES From 8aaff10bd559e53004fd0ad187b48eba3e7ef5ef Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 5 Jan 2021 16:33:07 +0100 Subject: [PATCH 18/62] fix(release script): fix regexp to update the required LVGL version in lv_examples.h --- scripts/release/release.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/release/release.py b/scripts/release/release.py index edcdf79e4..e45acbe4b 100755 --- a/scripts/release/release.py +++ b/scripts/release/release.py @@ -88,7 +88,7 @@ def lv_examples_release(ver): com.update_version(ver) - com.cmd("sed -i -r 's/LV_VERSION_CHECK\([0-9]+, *[0-9]+, *[0-9]+\)/"+ "LV_VERSION_CHECK(" + str(ver[0]) + ", " + str(ver[1]) + ", " + str(ver[2]) + ")/' lv_examples.h") + com.cmd("sed -i -r 's/LV_VERSION_CHECK\([0-9]+, *[0-9]+, *[0-9]+\)/"+ "LV_VERSION_CHECK\(" + str(ver[0]) + ", " + str(ver[1]) + ", " + str(ver[2]) + ")/' lv_examples.h") com.cmd('git commit -am "Release ' + ver_str + '"') com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ") From ae2fbdb9efebcd3e003bc474171a7e136bd98f7e Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Tue, 5 Jan 2021 17:10:57 -0500 Subject: [PATCH 19/62] fix(win): incorrect switch syntax --- src/lv_widgets/lv_win.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lv_widgets/lv_win.c b/src/lv_widgets/lv_win.c index f0c8c6457..332bbc5e1 100644 --- a/src/lv_widgets/lv_win.c +++ b/src/lv_widgets/lv_win.c @@ -607,7 +607,8 @@ static lv_design_res_t lv_win_header_design(lv_obj_t * header, const lv_area_t * txt_area.y1 = header->coords.y1 + (lv_obj_get_height(header) - txt_size.y) / 2; txt_area.y2 = txt_area.y1 + txt_size.y; break; - case LV_TXT_FLAG_FIT || LV_TXT_FLAG_EXPAND: + case LV_TXT_FLAG_FIT: + case LV_TXT_FLAG_EXPAND: txt_area.x1 = header->coords.x1; txt_area.x2 = header->coords.x2; txt_area.y1 = header->coords.y1 + (lv_obj_get_height(header) - txt_size.y) / 2; From 8cd07b6ff541d1bcc2e652d3094c51c3b8c80636 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 6 Jan 2021 11:53:51 +0100 Subject: [PATCH 20/62] fix(cpicker): fix division by zero fix #1992 --- CHANGELOG.md | 5 +++++ src/lv_widgets/lv_cpicker.c | 1 + 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cb04bd21..bcd371585 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## v7.9.1 (Planned at 19.01.2020 + +### Bugfixes +- fix(cpicker) fix division by zero + ## v7.9.0 (Plann1d at 05.01.2020 ### New features diff --git a/src/lv_widgets/lv_cpicker.c b/src/lv_widgets/lv_cpicker.c index 49efb9bd5..70cd3aeff 100644 --- a/src/lv_widgets/lv_cpicker.c +++ b/src/lv_widgets/lv_cpicker.c @@ -579,6 +579,7 @@ static void draw_rect_grad(lv_obj_t * cpicker, const lv_area_t * mask) } lv_coord_t grad_w = lv_area_get_width(&grad_area); + if(grad_w < 1) return; uint16_t i_step = LV_MATH_MAX(LV_CPICKER_DEF_QF, 360 / grad_w); bg_dsc.radius = 0; bg_dsc.border_width = 0; From 509a56fde9cf2e93143851f2153aa1b60db4b69a Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 6 Jan 2021 12:06:51 +0100 Subject: [PATCH 21/62] fix(dropdown): fix selecting options after the last one fix #1996 --- CHANGELOG.md | 1 + src/lv_widgets/lv_dropdown.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcd371585..22fe7c57a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Bugfixes - fix(cpicker) fix division by zero +- fix(dropdown) fix selecting options after the last one ## v7.9.0 (Plann1d at 05.01.2020 diff --git a/src/lv_widgets/lv_dropdown.c b/src/lv_widgets/lv_dropdown.c index 60f78d52c..31eae4589 100644 --- a/src/lv_widgets/lv_dropdown.c +++ b/src/lv_widgets/lv_dropdown.c @@ -1298,6 +1298,7 @@ static void page_press_handler(lv_obj_t * page) static uint16_t get_id_on_point(lv_obj_t * ddlist, lv_coord_t y) { + lv_dropdown_ext_t * ext = lv_obj_get_ext_attr(ddlist); lv_obj_t * label = get_label(ddlist); if(label == NULL) return 0; y -= label->coords.y1; @@ -1311,6 +1312,7 @@ static uint16_t get_id_on_point(lv_obj_t * ddlist, lv_coord_t y) uint16_t opt = y / h; + if(opt >= ext->option_cnt) opt = ext->option_cnt - 1; return opt; } From b391c64434a22d88585e5dc214b355af11988993 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 7 Jan 2021 13:33:01 +0100 Subject: [PATCH 22/62] Update config.yml --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 0ef14eb45..d37734182 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -5,7 +5,7 @@ contact_links: about: Be sure to read to documentation first - name: Forum url: https://forum.lvgl.io - about: For how-to questions use the forum + about: For topics like: How-to, Getting started, Feature request - name: CONTIBUTING.md url: https://github.com/lvgl/lvgl/blob/master/docs/CONTRIBUTING.md#faq-about-contributing about: The basic rules of contributing From 74564b7c7e4792f131139a4096ba79e37a6ce116 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Thu, 7 Jan 2021 07:46:20 -0500 Subject: [PATCH 23/62] fix(canvas): spelling in log messages --- src/lv_widgets/lv_canvas.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lv_widgets/lv_canvas.c b/src/lv_widgets/lv_canvas.c index 14fb5e023..a098e1bac 100644 --- a/src/lv_widgets/lv_canvas.c +++ b/src/lv_widgets/lv_canvas.c @@ -705,7 +705,7 @@ void lv_canvas_draw_rect(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord lv_img_dsc_t * dsc = lv_canvas_get_img(canvas); if(dsc->header.cf >= LV_IMG_CF_INDEXED_1BIT && dsc->header.cf <= LV_IMG_CF_INDEXED_8BIT) { - LV_LOG_WARN("lv_canvas_draw_rect: can't raw to LV_IMG_CF_INDEXED canvas"); + LV_LOG_WARN("lv_canvas_draw_rect: can't draw to LV_IMG_CF_INDEXED canvas"); return; } @@ -777,7 +777,7 @@ void lv_canvas_draw_text(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord lv_img_dsc_t * dsc = lv_canvas_get_img(canvas); if(dsc->header.cf >= LV_IMG_CF_INDEXED_1BIT && dsc->header.cf <= LV_IMG_CF_INDEXED_8BIT) { - LV_LOG_WARN("lv_canvas_draw_text: can't raw to LV_IMG_CF_INDEXED canvas"); + LV_LOG_WARN("lv_canvas_draw_text: can't draw to LV_IMG_CF_INDEXED canvas"); return; } @@ -852,7 +852,7 @@ void lv_canvas_draw_img(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, const voi lv_img_dsc_t * dsc = lv_canvas_get_img(canvas); if(dsc->header.cf >= LV_IMG_CF_INDEXED_1BIT && dsc->header.cf <= LV_IMG_CF_INDEXED_8BIT) { - LV_LOG_WARN("lv_canvas_draw_img: can't raw to LV_IMG_CF_INDEXED canvas"); + LV_LOG_WARN("lv_canvas_draw_img: can't draw to LV_IMG_CF_INDEXED canvas"); return; } @@ -917,7 +917,7 @@ void lv_canvas_draw_line(lv_obj_t * canvas, const lv_point_t points[], uint32_t lv_img_dsc_t * dsc = lv_canvas_get_img(canvas); if(dsc->header.cf >= LV_IMG_CF_INDEXED_1BIT && dsc->header.cf <= LV_IMG_CF_INDEXED_8BIT) { - LV_LOG_WARN("lv_canvas_draw_line: can't raw to LV_IMG_CF_INDEXED canvas"); + LV_LOG_WARN("lv_canvas_draw_line: can't draw to LV_IMG_CF_INDEXED canvas"); return; } /* Create a dummy display to fool the lv_draw function. @@ -980,7 +980,7 @@ void lv_canvas_draw_polygon(lv_obj_t * canvas, const lv_point_t points[], uint32 lv_img_dsc_t * dsc = lv_canvas_get_img(canvas); if(dsc->header.cf >= LV_IMG_CF_INDEXED_1BIT && dsc->header.cf <= LV_IMG_CF_INDEXED_8BIT) { - LV_LOG_WARN("lv_canvas_draw_polygon: can't raw to LV_IMG_CF_INDEXED canvas"); + LV_LOG_WARN("lv_canvas_draw_polygon: can't draw to LV_IMG_CF_INDEXED canvas"); return; } @@ -1044,7 +1044,7 @@ void lv_canvas_draw_arc(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord_ lv_img_dsc_t * dsc = lv_canvas_get_img(canvas); if(dsc->header.cf >= LV_IMG_CF_INDEXED_1BIT && dsc->header.cf <= LV_IMG_CF_INDEXED_8BIT) { - LV_LOG_WARN("lv_canvas_draw_arc: can't raw to LV_IMG_CF_INDEXED canvas"); + LV_LOG_WARN("lv_canvas_draw_arc: can't draw to LV_IMG_CF_INDEXED canvas"); return; } From 0110a1888d532fffd0dd76927ebbb37c7f20b967 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 7 Jan 2021 14:49:09 +0100 Subject: [PATCH 24/62] Update bug-report.md --- .github/ISSUE_TEMPLATE/bug-report.md | 37 +++++++++++++++++++--------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index c95affd3e..55894b8ce 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -7,23 +7,36 @@ assignees: '' --- -> # Important: issues that don't use this template will be ignored/closed. + + +**Perform all steps below and tick them with [x]** +- [ ] Update lvgl to the latest version +- [ ] Reproduce the issue in a [Simulator](https://docs.lvgl.io/latest/en/html/get-started/pc-simulator.html) **Describe the bug** - -A clear and concise description of what the bug is. + **To Reproduce** - -Please provide a small, independent code sample that can be used to reproduce the issue. Ideally this should work in the PC simulator unless the problem is specific to one platform. + **Expected behavior** + -A clear and concise description of what you expected to happen. - -**Screenshots** +**Screenshots or video** + From 7dc3262855f4ebd882aa6c48e763cb7d0c410294 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 7 Jan 2021 14:50:43 +0100 Subject: [PATCH 25/62] Update config.yml --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index d37734182..2228ff12d 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -5,7 +5,7 @@ contact_links: about: Be sure to read to documentation first - name: Forum url: https://forum.lvgl.io - about: For topics like: How-to, Getting started, Feature request + about: For topics like How-to, Getting started, Feature request - name: CONTIBUTING.md url: https://github.com/lvgl/lvgl/blob/master/docs/CONTRIBUTING.md#faq-about-contributing about: The basic rules of contributing From 20975a22909586298278eddf39fc241c1d982977 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 7 Jan 2021 14:52:19 +0100 Subject: [PATCH 26/62] Update all-other-issues.md --- .github/ISSUE_TEMPLATE/all-other-issues.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/all-other-issues.md b/.github/ISSUE_TEMPLATE/all-other-issues.md index 67d5adcd8..613688342 100644 --- a/.github/ISSUE_TEMPLATE/all-other-issues.md +++ b/.github/ISSUE_TEMPLATE/all-other-issues.md @@ -1,14 +1,14 @@ --- -name: All other issues -about: Questions and enhancement requests should go to the forum. +name: Other issues +about: Questions and enhancement requests should go to the Forum. title: '' labels: not-template assignees: '' --- -# All enhancement requests or questions should be directed to the Forum. +**All enhancement requests or questions should be directed to the Forum.** We use GitHub issues for development related discussions. -Please use the [forum](https://forum.littlevgl.com/) to ask questions. +Please use the [Forum](https://forum.lvgl.io/) to ask questions. From 97f149320287c310b8afea08777550833eebb86d Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 8 Jan 2021 12:51:44 +0100 Subject: [PATCH 27/62] Update bug-report.md --- .github/ISSUE_TEMPLATE/bug-report.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 55894b8ce..63daf9cc2 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -13,6 +13,7 @@ Issues that don't use this template will be ignored and closed. --> **Perform all steps below and tick them with [x]** +- [ ] Check the related part of the [Documentation](https://docs.lvgl.io/) - [ ] Update lvgl to the latest version - [ ] Reproduce the issue in a [Simulator](https://docs.lvgl.io/latest/en/html/get-started/pc-simulator.html) From f0fd2b757f490092ebffa0a261c04cae6a1bab04 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 8 Jan 2021 12:52:23 +0100 Subject: [PATCH 28/62] Update bug-report.md --- .github/ISSUE_TEMPLATE/bug-report.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 63daf9cc2..92cffaff7 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -12,17 +12,17 @@ IMPORTANT Issues that don't use this template will be ignored and closed. --> -**Perform all steps below and tick them with [x]** +### Perform all steps below and tick them with [x] - [ ] Check the related part of the [Documentation](https://docs.lvgl.io/) - [ ] Update lvgl to the latest version - [ ] Reproduce the issue in a [Simulator](https://docs.lvgl.io/latest/en/html/get-started/pc-simulator.html) -**Describe the bug** +### Describe the bug -**To Reproduce** +### To Reproduce -**Expected behavior** +### Expected behavior -**Screenshots or video** +### Screenshots or video From 9bb7ff30ec9c6eafe8cc7e3392772447d12276c9 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 8 Jan 2021 14:08:39 +0100 Subject: [PATCH 29/62] Update and rename all-other-issues.md to dev-discussion.md --- .github/ISSUE_TEMPLATE/all-other-issues.md | 14 ---------- .github/ISSUE_TEMPLATE/dev-discussion.md | 31 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 14 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/all-other-issues.md create mode 100644 .github/ISSUE_TEMPLATE/dev-discussion.md diff --git a/.github/ISSUE_TEMPLATE/all-other-issues.md b/.github/ISSUE_TEMPLATE/all-other-issues.md deleted file mode 100644 index 613688342..000000000 --- a/.github/ISSUE_TEMPLATE/all-other-issues.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: Other issues -about: Questions and enhancement requests should go to the Forum. -title: '' -labels: not-template -assignees: '' - ---- - - -**All enhancement requests or questions should be directed to the Forum.** - -We use GitHub issues for development related discussions. -Please use the [Forum](https://forum.lvgl.io/) to ask questions. diff --git a/.github/ISSUE_TEMPLATE/dev-discussion.md b/.github/ISSUE_TEMPLATE/dev-discussion.md new file mode 100644 index 000000000..c18fb1422 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/dev-discussion.md @@ -0,0 +1,31 @@ +--- +name: Development discussion +about: Discussion strictly related to the develoopment of the LVGL. +title: '' +labels: '' +assignees: '' + +--- + + + +### Introcude the problem + + +#### Examples and cases + + +### Suggested solution + + From e457c33dc29cde4c456222b32b76f9973e910844 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 8 Jan 2021 14:10:12 +0100 Subject: [PATCH 30/62] Update dev-discussion.md --- .github/ISSUE_TEMPLATE/dev-discussion.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/dev-discussion.md b/.github/ISSUE_TEMPLATE/dev-discussion.md index c18fb1422..69b0b97c5 100644 --- a/.github/ISSUE_TEMPLATE/dev-discussion.md +++ b/.github/ISSUE_TEMPLATE/dev-discussion.md @@ -6,12 +6,11 @@ labels: '' assignees: '' --- - ### Introcude the problem @@ -19,13 +18,12 @@ Normal Featrure request's should go to the Forum: https://forum.lvgl.io/c/featur A clear and concise description of the problem. --> -#### Examples and cases +### Examples and cases ### Suggested solution - From 6de31e9ffcd50488e80ebf0377b49fb1e861c600 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 8 Jan 2021 14:11:23 +0100 Subject: [PATCH 31/62] Update bug-report.md --- .github/ISSUE_TEMPLATE/bug-report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 92cffaff7..b3356e07f 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -1,6 +1,6 @@ --- name: Bug report -about: Create a report to help us improve +about: Create a bug report to help us improve title: '' labels: '' assignees: '' From d31304a1cc503d0024896a686051cd95c8526f31 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 8 Jan 2021 14:22:51 +0100 Subject: [PATCH 32/62] Create auto-close-if-no-template.yml --- .github/auto-close-if-no-template.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/auto-close-if-no-template.yml diff --git a/.github/auto-close-if-no-template.yml b/.github/auto-close-if-no-template.yml new file mode 100644 index 000000000..bfc9cd8cd --- /dev/null +++ b/.github/auto-close-if-no-template.yml @@ -0,0 +1,16 @@ +on: + issues: + types: [opened, edited] + +jobs: + auto_close_issues: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Automatically close issues that don't follow the issue template + uses: lucasbento/auto-close-issues@v1.0.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + issue-close-message: "@${issue.user.login}: hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template." # optional property + closed-issues-label: "🙁 Not following issue template" # optional property From cabbaf093ccb8c59ff38814977e36a953011f6f7 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 8 Jan 2021 14:24:24 +0100 Subject: [PATCH 33/62] Delete auto-close-if-no-template.yml --- .github/auto-close-if-no-template.yml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .github/auto-close-if-no-template.yml diff --git a/.github/auto-close-if-no-template.yml b/.github/auto-close-if-no-template.yml deleted file mode 100644 index bfc9cd8cd..000000000 --- a/.github/auto-close-if-no-template.yml +++ /dev/null @@ -1,16 +0,0 @@ -on: - issues: - types: [opened, edited] - -jobs: - auto_close_issues: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Automatically close issues that don't follow the issue template - uses: lucasbento/auto-close-issues@v1.0.2 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - issue-close-message: "@${issue.user.login}: hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template." # optional property - closed-issues-label: "🙁 Not following issue template" # optional property From ccc847e975405d78221dfdccec6eae1f1a4e7be9 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 8 Jan 2021 14:24:53 +0100 Subject: [PATCH 34/62] Create close-if-no-template.yml --- .github/workflows/close-if-no-template.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/close-if-no-template.yml diff --git a/.github/workflows/close-if-no-template.yml b/.github/workflows/close-if-no-template.yml new file mode 100644 index 000000000..bfc9cd8cd --- /dev/null +++ b/.github/workflows/close-if-no-template.yml @@ -0,0 +1,16 @@ +on: + issues: + types: [opened, edited] + +jobs: + auto_close_issues: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Automatically close issues that don't follow the issue template + uses: lucasbento/auto-close-issues@v1.0.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + issue-close-message: "@${issue.user.login}: hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template." # optional property + closed-issues-label: "🙁 Not following issue template" # optional property From 0e2c83813f9e01bea3d8bd86ae970f04774f51fb Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 8 Jan 2021 14:32:55 +0100 Subject: [PATCH 35/62] Create main.yml --- .github/workflows/main.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..83ea3b5b2 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,16 @@ +on: + issues: + types: [opened, edited] + +jobs: + auto_close_issues: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Automatically close issues that don't follow the issue template + uses: lucasbento/auto-close-issues@v1.0.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + issue-close-message: "@${issue.user.login}: hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template." # optional property + closed-issues-label: "not-template' From 636ea46a446c3456c6987230a0a222713d37a322 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 8 Jan 2021 14:33:49 +0100 Subject: [PATCH 36/62] Delete close-if-no-template.yml --- .github/workflows/close-if-no-template.yml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .github/workflows/close-if-no-template.yml diff --git a/.github/workflows/close-if-no-template.yml b/.github/workflows/close-if-no-template.yml deleted file mode 100644 index bfc9cd8cd..000000000 --- a/.github/workflows/close-if-no-template.yml +++ /dev/null @@ -1,16 +0,0 @@ -on: - issues: - types: [opened, edited] - -jobs: - auto_close_issues: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Automatically close issues that don't follow the issue template - uses: lucasbento/auto-close-issues@v1.0.2 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - issue-close-message: "@${issue.user.login}: hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template." # optional property - closed-issues-label: "🙁 Not following issue template" # optional property From 7d3a6c8de4303f69582a3939d36405a06b376ed0 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 8 Jan 2021 14:35:39 +0100 Subject: [PATCH 37/62] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 83ea3b5b2..9c4fc306a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,4 +13,4 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} issue-close-message: "@${issue.user.login}: hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template." # optional property - closed-issues-label: "not-template' + closed-issues-label: "not-template" From c988b686053d2284a0368ab1d7c6e6906086e25d Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Sat, 9 Jan 2021 15:25:07 -0500 Subject: [PATCH 38/62] fix(msgbox) use the animation time provided Fixes #2008 --- src/lv_widgets/lv_msgbox.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lv_widgets/lv_msgbox.c b/src/lv_widgets/lv_msgbox.c index daf5758d4..203c8d007 100644 --- a/src/lv_widgets/lv_msgbox.c +++ b/src/lv_widgets/lv_msgbox.c @@ -241,7 +241,6 @@ void lv_msgbox_set_anim_time(lv_obj_t * mbox, uint16_t anim_time) #if LV_USE_ANIMATION lv_msgbox_ext_t * ext = lv_obj_get_ext_attr(mbox); - anim_time = 0; ext->anim_time = anim_time; #else (void)mbox; From 0d52a60200ef17693fe96d8303085e813c51462a Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Sat, 9 Jan 2021 15:25:21 -0500 Subject: [PATCH 39/62] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22fe7c57a..3888658d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Bugfixes - fix(cpicker) fix division by zero - fix(dropdown) fix selecting options after the last one +* fix(msgbox) use the animation time provided ## v7.9.0 (Plann1d at 05.01.2020 From 4cff14f82394667b270c7225750176c008b882a6 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 11 Jan 2021 10:22:23 +0100 Subject: [PATCH 40/62] fix(gou_nxp_pxp): fix incorrent define name --- CHANGELOG.md | 3 ++- src/lv_draw/lv_draw_blend.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3888658d2..53a861370 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,8 @@ ### Bugfixes - fix(cpicker) fix division by zero - fix(dropdown) fix selecting options after the last one -* fix(msgbox) use the animation time provided +- fix(msgbox) use the animation time provided +- fix(gpu_nxp_pxp) fix incorrent define name ## v7.9.0 (Plann1d at 05.01.2020 diff --git a/src/lv_draw/lv_draw_blend.c b/src/lv_draw/lv_draw_blend.c index d5187815c..1b64346ca 100644 --- a/src/lv_draw/lv_draw_blend.c +++ b/src/lv_draw/lv_draw_blend.c @@ -757,7 +757,7 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col if(opa > LV_OPA_MAX) { #if LV_USE_GPU_NXP_PXP - if(lv_area_get_size(draw_area) >= GPU_NXP_PXP_BLIT_SIZE_LIMIT) { + if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_BLIT_SIZE_LIMIT) { lv_gpu_nxp_pxp_blit(disp_buf_first, disp_w, map_buf_first, map_w, draw_area_w, draw_area_h, opa); return; } From a2e9f03edae44e26f2f02a12d29ea5b63af9dc62 Mon Sep 17 00:00:00 2001 From: Julian Mitchell Date: Mon, 11 Jan 2021 01:26:24 -0800 Subject: [PATCH 41/62] Fix build when LV_USE_GPU_NXP_PXP is enabled (#1982) * Fix build when LV_USE_GPU_NXP_PXP is enabled * Allow fill_normal to use PXP --- src/lv_draw/lv_draw_blend.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lv_draw/lv_draw_blend.c b/src/lv_draw/lv_draw_blend.c index 1b64346ca..c10acffe2 100644 --- a/src/lv_draw/lv_draw_blend.c +++ b/src/lv_draw/lv_draw_blend.c @@ -70,7 +70,7 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co * STATIC VARIABLES **********************/ -#if LV_USE_GPU || LV_USE_GPU_STM32_DMA2D +#if (LV_USE_GPU || LV_USE_GPU_STM32_DMA2D) && (LV_USE_GPU_NXP_PXP == 0) && (LV_USE_GPU_NXP_VG_LITE == 0) LV_ATTRIBUTE_DMA static lv_color_t blend_buf[LV_HOR_RES_MAX]; #endif @@ -336,12 +336,7 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co /*Simple fill (maybe with opacity), no masking*/ if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) { if(opa > LV_OPA_MAX) { -#if LV_USE_GPU - if(disp->driver.gpu_fill_cb && lv_area_get_size(draw_area) > GPU_SIZE_LIMIT) { - disp->driver.gpu_fill_cb(&disp->driver, disp_buf, disp_w, draw_area, color); - return; - } -#elif LV_USE_GPU_NXP_PXP +#if LV_USE_GPU_NXP_PXP if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_FILL_SIZE_LIMIT) { lv_gpu_nxp_pxp_fill(disp_buf, disp_w, draw_area, color, opa); return; @@ -358,6 +353,11 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co lv_gpu_stm32_dma2d_fill(disp_buf_first, disp_w, color, draw_area_w, draw_area_h); return; } +#elif LV_USE_GPU + if(disp->driver.gpu_fill_cb && lv_area_get_size(draw_area) > GPU_SIZE_LIMIT) { + disp->driver.gpu_fill_cb(&disp->driver, disp_buf, disp_w, draw_area, color); + return; + } #endif /*Software rendering*/ for(y = 0; y < draw_area_h; y++) { From 923f989b391417e77f14aeb35311fe4a25749e8d Mon Sep 17 00:00:00 2001 From: udoudou <71432396+udoudou@users.noreply.github.com> Date: Mon, 11 Jan 2021 06:10:02 -0600 Subject: [PATCH 42/62] Fix(indev): Don't leave edit mode if there is only one object in the group (#1999) * Release v7.7.0 * Fix(indev): Don't leave edit mode if there is only one object in the group * Remove unnecessary judgment conditions Co-authored-by: Gabor Kiss-Vamosi Co-authored-by: Gabor Kiss-Vamosi --- src/lv_core/lv_indev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lv_core/lv_indev.c b/src/lv_core/lv_indev.c index 23866f769..f37c4495d 100644 --- a/src/lv_core/lv_indev.c +++ b/src/lv_core/lv_indev.c @@ -669,7 +669,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) /*On enter long press toggle edit mode.*/ if(editable) { /*Don't leave edit mode if there is only one object (nowhere to navigate)*/ - if(_lv_ll_is_empty(&g->obj_ll) == false) { + if (_lv_ll_get_len(&g->obj_ll) > 1 ) { lv_group_set_editing(g, lv_group_get_editing(g) ? false : true); /*Toggle edit mode on long press*/ } } @@ -735,7 +735,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) /*An object is being edited and the button is released. */ else if(g->editing) { /*Ignore long pressed enter release because it comes from mode switch*/ - if(!i->proc.long_pr_sent || _lv_ll_is_empty(&g->obj_ll)) { + if(!i->proc.long_pr_sent || _lv_ll_get_len(&g->obj_ll) <= 1) { indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_RELEASED, NULL); if(indev_reset_check(&i->proc)) return; From 52ba06a2284b058d6b418bede3115790d10fcf5a Mon Sep 17 00:00:00 2001 From: udoudou <71432396+udoudou@users.noreply.github.com> Date: Mon, 11 Jan 2021 06:10:54 -0600 Subject: [PATCH 43/62] Update CHANGELOG.md (#2011) Co-authored-by: Gabor Kiss-Vamosi --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53a861370..09c0a5ced 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ - fix(dropdown) fix selecting options after the last one - fix(msgbox) use the animation time provided - fix(gpu_nxp_pxp) fix incorrent define name +- fix(indev) don't leave edit mode if there is only one object in the group + ## v7.9.0 (Plann1d at 05.01.2020 From 81b13bf3b6219c3b1b05b05209a8449abf7ab84b Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 11 Jan 2021 07:28:00 -0600 Subject: [PATCH 44/62] Remove the double empty lines from all source files (#2009) * Run dos2unix for all source files * Remove the trail space from all source files * Remove the double empty lines from all source files --- .editorconfig | 1 - .github/ISSUE_TEMPLATE/bug-report.md | 12 +- .github/ISSUE_TEMPLATE/dev-discussion.md | 12 +- .github/auto-comment.yml | 12 +- .github/pull_request_template.md | 2 +- .github/stale.yml | 2 +- .github/workflows/build_micropython.yml | 3 +- CHANGELOG.md | 49 +- README.md | 28 +- docs/CODING_STYLE.md | 28 +- docs/CONTRIBUTING.md | 2 +- docs/ROADMAP.md | 4 +- examples/LVGL_Arduino.ino | 9 +- examples/porting/lv_port_disp_template.c | 12 +- examples/porting/lv_port_disp_template.h | 1 - examples/porting/lv_port_fs_template.c | 2 - examples/porting/lv_port_fs_template.h | 1 - examples/porting/lv_port_indev_template.c | 5 - examples/porting/lv_port_indev_template.h | 1 - lv_conf_template.h | 2 - lvgl.h | 4 +- lvgl.mk | 2 - scripts/built_in_font/built_in_font_gen.py | 46 +- scripts/built_in_font/generate_all.py | 2 - scripts/code-format.cfg | 3 +- scripts/cppcheck_run.sh | 1 - scripts/infer_run.sh | 3 +- scripts/lv_conf_checker.py | 7 +- scripts/release/com.py | 75 ++- scripts/release/dev.py | 18 +- scripts/release/main.py | 22 +- scripts/release/proj.py | 26 +- scripts/release/release.py | 114 +++-- src/lv_api_map.h | 10 - src/lv_conf_internal.h | 5 - src/lv_conf_kconfig.h | 1 - src/lv_core/lv_disp.c | 2 - src/lv_core/lv_disp.h | 2 - src/lv_core/lv_indev.c | 5 - src/lv_core/lv_indev.h | 1 - src/lv_core/lv_obj.c | 26 -- src/lv_core/lv_obj.h | 16 - src/lv_core/lv_obj_style_dec.h | 13 - src/lv_core/lv_refr.c | 1 - src/lv_core/lv_style.c | 4 - src/lv_core/lv_style.h | 3 - src/lv_draw/lv_draw_arc.c | 5 - src/lv_draw/lv_draw_blend.c | 10 - src/lv_draw/lv_draw_blend.h | 1 - src/lv_draw/lv_draw_img.c | 4 - src/lv_draw/lv_draw_img.h | 1 - src/lv_draw/lv_draw_label.c | 9 - src/lv_draw/lv_draw_line.c | 3 - src/lv_draw/lv_draw_line.h | 1 - src/lv_draw/lv_draw_mask.c | 15 - src/lv_draw/lv_draw_mask.h | 5 - src/lv_draw/lv_draw_rect.c | 8 - src/lv_draw/lv_draw_triangle.c | 1 - src/lv_draw/lv_img_buf.c | 4 - src/lv_draw/lv_img_buf.h | 6 - src/lv_draw/lv_img_decoder.c | 2 - src/lv_font/lv_font.h | 2 - .../lv_font_dejavu_16_persian_hebrew.c | 5 - src/lv_font/lv_font_fmt_txt.c | 2 - src/lv_font/lv_font_fmt_txt.h | 4 - src/lv_font/lv_font_loader.c | 6 - src/lv_font/lv_font_montserrat_10.c | 7 - src/lv_font/lv_font_montserrat_12.c | 5 - src/lv_font/lv_font_montserrat_12_subpx.c | 5 - src/lv_font/lv_font_montserrat_14.c | 5 - src/lv_font/lv_font_montserrat_16.c | 5 - src/lv_font/lv_font_montserrat_18.c | 5 - src/lv_font/lv_font_montserrat_20.c | 5 - src/lv_font/lv_font_montserrat_22.c | 5 - src/lv_font/lv_font_montserrat_24.c | 5 - src/lv_font/lv_font_montserrat_26.c | 5 - src/lv_font/lv_font_montserrat_28.c | 5 - .../lv_font_montserrat_28_compressed.c | 5 - src/lv_font/lv_font_montserrat_30.c | 5 - src/lv_font/lv_font_montserrat_32.c | 5 - src/lv_font/lv_font_montserrat_34.c | 5 - src/lv_font/lv_font_montserrat_36.c | 5 - src/lv_font/lv_font_montserrat_38.c | 5 - src/lv_font/lv_font_montserrat_40.c | 5 - src/lv_font/lv_font_montserrat_42.c | 5 - src/lv_font/lv_font_montserrat_44.c | 5 - src/lv_font/lv_font_montserrat_46.c | 5 - src/lv_font/lv_font_montserrat_48.c | 5 - src/lv_font/lv_font_montserrat_8.c | 7 - src/lv_font/lv_font_simsun_16_cjk.c | 5 - src/lv_font/lv_font_unscii_16.c | 8 - src/lv_font/lv_font_unscii_8.c | 8 - src/lv_font/lv_symbol_def.h | 6 - src/lv_gpu/lv_gpu_nxp_pxp.c | 4 - src/lv_gpu/lv_gpu_nxp_pxp.h | 4 - src/lv_gpu/lv_gpu_nxp_pxp_osa.c | 1 - src/lv_gpu/lv_gpu_nxp_vglite.c | 4 - src/lv_gpu/lv_gpu_stm32_dma2d.h | 2 - src/lv_hal/lv_hal_disp.c | 1 - src/lv_hal/lv_hal_disp.h | 1 - src/lv_hal/lv_hal_indev.h | 2 - src/lv_misc/lv_anim.c | 1 - src/lv_misc/lv_anim.h | 6 - src/lv_misc/lv_area.h | 4 - src/lv_misc/lv_bidi.c | 3 - src/lv_misc/lv_color.c | 2 - src/lv_misc/lv_color.h | 8 - src/lv_misc/lv_debug.c | 2 - src/lv_misc/lv_debug.h | 2 - src/lv_misc/lv_gc.h | 1 - src/lv_misc/lv_log.c | 1 - src/lv_misc/lv_math.c | 2 - src/lv_misc/lv_math.h | 2 - src/lv_misc/lv_mem.c | 10 - src/lv_misc/lv_mem.h | 2 - src/lv_misc/lv_printf.c | 20 - src/lv_misc/lv_printf.h | 3 - src/lv_misc/lv_task.c | 1 - src/lv_misc/lv_txt.c | 1 - src/lv_misc/lv_txt_ap.c | 2 - src/lv_misc/lv_types.h | 6 - src/lv_themes/lv_theme.c | 3 - src/lv_themes/lv_theme_empty.c | 2 - src/lv_themes/lv_theme_empty.h | 1 - src/lv_themes/lv_theme_material.c | 5 - src/lv_themes/lv_theme_mono.c | 17 - src/lv_themes/lv_theme_mono.h | 1 - src/lv_themes/lv_theme_template.c | 14 - src/lv_themes/lv_theme_template.h | 1 - src/lv_widgets/lv_arc.c | 6 - src/lv_widgets/lv_arc.h | 1 - src/lv_widgets/lv_bar.c | 3 - src/lv_widgets/lv_btnmatrix.c | 5 - src/lv_widgets/lv_calendar.c | 6 - src/lv_widgets/lv_canvas.c | 6 - src/lv_widgets/lv_canvas.h | 2 - src/lv_widgets/lv_chart.c | 8 - src/lv_widgets/lv_chart.h | 4 - src/lv_widgets/lv_checkbox.c | 2 - src/lv_widgets/lv_cont.c | 2 - src/lv_widgets/lv_cont.h | 1 - src/lv_widgets/lv_cpicker.c | 3 - src/lv_widgets/lv_cpicker.h | 3 - src/lv_widgets/lv_dropdown.c | 5 - src/lv_widgets/lv_dropdown.h | 1 - src/lv_widgets/lv_gauge.c | 2 - src/lv_widgets/lv_img.c | 3 - src/lv_widgets/lv_imgbtn.c | 1 - src/lv_widgets/lv_imgbtn.h | 1 - src/lv_widgets/lv_label.c | 3 - src/lv_widgets/lv_label.h | 1 - src/lv_widgets/lv_line.h | 1 - src/lv_widgets/lv_linemeter.c | 2 - src/lv_widgets/lv_linemeter.h | 1 - src/lv_widgets/lv_list.c | 3 - src/lv_widgets/lv_objmask.c | 6 - src/lv_widgets/lv_page.c | 4 - src/lv_widgets/lv_roller.c | 7 - src/lv_widgets/lv_roller.h | 3 - src/lv_widgets/lv_slider.c | 1 - src/lv_widgets/lv_spinbox.c | 4 - src/lv_widgets/lv_switch.c | 1 - src/lv_widgets/lv_table.c | 3 - src/lv_widgets/lv_tabview.c | 2 - src/lv_widgets/lv_textarea.c | 3 - src/lv_widgets/lv_tileview.c | 1 - src/lv_widgets/lv_win.c | 2 - src/lv_widgets/lv_win.h | 1 - tests/Makefile | 9 +- tests/build.py | 60 ++- tests/lv_test_assert.c | 9 - tests/lv_test_core/lv_test_core.c | 1 - tests/lv_test_core/lv_test_font_loader.c | 429 +++++++++--------- tests/lv_test_core/lv_test_font_loader.h | 77 ++-- tests/lv_test_core/lv_test_obj.c | 2 - tests/lv_test_core/lv_test_style.c | 13 - tests/lv_test_fonts/font_1.c | 5 - tests/lv_test_fonts/font_2.c | 5 - tests/lv_test_fonts/font_3.c | 7 - tests/lv_test_main.c | 2 - tests/lv_test_widgets/lv_test_label.c | 1 - 181 files changed, 515 insertions(+), 1201 deletions(-) diff --git a/.editorconfig b/.editorconfig index 28a8b011a..f22bee256 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,4 +4,3 @@ indent_size = 4 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true - diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index b3356e07f..9d9f05d8b 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -7,7 +7,7 @@ assignees: '' --- - @@ -18,13 +18,13 @@ Issues that don't use this template will be ignored and closed. - [ ] Reproduce the issue in a [Simulator](https://docs.lvgl.io/latest/en/html/get-started/pc-simulator.html) ### Describe the bug - ### To Reproduce ### Expected behavior - ### Screenshots or video diff --git a/.github/ISSUE_TEMPLATE/dev-discussion.md b/.github/ISSUE_TEMPLATE/dev-discussion.md index 69b0b97c5..017583012 100644 --- a/.github/ISSUE_TEMPLATE/dev-discussion.md +++ b/.github/ISSUE_TEMPLATE/dev-discussion.md @@ -6,7 +6,7 @@ labels: '' assignees: '' --- - ### Introcude the problem - ### Examples and cases - ### Suggested solution diff --git a/.github/auto-comment.yml b/.github/auto-comment.yml index 8ff0cf1e6..a141fb548 100644 --- a/.github/auto-comment.yml +++ b/.github/auto-comment.yml @@ -1,12 +1,12 @@ # Comment to a new issue. pullRequestOpened: | Thank you for raising your pull request. - - To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin). - + + To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin). + The text of DCO can be read here: https://developercertificate.org/ For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#developer-certification-of-origin-dco) site. - + By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. - - No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment. + + No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index c53888a24..e4e0cf8f9 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -5,4 +5,4 @@ A clear and concise description of what the bug or new feature is. ### Checkpoints - [ ] Follow the [styling guide](https://github.com/lvgl/lvgl/blob/master/docs/CODING_STYLE.md) - [ ] Update CHANGELOG.md -- [ ] Update the documentation +- [ ] Update the documentation diff --git a/.github/stale.yml b/.github/stale.yml index ea1179b76..c3d60ea60 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -7,7 +7,7 @@ exemptLabels: - architecture - pinned # Label to use when marking an issue as stale -staleLabel: stale +staleLabel: stale # Comment to post when marking an issue as stale. Set to `false` to disable markComment: > This issue or pull request has been automatically marked as stale because it has not had diff --git a/.github/workflows/build_micropython.yml b/.github/workflows/build_micropython.yml index 3f8e56b43..bbc33f7b5 100644 --- a/.github/workflows/build_micropython.yml +++ b/.github/workflows/build_micropython.yml @@ -37,6 +37,5 @@ jobs: echo "import gc,utime; utime.sleep(5); gc.collect(); - utime.sleep(5)" | + utime.sleep(5)" | ports/unix/micropython -i lib/lv_bindings/examples/advanced_demo.py - diff --git a/CHANGELOG.md b/CHANGELOG.md index 09c0a5ced..da1ab0b77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Bugfixes - fix(cpicker) fix division by zero -- fix(dropdown) fix selecting options after the last one +- fix(dropdown) fix selecting options after the last one - fix(msgbox) use the animation time provided - fix(gpu_nxp_pxp) fix incorrent define name - fix(indev) don't leave edit mode if there is only one object in the group @@ -17,7 +17,7 @@ - feat(img_cahce) allow disabling image cacheing - calendar: make get_day_of_week() public - Added support for Zephyr integration - + ### Bugfixes - fix(draw_rect) free buffer used for arabic processing - fix(win) arabic process the title of the window @@ -29,7 +29,6 @@ - fix(layout) stop layout after recursion threshold is reached - fix(gauge) fix redraw with image needle - ## v7.8.1 ### Bugfixes @@ -39,7 +38,7 @@ ## v7.8.0 (01.12.2020) ### New features -- make DMA2D non blocking +- make DMA2D non blocking - add unscii-16 built-in font - add KConfig - add lv_refr_get_fps_avg() @@ -56,7 +55,7 @@ - fix(slider) adjusting the left knob too with encoder - fix reference to LV_DRAW_BUF_MAX_NUM in lv_mem.c - fix(polygon draw) join adjacent points if they are on the same coordinate -- fix(linemeter) fix invalidation when setting new value +- fix(linemeter) fix invalidation when setting new value - fix(table) add missing invalidation when changeing cell type - refactor(roller) rename LV_ROLLER_MODE_INIFINITE -> LV_ROLLER_MODE_INFINITE @@ -68,7 +67,7 @@ - label: Repair calculate back `dot` character logical error which cause infinite loop. - fix(theme_material): remove the bottom border from tabview header - fix(imgbtn) guess a the closest availabe state with valid src -- fix(spinbox) update cursor position in lv_spinbox_set_step +- fix(spinbox) update cursor position in lv_spinbox_set_step ## v7.7.1 (03.11.2020) ### Bugfixes @@ -107,14 +106,13 @@ - Fix imgbtn image switching with empty style - Material theme: do not set the text font to allow easy global font change - ## v7.6.0 (22.09.2020) ### New features - Check whether any style property has changed on a state change to decide if any redraw is required ### Bugfixes -- Fix selection of options with non-ASCII letters in dropdown list +- Fix selection of options with non-ASCII letters in dropdown list - Fix font loader to support LV_FONT_FMT_TXT_LARGE ## v7.5.0 (15.09.2020) @@ -143,7 +141,7 @@ The main new features of v7.4 are run-time font loading, style caching and arc k - Add style caching to reduce acces time of properties with default value - arc: add set value by click feature - arc: add `LV_ARC_PART_KNOB` similarly to slider -- send gestures even if the the obejct was dragged. User can check dragging with `lv_indev_is_dragging(lv_indev_act())` in the event function. +- send gestures even if the the obejct was dragged. User can check dragging with `lv_indev_is_dragging(lv_indev_act())` in the event function. ### Bugfixes - Fix color bleeding on border drawing @@ -161,7 +159,7 @@ The main new features of v7.4 are run-time font loading, style caching and arc k - Rename `lv_chart_clear_serie` to `lv_chart_clear_series` and `lv_obj_align_origo` to `lv_obj_align_mid` - Add linemeter's mirror feature again - Fix text decor (udnerline strikethrough) with older versions of font converter -- Fix setting local style property multiple times +- Fix setting local style property multiple times - Add missing background drawing and radius handling to image button - Allow adding extra label to list buttons - Fix crash if `lv_table_set_col_cnt` is called before `lv_table_set_row_cnt` for the first time @@ -191,7 +189,6 @@ The main new features of v7.4 are run-time font loading, style caching and arc k - gauge: fix image needle drawing - fix using freed memory in _lv_style_list_remove_style - ## v7.2.0 (21.07.2020) ### New features @@ -214,7 +211,7 @@ The main new features of v7.4 are run-time font loading, style caching and arc k ### Bugfixes - `tileview` fix navigation when not screen sized -- Use 14px font by default to for better compatibility with smaller displays +- Use 14px font by default to for better compatibility with smaller displays - `linemeter` fix conversation of current value to "level" - Fix drawing on right border - Set the cursor image non clickable by default @@ -271,7 +268,7 @@ The main new features of v7.4 are run-time font loading, style caching and arc k ### Bugfixes - Make the Microptyhon working by adding the required variables as GC_ROOT -- Prefix some internal API functions with `_` to reduce the API of LVGL +- Prefix some internal API functions with `_` to reduce the API of LVGL - Fix built-in SimSun CJK font - Fix UTF-8 encoding when `LV_USE_ARABIC_PERSIAN_CHARS` is enabled - Fix DMA2D usage when 32 bit images directly blended @@ -295,30 +292,28 @@ The name of the project is changed to LVGL and the new website is on https://lvg LVGL remains free under the same conditions (MIT license) and a company is created to manage LVGL and offer services. - ### New drawing system -Complete rework of LVGL's draw engine to use "masks" for more advanced and higher quality graphical effects. +Complete rework of LVGL's draw engine to use "masks" for more advanced and higher quality graphical effects. A possible use-case of this system is to remove the overflowing content from the rounded edges. It also allows drawing perfectly anti-aliased circles, lines, and arcs. -Internally, the drawings happen by defining masks (such as rounded rectangle, line, angle). -When something is drawn the currently active masks can make some pixels transparent. -For example, rectangle borders are drawn by using 2 rectangle masks: one mask removes the inner part and another the outer part. +Internally, the drawings happen by defining masks (such as rounded rectangle, line, angle). +When something is drawn the currently active masks can make some pixels transparent. +For example, rectangle borders are drawn by using 2 rectangle masks: one mask removes the inner part and another the outer part. The API in this regard remained the same but some new functions were added: - `lv_img_set_zoom`: set image object's zoom factor - `lv_img_set_angle`: set image object's angle without using canvas - `lv_img_set_pivot`: set the pivot point of rotation - The new drawing engine brought new drawing features too. They are highlighted in the "style" section. ### New style system -The old style system is replaced with a new more flexible and lightweighted one. -It uses an approach similar to CSS: support cascading styles, inheriting properties and local style properties per object. -As part of these updates, a lot of objects were reworked and the APIs have been changed. +The old style system is replaced with a new more flexible and lightweighted one. +It uses an approach similar to CSS: support cascading styles, inheriting properties and local style properties per object. +As part of these updates, a lot of objects were reworked and the APIs have been changed. - more shadows options: *offset* and *spread* -- gradient stop position to shift the gradient area and horizontal gradient +- gradient stop position to shift the gradient area and horizontal gradient - `LV_BLEND_MODE_NORMAL/ADDITIVE/SUBTRACTIVE` blending modes - *clip corner*: crop the content on the rounded corners - *text underline* and *strikethrough* @@ -362,16 +357,16 @@ The following object types are renamed: - `linemeter`, `gauge`: can have background if the related style properties are set. Padding makes the scale/lines smaller. scale_border_width and scale_end_border_width allow to draw an arc on the outer part of the scale lines. - `gauge`: `lv_gauge_set_needle_img` allows use image as needle - `canvas`: allow drawing to true color alpha and alpha only canvas, add `lv_canvas_blur_hor/ver` and rename `lv_canvas_rotate` to `lv_canvas_transform` -- `textarea`: If available in the font use bullet (`U+2022`) character in text area password +- `textarea`: If available in the font use bullet (`U+2022`) character in text area password ### New object types -- `lv_objmask`: masks can be added to it. The children will be masked accordingly. +- `lv_objmask`: masks can be added to it. The children will be masked accordingly. ### Others - Change the built-in fonts to [Montserrat](https://fonts.google.com/specimen/Montserrat) and add built-in fonts from 12 px to 48 px for every 2nd size. - Add example CJK and Arabic/Persian/Hebrew built-in font - Add ° and "bullet" to the built-in fonts -- Add Arabic/Persian script support: change the character according to its position in the text. +- Add Arabic/Persian script support: change the character according to its position in the text. - Add `playback_time` to animations. - Add `repeat_count` to animations instead of the current "repeat forever". - Replace `LV_LAYOUT_PRETTY` with `LV_LAYOUT_PRETTY_TOP/MID/BOTTOM` @@ -388,4 +383,4 @@ The following object types are renamed: - First and foremost, create a new `lv_conf.h` based on `lv_conf_template.h`. - To try the new version it suggested using a simulator project and see the examples. - If you have a running project, the most difficult part of the migration is updating to the new style system. Unfortunately, there is no better way than manually updating to the new format. -- The other parts are mainly minor renames and refactoring as described above. +- The other parts are mainly minor renames and refactoring as described above. diff --git a/README.md b/README.md index 1eff0d1c8..7324fa9f1 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ -

LVGL - Light and Versatile Graphics Library

+

LVGL - Light and Versatile Graphics Library

-LVGL provides everything you need to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. +LVGL provides everything you need to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint.

-Website · -Online demo · -Nightly demos · -Docs · +Website · +Online demo · +Nightly demos · +Docs · Forum

@@ -53,37 +53,37 @@ Basically, every modern controller (which is able to drive a display) is suitabl > 16 MHz > 48 MHz - + Flash/ROM > 64 kB > 180 kB - + Static RAM > 2 kB > 4 kB - + Stack > 2 kB > 8 kB - + Heap > 2 kB > 8 kB - + Display buffer > 1 × hor. res. pixels > 10 × hor. res. pixels - + Compiler C99 or newer @@ -114,9 +114,9 @@ This list shows the recommended way of learning the library: 7. Read the [Overview](https://docs.lvgl.io/latest/en/html/overview/index.html) page to get a better understanding of the library (2-3 hours) 8. Check the documentation of the [Widgets](https://docs.lvgl.io/latest/en/html/widgets/index.html) to see their features and usage 9. If you have questions go to the [Forum](http://forum.lvgl.io/) -10. Read the [Contributing](https://docs.lvgl.io/latest/en/html/contributing/index.html) guide to see how you can help to improve LVGL (15 minutes) +10. Read the [Contributing](https://docs.lvgl.io/latest/en/html/contributing/index.html) guide to see how you can help to improve LVGL (15 minutes) -## Examples +## Examples For more examples see the [lv_examples](https://github.com/lvgl/lv_examples) repository. diff --git a/docs/CODING_STYLE.md b/docs/CODING_STYLE.md index 1f7b590e9..46bc63757 100644 --- a/docs/CODING_STYLE.md +++ b/docs/CODING_STYLE.md @@ -11,19 +11,19 @@ Use [lv_misc/lv_templ.c](https://github.com/lvgl/lvgl/blob/master/src/lv_misc/lv * starts with *lv* * followed by module name: *btn*, *label*, *style* etc. * followed by the action (for functions): *set*, *get*, *refr* etc. - * closed with the subject: *name*, *size*, *state* etc. + * closed with the subject: *name*, *size*, *state* etc. * Typedefs * prefer `typedef struct` and `typedef enum` instead of `struct name` and `enum name` * always end `typedef struct` and `typedef enum` type names with `_t` * Abbreviations: - * Only words longer or equal than 6 characters can be abbreviated. + * Only words longer or equal than 6 characters can be abbreviated. * Abbreviate only if it makes the word at least half as long - * Use only very straightforward and well-known abbreviations (e.g. pos: position, def: default, btn: button) + * Use only very straightforward and well-known abbreviations (e.g. pos: position, def: default, btn: button) ## Coding guide * Functions: - * Try to write function shorter than is 50 lines - * Always shorter than 200 lines (except very straightforwards) + * Try to write function shorter than is 50 lines + * Always shorter than 200 lines (except very straightforwards) * Variables: * One line, one declaration (BAD: char x, y;) * Use `` (*uint8_t*, *int32_t* etc) @@ -41,16 +41,16 @@ Before every function have a comment like this: * @param obj pointer to an object * @return pointer to a screen */ -lv_obj_t * lv_obj_get_scr(lv_obj_t * obj); +lv_obj_t * lv_obj_get_scr(lv_obj_t * obj); ``` Always use `/* Something */` format and NOT `//Something` -Write readable code to avoid descriptive comments like: -`x++; /* Add 1 to x */`. +Write readable code to avoid descriptive comments like: +`x++; /* Add 1 to x */`. The code should show clearly what you are doing. -You should write **why** have you done this: +You should write **why** have you done this: `x++; /*Because of closing '\0' of the string */` Short "code summaries" of a few lines are accepted. E.g. `/*Calculate the new coordinates*/` @@ -67,19 +67,19 @@ Here is example to show bracket placing and using of white spaces: */ void lv_label_set_text(lv_obj_t * label, const char * text) { /* Main brackets of functions in new line*/ - + if(label == NULL) return; /*No bracket only if the command is inline with the if statement*/ - + lv_obj_inv(label); - + lv_label_ext_t * ext = lv_obj_get_ext(label); /*Comment before a section */ if(text == ext->txt || text == NULL) { /*Bracket of statements start inline*/ lv_label_refr_text(label); - return; + return; } - + ... } ``` diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 1a3941f42..553cfa51f 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,5 +1,5 @@ # Contributing to LVGL -Thank you for considering contributing to LVGL. +Thank you for considering contributing to LVGL. For a detailed description of contribution opportunities, please visit the [Contributing](https://docs.lvgl.io/latest/en/html/contributing/index.html) section of the documentation. diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index efddec095..93d284678 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -1,6 +1,6 @@ # Roadmap -This is a summary for thenew fatures of the major releases and a collection of ideas. +This is a summary for thenew fatures of the major releases and a collection of ideas. This list indicates only the current intention and can be changed. @@ -47,8 +47,6 @@ Planned to November/December 2020 - Make image transformations more versatile - Allow snapshoting object to tranfrom them to images - - ## Ideas - lv_mem_alloc_aligned(size, align) - Text node. See [#1701](https://github.com/lvgl/lvgl/issues/1701#issuecomment-699479408) diff --git a/examples/LVGL_Arduino.ino b/examples/LVGL_Arduino.ino index 658fd9d8e..6e76e15dc 100644 --- a/examples/LVGL_Arduino.ino +++ b/examples/LVGL_Arduino.ino @@ -40,14 +40,14 @@ bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) data->state = LV_INDEV_STATE_REL; } else { data->state = LV_INDEV_STATE_PR; - + /*Set the coordinates*/ data->point.x = touchX; data->point.y = touchY; - + Serial.print("Data x"); Serial.println(touchX); - + Serial.print("Data y"); Serial.println(touchY); } @@ -70,7 +70,7 @@ void setup() uint16_t calData[5] = { 275, 3620, 264, 3532, 1 }; tft.setTouch(calData); - + lv_disp_buf_init(&disp_buf, buf, NULL, LV_HOR_RES_MAX * 10); /*Initialize the display*/ @@ -94,7 +94,6 @@ void setup() lv_ex_btn_1(); } - void loop() { diff --git a/examples/porting/lv_port_disp_template.c b/examples/porting/lv_port_disp_template.c index 7bb9c3d70..7d8b449d9 100644 --- a/examples/porting/lv_port_disp_template.c +++ b/examples/porting/lv_port_disp_template.c @@ -59,16 +59,16 @@ void lv_port_disp_init(void) * The buffer has to be greater than 1 display row * * There are three buffering configurations: - * 1. Create ONE buffer with some rows: + * 1. Create ONE buffer with some rows: * LVGL will draw the display's content here and writes it to your display - * - * 2. Create TWO buffer with some rows: + * + * 2. Create TWO buffer with some rows: * LVGL will draw the display's content to a buffer and writes it your display. * You should use DMA to write the buffer's content to the display. * It will enable LVGL to draw the next part of the screen to the other buffer while * the data is being sent form the first buffer. It makes rendering and flushing parallel. - * - * 3. Create TWO screen-sized buffer: + * + * 3. Create TWO screen-sized buffer: * Similar to 2) but the buffer have to be screen sized. When LVGL is ready it will give the * whole frame to display. This way you only need to change the frame buffer's address instead of * copying the pixels. @@ -91,7 +91,6 @@ void lv_port_disp_init(void) static lv_color_t draw_buf_3_1[LV_HOR_RES_MAX * LV_VER_RES_MAX]; /*An other screen sized buffer*/ lv_disp_buf_init(&draw_buf_dsc_3, draw_buf_3_1, draw_buf_3_2, LV_HOR_RES_MAX * LV_VER_RES_MAX); /*Initialize the display buffer*/ - /*----------------------------------- * Register the display in LVGL *----------------------------------*/ @@ -157,7 +156,6 @@ static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_colo lv_disp_flush_ready(disp_drv); } - /*OPTIONAL: GPU INTERFACE*/ #if LV_USE_GPU diff --git a/examples/porting/lv_port_disp_template.h b/examples/porting/lv_port_disp_template.h index eeca802b0..93e51cc26 100644 --- a/examples/porting/lv_port_disp_template.h +++ b/examples/porting/lv_port_disp_template.h @@ -34,7 +34,6 @@ extern "C" { * MACROS **********************/ - #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/examples/porting/lv_port_fs_template.c b/examples/porting/lv_port_fs_template.c index 27c1ca903..6b376042c 100644 --- a/examples/porting/lv_port_fs_template.c +++ b/examples/porting/lv_port_fs_template.c @@ -36,7 +36,6 @@ typedef struct { uint32_t dummy2; }dir_t; - /********************** * STATIC PROTOTYPES **********************/ @@ -157,7 +156,6 @@ static lv_fs_res_t fs_open (lv_fs_drv_t * drv, void * file_p, const char * path, return res; } - /** * Close an opened file * @param drv pointer to a driver where this function belongs diff --git a/examples/porting/lv_port_fs_template.h b/examples/porting/lv_port_fs_template.h index 7db06f658..d18f736f6 100644 --- a/examples/porting/lv_port_fs_template.h +++ b/examples/porting/lv_port_fs_template.h @@ -34,7 +34,6 @@ extern "C" { * MACROS **********************/ - #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/examples/porting/lv_port_indev_template.c b/examples/porting/lv_port_indev_template.c index 1910b74ee..98788da43 100644 --- a/examples/porting/lv_port_indev_template.c +++ b/examples/porting/lv_port_indev_template.c @@ -79,7 +79,6 @@ void lv_port_indev_init(void) * You should shape them according to your hardware */ - lv_indev_drv_t indev_drv; /*------------------ @@ -174,8 +173,6 @@ void lv_port_indev_init(void) * STATIC FUNCTIONS **********************/ - - /*------------------ * Touchpad * -----------------*/ @@ -225,7 +222,6 @@ static void touchpad_get_xy(lv_coord_t * x, lv_coord_t * y) (*y) = 0; } - /*------------------ * Mouse * -----------------*/ @@ -361,7 +357,6 @@ static void encoder_handler(void) encoder_state = LV_INDEV_STATE_REL; } - /*------------------ * Button * -----------------*/ diff --git a/examples/porting/lv_port_indev_template.h b/examples/porting/lv_port_indev_template.h index ca0274e80..b235d3093 100644 --- a/examples/porting/lv_port_indev_template.h +++ b/examples/porting/lv_port_indev_template.h @@ -35,7 +35,6 @@ extern "C" { * MACROS **********************/ - #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/lv_conf_template.h b/lv_conf_template.h index 38e4bef06..e53e97859 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -134,7 +134,6 @@ typedef int16_t lv_coord_t; * Time between `LV_EVENT_LONG_PRESSED_REPEAT */ #define LV_INDEV_DEF_LONG_PRESS_REP_TIME 100 - /* Gesture threshold in pixels */ #define LV_INDEV_DEF_GESTURE_LIMIT 50 @@ -731,7 +730,6 @@ typedef void * lv_obj_user_data_t; # define LV_TABLE_CELL_STYLE_CNT 4 #endif - /*Tab (dependencies: lv_page, lv_btnm)*/ #define LV_USE_TABVIEW 1 # if LV_USE_TABVIEW != 0 diff --git a/lvgl.h b/lvgl.h index 8cfe3f4eb..283013150 100644 --- a/lvgl.h +++ b/lvgl.h @@ -2,7 +2,7 @@ * @file lvgl.h * Include all LittleV GL related headers */ - + #ifndef LVGL_H #define LVGL_H @@ -10,7 +10,6 @@ extern "C" { #endif - /*************************** * CURRENT VERSION OF LVGL ***************************/ @@ -121,7 +120,6 @@ extern "C" { * */ #define LV_VERSION_CHECK(x,y,z) (x == LVGL_VERSION_MAJOR && (y < LVGL_VERSION_MINOR || (y == LVGL_VERSION_MINOR && z <= LVGL_VERSION_PATCH))) - #ifdef __cplusplus } #endif diff --git a/lvgl.mk b/lvgl.mk index bbea98d35..1479c217a 100644 --- a/lvgl.mk +++ b/lvgl.mk @@ -6,5 +6,3 @@ include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_misc/lv_misc.mk include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_themes/lv_themes.mk include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_draw/lv_draw.mk include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_gpu/lv_gpu.mk - - diff --git a/scripts/built_in_font/built_in_font_gen.py b/scripts/built_in_font/built_in_font_gen.py index b3206506f..1a0526464 100755 --- a/scripts/built_in_font/built_in_font_gen.py +++ b/scripts/built_in_font/built_in_font_gen.py @@ -7,40 +7,40 @@ import sys parser = argparse.ArgumentParser(description="""Create fonts for LittelvGL including the built-in symbols. lv_font_conv needs to be installed. See https://github.com/littlevgl/lv_font_conv Example: python built_in_font_gen.py --size 16 -o lv_font_roboto_16.c --bpp 4 -r 0x20-0x7F""", formatter_class=RawTextHelpFormatter) -parser.add_argument('-s', '--size', - type=int, - metavar = 'px', - nargs='?', +parser.add_argument('-s', '--size', + type=int, + metavar = 'px', + nargs='?', help='Size of the font in px') -parser.add_argument('--bpp', - type=int, - metavar = '1,2,4', - nargs='?', +parser.add_argument('--bpp', + type=int, + metavar = '1,2,4', + nargs='?', help='Bit per pixel') -parser.add_argument('-r', '--range', - nargs='+', - metavar = 'start-end', - default=['0x20-0x7F,0xB0,0x2022'], +parser.add_argument('-r', '--range', + nargs='+', + metavar = 'start-end', + default=['0x20-0x7F,0xB0,0x2022'], help='Ranges and/or characters to include. Default is 0x20-7F (ASCII). E.g. -r 0x20-0x7F, 0x200, 324') -parser.add_argument('--symbols', - nargs='+', - metavar = 'sym', +parser.add_argument('--symbols', + nargs='+', + metavar = 'sym', default=[''], help=u'Symbols to include. E.g. -s ÁÉŐ'.encode('utf-8')) -parser.add_argument('--font', - metavar = 'file', - nargs='?', - default='Montserrat-Medium.ttf', +parser.add_argument('--font', + metavar = 'file', + nargs='?', + default='Montserrat-Medium.ttf', help='A TTF or WOFF file') -parser.add_argument('-o', '--output', - nargs='?', - metavar='file', +parser.add_argument('-o', '--output', + nargs='?', + metavar='file', help='Output file name. E.g. my_font_20.c') parser.add_argument('--compressed', action='store_true', help='Compress the bitmaps') parser.add_argument('--subpx', action='store_true', help='3 times wider letters for sub pixel rendering') - + args = parser.parse_args() if args.compressed == False: diff --git a/scripts/built_in_font/generate_all.py b/scripts/built_in_font/generate_all.py index 348b95120..dab551f67 100755 --- a/scripts/built_in_font/generate_all.py +++ b/scripts/built_in_font/generate_all.py @@ -101,5 +101,3 @@ os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_ print("\nGenerating 16 px Hebrew, Persian") os.system("./built_in_font_gen.py --size 16 -o lv_font_dejavu_16_persian_hebrew.c --bpp 4 --font DejaVuSans.ttf -r 0x20-0x7f,0x5d0-0x5ea,0x600-0x6FF,0xFB50-0xFDFF,0xFE70-0xFEFF") os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_dejavu_16_persian_hebrew.c') - - diff --git a/scripts/code-format.cfg b/scripts/code-format.cfg index 9b0a35e17..0d786927c 100644 --- a/scripts/code-format.cfg +++ b/scripts/code-format.cfg @@ -23,7 +23,7 @@ --suffix=none --preserve-date --formatted ---exclude=lv_conf_internal.h +--exclude=lv_conf_internal.h --exclude=../src/lv_font/lv_font_montserrat_12.c --exclude=../src/lv_font/lv_font_montserrat_14.c --exclude=../src/lv_font/lv_font_montserrat_16.c @@ -47,4 +47,3 @@ --exclude=../src/lv_font/lv_font_montserrat_28_compressed.c --exclude=../src/lv_font/lv_font_simsun_16_cjk.c --exclude=../src/lv_font/lv_font_dejavu_16_persian_hebrew.c - diff --git a/scripts/cppcheck_run.sh b/scripts/cppcheck_run.sh index 98e594cb9..3916c7672 100755 --- a/scripts/cppcheck_run.sh +++ b/scripts/cppcheck_run.sh @@ -1,2 +1 @@ cppcheck -j8 --template="{severity}\t{file}:{line}\t{id}: {message}" --enable=all ../src/ --output-file=cppcheck_res.txt --suppress=unusedFunction --suppress=preprocessorErrorDirective --force - diff --git a/scripts/infer_run.sh b/scripts/infer_run.sh index 2d33d5b84..f1d12235a 100755 --- a/scripts/infer_run.sh +++ b/scripts/infer_run.sh @@ -1,10 +1,9 @@ # https://github.com/facebook/infer # -# Install: +# Install: # VERSION=0.17.0; \ # curl -sSL "https://github.com/facebook/infer/releases/download/v$VERSION/infer-linux64-v$VERSION.tar.xz" \ # | sudo tar -C /opt -xJ && \ # sudoln -s "/opt/infer-linux64-v$VERSION/bin/infer" /usr/local/bin/infer - infer run -- make -j8 diff --git a/scripts/lv_conf_checker.py b/scripts/lv_conf_checker.py index 357c528a3..d52004208 100755 --- a/scripts/lv_conf_checker.py +++ b/scripts/lv_conf_checker.py @@ -4,7 +4,6 @@ Generates a checker file for lv_conf.h from lv_conf_template.h define all the not defined values ''' - import sys import re @@ -15,7 +14,6 @@ if sys.version_info < (3,6,0): fin = open("../lv_conf_template.h", "r") fout = open("../src/lv_conf_internal.h", "w") - fout.write( '''/** * GENERATED FILE, DO NOT EDIT IT! @@ -82,7 +80,7 @@ for i in fin.read().splitlines(): if '/*--END OF LV_CONF_H--*/' in i: break r = re.search(r'^ *# *define ([^\s]+).*$', i) - + #ifndef LV_USE_BTN /*Only if not defined in lv_conf.h*/ # ifdef CONFIG_LV_USE_BTN /*Use KConfig value if set*/ # define LV_USE_BTN CONFIG_LV_USE_BTN @@ -90,7 +88,7 @@ for i in fin.read().splitlines(): # define LV_USE_BTN 1 /*Use default value*/ # endif #endif - + if r: line = re.sub('\(.*?\)', '', r[1], 1) #remove parentheses from macros dr = re.sub('.*# *define', '', i, 1) @@ -110,7 +108,6 @@ for i in fin.read().splitlines(): else: fout.write(f'{i}\n') - fout.write( ''' diff --git a/scripts/release/com.py b/scripts/release/com.py index bb3fd7ddd..4126c354d 100755 --- a/scripts/release/com.py +++ b/scripts/release/com.py @@ -10,32 +10,32 @@ import com def cmd(c, ask_on_err = True): print("\n" + c) - r = os.system(c) + r = os.system(c) if r: print("### Error: " + str(r)) - if ask_on_err: + if ask_on_err: input("Press Enter to continue exectution...") - -def define_set(fn, name, value): + +def define_set(fn, name, value): print("In " + fn + " set " + name + " to " + value) - - new_content = "" + + new_content = "" s = r'^ *# *define +' + str(name).rstrip() + ' +' - + f = open(fn, "r") for i in f.read().splitlines(): r = re.search(s, i) - if r: + if r: d = i.split("define") - i = d[0] + "define " + name + " " + value + i = d[0] + "define " + name + " " + value new_content += i + '\n' - + f.close() - + f = open(fn, "w") f.write(new_content) f.close() - + def ver_format(ver): s = "v" + str(ver[0]) + "." + str(ver[1]) + "." + str(ver[2]) if(ver[3] != ""): s = s + "-" + ver[3] @@ -43,69 +43,68 @@ def ver_format(ver): def get_lvgl_version(br): print("Get LVGL's version") - - ver = [0, 0, 0, ""] - + + ver = [0, 0, 0, ""] + os.chdir("./lvgl") - + com.cmd("git checkout " + br) - + f = open("./lvgl.h", "r") - + lastNum = re.compile(r'(?:[^\d]*(\d+)[^\d]*)+') for i in f.read().splitlines(): r = re.search(r'^#define LVGL_VERSION_MAJOR ', i) - if r: + if r: m = lastNum.search(i) if m: ver[0] = m.group(1) r = re.search(r'^#define LVGL_VERSION_MINOR ', i) - if r: + if r: m = lastNum.search(i) if m: ver[1] = m.group(1) - + r = re.search(r'^#define LVGL_VERSION_PATCH ', i) - if r: + if r: m = lastNum.search(i) if m: ver[2] = m.group(1) - + f.close() - + com.cmd("git checkout master") - + os.chdir("../") return ver - + def push(c): cmd("git push " + c) - + def update_version(ver): ver_str = ver_format(ver) ver_num = ver[0] + "." + ver[1] + "." + ver[2] - + templ = fnmatch.filter(os.listdir('.'), '*_templ*.h') - + if len(templ) > 0 and templ[0]: print("Updating version in " + templ[0]) cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+.*/"+ "v" + ver_num + "/' " + templ[0]) - if os.path.exists("library.json"): + if os.path.exists("library.json"): print("Updating version in library.json") cmd("sed -i -r 's/[0-9]+\.[0-9]+\.[0-9]+/"+ ver_num +"/' library.json") - - if path.exists("library.properties"): + + if path.exists("library.properties"): print("Updating version in library.properties") cmd("sed -i -r 's/version=[0-9]+\.[0-9]+\.[0-9]+/"+ "version=" + ver_num + "/' library.properties") - - if path.exists("conf.py"): - cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + ver_str + "'/\" conf.py") - + + if path.exists("conf.py"): + cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + ver_str + "'/\" conf.py") + if path.exists("Kconfig"): cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + ver_str + "'/\" Kconfig") - if path.exists("lvgl.h"): + if path.exists("lvgl.h"): define_set("./lvgl.h", "LVGL_VERSION_MAJOR", str(ver[0])) define_set("./lvgl.h", "LVGL_VERSION_MINOR", str(ver[1])) define_set("./lvgl.h", "LVGL_VERSION_PATCH", str(ver[2])) define_set("./lvgl.h", "LVGL_VERSION_INFO", "\"" + ver[3] + "\"") - diff --git a/scripts/release/dev.py b/scripts/release/dev.py index 38c342e31..7b53fe530 100755 --- a/scripts/release/dev.py +++ b/scripts/release/dev.py @@ -15,7 +15,7 @@ def lvgl_update_ver(ver, br): com.cmd("git commit -am 'Update " + br + " version'") com.push("origin " + br) com.cmd("git checkout master") - + os.chdir("../") def docs_update_ver(ver, br): @@ -25,10 +25,9 @@ def docs_update_ver(ver, br): com.cmd("git commit -am 'Update " + br + " version'") com.push("origin " + br) com.cmd("git checkout master --") - + os.chdir("../") - - + def merge_dev_to_master(): os.chdir("./lvgl") com.cmd("git checkout master") @@ -42,8 +41,7 @@ def merge_dev_to_master(): com.cmd("git merge dev -X theirs --no-edit;") com.push("origin latest") os.chdir("../") - - + def make(mode): if(mode == "bugfix"): ver = com.get_lvgl_version("master") @@ -58,14 +56,14 @@ def make(mode): if(mode == "major"): ver[0] = str(int(ver[0]) + 1) ver[1] = '0' - ver[2] = '0' + ver[2] = '0' if(mode == "minor"): ver[1] = str(int(ver[1]) + 1) - ver[2] = '0' - + ver[2] = '0' + lvgl_update_ver(ver, "dev") docs_update_ver(ver, "dev") - + if __name__ == '__main__': if(len(sys.argv) != 2): print("Missing argument. Usage ./dev.py major | minor | bugfix") diff --git a/scripts/release/main.py b/scripts/release/main.py index a96d11fc3..d22d32234 100755 --- a/scripts/release/main.py +++ b/scripts/release/main.py @@ -15,7 +15,7 @@ proj_list = [ "lv_sim_eclipse_sdl", "lv_sim_emscripten"] def upstream(repo): return upstream_org_url + repo + ".git" - + def clone(repo): com.cmd("git clone --recurse-submodules " + upstream(repo)) os.chdir("./" + repo) @@ -23,7 +23,7 @@ def clone(repo): com.cmd("git remote update origin --prune") com.cmd("git pull origin --tags") os.chdir("..") - + def clone_repos(): com.cmd("rm -fr " + workdir) com.cmd("mkdir " + workdir) @@ -36,30 +36,30 @@ def clone_repos(): for p in proj_list: clone(p) - + def cleanup(): os.chdir("../") com.cmd("rm -fr " + workdir) if __name__ == '__main__': prepare_type = ['major', 'minor', 'bugfix'] - dev_prepare = 'minor' + dev_prepare = 'minor' # if(len(sys.argv) != 2): # print("Missing argument. Usage ./release.py bugfix | minor | major") # print("Use minor by deafult") -# else: +# else: # dev_prepare = sys.argv[1] - - if not (dev_prepare in prepare_type): - print("Invalid argument. Usage ./release.py bugfix | minor | major") + + if not (dev_prepare in prepare_type): + print("Invalid argument. Usage ./release.py bugfix | minor | major") exit(1) - + #os.chdir(workdir) clone_repos() release.make() for p in proj_list: proj.make(p, True) - - dev.make(dev_prepare) + + dev.make(dev_prepare) #cleanup() diff --git a/scripts/release/proj.py b/scripts/release/proj.py index db02cd537..732c200e5 100755 --- a/scripts/release/proj.py +++ b/scripts/release/proj.py @@ -7,7 +7,6 @@ import re import subprocess import com - def make(repo_path, auto_push = False): os.chdir("./" + repo_path) com.cmd('git checkout master') @@ -15,34 +14,33 @@ def make(repo_path, auto_push = False): os.chdir("./lvgl") com.cmd("git checkout master") com.cmd("git pull origin --tags") - - out = subprocess.Popen(['git', 'tag', '--sort=-creatordate'], - stdout=subprocess.PIPE, + + out = subprocess.Popen(['git', 'tag', '--sort=-creatordate'], + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout,stderr = out.communicate() - + ver_str = stdout.decode("utf-8").split('\n')[0] release_br = ver_str[1:] #trim "v" release_br = release_br.split('.')[0] # get the first number release_br = "release/v" + release_br - + com.cmd("git checkout " + release_br + "; git pull origin " + release_br) - + os.chdir("..") - + com.cmd("cp -f lvgl/lv_conf_template.h lv_conf.h") com.cmd("sed -i -r 's/#if 0/#if 1/' lv_conf.h") # Enable lv_conf.h with open("confdef.txt") as f: for line in f: (key, val) = line.rstrip().split('\t') - com.define_set("lv_conf.h", str(key), str(val)) + com.define_set("lv_conf.h", str(key), str(val)) - - if os.path.exists("lv_examples"): + if os.path.exists("lv_examples"): print("Upadte lv_examples"); com.cmd("cd lv_examples; git co " + release_br + "; git pull origin " + release_br) - - if os.path.exists("lv_drivers"): + + if os.path.exists("lv_drivers"): print("upadte lv_drivers"); com.cmd("cd lv_drivers " + release_br + "; git pull origin " + release_br) @@ -53,7 +51,7 @@ def make(repo_path, auto_push = False): if auto_push: com.push("origin --tags") com.push("origin master") - + os.chdir("../") if __name__ == '__main__': diff --git a/scripts/release/release.py b/scripts/release/release.py index e45acbe4b..fb7b7e7a8 100755 --- a/scripts/release/release.py +++ b/scripts/release/release.py @@ -8,21 +8,21 @@ import com import re def update_release_branch(release_br, master_br = "master"): - com.cmd("git checkout " + release_br) - com.cmd("git pull origin " + release_br) - com.cmd("git merge "+ master_br +" -X ours"); - com.push("origin " + release_br); - com.cmd("git checkout master"); - + com.cmd("git checkout " + release_br) + com.cmd("git pull origin " + release_br) + com.cmd("git merge "+ master_br +" -X ours"); + com.push("origin " + release_br); + com.cmd("git checkout master"); + def lvgl_release(ver): print("Release lvgl") - + ver_str = com.ver_format(ver) release_br = "release/v" + str(ver[0]) - + os.chdir("./lvgl") com.define_set("./lvgl.h", "LVGL_VERSION_INFO", '\"\"') - + # Run some scripts os.chdir("./scripts") com.cmd("./code-format.sh") @@ -35,132 +35,130 @@ def lvgl_release(ver): #update CHANGLELOG new_content = "" f = open("./CHANGELOG.md", "r") - + release_note = "" - note_state = 0 + note_state = 0 for i in f.read().splitlines(): if note_state == 0: r = re.search(r'^## ' + ver_str, i) - if r: - i = i.replace("planned on ", "") + if r: + i = i.replace("planned on ", "") note_state+=1 - - elif note_state == 1: + + elif note_state == 1: r = re.search(r'^## ', i) if r: note_state+=1 else: release_note += i + '\n' - + new_content += i + '\n' - + f.close() - + f = open("./CHANGELOG.md", "w") f.write(new_content) f.close() - + com.cmd('git commit -am "Release ' + ver_str + '"') - + com.cmd('git checkout dev') com.cmd("git merge master -X ours") com.cmd("git add .") com.cmd("git commit -am 'Merge master'", False) com.push('origin dev') com.cmd('git checkout master') - com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ") + com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ") com.push('origin master') com.push('origin --tags') - + update_release_branch(release_br) - + os.chdir("../") - + return release_note - - + def lv_examples_release(ver): print("Release lv_examples") - + os.chdir("./lv_examples") release_br = "release/v" + str(ver[0]) ver_str = com.ver_format(ver) - + com.update_version(ver) - + com.cmd("sed -i -r 's/LV_VERSION_CHECK\([0-9]+, *[0-9]+, *[0-9]+\)/"+ "LV_VERSION_CHECK\(" + str(ver[0]) + ", " + str(ver[1]) + ", " + str(ver[2]) + ")/' lv_examples.h") - + com.cmd('git commit -am "Release ' + ver_str + '"') - com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ") + com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ") com.push('origin master') com.push('origin --tags') - + os.chdir("../") - + def lv_drivers_release(ver): print("Release lv_drivers") - + os.chdir("./lv_drivers") release_br = "release/v" + str(ver[0]) ver_str = com.ver_format(ver) - + com.update_version(ver) - + com.cmd('git commit -am "Release ' + ver_str + '"') - com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ") + com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ") com.push('origin master') com.push('origin --tags') - + update_release_branch(release_br) os.chdir("../") - + def docs_release(ver): print("Release docs") - + os.chdir("./docs") release_br = "release/v" + str(ver[0]) ver_str = com.ver_format(ver) - - com.cmd("git co latest --") - com.cmd("rm -rf xml"); - com.cmd("cp -r ../lvgl/docs/api_doc/xml ."); + + com.cmd("git co latest --") + com.cmd("rm -rf xml"); + com.cmd("cp -r ../lvgl/docs/api_doc/xml ."); com.cmd("git add xml"); - + com.update_version(ver) com.cmd('git commit -am "Release ' + ver_str + '"') - com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ") + com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ") com.push('origin master') com.push('origin --tags') - + update_release_branch(release_br, "latest") os.chdir("../") - + def blog_release(ver, release_note): - + os.chdir("./blog/_posts") - + ver_str = com.ver_format(ver) - + post = "---\nlayout: post\ntitle: " + ver_str + " is released\nauthor: \"kisvegabor\"\ncover: /assets/release_cover.png\n---\n\n" post += release_note - + today = date.today() d = today.strftime("%Y-%m-%d") - + f = open(d + "-release_" + ver_str + ".md", "w") f.write(post) f.close() - + com.cmd("git add .") com.cmd("git commit -am 'Add " + ver_str + " release post'") com.push('origin master') - + os.chdir("../../") - - + def make(): ver = com.get_lvgl_version("master") release_note = lvgl_release(ver) @@ -168,6 +166,6 @@ def make(): lv_drivers_release(ver) docs_release(ver) blog_release(ver, release_note) - + if __name__ == '__main__': make() diff --git a/src/lv_api_map.h b/src/lv_api_map.h index f86a4c6d6..bd58d1aa2 100644 --- a/src/lv_api_map.h +++ b/src/lv_api_map.h @@ -49,7 +49,6 @@ static inline void lv_task_once(lv_task_t * task) #endif - #if LV_USE_DROPDOWN static inline void lv_dropdown_set_draw_arrow(lv_obj_t * ddlist, bool en) @@ -145,10 +144,8 @@ static inline void lv_roller_set_fix_width(lv_obj_t * roller, lv_coord_t w) lv_obj_set_width(roller, w); } - #endif - #if LV_USE_PAGE #define lv_scrlbar_mode_t lv_scrollbar_mode_t @@ -159,7 +156,6 @@ static inline void lv_roller_set_fix_width(lv_obj_t * roller, lv_coord_t w) #define LV_SCRLBAR_MODE_HIDE LV_SCROLLBAR_MODE_HIDE #define LV_SCRLBAR_MODE_UNHIDE LV_SCROLLBAR_MODE_UNHIDE - static inline void lv_page_set_scrlbar_mode(lv_obj_t * page, lv_scrlbar_mode_t sb_mode) { lv_page_set_scrollbar_mode(page, sb_mode); @@ -169,19 +165,14 @@ static inline lv_scrollbar_mode_t lv_page_get_scrlbar_mode(lv_obj_t * page) return lv_page_get_scrollbar_mode(page); } - static inline lv_obj_t * lv_page_get_scrl(lv_obj_t * page) { return lv_page_get_scrollable(page); } #endif - #endif /*LV_USE_API_EXTENSION_V6*/ - - - /*--------------------- * V7.0 COMPATIBILITY *--------------------*/ @@ -206,7 +197,6 @@ static inline void lv_chart_set_range(lv_obj_t * chart, lv_coord_t ymin, lv_coor lv_chart_set_y_range(chart, LV_CHART_AXIS_PRIMARY_Y, ymin, ymax); } - static inline void lv_chart_clear_serie(lv_obj_t * chart, lv_chart_series_t * series) { lv_chart_clear_series(chart, series); diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index 0e5da5898..fb75f7031 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -349,7 +349,6 @@ # endif #endif - /* Gesture threshold in pixels */ #ifndef LV_INDEV_DEF_GESTURE_LIMIT # ifdef CONFIG_LV_INDEV_DEF_GESTURE_LIMIT @@ -749,7 +748,6 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ #endif #endif /*LV_TICK_CUSTOM*/ - /*================ * Log settings *===============*/ @@ -1928,7 +1926,6 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ #endif #endif - /*Tab (dependencies: lv_page, lv_btnm)*/ #ifndef LV_USE_TABVIEW # ifdef CONFIG_LV_USE_TABVIEW @@ -1990,8 +1987,6 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ #endif #endif - - /*If running without lv_conf.h add typdesf with default value*/ #if defined(LV_CONF_SKIP) diff --git a/src/lv_conf_kconfig.h b/src/lv_conf_kconfig.h index 3387eb599..648edfa0e 100644 --- a/src/lv_conf_kconfig.h +++ b/src/lv_conf_kconfig.h @@ -385,7 +385,6 @@ extern "C" { #endif #endif - /*------------------ * SPINNER DEF ANIM *-----------------*/ diff --git a/src/lv_core/lv_disp.c b/src/lv_core/lv_disp.c index 4e319dfdf..aaa8fb1ae 100644 --- a/src/lv_core/lv_disp.c +++ b/src/lv_core/lv_disp.c @@ -180,7 +180,6 @@ void lv_disp_set_bg_image(lv_disp_t * disp, const void * img_src) _lv_inv_area(disp, &a); } - /** * Opacity of the background * @param disp pointer to a display @@ -216,7 +215,6 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t lv_disp_t * d = lv_obj_get_disp(new_scr); lv_obj_t * act_scr = lv_scr_act(); - if(d->del_prev && act_scr != d->scr_to_load && d->scr_to_load) { lv_obj_del(act_scr); lv_disp_load_scr(d->scr_to_load); diff --git a/src/lv_core/lv_disp.h b/src/lv_core/lv_disp.h index d733ad756..6353315ec 100644 --- a/src/lv_core/lv_disp.h +++ b/src/lv_core/lv_disp.h @@ -85,7 +85,6 @@ 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); - /** * Set the background color of a display * @param disp pointer to a display @@ -207,7 +206,6 @@ static inline void lv_scr_load(lv_obj_t * scr) #define LV_VER_RES lv_disp_get_ver_res(lv_disp_get_default()) #endif - /** * Same as Android's DIP. (Different name is chosen to avoid mistype between LV_DPI and LV_DIP) * 1 dip is 1 px on a 160 DPI screen diff --git a/src/lv_core/lv_indev.c b/src/lv_core/lv_indev.c index f37c4495d..336b377ea 100644 --- a/src/lv_core/lv_indev.c +++ b/src/lv_core/lv_indev.c @@ -1263,7 +1263,6 @@ static void indev_drag(lv_indev_proc_t * proc) if(lv_obj_get_drag(drag_obj) == false) return; - lv_drag_dir_t allowed_dirs = lv_obj_get_drag_dir(drag_obj); /*Count the movement by drag*/ @@ -1469,7 +1468,6 @@ static void indev_drag_throw(lv_indev_proc_t * proc) } } - /** * Get the really dragged object by taking `drag_parent` into account. * @param obj the start object @@ -1486,7 +1484,6 @@ static lv_obj_t * get_dragged_obj(lv_obj_t * obj) return drag_obj; } - /** * Handle the gesture of indev_proc_p->types.pointer.act_obj * @param indev pointer to a input device state @@ -1505,7 +1502,6 @@ static void indev_gesture(lv_indev_proc_t * proc) if(gesture_obj == NULL) return; - if((LV_MATH_ABS(proc->types.pointer.vect.x) < indev_act->driver.gesture_min_velocity) && (LV_MATH_ABS(proc->types.pointer.vect.y) < indev_act->driver.gesture_min_velocity)) { proc->types.pointer.gesture_sum.x = 0; @@ -1541,7 +1537,6 @@ static void indev_gesture(lv_indev_proc_t * proc) } } - /** * Checks if the reset_query flag has been set. If so, perform necessary global indev cleanup actions * @param proc pointer to an input device 'proc' diff --git a/src/lv_core/lv_indev.h b/src/lv_core/lv_indev.h index 403081f22..15f0f89cf 100644 --- a/src/lv_core/lv_indev.h +++ b/src/lv_core/lv_indev.h @@ -149,7 +149,6 @@ lv_res_t lv_indev_finish_drag(lv_indev_t * indev); */ void lv_indev_wait_release(lv_indev_t * indev); - /** * Gets a pointer to the currently active object in indev proc functions. * NULL if no object is currently being handled or if groups aren't used. diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index a549db952..fb409ea16 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -34,7 +34,6 @@ #include LV_GC_INCLUDE #endif /* LV_ENABLE_GC */ - #if defined(LV_USER_DATA_FREE_INCLUDE) #include LV_USER_DATA_FREE_INCLUDE #endif /* LV_USE_USER_DATA_FREE */ @@ -341,10 +340,8 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy) } } - _lv_ll_init(&(new_obj->child_ll), sizeof(lv_obj_t)); - new_obj->ext_draw_pad = 0; #if LV_USE_EXT_CLICK_AREA == LV_EXT_CLICK_AREA_FULL @@ -368,7 +365,6 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy) _lv_memset_00(&new_obj->user_data, sizeof(lv_obj_user_data_t)); #endif - #if LV_USE_GROUP new_obj->group_p = NULL; #endif @@ -490,7 +486,6 @@ lv_res_t lv_obj_del(lv_obj_t * obj) if(disp->act_scr == obj) act_scr_del = true; } - obj_del_core(obj); /*Send a signal to the parent to notify it about the child delete*/ @@ -694,7 +689,6 @@ void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent) _lv_ll_chg_list(&obj->parent->child_ll, &parent->child_ll, obj, true); obj->parent = parent; - if(new_base_dir != LV_BIDI_DIR_RTL) { lv_obj_set_pos(obj, old_pos.x, old_pos.y); } @@ -781,7 +775,6 @@ void lv_obj_set_pos(lv_obj_t * obj, lv_coord_t x, lv_coord_t y) y = y + par->coords.y1; } - /*Calculate and set the movement*/ lv_point_t diff; diff.x = x - obj->coords.x1; @@ -1055,7 +1048,6 @@ void lv_obj_align_mid(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, l LV_ASSERT_OBJ(base, LV_OBJX_NAME); - obj_align_mid_core(obj, base, align, true, true, x_ofs, y_ofs); #if LV_USE_OBJ_REALIGN @@ -1085,11 +1077,9 @@ void lv_obj_align_mid_x(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, LV_ASSERT_OBJ(base, LV_OBJX_NAME); - obj_align_mid_core(obj, base, align, true, false, x_ofs, 0); } - /** * Align an object's middle point to an other object vertically. * @param obj pointer to an object to align @@ -1107,7 +1097,6 @@ void lv_obj_align_mid_y(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, LV_ASSERT_OBJ(base, LV_OBJX_NAME); - obj_align_mid_core(obj, base, align, false, true, 0, y_ofs); } @@ -1149,7 +1138,6 @@ void lv_obj_set_auto_realign(lv_obj_t * obj, bool en) #endif } - /** * Set the size of an extended clickable area * If TINY mode is used, only the largest of the horizontal and vertical padding @@ -1751,7 +1739,6 @@ void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state) else if(cmp_res == STYLE_COMPARE_VISUAL_DIFF) lv_obj_refresh_style(obj, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL); #else - for(part = 0; part < _LV_OBJ_PART_REAL_LAST; part++) { lv_style_list_t * style_list = lv_obj_get_style_list(obj, part); if(style_list == NULL) break; /*No more style lists*/ @@ -1943,7 +1930,6 @@ void lv_event_send_refresh_recursive(lv_obj_t * obj) } } - /** * Call an event function with an object, event, and data. * @param event_xcb an event callback function. If `NULL` `LV_RES_OK` will return without any actions. @@ -2804,7 +2790,6 @@ lv_opa_t _lv_obj_get_style_opa(const lv_obj_t * obj, uint8_t part, lv_style_prop } } - lv_state_t state = lv_obj_get_state(parent, part); prop = (uint16_t)prop_ori + ((uint16_t)state << LV_STYLE_STATE_POS); @@ -3059,7 +3044,6 @@ bool lv_obj_get_parent_event(const lv_obj_t * obj) return obj->parent_event == 0 ? false : true; } - lv_bidi_dir_t lv_obj_get_base_dir(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, LV_OBJX_NAME); @@ -3282,7 +3266,6 @@ bool lv_obj_is_focused(const lv_obj_t * obj) #endif } - /*------------------- * OTHER FUNCTIONS *------------------*/ @@ -3959,7 +3942,6 @@ static lv_design_res_t lv_obj_design(lv_obj_t * obj, const lv_area_t * clip_area return LV_DESIGN_RES_OK; } - /** * Get the really focused object by taking `focus_parent` into account. * @param obj the start object @@ -4168,7 +4150,6 @@ static void obj_align_mid_core(lv_obj_t * obj, const lv_obj_t * base, lv_align_t lv_coord_t obj_w_half = lv_obj_get_width(obj) / 2; lv_coord_t obj_h_half = lv_obj_get_height(obj) / 2; - switch(align) { case LV_ALIGN_CENTER: new_x = lv_obj_get_width(base) / 2 - obj_w_half; @@ -4290,8 +4271,6 @@ static void obj_align_mid_core(lv_obj_t * obj, const lv_obj_t * base, lv_align_t } - - #if LV_USE_ANIMATION /** @@ -4656,7 +4635,6 @@ static void update_style_cache(lv_obj_t * obj, uint8_t part, uint16_t prop) list->text_space_zero = 0; } - lv_opa_t bg_opa = lv_obj_get_style_bg_opa(obj, part); list->bg_opa_transp = bg_opa == LV_OPA_TRANSP ? 1 : 0; list->bg_opa_cover = bg_opa == LV_OPA_COVER ? 1 : 0; @@ -4672,7 +4650,6 @@ static void update_style_cache(lv_obj_t * obj, uint8_t part, uint16_t prop) list->shadow_width_zero = lv_obj_get_style_shadow_width(obj, part) == 0 ? 1 : 0; list->value_txt_str = lv_obj_get_style_value_str(obj, part) == NULL ? 1 : 0; - list->transform_all_zero = 1; if(lv_obj_get_style_transform_angle(obj, part) != 0 || lv_obj_get_style_transform_width(obj, part) != 0 || @@ -4773,7 +4750,6 @@ static void invalidate_style_cache(lv_obj_t * obj, uint8_t part, lv_style_proper list->valid_cache = 0; } - lv_obj_t * child = lv_obj_get_child(obj, NULL); while(child) { update_style_cache_children(child); @@ -4799,7 +4775,6 @@ static void style_snapshot(lv_obj_t * obj, uint8_t part, style_snapshot_t * shot lv_obj_init_draw_img_dsc(obj, part, &shot->img); lv_obj_init_draw_line_dsc(obj, part, &shot->line); - shot->pad_top = lv_obj_get_style_pad_top(obj, part); shot->pad_bottom = lv_obj_get_style_pad_bottom(obj, part); shot->pad_right = lv_obj_get_style_pad_right(obj, part); @@ -4832,7 +4807,6 @@ static style_snapshot_res_t style_snapshot_compare(style_snapshot_t * shot1, sty { if(memcmp(shot1, shot2, sizeof(style_snapshot_t)) == 0) return STYLE_COMPARE_SAME; - if(shot1->pad_top != shot2->pad_top) return STYLE_COMPARE_DIFF; if(shot1->pad_bottom != shot2->pad_bottom) return STYLE_COMPARE_DIFF; if(shot1->pad_left != shot2->pad_right) return STYLE_COMPARE_DIFF; diff --git a/src/lv_core/lv_obj.h b/src/lv_core/lv_obj.h index 2328d9df0..9551f1c62 100644 --- a/src/lv_core/lv_obj.h +++ b/src/lv_core/lv_obj.h @@ -56,7 +56,6 @@ extern "C" { struct _lv_obj_t; - /** Design modes */ enum { LV_DESIGN_DRAW_MAIN, /**< Draw the main portion of the object */ @@ -65,7 +64,6 @@ enum { }; typedef uint8_t lv_design_mode_t; - /** Design results */ enum { LV_DESIGN_RES_OK, /**< Draw ready */ @@ -288,7 +286,6 @@ typedef struct { */ void lv_init(void); - /** * Deinit the 'lv' library * Currently only implemented when not using custom allocators, or GC is enabled. @@ -339,7 +336,6 @@ void lv_obj_del_async(struct _lv_obj_t * obj); */ void lv_obj_clean(lv_obj_t * obj); - /** * Mark an area of an object as invalid. * This area will be redrawn by 'lv_refr_task' @@ -354,7 +350,6 @@ void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area); */ void lv_obj_invalidate(const lv_obj_t * obj); - /** * Tell whether an area of an object is visible (even partially) now or not * @param obj pointer to an object @@ -513,7 +508,6 @@ void lv_obj_align_y(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_ */ void lv_obj_align_mid(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs); - /** * Align an object's middle point to an other object horizontally. * @param obj pointer to an object to align @@ -848,7 +842,6 @@ void lv_obj_set_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb); */ lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data); - /** * Send LV_EVENT_REFRESH event to an object * @param obj point to an object. (Can NOT be NULL) @@ -888,7 +881,6 @@ const void * lv_event_get_data(void); */ void lv_obj_set_signal_cb(lv_obj_t * obj, lv_signal_cb_t signal_cb); - /** * Send an event to the object * @param obj pointer to an object @@ -1212,7 +1204,6 @@ const void * _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, lv_style_ */ lv_style_t * lv_obj_get_local_style(lv_obj_t * obj, uint8_t part); - #include "lv_obj_style_dec.h" /*----------------- @@ -1275,7 +1266,6 @@ bool lv_obj_get_drag_throw(const lv_obj_t * obj); */ bool lv_obj_get_drag_parent(const lv_obj_t * obj); - /** * Get the focus parent attribute of an object * @param obj pointer to an object @@ -1283,7 +1273,6 @@ bool lv_obj_get_drag_parent(const lv_obj_t * obj); */ bool lv_obj_get_focus_parent(const lv_obj_t * obj); - /** * Get the drag parent attribute of an object * @param obj pointer to an object @@ -1315,7 +1304,6 @@ uint8_t lv_obj_get_protect(const lv_obj_t * obj); */ bool lv_obj_is_protected(const lv_obj_t * obj, uint8_t prot); - lv_state_t lv_obj_get_state(const lv_obj_t * obj, uint8_t part); /** @@ -1489,7 +1477,6 @@ bool lv_debug_check_obj_type(const lv_obj_t * obj, const char * obj_type); */ bool lv_debug_check_obj_valid(const lv_obj_t * obj); - /********************** * MACROS **********************/ @@ -1510,7 +1497,6 @@ bool lv_debug_check_obj_valid(const lv_obj_t * obj); */ #define LV_EVENT_CB_DECLARE(name) static void name(lv_obj_t * obj, lv_event_t e) - #if LV_USE_DEBUG # ifndef LV_DEBUG_IS_OBJ @@ -1519,7 +1505,6 @@ bool lv_debug_check_obj_valid(const lv_obj_t * obj); lv_debug_check_obj_type(obj_p, obj_type)) # endif - # if LV_USE_ASSERT_OBJ # ifndef LV_ASSERT_OBJ # define LV_ASSERT_OBJ(obj_p, obj_type) LV_DEBUG_ASSERT(LV_DEBUG_IS_OBJ(obj_p, obj_type), "Invalid object", obj_p); @@ -1535,7 +1520,6 @@ bool lv_debug_check_obj_valid(const lv_obj_t * obj); # define LV_ASSERT_OBJ(obj, obj_type) #endif - #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/lv_core/lv_obj_style_dec.h b/src/lv_core/lv_obj_style_dec.h index 28cbe52ce..7c3d051b3 100644 --- a/src/lv_core/lv_obj_style_dec.h +++ b/src/lv_core/lv_obj_style_dec.h @@ -200,7 +200,6 @@ _LV_OBJ_STYLE_SET_GET_DECLARE(SCALE_END_COLOR, scale_end_color, lv_color_t, _col #undef _LV_OBJ_STYLE_SET_GET_DECLARE - static inline void lv_obj_set_style_local_pad_all(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value) { lv_obj_set_style_local_pad_top(obj, part, state, value); @@ -209,7 +208,6 @@ static inline void lv_obj_set_style_local_pad_all(lv_obj_t * obj, uint8_t part, lv_obj_set_style_local_pad_right(obj, part, state, value); } - static inline void lv_style_set_pad_all(lv_style_t * style, lv_state_t state, lv_style_int_t value) { lv_style_set_pad_top(style, state, value); @@ -218,35 +216,30 @@ static inline void lv_style_set_pad_all(lv_style_t * style, lv_state_t state, lv lv_style_set_pad_right(style, state, value); } - static inline void lv_obj_set_style_local_pad_hor(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value) { lv_obj_set_style_local_pad_left(obj, part, state, value); lv_obj_set_style_local_pad_right(obj, part, state, value); } - static inline void lv_style_set_pad_hor(lv_style_t * style, lv_state_t state, lv_style_int_t value) { lv_style_set_pad_left(style, state, value); lv_style_set_pad_right(style, state, value); } - static inline void lv_obj_set_style_local_pad_ver(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value) { lv_obj_set_style_local_pad_top(obj, part, state, value); lv_obj_set_style_local_pad_bottom(obj, part, state, value); } - static inline void lv_style_set_pad_ver(lv_style_t * style, lv_state_t state, lv_style_int_t value) { lv_style_set_pad_top(style, state, value); lv_style_set_pad_bottom(style, state, value); } - static inline void lv_obj_set_style_local_margin_all(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value) { @@ -256,7 +249,6 @@ static inline void lv_obj_set_style_local_margin_all(lv_obj_t * obj, uint8_t par lv_obj_set_style_local_margin_right(obj, part, state, value); } - static inline void lv_style_set_margin_all(lv_style_t * style, lv_state_t state, lv_style_int_t value) { lv_style_set_margin_top(style, state, value); @@ -265,7 +257,6 @@ static inline void lv_style_set_margin_all(lv_style_t * style, lv_state_t state, lv_style_set_margin_right(style, state, value); } - static inline void lv_obj_set_style_local_margin_hor(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value) { @@ -273,14 +264,12 @@ static inline void lv_obj_set_style_local_margin_hor(lv_obj_t * obj, uint8_t par lv_obj_set_style_local_margin_right(obj, part, state, value); } - static inline void lv_style_set_margin_hor(lv_style_t * style, lv_state_t state, lv_style_int_t value) { lv_style_set_margin_left(style, state, value); lv_style_set_margin_right(style, state, value); } - static inline void lv_obj_set_style_local_margin_ver(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value) { @@ -288,14 +277,12 @@ static inline void lv_obj_set_style_local_margin_ver(lv_obj_t * obj, uint8_t par lv_obj_set_style_local_margin_bottom(obj, part, state, value); } - static inline void lv_style_set_margin_ver(lv_style_t * style, lv_state_t state, lv_style_int_t value) { lv_style_set_margin_top(style, state, value); lv_style_set_margin_bottom(style, state, value); } - #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/lv_core/lv_refr.c b/src/lv_core/lv_refr.c index 0c25671ee..7572412e4 100644 --- a/src/lv_core/lv_refr.c +++ b/src/lv_core/lv_refr.c @@ -564,7 +564,6 @@ static void lv_refr_area_part(const lv_area_t * area_p) } - if(top_act_scr == NULL) { top_act_scr = disp_refr->act_scr; } diff --git a/src/lv_core/lv_style.c b/src/lv_core/lv_style.c index c4ff92276..2ee6017c9 100644 --- a/src/lv_core/lv_style.c +++ b/src/lv_core/lv_style.c @@ -732,7 +732,6 @@ lv_style_t * _lv_style_list_add_trans_style(lv_style_list_t * list) return trans_style; } - /** * Set a local integer typed property in a style list. * @param list pointer to a style list where the local property should be set @@ -797,8 +796,6 @@ void _lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t pr _lv_style_set_ptr(local, prop, value); } - - /** * Get an integer typed property from a style list. * It will return the property which match best with given state. @@ -1169,7 +1166,6 @@ static inline uint8_t get_style_prop_attr(const lv_style_t * style, size_t idx) return ((get_style_prop(style, idx) >> 8) & 0xFFU); } - /** * Get property size. * @param prop_id property id. diff --git a/src/lv_core/lv_style.h b/src/lv_core/lv_style.h index cc6d6937a..6f62bb1b4 100644 --- a/src/lv_core/lv_style.h +++ b/src/lv_core/lv_style.h @@ -539,7 +539,6 @@ lv_res_t _lv_style_list_get_int(lv_style_list_t * list, lv_style_property_t prop */ lv_res_t _lv_style_list_get_color(lv_style_list_t * list, lv_style_property_t prop, lv_color_t * res); - /** * Get an opacity typed property from a style list. * It will return the property which match best with given state. @@ -599,8 +598,6 @@ bool lv_debug_check_style_list(const lv_style_list_t * list); */ #define LV_STYLE_CREATE(name, copy_p) static lv_style_t name; lv_style_init(&name); lv_style_copy(&name, copy_p); - - #if LV_USE_DEBUG # ifndef LV_DEBUG_IS_STYLE diff --git a/src/lv_draw/lv_draw_arc.c b/src/lv_draw/lv_draw_arc.c index 837bef350..c00be7aab 100644 --- a/src/lv_draw/lv_draw_arc.c +++ b/src/lv_draw/lv_draw_arc.c @@ -34,7 +34,6 @@ typedef struct { const lv_area_t * clip_area; } quarter_draw_dsc_t; - /********************** * STATIC PROTOTYPES **********************/ @@ -44,7 +43,6 @@ static void draw_quarter_2(quarter_draw_dsc_t * q); static void draw_quarter_3(quarter_draw_dsc_t * q); static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness, lv_area_t * res_area); - /********************** * STATIC VARIABLES **********************/ @@ -331,7 +329,6 @@ static void draw_quarter_2(quarter_draw_dsc_t * q) } } - static void draw_quarter_3(quarter_draw_dsc_t * q) { lv_area_t quarter_area; @@ -385,7 +382,6 @@ static void draw_quarter_3(quarter_draw_dsc_t * q) } } - static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness, lv_area_t * res_area) { const uint8_t ps = 8; @@ -423,4 +419,3 @@ static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness res_area->y2 = cir_y + thick_half - thick_corr; } } - diff --git a/src/lv_draw/lv_draw_blend.c b/src/lv_draw/lv_draw_blend.c index c10acffe2..71fd09e8d 100644 --- a/src/lv_draw/lv_draw_blend.c +++ b/src/lv_draw/lv_draw_blend.c @@ -78,7 +78,6 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co * MACROS **********************/ - #define FILL_NORMAL_MASK_PX(out_x, color) \ if(*mask_tmp_x) { \ if(*mask_tmp_x == LV_OPA_COVER) disp_buf_first[out_x] = color; \ @@ -86,7 +85,6 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co } \ mask_tmp_x++; - #define FILL_NORMAL_MASK_PX_SCR_TRANSP(out_x, color) \ if(*mask_tmp_x) { \ if(*mask_tmp_x == LV_OPA_COVER) disp_buf_first[out_x] = color; \ @@ -96,7 +94,6 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co } \ mask_tmp_x++; - #define MAP_NORMAL_MASK_PX(x) \ if(*mask_tmp_x) { \ if(*mask_tmp_x == LV_OPA_COVER) disp_buf_first[x] = map_buf_first[x]; \ @@ -117,7 +114,6 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co * GLOBAL FUNCTIONS **********************/ - /** * Fill and area in the display buffer. * @param clip_area clip the fill to this area (absolute coordinates) @@ -252,7 +248,6 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_a #endif } - /********************** * STATIC FUNCTIONS **********************/ @@ -392,7 +387,6 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co } #endif - #if LV_USE_GPU_STM32_DMA2D if(lv_area_get_size(draw_area) >= 240) { if(blend_buf[0].full != color.full) lv_color_fill(blend_buf, color, LV_HOR_RES_MAX); @@ -450,7 +444,6 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co } #endif - /*Buffer the result color to avoid recalculating the same color*/ lv_color_t last_dest_color; lv_color_t last_res_color; @@ -581,7 +574,6 @@ static void fill_blended(const lv_area_t * disp_area, lv_color_t * disp_buf, co /*Create a temp. disp_buf which always point to current line to draw*/ lv_color_t * disp_buf_tmp = disp_buf + disp_w * draw_area->y1; - lv_color_t (*blend_fp)(lv_color_t, lv_color_t, lv_opa_t); switch(mode) { case LV_BLEND_MODE_ADDITIVE: @@ -775,7 +767,6 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col blit.src_area.x2 = blit.src_area.x1 + draw_area_w; blit.src_area.y2 = blit.src_area.y1 + draw_area_h; - blit.dst = disp_buf; blit.dst_width = lv_area_get_width(disp_area); blit.dst_height = lv_area_get_height(disp_area); @@ -826,7 +817,6 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col blit.src_area.x2 = blit.src_area.x1 + draw_area_w; blit.src_area.y2 = blit.src_area.y1 + draw_area_h; - blit.dst = disp_buf; blit.dst_width = lv_area_get_width(disp_area); blit.dst_height = lv_area_get_height(disp_area); diff --git a/src/lv_draw/lv_draw_blend.h b/src/lv_draw/lv_draw_blend.h index a5f57ed88..3dcf2c045 100644 --- a/src/lv_draw/lv_draw_blend.h +++ b/src/lv_draw/lv_draw_blend.h @@ -42,7 +42,6 @@ typedef uint8_t lv_blend_mode_t; LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_area_t * fill_area, lv_color_t color, lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode); - LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_area_t * map_area, const lv_color_t * map_buf, lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode); diff --git a/src/lv_draw/lv_draw_img.c b/src/lv_draw/lv_draw_img.c index 57610af08..3a07bde4a 100644 --- a/src/lv_draw/lv_draw_img.c +++ b/src/lv_draw/lv_draw_img.c @@ -313,7 +313,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords, return LV_RES_INV; } - lv_draw_map(&line, &mask_line, buf, draw_dsc, chroma_keyed, alpha_byte); line.y1++; line.y2++; @@ -512,7 +511,6 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const mask_res = (alpha_byte || chroma_key || draw_dsc->angle || draw_dsc->zoom != LV_IMG_ZOOM_NONE) ? LV_DRAW_MASK_RES_CHANGED : LV_DRAW_MASK_RES_FULL_COVER; - /*Prepare the `mask_buf`if there are other masks*/ if(other_mask_cnt) { _lv_memset_ff(mask_buf, mask_buf_size); @@ -532,7 +530,6 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const #endif for(x = 0; x < draw_area_w; x++, map_px += px_size_byte, px_i++) { - #if LV_USE_IMG_TRANSFORM if(transform) { @@ -663,4 +660,3 @@ static void draw_cleanup(lv_img_cache_entry_t * cache) LV_UNUSED(cache); #endif } - diff --git a/src/lv_draw/lv_draw_img.h b/src/lv_draw/lv_draw_img.h index 168b7fffc..a9c699092 100644 --- a/src/lv_draw/lv_draw_img.h +++ b/src/lv_draw/lv_draw_img.h @@ -88,7 +88,6 @@ bool lv_img_cf_is_chroma_keyed(lv_img_cf_t cf); */ bool lv_img_cf_has_alpha(lv_img_cf_t cf); - #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/lv_draw/lv_draw_label.c b/src/lv_draw/lv_draw_label.c index c57848ebd..8fb92444c 100644 --- a/src/lv_draw/lv_draw_label.c +++ b/src/lv_draw/lv_draw_label.c @@ -41,7 +41,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_dsc_t * g, const lv_area_t * clip_area, const uint8_t * map_p, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode); - static uint8_t hex_char_to_num(char hex); /********************** @@ -129,7 +128,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area bool clip_ok = _lv_area_intersect(&clipped_area, coords, mask); if(!clip_ok) return; - if((dsc->flag & LV_TXT_FLAG_EXPAND) == 0) { /*Normally use the label's width as width*/ w = lv_area_get_width(coords); @@ -232,7 +230,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area lv_color_t recolor; int32_t letter_w; - lv_draw_rect_dsc_t draw_dsc_sel; lv_draw_rect_dsc_init(&draw_dsc_sel); draw_dsc_sel.bg_color = dsc->sel_bg_color; @@ -389,7 +386,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area * STATIC FUNCTIONS **********************/ - /** * Draw a letter in the Virtual Display Buffer * @param pos_p left-top coordinate of the latter @@ -437,7 +433,6 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_letter(const lv_point_t * pos_p, const return; } - const uint8_t * map_p = lv_font_get_glyph_bitmap(font_p, letter); if(map_p == NULL) { LV_LOG_WARN("lv_draw_letter: character's bitmap not found"); @@ -452,7 +447,6 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_letter(const lv_point_t * pos_p, const } } - LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_dsc_t * g, const lv_area_t * clip_area, const uint8_t * map_p, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode) @@ -569,7 +563,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_ mask_p++; } - /*Apply masks if any*/ if(other_mask_cnt) { lv_draw_mask_res_t mask_res = lv_draw_mask_apply(mask_buf + mask_p_start, fill_area.x1, fill_area.y2, @@ -647,7 +640,6 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_ int32_t box_h = g->box_h; int32_t width_bit = box_w * bpp; /*Letter width in bits*/ - /* Calculate the col/row start/end on the map*/ int32_t col_start = pos_x >= clip_area->x1 ? 0 : (clip_area->x1 - pos_x) * 3; int32_t col_end = pos_x + box_w / 3 <= clip_area->x2 ? box_w : (clip_area->x2 - pos_x + 1) * 3; @@ -817,7 +809,6 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_ #endif } - /** * Convert a hexadecimal characters to a number (0..15) * @param hex Pointer to a hexadecimal character (0..9, A..F) diff --git a/src/lv_draw/lv_draw_line.c b/src/lv_draw/lv_draw_line.c index 1ae458f3f..130c71448 100644 --- a/src/lv_draw/lv_draw_line.c +++ b/src/lv_draw/lv_draw_line.c @@ -83,7 +83,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line(const lv_point_t * point1, const lv_poin else if(point1->x == point2->x) draw_line_ver(point1, point2, &clip_line, dsc); else draw_line_skew(point1, point2, &clip_line, dsc); - if(dsc->round_end || dsc->round_start) { lv_draw_rect_dsc_t cir_dsc; lv_draw_rect_dsc_init(&cir_dsc); @@ -217,7 +216,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const } } - LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const lv_point_t * point2, const lv_area_t * clip, const lv_draw_line_dsc_t * dsc) @@ -312,7 +310,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const } } - LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, const lv_point_t * point2, const lv_area_t * clip, const lv_draw_line_dsc_t * dsc) diff --git a/src/lv_draw/lv_draw_line.h b/src/lv_draw/lv_draw_line.h index eb4bbaf58..9a1da4e55 100644 --- a/src/lv_draw/lv_draw_line.h +++ b/src/lv_draw/lv_draw_line.h @@ -51,7 +51,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line(const lv_point_t * point1, const lv_poin LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc); - //! @endcond /********************** diff --git a/src/lv_draw/lv_draw_mask.c b/src/lv_draw/lv_draw_mask.c index f7b8bc1ff..130c449f0 100644 --- a/src/lv_draw/lv_draw_mask.c +++ b/src/lv_draw/lv_draw_mask.c @@ -284,7 +284,6 @@ void lv_draw_mask_line_angle_init(lv_draw_mask_line_param_t * param, lv_coord_t * Find the degree which keeps the origo in place */ if(angle > 180) angle -= 180; /*> 180 will swap the origo*/ - int32_t p2x; int32_t p2y; @@ -294,7 +293,6 @@ void lv_draw_mask_line_angle_init(lv_draw_mask_line_param_t * param, lv_coord_t lv_draw_mask_line_points_init(param, p1x, py, p2x, p2y, side); } - /** * Initialize an angle mask. * @param param pointer to a `lv_draw_mask_param_t` to initialize @@ -360,7 +358,6 @@ void lv_draw_mask_angle_init(lv_draw_mask_angle_param_t * param, lv_coord_t vert lv_draw_mask_line_angle_init(¶m->end_line, vertex_x, vertex_y, end_angle, end_side); } - /** * Initialize a fade mask. * @param param param pointer to a `lv_draw_mask_param_t` to initialize @@ -385,7 +382,6 @@ void lv_draw_mask_radius_init(lv_draw_mask_radius_param_t * param, const lv_area param->y_prev_x.i = 0; } - /** * Initialize a fade mask. * @param param pointer to a `lv_draw_mask_param_t` to initialize @@ -408,7 +404,6 @@ void lv_draw_mask_fade_init(lv_draw_mask_fade_param_t * param, const lv_area_t * param->dsc.type = LV_DRAW_MASK_TYPE_FADE; } - /** * Initialize a map mask. * @param param pointer to a `lv_draw_mask_param_t` to initialize @@ -423,7 +418,6 @@ void lv_draw_mask_map_init(lv_draw_mask_map_param_t * param, const lv_area_t * c param->dsc.type = LV_DRAW_MASK_TYPE_MAP; } - /********************** * STATIC FUNCTIONS **********************/ @@ -573,7 +567,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_b if(k >= len) break; } - if(k < len && k >= 0) { int32_t x_inters = (px_h * p->xy_steep) >> 10; m = (x_inters * px_h) >> 9; @@ -582,7 +575,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_b mask_buf[k] = mask_mix(mask_buf[k], m); } - if(p->inv) { k = xei - abs_x; if(k > len) { @@ -747,7 +739,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_ return LV_DRAW_MASK_RES_CHANGED; } - LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, lv_coord_t len, lv_draw_mask_angle_param_t * p) @@ -755,7 +746,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma int32_t rel_y = abs_y - p->cfg.vertex_p.y; int32_t rel_x = abs_x - p->cfg.vertex_p.x; - if(p->cfg.start_angle < 180 && p->cfg.end_angle < 180 && p->cfg.start_angle != 0 && p->cfg.end_angle != 0 && p->cfg.start_angle > p->cfg.end_angle) { @@ -768,7 +758,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma int32_t end_angle_first = (rel_y * p->end_line.xy_steep) >> 10; int32_t start_angle_last = ((rel_y + 1) * p->start_line.xy_steep) >> 10; - /*Do not let the line end cross the vertex else it will affect the opposite part*/ if(p->cfg.start_angle > 270 && p->cfg.start_angle <= 359 && start_angle_last < 0) start_angle_last = 0; else if(p->cfg.start_angle > 0 && p->cfg.start_angle <= 90 && start_angle_last < 0) start_angle_last = 0; @@ -778,7 +767,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma else if(p->cfg.end_angle > 0 && p->cfg.end_angle <= 90 && start_angle_last < 0) start_angle_last = 0; else if(p->cfg.end_angle > 90 && p->cfg.end_angle < 270 && start_angle_last > 0) start_angle_last = 0; - int32_t dist = (end_angle_first - start_angle_last) >> 1; lv_draw_mask_res_t res1 = LV_DRAW_MASK_RES_FULL_COVER; @@ -1139,7 +1127,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m return LV_DRAW_MASK_RES_CHANGED; } - LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_fade(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, lv_coord_t len, lv_draw_mask_fade_param_t * p) @@ -1200,7 +1187,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_map(lv_opa_t * mask const lv_opa_t * map_tmp = p->cfg.map; map_tmp += (abs_y - p->cfg.coords.y1) * lv_area_get_width(&p->cfg.coords); - if(abs_x + len > p->cfg.coords.x2) len -= abs_x + len - p->cfg.coords.x2 - 1; if(abs_x < p->cfg.coords.x1) { @@ -1221,7 +1207,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_map(lv_opa_t * mask return LV_DRAW_MASK_RES_CHANGED; } - LV_ATTRIBUTE_FAST_MEM static inline lv_opa_t mask_mix(lv_opa_t mask_act, lv_opa_t mask_new) { if(mask_new >= LV_OPA_MAX) return mask_act; diff --git a/src/lv_draw/lv_draw_mask.h b/src/lv_draw/lv_draw_mask.h index dc40ce0f4..adb9a050a 100644 --- a/src/lv_draw/lv_draw_mask.h +++ b/src/lv_draw/lv_draw_mask.h @@ -36,7 +36,6 @@ enum { typedef uint8_t lv_draw_mask_res_t; - enum { LV_DRAW_MASK_TYPE_LINE, LV_DRAW_MASK_TYPE_ANGLE, @@ -102,7 +101,6 @@ typedef struct { /*1: It's a flat line? (Near to horizontal)*/ uint8_t flat : 1; - /* Invert the mask. The default is: Keep the left part. * It is used to select left/right/top/bottom*/ uint8_t inv: 1; @@ -181,7 +179,6 @@ typedef _lv_draw_mask_saved_t _lv_draw_mask_saved_arr_t[_LV_MASK_MAX_NUM]; */ int16_t lv_draw_mask_add(void * param, void * custom_id); - //! @cond Doxygen_Suppress /** @@ -198,7 +195,6 @@ int16_t lv_draw_mask_add(void * param, void * custom_id); LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, lv_coord_t len); - //! @endcond /** @@ -225,7 +221,6 @@ void * lv_draw_mask_remove_custom(void * custom_id); */ LV_ATTRIBUTE_FAST_MEM uint8_t lv_draw_mask_get_cnt(void); - //! @endcond /** diff --git a/src/lv_draw/lv_draw_rect.c b/src/lv_draw/lv_draw_rect.c index 350178a93..d81f1a6fa 100644 --- a/src/lv_draw/lv_draw_rect.c +++ b/src/lv_draw/lv_draw_rect.c @@ -245,7 +245,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are lv_draw_mask_res_t mask_res = LV_DRAW_MASK_RES_FULL_COVER; lv_color_t grad_color = dsc->bg_color; - lv_color_t * grad_map = NULL; /*In case of horizontal gradient pre-compute a line with a gradient*/ if(grad_dir == LV_GRAD_DIR_HOR) { @@ -330,7 +329,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are _lv_blend_fill(clip, &fill_area2, grad_color, mask_buf + mask_ofs, mask_res, opa2, dsc->bg_blend_mode); - } else { if(grad_dir == LV_GRAD_DIR_HOR) { @@ -363,7 +361,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are if(fill_area.y1 <= fill_area.y2) fill_area.y1 = fill_area.y2 + 1; /*Avoid overdrawing the last line*/ fill_area.y2 = coords_bg.y2; - _lv_blend_fill(clip, &fill_area, dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode); @@ -589,7 +586,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv short_side = LV_MATH_MIN(lv_area_get_width(&sh_rect_area), lv_area_get_height(&sh_rect_area)); if(r_sh > short_side >> 1) r_sh = short_side >> 1; - int32_t corner_size = sw + r_sh; lv_opa_t * sh_buf; @@ -916,7 +912,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv } } - /*Fill the bottom side*/ a.x1 = sh_area.x1 + corner_size; a.x2 = sh_area.x2 - corner_size; @@ -1289,7 +1284,6 @@ static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, const } #endif - #if LV_USE_VALUE_STR static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, const lv_draw_rect_dsc_t * dsc) { @@ -1483,7 +1477,6 @@ static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * are if(mask_ofs < 0) mask_ofs = 0; _lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode); - fill_area.y1++; fill_area.y2++; } @@ -1523,4 +1516,3 @@ static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * are lv_draw_mask_remove_id(mask_rout_id); _lv_mem_buf_release(mask_buf); } - diff --git a/src/lv_draw/lv_draw_triangle.c b/src/lv_draw/lv_draw_triangle.c index e5775a7e2..a8fabfcaf 100644 --- a/src/lv_draw/lv_draw_triangle.c +++ b/src/lv_draw/lv_draw_triangle.c @@ -125,7 +125,6 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are i_next_right = y_min_i + 1; if(i_next_right > point_cnt - 1) i_next_right = 0; - /* Check if the order of points is inverted or not. * The normal case is when the left point is on `y_min_i - 1` * Explanation: diff --git a/src/lv_draw/lv_img_buf.c b/src/lv_draw/lv_img_buf.c index f18a6fd6c..ff454b73f 100644 --- a/src/lv_draw/lv_img_buf.c +++ b/src/lv_draw/lv_img_buf.c @@ -38,7 +38,6 @@ * GLOBAL FUNCTIONS **********************/ - /** * Get the color of an image's pixel * @param dsc an image descriptor @@ -411,7 +410,6 @@ uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf) } } - #if LV_USE_IMG_TRANSFORM /** * Initialize a descriptor to transform an image @@ -485,7 +483,6 @@ void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t return; } - res->x1 = (((-pivot->x) * zoom) >> 8) - 1; res->y1 = (((-pivot->y) * zoom) >> 8) - 1; res->x2 = (((w - pivot->x) * zoom) >> 8) + 2; @@ -683,4 +680,3 @@ bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc) /********************** * STATIC FUNCTIONS **********************/ - diff --git a/src/lv_draw/lv_img_buf.h b/src/lv_draw/lv_img_buf.h index 5b43456ac..93974b992 100644 --- a/src/lv_draw/lv_img_buf.h +++ b/src/lv_draw/lv_img_buf.h @@ -17,7 +17,6 @@ extern "C" { #include "../lv_misc/lv_color.h" #include "../lv_misc/lv_area.h" - /********************* * DEFINES *********************/ @@ -101,7 +100,6 @@ enum { }; typedef uint8_t lv_img_cf_t; - /** * LVGL image header */ @@ -120,7 +118,6 @@ typedef struct { non-printable character*/ uint32_t cf : 5; /* Color format: See `lv_img_color_format_t`*/ - } lv_img_header_t; #else typedef struct { @@ -163,7 +160,6 @@ typedef struct { lv_opa_t opa; } res; - struct { lv_img_dsc_t img_dsc; int32_t pivot_x_256; @@ -269,7 +265,6 @@ void lv_img_buf_free(lv_img_dsc_t * dsc); */ uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf); - #if LV_USE_IMG_TRANSFORM /** * Initialize a descriptor to rotate an image @@ -283,7 +278,6 @@ void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc); */ bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc); - /** * Get which color and opa would come to a pixel if it were rotated * @param dsc a descriptor initialized by `lv_img_buf_rotate_init` diff --git a/src/lv_draw/lv_img_decoder.c b/src/lv_draw/lv_img_decoder.c index 895c064bb..c70f32fbe 100644 --- a/src/lv_draw/lv_img_decoder.c +++ b/src/lv_draw/lv_img_decoder.c @@ -432,7 +432,6 @@ lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder /*The palette begins in the beginning of the image data. Just point to it.*/ lv_color32_t * palette_p = (lv_color32_t *)((lv_img_dsc_t *)dsc->src)->data; - uint32_t i; for(i = 0; i < palette_size; i++) { user_data->palette[i] = lv_color_make(palette_p[i].ch.red, palette_p[i].ch.green, palette_p[i].ch.blue); @@ -537,7 +536,6 @@ void lv_img_decoder_built_in_close(lv_img_decoder_t * decoder, lv_img_decoder_ds } } - /********************** * STATIC FUNCTIONS **********************/ diff --git a/src/lv_font/lv_font.h b/src/lv_font/lv_font.h index 6a72f02cf..d8c69f3f7 100644 --- a/src/lv_font/lv_font.h +++ b/src/lv_font/lv_font.h @@ -43,7 +43,6 @@ typedef struct { uint8_t bpp; /**< Bit-per-pixel: 1, 2, 4, 8*/ } lv_font_glyph_dsc_t; - /** The bitmaps might be upscaled by 3 to achieve subpixel rendering. */ enum { LV_FONT_SUBPX_NONE, @@ -75,7 +74,6 @@ typedef struct _lv_font_struct { lv_font_user_data_t user_data; /**< Custom user data for font. */ #endif - } lv_font_t; /********************** diff --git a/src/lv_font/lv_font_dejavu_16_persian_hebrew.c b/src/lv_font/lv_font_dejavu_16_persian_hebrew.c index 8a32111a7..4c4181806 100644 --- a/src/lv_font/lv_font_dejavu_16_persian_hebrew.c +++ b/src/lv_font/lv_font_dejavu_16_persian_hebrew.c @@ -5818,7 +5818,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -6508,8 +6507,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = } }; - - /*-------------------- * ALL CUSTOM DATA *--------------------*/ @@ -6527,7 +6524,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -6549,4 +6545,3 @@ lv_font_t lv_font_dejavu_16_persian_hebrew = { }; #endif /*#if LV_FONT_DEJAVU_16_PERSIAN_HEBREW*/ - diff --git a/src/lv_font/lv_font_fmt_txt.c b/src/lv_font/lv_font_fmt_txt.c index 011f55e86..75a084772 100644 --- a/src/lv_font/lv_font_fmt_txt.c +++ b/src/lv_font/lv_font_fmt_txt.c @@ -199,7 +199,6 @@ void _lv_font_clean_up_fmt_txt(void) } } - /********************** * STATIC FUNCTIONS **********************/ @@ -557,7 +556,6 @@ static inline uint8_t rle_next(void) rle_state = RLE_STATE_SINGLE; } - } else if(rle_state == RLE_STATE_COUNTER) { ret = rle_prev_v; diff --git a/src/lv_font/lv_font_fmt_txt.h b/src/lv_font/lv_font_fmt_txt.h index 863b19269..99d5ec0aa 100644 --- a/src/lv_font/lv_font_fmt_txt.h +++ b/src/lv_font/lv_font_fmt_txt.h @@ -45,7 +45,6 @@ typedef struct { #endif } lv_font_fmt_txt_glyph_dsc_t; - /** Format of font character map. */ enum { LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY, @@ -56,7 +55,6 @@ enum { typedef uint8_t lv_font_fmt_txt_cmap_type_t; - /* Map codepoints to a `glyph_dsc`s * Several formats are supported to optimize memory usage * See https://github.com/lvgl/lv_font_conv/blob/master/doc/font_spec.md @@ -145,7 +143,6 @@ typedef struct { uint8_t right_class_cnt; } lv_font_fmt_txt_kern_classes_t; - /** Bitmap formats*/ typedef enum { LV_FONT_FMT_TXT_PLAIN = 0, @@ -153,7 +150,6 @@ typedef enum { LV_FONT_FMT_TXT_COMPRESSED_NO_PREFILTER = 1, } lv_font_fmt_txt_bitmap_format_t; - /*Describe store additional data for fonts */ typedef struct { /*The bitmaps of all glyphs*/ diff --git a/src/lv_font/lv_font_loader.c b/src/lv_font/lv_font_loader.c index 7cde8370d..27f4c1030 100644 --- a/src/lv_font/lv_font_loader.c +++ b/src/lv_font/lv_font_loader.c @@ -16,7 +16,6 @@ #if LV_USE_FILESYSTEM - /********************** * TYPEDEFS **********************/ @@ -61,7 +60,6 @@ typedef struct cmap_table_bin { uint8_t padding; } cmap_table_bin_t; - /********************** * STATIC PROTOTYPES **********************/ @@ -72,7 +70,6 @@ int32_t load_kern(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint8_t f static int read_bits_signed(bit_iterator_t * it, int n_bits, lv_fs_res_t * res); static int read_bits(bit_iterator_t * it, int n_bits, lv_fs_res_t * res); - /********************** * MACROS **********************/ @@ -116,7 +113,6 @@ lv_font_t * lv_font_load(const char * font_name) return font; } - /** * Frees the memory allocated by the `lv_font_load()` function * @param font lv_font_t object created by the lv_font_load function @@ -185,7 +181,6 @@ void lv_font_free(lv_font_t * font) } } - /********************** * STATIC FUNCTIONS **********************/ @@ -691,4 +686,3 @@ int32_t load_kern(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint8_t f } #endif /*LV_USE_FILESYSTEM*/ - diff --git a/src/lv_font/lv_font_montserrat_10.c b/src/lv_font/lv_font_montserrat_10.c index 3f42da8b1..6d1dbfa54 100644 --- a/src/lv_font/lv_font_montserrat_10.c +++ b/src/lv_font/lv_font_montserrat_10.c @@ -947,7 +947,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -1141,7 +1140,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -1568,7 +1566,6 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -1595,7 +1592,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -1616,7 +1612,4 @@ lv_font_t lv_font_montserrat_10 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; - - #endif /*#if LV_FONT_MONTSERRAT_10*/ - diff --git a/src/lv_font/lv_font_montserrat_12.c b/src/lv_font/lv_font_montserrat_12.c index 209eea93e..dd1ef8f70 100644 --- a/src/lv_font/lv_font_montserrat_12.c +++ b/src/lv_font/lv_font_montserrat_12.c @@ -1201,7 +1201,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -1396,7 +1395,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -1826,7 +1824,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -1854,7 +1851,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -1876,4 +1872,3 @@ lv_font_t lv_font_montserrat_12 = { }; #endif /*#if LV_FONT_MONTSERRAT_12*/ - diff --git a/src/lv_font/lv_font_montserrat_12_subpx.c b/src/lv_font/lv_font_montserrat_12_subpx.c index 2bd1fc68d..2dddd60a8 100644 --- a/src/lv_font/lv_font_montserrat_12_subpx.c +++ b/src/lv_font/lv_font_montserrat_12_subpx.c @@ -1201,7 +1201,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -1396,7 +1395,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -1826,7 +1824,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -1854,7 +1851,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -1876,4 +1872,3 @@ lv_font_t lv_font_montserrat_12_subpx = { }; #endif /*#if LV_FONT_MONTSERRAT_12_SUBPX*/ - diff --git a/src/lv_font/lv_font_montserrat_14.c b/src/lv_font/lv_font_montserrat_14.c index 978742d5e..095073323 100644 --- a/src/lv_font/lv_font_montserrat_14.c +++ b/src/lv_font/lv_font_montserrat_14.c @@ -1470,7 +1470,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -1665,7 +1664,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -2095,7 +2093,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -2123,7 +2120,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -2145,4 +2141,3 @@ lv_font_t lv_font_montserrat_14 = { }; #endif /*#if LV_FONT_MONTSERRAT_14*/ - diff --git a/src/lv_font/lv_font_montserrat_16.c b/src/lv_font/lv_font_montserrat_16.c index eeaed4f80..2336c9c43 100644 --- a/src/lv_font/lv_font_montserrat_16.c +++ b/src/lv_font/lv_font_montserrat_16.c @@ -1733,7 +1733,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -1928,7 +1927,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -2358,7 +2356,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -2386,7 +2383,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -2408,4 +2404,3 @@ lv_font_t lv_font_montserrat_16 = { }; #endif /*#if LV_FONT_MONTSERRAT_16*/ - diff --git a/src/lv_font/lv_font_montserrat_18.c b/src/lv_font/lv_font_montserrat_18.c index c1850de0f..209d80ed0 100644 --- a/src/lv_font/lv_font_montserrat_18.c +++ b/src/lv_font/lv_font_montserrat_18.c @@ -2122,7 +2122,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -2317,7 +2316,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -2747,7 +2745,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -2775,7 +2772,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -2797,4 +2793,3 @@ lv_font_t lv_font_montserrat_18 = { }; #endif /*#if LV_FONT_MONTSERRAT_18*/ - diff --git a/src/lv_font/lv_font_montserrat_20.c b/src/lv_font/lv_font_montserrat_20.c index 6403288da..5b8762e25 100644 --- a/src/lv_font/lv_font_montserrat_20.c +++ b/src/lv_font/lv_font_montserrat_20.c @@ -2468,7 +2468,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -2663,7 +2662,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -3093,7 +3091,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -3121,7 +3118,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -3143,4 +3139,3 @@ lv_font_t lv_font_montserrat_20 = { }; #endif /*#if LV_FONT_MONTSERRAT_20*/ - diff --git a/src/lv_font/lv_font_montserrat_22.c b/src/lv_font/lv_font_montserrat_22.c index e1c1e42af..7308e6ea1 100644 --- a/src/lv_font/lv_font_montserrat_22.c +++ b/src/lv_font/lv_font_montserrat_22.c @@ -2885,7 +2885,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -3080,7 +3079,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -3510,7 +3508,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -3538,7 +3535,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -3560,4 +3556,3 @@ lv_font_t lv_font_montserrat_22 = { }; #endif /*#if LV_FONT_MONTSERRAT_22*/ - diff --git a/src/lv_font/lv_font_montserrat_24.c b/src/lv_font/lv_font_montserrat_24.c index 22f5f3a7e..e182ee73d 100644 --- a/src/lv_font/lv_font_montserrat_24.c +++ b/src/lv_font/lv_font_montserrat_24.c @@ -3286,7 +3286,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -3481,7 +3480,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -3911,7 +3909,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -3939,7 +3936,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -3961,4 +3957,3 @@ lv_font_t lv_font_montserrat_24 = { }; #endif /*#if LV_FONT_MONTSERRAT_24*/ - diff --git a/src/lv_font/lv_font_montserrat_26.c b/src/lv_font/lv_font_montserrat_26.c index 6d4e9db0c..9dacec475 100644 --- a/src/lv_font/lv_font_montserrat_26.c +++ b/src/lv_font/lv_font_montserrat_26.c @@ -3806,7 +3806,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -4001,7 +4000,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -4431,7 +4429,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -4459,7 +4456,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -4481,4 +4477,3 @@ lv_font_t lv_font_montserrat_26 = { }; #endif /*#if LV_FONT_MONTSERRAT_26*/ - diff --git a/src/lv_font/lv_font_montserrat_28.c b/src/lv_font/lv_font_montserrat_28.c index 59c381519..5e740fed6 100644 --- a/src/lv_font/lv_font_montserrat_28.c +++ b/src/lv_font/lv_font_montserrat_28.c @@ -4340,7 +4340,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -4535,7 +4534,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -4965,7 +4963,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -4993,7 +4990,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -5015,4 +5011,3 @@ lv_font_t lv_font_montserrat_28 = { }; #endif /*#if LV_FONT_MONTSERRAT_28*/ - diff --git a/src/lv_font/lv_font_montserrat_28_compressed.c b/src/lv_font/lv_font_montserrat_28_compressed.c index ef74c0a54..96e415365 100644 --- a/src/lv_font/lv_font_montserrat_28_compressed.c +++ b/src/lv_font/lv_font_montserrat_28_compressed.c @@ -2530,7 +2530,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0xff, 0x3a, 0xba, 0x40, 0x3f, 0xf9, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -2725,7 +2724,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -3155,7 +3153,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -3183,7 +3180,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 1 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -3205,4 +3201,3 @@ lv_font_t lv_font_montserrat_28_compressed = { }; #endif /*#if LV_FONT_MONTSERRAT_28_COMPRESSED*/ - diff --git a/src/lv_font/lv_font_montserrat_30.c b/src/lv_font/lv_font_montserrat_30.c index 93e024b01..bde5a9032 100644 --- a/src/lv_font/lv_font_montserrat_30.c +++ b/src/lv_font/lv_font_montserrat_30.c @@ -4906,7 +4906,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -5101,7 +5100,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -5531,7 +5529,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -5559,7 +5556,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -5581,4 +5577,3 @@ lv_font_t lv_font_montserrat_30 = { }; #endif /*#if LV_FONT_MONTSERRAT_30*/ - diff --git a/src/lv_font/lv_font_montserrat_32.c b/src/lv_font/lv_font_montserrat_32.c index 9a4485bec..a9fb7bd04 100644 --- a/src/lv_font/lv_font_montserrat_32.c +++ b/src/lv_font/lv_font_montserrat_32.c @@ -5383,7 +5383,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -5578,7 +5577,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -6008,7 +6006,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -6036,7 +6033,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -6058,4 +6054,3 @@ lv_font_t lv_font_montserrat_32 = { }; #endif /*#if LV_FONT_MONTSERRAT_32*/ - diff --git a/src/lv_font/lv_font_montserrat_34.c b/src/lv_font/lv_font_montserrat_34.c index 71f1ee64a..10fc05a4a 100644 --- a/src/lv_font/lv_font_montserrat_34.c +++ b/src/lv_font/lv_font_montserrat_34.c @@ -6160,7 +6160,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -6355,7 +6354,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -6785,7 +6783,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -6813,7 +6810,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -6835,4 +6831,3 @@ lv_font_t lv_font_montserrat_34 = { }; #endif /*#if LV_FONT_MONTSERRAT_34*/ - diff --git a/src/lv_font/lv_font_montserrat_36.c b/src/lv_font/lv_font_montserrat_36.c index 3c4104f2d..ef6c397c8 100644 --- a/src/lv_font/lv_font_montserrat_36.c +++ b/src/lv_font/lv_font_montserrat_36.c @@ -6787,7 +6787,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -6982,7 +6981,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -7412,7 +7410,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -7440,7 +7437,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -7462,4 +7458,3 @@ lv_font_t lv_font_montserrat_36 = { }; #endif /*#if LV_FONT_MONTSERRAT_36*/ - diff --git a/src/lv_font/lv_font_montserrat_38.c b/src/lv_font/lv_font_montserrat_38.c index 5f3cb1a8f..f86dfd9da 100644 --- a/src/lv_font/lv_font_montserrat_38.c +++ b/src/lv_font/lv_font_montserrat_38.c @@ -7510,7 +7510,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -7705,7 +7704,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -8135,7 +8133,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -8163,7 +8160,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -8185,4 +8181,3 @@ lv_font_t lv_font_montserrat_38 = { }; #endif /*#if LV_FONT_MONTSERRAT_38*/ - diff --git a/src/lv_font/lv_font_montserrat_40.c b/src/lv_font/lv_font_montserrat_40.c index a26745b21..815e8572c 100644 --- a/src/lv_font/lv_font_montserrat_40.c +++ b/src/lv_font/lv_font_montserrat_40.c @@ -8342,7 +8342,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -8537,7 +8536,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -8967,7 +8965,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -8995,7 +8992,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -9017,4 +9013,3 @@ lv_font_t lv_font_montserrat_40 = { }; #endif /*#if LV_FONT_MONTSERRAT_40*/ - diff --git a/src/lv_font/lv_font_montserrat_42.c b/src/lv_font/lv_font_montserrat_42.c index f386e40b1..d83dff5cb 100644 --- a/src/lv_font/lv_font_montserrat_42.c +++ b/src/lv_font/lv_font_montserrat_42.c @@ -9160,7 +9160,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -9355,7 +9354,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -9785,7 +9783,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -9813,7 +9810,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -9835,4 +9831,3 @@ lv_font_t lv_font_montserrat_42 = { }; #endif /*#if LV_FONT_MONTSERRAT_42*/ - diff --git a/src/lv_font/lv_font_montserrat_44.c b/src/lv_font/lv_font_montserrat_44.c index c87339779..feb6b21ce 100644 --- a/src/lv_font/lv_font_montserrat_44.c +++ b/src/lv_font/lv_font_montserrat_44.c @@ -9960,7 +9960,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -10155,7 +10154,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -10585,7 +10583,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -10613,7 +10610,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -10635,4 +10631,3 @@ lv_font_t lv_font_montserrat_44 = { }; #endif /*#if LV_FONT_MONTSERRAT_44*/ - diff --git a/src/lv_font/lv_font_montserrat_46.c b/src/lv_font/lv_font_montserrat_46.c index 01c1d6877..d6d9f06f2 100644 --- a/src/lv_font/lv_font_montserrat_46.c +++ b/src/lv_font/lv_font_montserrat_46.c @@ -10889,7 +10889,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -11084,7 +11083,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -11514,7 +11512,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -11542,7 +11539,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -11564,4 +11560,3 @@ lv_font_t lv_font_montserrat_46 = { }; #endif /*#if LV_FONT_MONTSERRAT_46*/ - diff --git a/src/lv_font/lv_font_montserrat_48.c b/src/lv_font/lv_font_montserrat_48.c index 1d24b1692..9a801ae59 100644 --- a/src/lv_font/lv_font_montserrat_48.c +++ b/src/lv_font/lv_font_montserrat_48.c @@ -11571,7 +11571,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -11766,7 +11765,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -12196,7 +12194,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -12224,7 +12221,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -12246,4 +12242,3 @@ lv_font_t lv_font_montserrat_48 = { }; #endif /*#if LV_FONT_MONTSERRAT_48*/ - diff --git a/src/lv_font/lv_font_montserrat_8.c b/src/lv_font/lv_font_montserrat_8.c index ae766a7d2..34f6d4cc9 100644 --- a/src/lv_font/lv_font_montserrat_8.c +++ b/src/lv_font/lv_font_montserrat_8.c @@ -739,7 +739,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -933,7 +932,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -1360,7 +1358,6 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -1387,7 +1384,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -1408,7 +1404,4 @@ lv_font_t lv_font_montserrat_8 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; - - #endif /*#if LV_FONT_MONTSERRAT_8*/ - diff --git a/src/lv_font/lv_font_simsun_16_cjk.c b/src/lv_font/lv_font_simsun_16_cjk.c index 8d57f1e53..7e8a38a0b 100644 --- a/src/lv_font/lv_font_simsun_16_cjk.c +++ b/src/lv_font/lv_font_simsun_16_cjk.c @@ -12639,7 +12639,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -13559,8 +13558,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = } }; - - /*-------------------- * ALL CUSTOM DATA *--------------------*/ @@ -13578,7 +13575,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -13600,4 +13596,3 @@ lv_font_t lv_font_simsun_16_cjk = { }; #endif /*#if LV_FONT_SIMSUN_16_CJK*/ - diff --git a/src/lv_font/lv_font_unscii_16.c b/src/lv_font/lv_font_unscii_16.c index 16bfc255d..1ce0bf719 100644 --- a/src/lv_font/lv_font_unscii_16.c +++ b/src/lv_font/lv_font_unscii_16.c @@ -471,7 +471,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0xc0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -580,8 +579,6 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { * CHARACTER MAPPING *--------------------*/ - - /*Collect the unicode lists and glyph_id offsets*/ static const lv_font_fmt_txt_cmap_t cmaps[] = { { @@ -590,8 +587,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { } }; - - /*-------------------- * ALL CUSTOM DATA *--------------------*/ @@ -609,7 +604,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -630,6 +624,4 @@ lv_font_t lv_font_unscii_16 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; - - #endif /*#if LV_FONT_UNSCII_16*/ diff --git a/src/lv_font/lv_font_unscii_8.c b/src/lv_font/lv_font_unscii_8.c index 4438d82e5..714f5486a 100644 --- a/src/lv_font/lv_font_unscii_8.c +++ b/src/lv_font/lv_font_unscii_8.c @@ -307,7 +307,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0xc1, 0x42, 0xbd, 0x2c, 0x40, 0x81, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -416,8 +415,6 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { * CHARACTER MAPPING *--------------------*/ - - /*Collect the unicode lists and glyph_id offsets*/ static const lv_font_fmt_txt_cmap_t cmaps[] = { { @@ -426,8 +423,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { } }; - - /*-------------------- * ALL CUSTOM DATA *--------------------*/ @@ -445,7 +440,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -466,6 +460,4 @@ lv_font_t lv_font_unscii_8 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; - - #endif /*#if LV_FONT_UNSCII_8*/ diff --git a/src/lv_font/lv_symbol_def.h b/src/lv_font/lv_symbol_def.h index 4ca5d54fa..bc32ec26f 100644 --- a/src/lv_font/lv_symbol_def.h +++ b/src/lv_font/lv_symbol_def.h @@ -156,10 +156,4 @@ enum { } /* extern "C" */ #endif - #endif /*LV_SYMBOL_DEF_H*/ - - - - - diff --git a/src/lv_gpu/lv_gpu_nxp_pxp.c b/src/lv_gpu/lv_gpu_nxp_pxp.c index ccb720297..c97b068d2 100644 --- a/src/lv_gpu/lv_gpu_nxp_pxp.c +++ b/src/lv_gpu/lv_gpu_nxp_pxp.c @@ -27,7 +27,6 @@ * */ - /********************* * INCLUDES *********************/ @@ -60,7 +59,6 @@ #error Only 16bit color depth is supported. Set LV_COLOR_DEPTH to 16. #endif - /********************** * TYPEDEFS **********************/ @@ -136,7 +134,6 @@ void lv_gpu_nxp_pxp_deinit(void) PXP_Deinit(LV_GPU_NXP_PXP_ID); } - /** * Fill area, with optional opacity. * @@ -283,7 +280,6 @@ void lv_gpu_nxp_pxp_blit(lv_color_t * dest, lv_coord_t dest_width, const lv_colo } PXP_EnableAlphaSurfaceOverlayColorKey(LV_GPU_NXP_PXP_ID, colorKeyEnabled); - /* Output buffer. */ outputBufferConfig.pixelFormat = (pxp_output_pixel_format_t)PXP_OUT_PIXEL_FORMAT; outputBufferConfig.interlacedMode = kPXP_OutputProgressive; diff --git a/src/lv_gpu/lv_gpu_nxp_pxp.h b/src/lv_gpu/lv_gpu_nxp_pxp.h index e3f10a445..e68d5a1b1 100644 --- a/src/lv_gpu/lv_gpu_nxp_pxp.h +++ b/src/lv_gpu/lv_gpu_nxp_pxp.h @@ -126,8 +126,6 @@ void lv_gpu_nxp_pxp_deinit(void); void lv_gpu_nxp_pxp_fill(lv_color_t * dest_buf, lv_coord_t dest_width, const lv_area_t * fill_area, lv_color_t color, lv_opa_t opa); - - /** * @brief BLock Image Transfer - copy rectangular image from src buffer to dst buffer with effects. * @@ -147,7 +145,6 @@ void lv_gpu_nxp_pxp_fill(lv_color_t * dest_buf, lv_coord_t dest_width, const lv_ void lv_gpu_nxp_pxp_blit(lv_color_t * dest, lv_coord_t dest_width, const lv_color_t * src, lv_coord_t src_width, lv_coord_t copy_width, lv_coord_t copy_height, lv_opa_t opa); - /** * @brief Enable color keying for subsequent calls to lv_gpu_nxp_pxp_blit() * @@ -161,7 +158,6 @@ void lv_gpu_nxp_pxp_enable_color_key(void); */ void lv_gpu_nxp_pxp_disable_color_key(void); - /** * @brief Enable recolor feature for subsequent calls to lv_gpu_nxp_pxp_blit() * diff --git a/src/lv_gpu/lv_gpu_nxp_pxp_osa.c b/src/lv_gpu/lv_gpu_nxp_pxp_osa.c index 19b4a12f1..81163c10a 100644 --- a/src/lv_gpu/lv_gpu_nxp_pxp_osa.c +++ b/src/lv_gpu/lv_gpu_nxp_pxp_osa.c @@ -43,7 +43,6 @@ #include "semphr.h" #endif - /********************* * DEFINES *********************/ diff --git a/src/lv_gpu/lv_gpu_nxp_vglite.c b/src/lv_gpu/lv_gpu_nxp_vglite.c index 8db4bce7a..3ac384c85 100644 --- a/src/lv_gpu/lv_gpu_nxp_vglite.c +++ b/src/lv_gpu/lv_gpu_nxp_vglite.c @@ -41,7 +41,6 @@ #include "fsl_cache.h" #include "vg_lite.h" - /********************* * DEFINES *********************/ @@ -117,7 +116,6 @@ lv_res_t lv_gpu_nxp_vglite_fill(lv_color_t * dest_buf, lv_coord_t dest_width, lv } else { /* fill with transparency */ - vg_lite_path_t path; lv_color32_t colMix; int16_t path_data[] = { /* VG rectangular path */ @@ -129,7 +127,6 @@ lv_res_t lv_gpu_nxp_vglite_fill(lv_color_t * dest_buf, lv_coord_t dest_width, lv VLC_OP_END }; - err |= vg_lite_init_path(&path, VG_LITE_S16, VG_LITE_LOW, sizeof(path_data), path_data, fill_area->x1, fill_area->y1, fill_area->x2 + 1, fill_area->y2 + 1); if(err != VG_LITE_SUCCESS) { @@ -176,7 +173,6 @@ lv_res_t lv_gpu_nxp_vglite_fill(lv_color_t * dest_buf, lv_coord_t dest_width, lv } } - /*** * BLock Image Transfer. * @param[in] blit Description of the transfer diff --git a/src/lv_gpu/lv_gpu_stm32_dma2d.h b/src/lv_gpu/lv_gpu_stm32_dma2d.h index f3d468049..59b14c00f 100644 --- a/src/lv_gpu/lv_gpu_stm32_dma2d.h +++ b/src/lv_gpu/lv_gpu_stm32_dma2d.h @@ -52,7 +52,6 @@ void lv_gpu_stm32_dma2d_init(void); void lv_gpu_stm32_dma2d_fill(lv_color_t * buf, lv_coord_t buf_w, lv_color_t color, lv_coord_t fill_w, lv_coord_t fill_h); - /** * Fill an area in the buffer with a color but take into account a mask which describes the opacity of each pixel * @param buf a buffer which should be filled using a mask @@ -93,7 +92,6 @@ void lv_gpu_stm32_dma2d_copy(lv_color_t * buf, lv_coord_t buf_w, const lv_color_ void lv_gpu_stm32_dma2d_blend(lv_color_t * buf, lv_coord_t buf_w, const lv_color_t * map, lv_opa_t opa, lv_coord_t map_w, lv_coord_t copy_w, lv_coord_t copy_h); - /** * Can be used as `gpu_wait_cb` in display driver to * let the MCU run while the GPU is working diff --git a/src/lv_hal/lv_hal_disp.c b/src/lv_hal/lv_hal_disp.c index d87afb55f..a79987cb6 100644 --- a/src/lv_hal/lv_hal_disp.c +++ b/src/lv_hal/lv_hal_disp.c @@ -333,7 +333,6 @@ LV_ATTRIBUTE_FLUSH_READY void lv_disp_flush_ready(lv_disp_drv_t * disp_drv) disp_drv->buffer->flushing_last = 0; } - /** * Tell if it's the last area of the refreshing process. * Can be called from `flush_cb` to execute some special display refreshing if needed when all areas area flushed. diff --git a/src/lv_hal/lv_hal_disp.h b/src/lv_hal/lv_hal_disp.h index 87b020843..cd77c3037 100644 --- a/src/lv_hal/lv_hal_disp.h +++ b/src/lv_hal/lv_hal_disp.h @@ -177,7 +177,6 @@ uint8_t del_prev : uint32_t last_activity_time; /**< Last time there was activity on this display */ } lv_disp_t; - typedef enum { LV_DISP_SIZE_SMALL, LV_DISP_SIZE_MEDIUM, diff --git a/src/lv_hal/lv_hal_indev.h b/src/lv_hal/lv_hal_indev.h index 1d4f77e7a..cb559f694 100644 --- a/src/lv_hal/lv_hal_indev.h +++ b/src/lv_hal/lv_hal_indev.h @@ -50,7 +50,6 @@ typedef uint8_t lv_indev_type_t; enum { LV_INDEV_STATE_REL = 0, LV_INDEV_STATE_PR }; typedef uint8_t lv_indev_state_t; - enum { LV_DRAG_DIR_HOR = 0x1, /**< Object can be dragged horizontally. */ LV_DRAG_DIR_VER = 0x2, /**< Object can be dragged vertically. */ @@ -78,7 +77,6 @@ typedef struct { lv_indev_state_t state; /**< LV_INDEV_STATE_REL or LV_INDEV_STATE_PR*/ } lv_indev_data_t; - /** Initialized by the user and registered by 'lv_indev_add()'*/ typedef struct _lv_indev_drv_t { diff --git a/src/lv_misc/lv_anim.c b/src/lv_misc/lv_anim.c index f813c9197..ed54cf635 100644 --- a/src/lv_misc/lv_anim.c +++ b/src/lv_misc/lv_anim.c @@ -351,7 +351,6 @@ lv_anim_value_t lv_anim_path_overshoot(const lv_anim_path_t * path, const lv_ani return (lv_anim_value_t)new_value; } - /** * Calculate the current value of an animation with 3 bounces * @param a pointer to an animation diff --git a/src/lv_misc/lv_anim.h b/src/lv_misc/lv_anim.h index e48dae50f..54baf5969 100644 --- a/src/lv_misc/lv_anim.h +++ b/src/lv_misc/lv_anim.h @@ -43,7 +43,6 @@ typedef lv_coord_t lv_anim_value_t; #define LV_ANIM_REPEAT_INFINITE 0xFFFF - struct _lv_anim_t; struct _lv_anim_path_t; /** Get the current value during an animation*/ @@ -54,8 +53,6 @@ typedef struct _lv_anim_path_t { void * user_data; } lv_anim_path_t; - - /** Generic prototype of "animator" functions. * First parameter is the variable to animate. * Second parameter is the value to set. @@ -101,7 +98,6 @@ typedef struct _lv_anim_t { uint32_t has_run : 1; /**< Indicates the animation has run in this round*/ } lv_anim_t; - /********************** * GLOBAL PROTOTYPES **********************/ @@ -202,7 +198,6 @@ static inline void lv_anim_set_path(lv_anim_t * a, const lv_anim_path_t * path) _lv_memcpy_small(&a->path, path, sizeof(lv_anim_path_t)); } - /** * Set a function call when the animation really starts (considering `delay`) * @param a pointer to an initialized `lv_anim_t` variable @@ -317,7 +312,6 @@ static inline int32_t lv_anim_get_delay(lv_anim_t * a) */ bool lv_anim_del(void * var, lv_anim_exec_xcb_t exec_cb); - /** * Get the animation of a variable and its `exec_cb`. * @param var pointer to variable diff --git a/src/lv_misc/lv_area.h b/src/lv_misc/lv_area.h index 879a9c03a..6394b73c9 100644 --- a/src/lv_misc/lv_area.h +++ b/src/lv_misc/lv_area.h @@ -49,8 +49,6 @@ typedef struct { lv_coord_t y2; } lv_area_t; - - /** Alignments */ enum { LV_ALIGN_CENTER = 0, @@ -77,7 +75,6 @@ enum { }; typedef uint8_t lv_align_t; - /********************** * GLOBAL PROTOTYPES **********************/ @@ -194,7 +191,6 @@ bool _lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p); */ bool _lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p, lv_coord_t radius); - /** * Align an area to an other * @param base an are where the other will be aligned diff --git a/src/lv_misc/lv_bidi.c b/src/lv_misc/lv_bidi.c index e3cf51463..ea1ab3354 100644 --- a/src/lv_misc/lv_bidi.c +++ b/src/lv_misc/lv_bidi.c @@ -625,7 +625,6 @@ static lv_bidi_dir_t bracket_process(const char * txt, uint32_t next_pos, uint32 } } - /*There where a previous strong char which can be used*/ if(bracket_dir != LV_BIDI_DIR_NEUTRAL) break; @@ -636,7 +635,6 @@ static lv_bidi_dir_t bracket_process(const char * txt, uint32_t next_pos, uint32 } } - /*The letter was an opening bracket*/ if(bracket_left[i] != '\0') { @@ -660,5 +658,4 @@ static lv_bidi_dir_t bracket_process(const char * txt, uint32_t next_pos, uint32 return LV_BIDI_DIR_NEUTRAL; } - #endif /*LV_USE_BIDI*/ diff --git a/src/lv_misc/lv_color.c b/src/lv_misc/lv_color.c index c0f3c0d23..f48bff581 100644 --- a/src/lv_misc/lv_color.c +++ b/src/lv_misc/lv_color.c @@ -127,13 +127,11 @@ LV_ATTRIBUTE_FAST_MEM void lv_color_fill(lv_color_t * buf, lv_color_t color, uin #endif } - lv_color_t lv_color_lighten(lv_color_t c, lv_opa_t lvl) { return lv_color_mix(LV_COLOR_WHITE, c, lvl); } - lv_color_t lv_color_darken(lv_color_t c, lv_opa_t lvl) { return lv_color_mix(LV_COLOR_BLACK, c, lvl); diff --git a/src/lv_misc/lv_color.h b/src/lv_misc/lv_color.h index 42f2c413e..74bd5256c 100644 --- a/src/lv_misc/lv_color.h +++ b/src/lv_misc/lv_color.h @@ -87,7 +87,6 @@ enum { #error "Invalid LV_COLOR_DEPTH in lv_conf.h! Set it to 1, 8, 16 or 32!" #endif - /* Adjust color mix functions rounding. * GPUs might calculate color mix (blending) differently. * Should be in range of 0..254 @@ -150,7 +149,6 @@ enum { # define LV_COLOR_GET_B32(c) (c).ch.blue # define LV_COLOR_GET_A32(c) (c).ch.alpha - /*--------------------------------------- * Macros for the current color depth * to set/get values of the color channels @@ -280,7 +278,6 @@ typedef lv_color32_t lv_color_t; #error "Invalid LV_COLOR_DEPTH in lv_conf.h! Set it to 1, 8, 16 or 32!" #endif - typedef struct { uint16_t h; uint8_t s; @@ -449,7 +446,6 @@ static inline uint32_t lv_color_to32(lv_color_t color) #endif } - //! @cond Doxygen_Suppress /** @@ -495,7 +491,6 @@ LV_ATTRIBUTE_FAST_MEM static inline void lv_color_premult(lv_color_t c, uint8_t } - /** * Mix two colors with a given ratio. It runs faster then `lv_color_mix` but requires some pre computation. * @param c1 The first color. Should be preprocessed with `lv_color_premult(c1)` @@ -527,7 +522,6 @@ LV_ATTRIBUTE_FAST_MEM static inline lv_color_t lv_color_mix_premult(uint16_t * p return ret; } - /** * Mix two colors. Both color can have alpha value. It requires ARGB888 colors. * @param bg_color background color @@ -663,7 +657,6 @@ static inline lv_color_t lv_color_hex3(uint32_t c) (uint8_t)((c & 0xF) | ((c & 0xF) << 4))); } - //! @cond Doxygen_Suppress //! LV_ATTRIBUTE_FAST_MEM void lv_color_fill(lv_color_t * buf, lv_color_t color, uint32_t px_num); @@ -698,7 +691,6 @@ lv_color_hsv_t lv_color_rgb_to_hsv(uint8_t r8, uint8_t g8, uint8_t b8); */ lv_color_hsv_t lv_color_to_hsv(lv_color_t color); - /********************** * MACROS **********************/ diff --git a/src/lv_misc/lv_debug.c b/src/lv_misc/lv_debug.c index 80229bb94..fd5bd86b5 100644 --- a/src/lv_misc/lv_debug.c +++ b/src/lv_misc/lv_debug.c @@ -135,6 +135,4 @@ void lv_debug_log_error(const char * msg, uint64_t value) * STATIC FUNCTIONS **********************/ - #endif /*LV_USE_DEBUG*/ - diff --git a/src/lv_misc/lv_debug.h b/src/lv_misc/lv_debug.h index 9160ceee8..82c92fe09 100644 --- a/src/lv_misc/lv_debug.h +++ b/src/lv_misc/lv_debug.h @@ -60,7 +60,6 @@ void lv_debug_log_error(const char * msg, uint64_t value); #define LV_DEBUG_IS_NULL(p) (lv_debug_check_null(p)) #endif - #ifndef LV_DEBUG_CHECK_MEM_INTEGRITY #define LV_DEBUG_CHECK_MEM_INTEGRITY() (lv_debug_check_mem_integrity()) #endif @@ -112,7 +111,6 @@ void lv_debug_log_error(const char * msg, uint64_t value); # endif #endif - #else /* LV_USE_DEBUG == 0 */ #define LV_DEBUG_ASSERT(expr, msg, value) do{}while(0) diff --git a/src/lv_misc/lv_gc.h b/src/lv_misc/lv_gc.h index c59ca5704..e1d7f4526 100644 --- a/src/lv_misc/lv_gc.h +++ b/src/lv_misc/lv_gc.h @@ -45,7 +45,6 @@ extern "C" { f(void * , _lv_theme_empty_styles) \ f(uint8_t *, _lv_font_decompr_buf) \ - #define LV_DEFINE_ROOT(root_type, root_name) root_type root_name; #define LV_ROOTS LV_ITERATE_ROOTS(LV_DEFINE_ROOT) diff --git a/src/lv_misc/lv_log.c b/src/lv_misc/lv_log.c index d3cd8215d..42b3b0251 100644 --- a/src/lv_misc/lv_log.c +++ b/src/lv_misc/lv_log.c @@ -53,7 +53,6 @@ void lv_log_register_print_cb(lv_log_print_g_cb_t print_cb) custom_print_cb = print_cb; } - /** * Add a log * @param level the level of log. (From `lv_log_level_t` enum) diff --git a/src/lv_misc/lv_math.c b/src/lv_misc/lv_math.c index b0ecfaad7..b66f75002 100644 --- a/src/lv_misc/lv_math.c +++ b/src/lv_misc/lv_math.c @@ -35,8 +35,6 @@ static const int16_t sin0_90_table[] = { 32269, 32364, 32448, 32523, 32587, 32642, 32687, 32722, 32747, 32762, 32767 }; - - /********************** * MACROS **********************/ diff --git a/src/lv_misc/lv_math.h b/src/lv_misc/lv_math.h index 3c5600d2b..f734f7b44 100644 --- a/src/lv_misc/lv_math.h +++ b/src/lv_misc/lv_math.h @@ -51,7 +51,6 @@ typedef struct { uint16_t f; } lv_sqrt_res_t; - /********************** * GLOBAL PROTOTYPES **********************/ @@ -85,7 +84,6 @@ int32_t _lv_bezier3(uint32_t t, int32_t u0, int32_t u1, int32_t u2, int32_t u3); */ uint16_t _lv_atan2(int x, int y); - //! @cond Doxygen_Suppress /** diff --git a/src/lv_misc/lv_mem.c b/src/lv_misc/lv_mem.c index a2cfd3489..33539391b 100644 --- a/src/lv_misc/lv_mem.c +++ b/src/lv_misc/lv_mem.c @@ -265,7 +265,6 @@ void lv_mem_free(const void * data) } - #endif /*LV_MEM_AUTO_DEFRAG*/ #else /*Use custom, user defined free function*/ #if LV_ENABLE_GC == 0 @@ -332,7 +331,6 @@ void * lv_mem_realloc(void * data_p, size_t new_size) } } - return new_p; } @@ -521,7 +519,6 @@ void * _lv_mem_buf_get(uint32_t size) return LV_GC_ROOT(_lv_mem_buf[i_guess]).p; } - /*Reallocate a free buffer*/ for(i = 0; i < LV_MEM_BUF_MAX_NUM; i++) { if(LV_GC_ROOT(_lv_mem_buf[i]).used == 0) { @@ -617,7 +614,6 @@ LV_ATTRIBUTE_FAST_MEM void * _lv_memcpy(void * dst, const void * src, size_t len return dst; } - /*Make the memories aligned*/ if(d_align) { d_align = ALIGN_MASK + 1 - d_align; @@ -650,7 +646,6 @@ LV_ATTRIBUTE_FAST_MEM void * _lv_memcpy(void * dst, const void * src, size_t len return dst; } - /** * Same as `memset` but optimized for 4 byte operation. * @param dst pointer to the destination buffer @@ -696,7 +691,6 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset(void * dst, uint8_t v, size_t len) len -= 4; } - d8 = (uint8_t *)d32; while(len) { *d8 = v; @@ -715,7 +709,6 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset_00(void * dst, size_t len) uint8_t * d8 = (uint8_t *) dst; uintptr_t d_align = (lv_uintptr_t) d8 & ALIGN_MASK; - /*Make the address aligned*/ if(d_align) { d_align = ALIGN_MASK + 1 - d_align; @@ -745,7 +738,6 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset_00(void * dst, size_t len) len -= 4; } - d8 = (uint8_t *)d32; while(len) { *d8 = 0; @@ -764,7 +756,6 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset_ff(void * dst, size_t len) uint8_t * d8 = (uint8_t *) dst; uintptr_t d_align = (lv_uintptr_t) d8 & ALIGN_MASK; - /*Make the address aligned*/ if(d_align) { d_align = ALIGN_MASK + 1 - d_align; @@ -794,7 +785,6 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset_ff(void * dst, size_t len) len -= 4; } - d8 = (uint8_t *)d32; while(len) { *d8 = 0xFF; diff --git a/src/lv_misc/lv_mem.h b/src/lv_misc/lv_mem.h index f3ca9c6f2..9c20a23f4 100644 --- a/src/lv_misc/lv_mem.h +++ b/src/lv_misc/lv_mem.h @@ -138,7 +138,6 @@ void _lv_mem_buf_release(void * p); */ void _lv_mem_buf_free_all(void); - //! @cond Doxygen_Suppress #if LV_MEMCPY_MEMSET_STD @@ -252,7 +251,6 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset_ff(void * dst, size_t len); #endif - /********************** * MACROS **********************/ diff --git a/src/lv_misc/lv_printf.c b/src/lv_misc/lv_printf.c index c8281038c..525788f5b 100644 --- a/src/lv_misc/lv_printf.c +++ b/src/lv_misc/lv_printf.c @@ -37,7 +37,6 @@ #include #include - #define PRINTF_DISABLE_SUPPORT_FLOAT LV_SPRINTF_DISABLE_FLOAT // 'ntoa' conversion buffer size, this must be big enough to hold one converted @@ -107,24 +106,20 @@ #define FLAGS_PRECISION (1U << 10U) #define FLAGS_ADAPT_EXP (1U << 11U) - // import float.h for DBL_MAX #if defined(PRINTF_SUPPORT_FLOAT) #include #endif - // output function type typedef void (*out_fct_type)(char character, void * buffer, size_t idx, size_t maxlen); - // wrapper (used as buffer) for output function type typedef struct { void (*fct)(char character, void * arg); void * arg; } out_fct_wrap_type; - // internal buffer output static inline void _out_buffer(char character, void * buffer, size_t idx, size_t maxlen) { @@ -133,7 +128,6 @@ static inline void _out_buffer(char character, void * buffer, size_t idx, size_t } } - // internal null output static inline void _out_null(char character, void * buffer, size_t idx, size_t maxlen) { @@ -143,8 +137,6 @@ static inline void _out_null(char character, void * buffer, size_t idx, size_t m (void)maxlen; } - - // internal secure strlen // \return The length of the string (excluding the terminating 0) limited by 'maxsize' static inline unsigned int _strnlen_s(const char * str, size_t maxsize) @@ -154,7 +146,6 @@ static inline unsigned int _strnlen_s(const char * str, size_t maxsize) return (unsigned int)(s - str); } - // internal test if char is a digit (0-9) // \return true if char is a digit static inline bool _is_digit(char ch) @@ -162,7 +153,6 @@ static inline bool _is_digit(char ch) return (ch >= '0') && (ch <= '9'); } - // internal ASCII string to unsigned int conversion static unsigned int _atoi(const char ** str) { @@ -173,7 +163,6 @@ static unsigned int _atoi(const char ** str) return i; } - // output the specified string in reverse, taking care of any zero-padding static size_t _out_rev(out_fct_type out, char * buffer, size_t idx, size_t maxlen, const char * buf, size_t len, unsigned int width, unsigned int flags) @@ -203,7 +192,6 @@ static size_t _out_rev(out_fct_type out, char * buffer, size_t idx, size_t maxle return idx; } - // internal itoa format static size_t _ntoa_format(out_fct_type out, char * buffer, size_t idx, size_t maxlen, char * buf, size_t len, bool negative, unsigned int base, unsigned int prec, unsigned int width, unsigned int flags) @@ -258,7 +246,6 @@ static size_t _ntoa_format(out_fct_type out, char * buffer, size_t idx, size_t m return _out_rev(out, buffer, idx, maxlen, buf, len, width, flags); } - // internal itoa for 'long' type static size_t _ntoa_long(out_fct_type out, char * buffer, size_t idx, size_t maxlen, unsigned long value, bool negative, unsigned long base, unsigned int prec, unsigned int width, unsigned int flags) @@ -283,7 +270,6 @@ static size_t _ntoa_long(out_fct_type out, char * buffer, size_t idx, size_t max return _ntoa_format(out, buffer, idx, maxlen, buf, len, negative, (unsigned int)base, prec, width, flags); } - // internal itoa for 'long long' type #if defined(PRINTF_SUPPORT_LONG_LONG) static size_t _ntoa_long_long(out_fct_type out, char * buffer, size_t idx, size_t maxlen, unsigned long long value, @@ -310,7 +296,6 @@ static size_t _ntoa_long_long(out_fct_type out, char * buffer, size_t idx, size_ } #endif // PRINTF_SUPPORT_LONG_LONG - #if defined(PRINTF_SUPPORT_FLOAT) #if defined(PRINTF_SUPPORT_EXPONENTIAL) @@ -319,7 +304,6 @@ static size_t _etoa(out_fct_type out, char * buffer, size_t idx, size_t maxlen, unsigned int width, unsigned int flags); #endif - // internal ftoa for fixed decimal floating point static size_t _ftoa(out_fct_type out, char * buffer, size_t idx, size_t maxlen, double value, unsigned int prec, unsigned int width, unsigned int flags) @@ -448,7 +432,6 @@ static size_t _ftoa(out_fct_type out, char * buffer, size_t idx, size_t maxlen, return _out_rev(out, buffer, idx, maxlen, buf, len, width, flags); } - #if defined(PRINTF_SUPPORT_EXPONENTIAL) // internal ftoa variant for exponential floating-point type, contributed by Martijn Jasperse static size_t _etoa(out_fct_type out, char * buffer, size_t idx, size_t maxlen, double value, unsigned int prec, @@ -562,7 +545,6 @@ static size_t _etoa(out_fct_type out, char * buffer, size_t idx, size_t maxlen, #endif // PRINTF_SUPPORT_EXPONENTIAL #endif // PRINTF_SUPPORT_FLOAT - // internal vsnprintf static int _vsnprintf(out_fct_type out, char * buffer, const size_t maxlen, const char * format, va_list va) { @@ -873,7 +855,6 @@ static int _vsnprintf(out_fct_type out, char * buffer, const size_t maxlen, cons return (int)idx; } - /////////////////////////////////////////////////////////////////////////////// int lv_snprintf(char * buffer, size_t count, const char * format, ...) @@ -891,4 +872,3 @@ int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va) } #endif /*LV_SPRINTF_CUSTOM*/ - diff --git a/src/lv_misc/lv_printf.h b/src/lv_misc/lv_printf.h index 9aa7073b3..1f9879f5c 100644 --- a/src/lv_misc/lv_printf.h +++ b/src/lv_misc/lv_printf.h @@ -32,7 +32,6 @@ #ifndef _LV_PRINTF_H_ #define _LV_PRINTF_H_ - #ifdef __cplusplus extern "C" { #endif @@ -61,10 +60,8 @@ int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va); #include LV_SPRINTF_INCLUDE #endif - #ifdef __cplusplus } #endif - #endif // _PRINTF_H_ diff --git a/src/lv_misc/lv_task.c b/src/lv_misc/lv_task.c index c051d9faa..04a240b88 100644 --- a/src/lv_misc/lv_task.c +++ b/src/lv_misc/lv_task.c @@ -70,7 +70,6 @@ void _lv_task_core_init(void) LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) { - LV_LOG_TRACE("lv_task_handler started"); /*Avoid concurrent running of the task handler*/ diff --git a/src/lv_misc/lv_txt.c b/src/lv_misc/lv_txt.c index 619545367..0521aab3a 100644 --- a/src/lv_misc/lv_txt.c +++ b/src/lv_misc/lv_txt.c @@ -234,7 +234,6 @@ static uint32_t lv_txt_get_next_word(const char * txt, const lv_font_t * font, /* Update the output width */ if(word_w_ptr != NULL && break_index == NO_BREAK_FOUND) *word_w_ptr = cur_w; - i = i_next; i_next = i_next_next; letter = letter_next; diff --git a/src/lv_misc/lv_txt_ap.c b/src/lv_misc/lv_txt_ap.c index 1bf68207d..673babeee 100644 --- a/src/lv_misc/lv_txt_ap.c +++ b/src/lv_misc/lv_txt_ap.c @@ -12,7 +12,6 @@ #include "lv_txt_ap.h" #include "../lv_draw/lv_draw.h" - /********************* * DEFINES *********************/ @@ -126,7 +125,6 @@ uint32_t _lv_txt_ap_calc_bytes_cnt(const char * txt) return chars_cnt + 1; } - void _lv_txt_ap_proc(const char * txt, char * txt_out) { uint32_t txt_length = 0; diff --git a/src/lv_misc/lv_types.h b/src/lv_misc/lv_types.h index 92c75ee39..5f49a0e6c 100644 --- a/src/lv_misc/lv_types.h +++ b/src/lv_misc/lv_types.h @@ -22,7 +22,6 @@ extern "C" { #include #endif - // If __UINTPTR_MAX__ or UINTPTR_MAX are available, use them to determine arch size #if defined(__UINTPTR_MAX__) && __UINTPTR_MAX__ > 0xFFFFFFFF #define LV_ARCH_64 @@ -36,7 +35,6 @@ extern "C" { #endif - /********************** * TYPEDEFS **********************/ @@ -51,8 +49,6 @@ enum { }; typedef uint8_t lv_res_t; - - #if defined(__cplusplus) || __STDC_VERSION__ >= 199901L // If c99 or newer, use the definition of uintptr_t directly from typedef uintptr_t lv_uintptr_t; @@ -68,7 +64,6 @@ typedef uint32_t lv_uintptr_t; #endif - /********************** * GLOBAL PROTOTYPES **********************/ @@ -84,4 +79,3 @@ typedef uint32_t lv_uintptr_t; #endif #endif /*LV_TYPES_H*/ - diff --git a/src/lv_themes/lv_theme.c b/src/lv_themes/lv_theme.c index 2c36b4f08..faed5e4f3 100644 --- a/src/lv_themes/lv_theme.c +++ b/src/lv_themes/lv_theme.c @@ -357,7 +357,6 @@ static void clear_styles(lv_obj_t * obj, lv_theme_style_t name) break; #endif - #if LV_USE_ROLLER case LV_THEME_ROLLER: lv_obj_clean_style_list(obj, LV_ROLLER_PART_BG); @@ -365,7 +364,6 @@ static void clear_styles(lv_obj_t * obj, lv_theme_style_t name) break; #endif - #if LV_USE_OBJMASK case LV_THEME_OBJMASK: lv_obj_clean_style_list(obj, LV_OBJMASK_PART_MAIN); @@ -432,7 +430,6 @@ static void clear_styles(lv_obj_t * obj, lv_theme_style_t name) break; #endif - #if LV_USE_SPINBOX case LV_THEME_SPINBOX: lv_obj_clean_style_list(obj, LV_SPINBOX_PART_BG); diff --git a/src/lv_themes/lv_theme_empty.c b/src/lv_themes/lv_theme_empty.c index 6900ef23c..7d565e475 100644 --- a/src/lv_themes/lv_theme_empty.c +++ b/src/lv_themes/lv_theme_empty.c @@ -77,7 +77,6 @@ lv_theme_t * lv_theme_empty_init(lv_color_t color_primary, lv_color_t color_seco styles = (theme_styles_t *)LV_GC_ROOT(_lv_theme_empty_styles); } - theme.color_primary = color_primary; theme.color_secondary = color_secondary; theme.font_small = font_small; @@ -94,7 +93,6 @@ lv_theme_t * lv_theme_empty_init(lv_color_t color_primary, lv_color_t color_seco return &theme; } - static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) { LV_UNUSED(th); diff --git a/src/lv_themes/lv_theme_empty.h b/src/lv_themes/lv_theme_empty.h index c12fdf12c..6611fad33 100644 --- a/src/lv_themes/lv_theme_empty.h +++ b/src/lv_themes/lv_theme_empty.h @@ -29,7 +29,6 @@ extern "C" { * GLOBAL PROTOTYPES **********************/ - /** * Initialize the default * @param color_primary the primary color of the theme diff --git a/src/lv_themes/lv_theme_material.c b/src/lv_themes/lv_theme_material.c index 43c3d4927..73d2e618d 100644 --- a/src/lv_themes/lv_theme_material.c +++ b/src/lv_themes/lv_theme_material.c @@ -875,7 +875,6 @@ static void tabview_win_shared_init(void) #endif } - /********************** * GLOBAL FUNCTIONS **********************/ @@ -955,7 +954,6 @@ lv_theme_t * lv_theme_material_init(lv_color_t color_primary, lv_color_t color_s return &theme; } - static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) { LV_UNUSED(th); @@ -1187,7 +1185,6 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) break; #endif - #if LV_USE_ROLLER case LV_THEME_ROLLER: list = lv_obj_get_style_list(obj, LV_ROLLER_PART_BG); @@ -1211,7 +1208,6 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) _lv_style_list_add_style(list, &styles->bg); _lv_style_list_add_style(list, &styles->list_bg); - list = lv_obj_get_style_list(obj, LV_LIST_PART_SCROLLBAR); _lv_style_list_add_style(list, &styles->sb); break; @@ -1315,7 +1311,6 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) #endif - #if LV_USE_SPINBOX case LV_THEME_SPINBOX: list = lv_obj_get_style_list(obj, LV_SPINBOX_PART_BG); diff --git a/src/lv_themes/lv_theme_mono.c b/src/lv_themes/lv_theme_mono.c index bfd12652b..0f2b1d233 100644 --- a/src/lv_themes/lv_theme_mono.c +++ b/src/lv_themes/lv_theme_mono.c @@ -173,11 +173,9 @@ static void basic_init(void) style_init_reset(&styles->no_radius); lv_style_set_radius(&styles->no_radius, LV_STATE_DEFAULT, 0); - style_init_reset(&styles->border_none); lv_style_set_border_width(&styles->border_none, LV_STATE_DEFAULT, 0); - style_init_reset(&styles->fg_color); lv_style_set_bg_color(&styles->fg_color, LV_STATE_DEFAULT, FG_COLOR); lv_style_set_text_color(&styles->fg_color, LV_STATE_DEFAULT, BG_COLOR); @@ -242,7 +240,6 @@ static void btn_init(void) #endif } - static void btnmatrix_init(void) { #if LV_USE_BTNMATRIX @@ -250,7 +247,6 @@ static void btnmatrix_init(void) #endif } - static void calendar_init(void) { #if LV_USE_CALENDAR @@ -283,7 +279,6 @@ static void chart_init(void) #endif } - static void cpicker_init(void) { #if LV_USE_CPICKER @@ -298,7 +293,6 @@ static void checkbox_init(void) #endif } - static void cont_init(void) { #if LV_USE_CONT != 0 @@ -306,7 +300,6 @@ static void cont_init(void) #endif } - static void gauge_init(void) { #if LV_USE_GAUGE != 0 @@ -342,7 +335,6 @@ static void label_init(void) #endif } - static void linemeter_init(void) { #if LV_USE_LINEMETER != 0 @@ -393,7 +385,6 @@ static void switch_init(void) #endif } - static void spinbox_init(void) { #if LV_USE_SPINBOX @@ -401,7 +392,6 @@ static void spinbox_init(void) #endif } - static void spinner_init(void) { #if LV_USE_SPINNER != 0 @@ -492,7 +482,6 @@ static void win_init(void) #endif } - /********************** * GLOBAL FUNCTIONS **********************/ @@ -567,7 +556,6 @@ lv_theme_t * lv_theme_mono_init(lv_color_t color_primary, lv_color_t color_secon return &theme; } - static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) { LV_UNUSED(th); @@ -812,7 +800,6 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) break; #endif - #if LV_USE_ROLLER case LV_THEME_ROLLER: list = lv_obj_get_style_list(obj, LV_ROLLER_PART_BG); @@ -826,7 +813,6 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) break; #endif - #if LV_USE_OBJMASK case LV_THEME_OBJMASK: list = lv_obj_get_style_list(obj, LV_OBJMASK_PART_MAIN); @@ -940,7 +926,6 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) break; #endif - #if LV_USE_SPINBOX case LV_THEME_SPINBOX: list = lv_obj_get_style_list(obj, LV_SPINBOX_PART_BG); @@ -1019,10 +1004,8 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) break; } - lv_obj_refresh_style(obj, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL); - } /********************** diff --git a/src/lv_themes/lv_theme_mono.h b/src/lv_themes/lv_theme_mono.h index 7d252e3b0..3a9044d64 100644 --- a/src/lv_themes/lv_theme_mono.h +++ b/src/lv_themes/lv_theme_mono.h @@ -29,7 +29,6 @@ extern "C" { * GLOBAL PROTOTYPES **********************/ - /** * Initialize the mono theme. * @param color_primary the primary color of the theme diff --git a/src/lv_themes/lv_theme_template.c b/src/lv_themes/lv_theme_template.c index 18a47a1ca..5efa05018 100644 --- a/src/lv_themes/lv_theme_template.c +++ b/src/lv_themes/lv_theme_template.c @@ -57,7 +57,6 @@ static bool inited; **********************/ static void style_init_reset(lv_style_t * style); - static void basic_init(void) { style_init_reset(&styles->bg); @@ -131,7 +130,6 @@ static void btn_init(void) #endif } - static void btnmatrix_init(void) { #if LV_USE_BTNMATRIX @@ -139,7 +137,6 @@ static void btnmatrix_init(void) #endif } - static void calendar_init(void) { #if LV_USE_CALENDAR @@ -154,7 +151,6 @@ static void chart_init(void) #endif } - static void cpicker_init(void) { #if LV_USE_CPICKER @@ -169,7 +165,6 @@ static void checkbox_init(void) #endif } - static void cont_init(void) { #if LV_USE_CONT != 0 @@ -177,7 +172,6 @@ static void cont_init(void) #endif } - static void gauge_init(void) { #if LV_USE_GAUGE != 0 @@ -199,7 +193,6 @@ static void label_init(void) #endif } - static void linemeter_init(void) { #if LV_USE_LINEMETER != 0 @@ -242,7 +235,6 @@ static void switch_init(void) #endif } - static void spinbox_init(void) { #if LV_USE_SPINBOX @@ -250,7 +242,6 @@ static void spinbox_init(void) #endif } - static void spinner_init(void) { #if LV_USE_SPINNER != 0 @@ -327,7 +318,6 @@ static void win_init(void) #endif } - /********************** * GLOBAL FUNCTIONS **********************/ @@ -407,7 +397,6 @@ lv_theme_t * lv_theme_template_init(lv_color_t color_primary, lv_color_t color_s return &theme; } - void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) { LV_UNUSED(th); @@ -658,7 +647,6 @@ void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) break; #endif - #if LV_USE_ROLLER case LV_THEME_ROLLER: list = lv_obj_get_style_list(obj, LV_ROLLER_PART_BG); @@ -670,7 +658,6 @@ void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) break; #endif - #if LV_USE_OBJMASK case LV_THEME_OBJMASK: list = lv_obj_get_style_list(obj, LV_OBJMASK_PART_MAIN); @@ -782,7 +769,6 @@ void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) break; #endif - #if LV_USE_SPINBOX case LV_THEME_SPINBOX: list = lv_obj_get_style_list(obj, LV_SPINBOX_PART_BG); diff --git a/src/lv_themes/lv_theme_template.h b/src/lv_themes/lv_theme_template.h index afefc958e..c71a265c8 100644 --- a/src/lv_themes/lv_theme_template.h +++ b/src/lv_themes/lv_theme_template.h @@ -29,7 +29,6 @@ extern "C" { * GLOBAL PROTOTYPES **********************/ - /** * Initialize the default * @param color_primary the primary color of the theme diff --git a/src/lv_widgets/lv_arc.c b/src/lv_widgets/lv_arc.c index 95e7557b8..50b5ba248 100644 --- a/src/lv_widgets/lv_arc.c +++ b/src/lv_widgets/lv_arc.c @@ -218,7 +218,6 @@ void lv_arc_set_end_angle(lv_obj_t * arc, uint16_t end) ext->arc_angle_end = end; } - /** * Set the start and end angles * @param arc pointer to an arc object @@ -353,7 +352,6 @@ void lv_arc_set_rotation(lv_obj_t * arc, uint16_t rotation_angle) lv_obj_invalidate(arc); } - /** * Set the type of arc. * @param arc pointer to arc object @@ -529,7 +527,6 @@ uint16_t lv_arc_get_bg_angle_end(lv_obj_t * arc) return ext->bg_angle_end; } - /** * Get the value of a arc * @param arc pointer to a arc object @@ -661,7 +658,6 @@ static lv_design_res_t lv_arc_design(lv_obj_t * arc, const lv_area_t * clip_area &arc_dsc); } - /*make the indicator arc smaller or larger according to its greatest padding value*/ lv_coord_t left_indic = lv_obj_get_style_pad_left(arc, LV_ARC_PART_INDIC); lv_coord_t right_indic = lv_obj_get_style_pad_right(arc, LV_ARC_PART_INDIC); @@ -768,7 +764,6 @@ static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param) bg_end = ext->bg_angle_end + 360; } - angle = _lv_atan2(p.y, p.x); angle -= ext->rotation_angle; angle -= ext->bg_angle_start; /*Make the angle relative to the start angle*/ @@ -1044,7 +1039,6 @@ static void get_center(lv_obj_t * arc, lv_point_t * center, lv_coord_t * arc_r) center->x = arc->coords.x1 + r + left_bg; center->y = arc->coords.y1 + r + top_bg; - lv_coord_t indic_width = lv_obj_get_style_line_width(arc, LV_ARC_PART_INDIC); r -= indic_width; } diff --git a/src/lv_widgets/lv_arc.h b/src/lv_widgets/lv_arc.h index 55494a8d7..5f379219a 100644 --- a/src/lv_widgets/lv_arc.h +++ b/src/lv_widgets/lv_arc.h @@ -138,7 +138,6 @@ void lv_arc_set_bg_angles(lv_obj_t * arc, uint16_t start, uint16_t end); */ void lv_arc_set_rotation(lv_obj_t * arc, uint16_t rotation_angle); - /** * Set the type of arc. * @param arc pointer to arc object diff --git a/src/lv_widgets/lv_bar.c b/src/lv_widgets/lv_bar.c index 37112fdce..5545f1019 100644 --- a/src/lv_widgets/lv_bar.c +++ b/src/lv_widgets/lv_bar.c @@ -109,7 +109,6 @@ lv_obj_t * lv_bar_create(lv_obj_t * par, const lv_obj_t * copy) lv_obj_set_signal_cb(bar, lv_bar_signal); lv_obj_set_design_cb(bar, lv_bar_design); - /*Init the new bar object*/ if(copy == NULL) { @@ -162,7 +161,6 @@ void lv_bar_set_value(lv_obj_t * bar, int16_t value, lv_anim_enable_t anim) new_value = new_value < ext->min_value ? ext->min_value : new_value; new_value = new_value < ext->start_value ? ext->start_value : new_value; - if(ext->cur_value == new_value) return; #if LV_USE_ANIMATION == 0 LV_UNUSED(anim); @@ -355,7 +353,6 @@ uint16_t lv_bar_get_anim_time(const lv_obj_t * bar) #endif } - /********************** * STATIC FUNCTIONS **********************/ diff --git a/src/lv_widgets/lv_btnmatrix.c b/src/lv_widgets/lv_btnmatrix.c index 8829b7107..783fc96ed 100644 --- a/src/lv_widgets/lv_btnmatrix.c +++ b/src/lv_widgets/lv_btnmatrix.c @@ -299,7 +299,6 @@ void lv_btnmatrix_set_focused_btn(lv_obj_t * btnm, uint16_t id) lv_obj_invalidate(btnm); } - /** * Enable recoloring of button's texts * @param btnm pointer to button matrix object @@ -401,7 +400,6 @@ void lv_btnmatrix_set_btn_width(lv_obj_t * btnm, uint16_t btn_id, uint8_t width) { LV_ASSERT_OBJ(btnm, LV_OBJX_NAME); - lv_btnmatrix_ext_t * ext = lv_obj_get_ext_attr(btnm); if(btn_id >= ext->btn_cnt) return; ext->ctrl_bits[btn_id] &= (~LV_BTNMATRIX_WIDTH_MASK); @@ -571,7 +569,6 @@ bool lv_btnmatrix_get_btn_ctrl(lv_obj_t * btnm, uint16_t btn_id, lv_btnmatrix_ct return (ext->ctrl_bits[btn_id] & ctrl) ? true : false; } - /** * Find whether "one check" mode is enabled. * @param btnm Button matrix object @@ -955,7 +952,6 @@ static lv_res_t lv_btnmatrix_signal(lv_obj_t * btnm, lv_signal_t sign, void * pa invalidate_button_area(btnm, ext->btn_id_pr); invalidate_button_area(btnm, ext->btn_id_focused); - lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act()); if(indev_type == LV_INDEV_TYPE_KEYPAD || indev_type == LV_INDEV_TYPE_ENCODER) { ext->btn_id_focused = ext->btn_id_pr; @@ -1151,7 +1147,6 @@ static void allocate_btn_areas_and_controls(const lv_obj_t * btnm, const char ** /*Do not allocate memory for the same amount of buttons*/ if(btn_cnt == ext->btn_cnt) return; - if(ext->button_areas != NULL) { lv_mem_free(ext->button_areas); ext->button_areas = NULL; diff --git a/src/lv_widgets/lv_calendar.c b/src/lv_widgets/lv_calendar.c index 0ec2e8811..9346ca653 100644 --- a/src/lv_widgets/lv_calendar.c +++ b/src/lv_widgets/lv_calendar.c @@ -119,7 +119,6 @@ lv_obj_t * lv_calendar_create(lv_obj_t * par, const lv_obj_t * copy) ext->btn_pressing = 0; - lv_style_list_init(&ext->style_date_nums); lv_style_list_init(&ext->style_day_names); lv_style_list_init(&ext->style_header); @@ -581,7 +580,6 @@ static lv_style_list_t * lv_calendar_get_style(lv_obj_t * calendar, uint8_t part lv_calendar_ext_t * ext = lv_obj_get_ext_attr(calendar); lv_style_list_t * style_dsc_p; - switch(part) { case LV_CALENDAR_PART_BG: style_dsc_p = &calendar->style_list; @@ -942,7 +940,6 @@ static void draw_dates(lv_obj_t * calendar, const lv_area_t * clip_area) box_area.x1 = label_area.x1; box_area.x2 = label_area.x2; - lv_draw_rect(&box_area, clip_area, &rect_dsc); /*Write the day's number*/ @@ -956,7 +953,6 @@ static void draw_dates(lv_obj_t * calendar, const lv_area_t * clip_area) calendar->state = state_ori; _lv_obj_disable_style_caching(calendar, false); - } /** @@ -972,7 +968,6 @@ static bool is_highlighted(lv_obj_t * calendar, day_draw_state_t draw_state, int { lv_calendar_ext_t * ext = lv_obj_get_ext_attr(calendar); - if(draw_state == DAY_DRAW_PREV_MONTH) { year -= month == 1 ? 1 : 0; month = month == 1 ? 12 : month - 1; @@ -1006,7 +1001,6 @@ static bool is_pressed(lv_obj_t * calendar, day_draw_state_t draw_state, int32_t { lv_calendar_ext_t * ext = lv_obj_get_ext_attr(calendar); - if(draw_state == DAY_DRAW_PREV_MONTH) { year -= month == 1 ? 1 : 0; month = month == 1 ? 12 : month - 1; diff --git a/src/lv_widgets/lv_canvas.c b/src/lv_widgets/lv_canvas.c index a098e1bac..4203779c6 100644 --- a/src/lv_widgets/lv_canvas.c +++ b/src/lv_widgets/lv_canvas.c @@ -44,7 +44,6 @@ static void set_px_cb_alpha2(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t static void set_px_cb_alpha4(lv_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); - static void set_px_cb_alpha8(lv_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); @@ -377,7 +376,6 @@ void lv_canvas_transform(lv_obj_t * canvas, lv_img_dsc_t * img, int16_t angle, u #endif } - /** * Apply horizontal blur on the canvas * @param canvas pointer to a canvas object @@ -440,7 +438,6 @@ void lv_canvas_blur_hor(lv_obj_t * canvas, const lv_area_t * area, uint16_t r) lv_opa_t opa = LV_OPA_TRANSP; _lv_memcpy(line_buf, &ext->dsc.data[y * line_w], line_w); - for(x = a.x1 - r_back; x <= a.x1 + r_front; x++) { x_safe = x < 0 ? 0 : x; x_safe = x_safe > ext->dsc.header.w - 1 ? ext->dsc.header.w - 1 : x_safe; @@ -513,7 +510,6 @@ void lv_canvas_blur_hor(lv_obj_t * canvas, const lv_area_t * area, uint16_t r) _lv_mem_buf_release(line_buf); } - /** * Apply vertical blur on the canvas * @param canvas pointer to a canvas object @@ -1210,7 +1206,6 @@ static void set_px_alpha_generic(lv_img_dsc_t * d, lv_coord_t x, lv_coord_t y, l lv_img_buf_set_px_alpha(d, x, y, br); } - static void set_px_true_color_alpha(lv_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) @@ -1233,7 +1228,6 @@ static void set_px_true_color_alpha(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_ lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &res_opa); - lv_img_buf_set_px_alpha(&d, x, y, res_opa); lv_img_buf_set_px_color(&d, x, y, res_color); } diff --git a/src/lv_widgets/lv_canvas.h b/src/lv_widgets/lv_canvas.h index de1a26bf4..0c9ca80da 100644 --- a/src/lv_widgets/lv_canvas.h +++ b/src/lv_widgets/lv_canvas.h @@ -148,8 +148,6 @@ void lv_canvas_transform(lv_obj_t * canvas, lv_img_dsc_t * img, int16_t angle, u lv_coord_t offset_y, int32_t pivot_x, int32_t pivot_y, bool antialias); - - /** * Apply horizontal blur on the canvas * @param canvas pointer to a canvas object diff --git a/src/lv_widgets/lv_chart.c b/src/lv_widgets/lv_chart.c index 47609d3e3..b6ed55ce7 100644 --- a/src/lv_widgets/lv_chart.c +++ b/src/lv_widgets/lv_chart.c @@ -289,7 +289,6 @@ void lv_chart_hide_series(lv_obj_t * chart, lv_chart_series_t * series, bool hid lv_chart_refresh(chart); } - /*===================== * Setter functions *====================*/ @@ -710,7 +709,6 @@ void lv_chart_set_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_ lv_chart_refresh(chart); } - /*===================== * Getter functions *====================*/ @@ -848,7 +846,6 @@ lv_coord_t lv_chart_get_x_from_index(lv_obj_t * chart, lv_chart_series_t * ser, lv_coord_t x = 0; - if(ext->type & LV_CHART_TYPE_LINE) { x = (w * id) / (ext->point_cnt - 1); } @@ -963,7 +960,6 @@ static lv_design_res_t lv_chart_design(lv_obj_t * chart, const lv_area_t * clip_ draw_series_bg(chart, &series_area, clip_area); draw_axes(chart, &series_area, clip_area); - lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart); if(ext->type & LV_CHART_TYPE_LINE) draw_series_line(chart, &series_area, clip_area); if(ext->type & LV_CHART_TYPE_COLUMN) draw_series_column(chart, &series_area, clip_area); @@ -1016,7 +1012,6 @@ static lv_res_t lv_chart_signal(lv_obj_t * chart, lv_signal_t sign, void * param return res; } - /** * Get the style descriptor of a part of the object * @param chart pointer the object @@ -1172,7 +1167,6 @@ static void draw_series_line(lv_obj_t * chart, const lv_area_t * series_area, co point_dsc.bg_opa = line_dsc.opa; point_dsc.radius = LV_RADIUS_CIRCLE; - lv_coord_t point_radius = lv_obj_get_style_size(chart, LV_CHART_PART_SERIES); /*Do not bother with line ending is the point will over it*/ @@ -1710,7 +1704,6 @@ static void draw_x_ticks(lv_obj_t * chart, const lv_area_t * series_area, const lv_draw_label_dsc_init(&label_dsc); lv_obj_init_draw_label_dsc(chart, LV_CHART_PART_BG, &label_dsc); - /* calculate the size of tick marks */ if(ext->x_axis.major_tick_len == LV_CHART_TICK_LENGTH_AUTO) major_tick_len = (int32_t)w * LV_CHART_AXIS_MAJOR_TICK_LEN_COE; @@ -1835,7 +1828,6 @@ static void invalidate_lines(lv_obj_t * chart, uint16_t i) } } - /** * invalid area of the new column data lines on a chart * @param chart pointer to chart object diff --git a/src/lv_widgets/lv_chart.h b/src/lv_widgets/lv_chart.h index 0234b411d..df75a6d36 100644 --- a/src/lv_widgets/lv_chart.h +++ b/src/lv_widgets/lv_chart.h @@ -52,7 +52,6 @@ enum { }; typedef uint8_t lv_chart_update_mode_t; - enum { LV_CHART_AXIS_PRIMARY_Y, LV_CHART_AXIS_SECONDARY_Y, @@ -185,12 +184,10 @@ void lv_chart_clear_series(lv_obj_t * chart, lv_chart_series_t * series); */ void lv_chart_hide_series(lv_obj_t * chart, lv_chart_series_t * series, bool hide); - /*===================== * Setter functions *====================*/ - /** * Set the number of horizontal and vertical division lines * @param chart pointer to a graph background object @@ -359,7 +356,6 @@ void lv_chart_set_series_axis(lv_obj_t * chart, lv_chart_series_t * ser, lv_char */ void lv_chart_set_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_point_t * point); - /*===================== * Getter functions *====================*/ diff --git a/src/lv_widgets/lv_checkbox.c b/src/lv_widgets/lv_checkbox.c index 93f2b4b21..a9a7a386f 100644 --- a/src/lv_widgets/lv_checkbox.c +++ b/src/lv_widgets/lv_checkbox.c @@ -160,7 +160,6 @@ void lv_checkbox_set_checked(lv_obj_t * cb, bool checked) #endif } - /** * Make the check box inactive (disabled) * @param cb pointer to a check box object @@ -270,7 +269,6 @@ static lv_res_t lv_checkbox_signal(lv_obj_t * cb, lv_signal_t sign, void * param return res; } - static lv_style_list_t * lv_checkbox_get_style(lv_obj_t * cb, uint8_t type) { lv_style_list_t * style_dsc_p; diff --git a/src/lv_widgets/lv_cont.c b/src/lv_widgets/lv_cont.c index 94ab41894..7a21bc2b3 100644 --- a/src/lv_widgets/lv_cont.c +++ b/src/lv_widgets/lv_cont.c @@ -104,7 +104,6 @@ lv_obj_t * lv_cont_create(lv_obj_t * par, const lv_obj_t * copy) lv_theme_apply(cont, LV_THEME_CONT); } - } /*Copy an existing object*/ else { @@ -292,7 +291,6 @@ static lv_res_t lv_cont_signal(lv_obj_t * cont, lv_signal_t sign, void * param) return res; } - static lv_style_list_t * lv_cont_get_style(lv_obj_t * cont, uint8_t type) { lv_style_list_t * style_dsc_p; diff --git a/src/lv_widgets/lv_cont.h b/src/lv_widgets/lv_cont.h index 6fc6a2a52..a65d040d2 100644 --- a/src/lv_widgets/lv_cont.h +++ b/src/lv_widgets/lv_cont.h @@ -54,7 +54,6 @@ enum { LV_LAYOUT_ROW_MID, /**< Row middle align*/ LV_LAYOUT_ROW_BOTTOM, /**< Row bottom align*/ - /** * PRETTY: * - Place the object next to each other diff --git a/src/lv_widgets/lv_cpicker.c b/src/lv_widgets/lv_cpicker.c index 70cd3aeff..3d54303c0 100644 --- a/src/lv_widgets/lv_cpicker.c +++ b/src/lv_widgets/lv_cpicker.c @@ -434,7 +434,6 @@ bool lv_cpicker_get_knob_colored(lv_obj_t * cpicker) * STATIC FUNCTIONS **********************/ - /** * Handle the drawing related tasks of the color_picker * @param cpicker pointer to an object @@ -876,7 +875,6 @@ static lv_res_t lv_cpicker_signal(lv_obj_t * cpicker, lv_signal_t sign, void * p return res; } - /** * Get the style_list descriptor of a part of the object * @param cpicker pointer the object @@ -914,7 +912,6 @@ static bool lv_cpicker_hit(lv_obj_t * cpicker, const lv_point_t * p) if(ext->type == LV_CPICKER_TYPE_RECT) return true; - /*Valid clicks can be only in the circle*/ if(_lv_area_is_point_on(&cpicker->coords, p, LV_RADIUS_CIRCLE)) return true; else return false; diff --git a/src/lv_widgets/lv_cpicker.h b/src/lv_widgets/lv_cpicker.h index 2aef0d732..66da3a8ba 100644 --- a/src/lv_widgets/lv_cpicker.h +++ b/src/lv_widgets/lv_cpicker.h @@ -40,8 +40,6 @@ enum { }; typedef uint8_t lv_cpicker_color_mode_t; - - /*Data of colorpicker*/ typedef struct { lv_color_hsv_t hsv; @@ -67,7 +65,6 @@ enum { _LV_CPICKER_PART_REAL_LAST = _LV_OBJ_PART_REAL_LAST, }; - /********************** * GLOBAL PROTOTYPES **********************/ diff --git a/src/lv_widgets/lv_dropdown.c b/src/lv_widgets/lv_dropdown.c index 31eae4589..f33cd3d73 100644 --- a/src/lv_widgets/lv_dropdown.c +++ b/src/lv_widgets/lv_dropdown.c @@ -1117,7 +1117,6 @@ static lv_res_t lv_dropdown_page_scrl_signal(lv_obj_t * scrl, lv_signal_t sign, return res; } - /** * Get the style descriptor of a part of the object * @param page pointer the object @@ -1187,8 +1186,6 @@ static void draw_box(lv_obj_t * ddlist, const lv_area_t * clip_area, uint16_t id _lv_obj_disable_style_caching(ddlist, false); } - - static void draw_box_label(lv_obj_t * ddlist, const lv_area_t * clip_area, uint16_t id, lv_state_t state) { lv_dropdown_ext_t * ext = lv_obj_get_ext_attr(ddlist); @@ -1339,8 +1336,6 @@ static void position_to_selected(lv_obj_t * ddlist) lv_obj_invalidate(ext->page); } - - static lv_obj_t * get_label(const lv_obj_t * ddlist) { lv_dropdown_ext_t * ext = lv_obj_get_ext_attr(ddlist); diff --git a/src/lv_widgets/lv_dropdown.h b/src/lv_widgets/lv_dropdown.h index 87cae4387..05c6bb553 100644 --- a/src/lv_widgets/lv_dropdown.h +++ b/src/lv_widgets/lv_dropdown.h @@ -134,7 +134,6 @@ void lv_dropdown_add_option(lv_obj_t * ddlist, const char * option, uint32_t pos */ void lv_dropdown_set_selected(lv_obj_t * ddlist, uint16_t sel_opt); - /** * Set the direction of the a drop down list * @param ddlist pointer to a drop down list object diff --git a/src/lv_widgets/lv_gauge.c b/src/lv_widgets/lv_gauge.c index ad3bcb066..0aafc5fcd 100644 --- a/src/lv_widgets/lv_gauge.c +++ b/src/lv_widgets/lv_gauge.c @@ -240,7 +240,6 @@ void lv_gauge_set_value(lv_obj_t * gauge, uint8_t needle_id, int32_t value) a.y2 = LV_MATH_MAX(p_mid.y, p_end.y) + needle_w; lv_obj_invalidate_area(gauge, &a); - } /** @@ -390,7 +389,6 @@ lv_coord_t lv_gauge_get_needle_img_pivot_y(lv_obj_t * gauge) return ext->needle_img_pivot.y; } - /********************** * STATIC FUNCTIONS **********************/ diff --git a/src/lv_widgets/lv_img.c b/src/lv_widgets/lv_img.c index bb5850848..ab77125aa 100644 --- a/src/lv_widgets/lv_img.c +++ b/src/lv_widgets/lv_img.c @@ -624,7 +624,6 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area bg_dsc.border_opa = LV_OPA_TRANSP; } - int32_t zoom_final = lv_obj_get_style_transform_zoom(img, LV_IMG_PART_MAIN); zoom_final = (zoom_final * ext->zoom) >> 8; @@ -839,7 +838,6 @@ static lv_res_t lv_img_signal(lv_obj_t * img, lv_signal_t sign, void * param) img->ext_draw_pad = LV_MATH_MAX(img->ext_draw_pad, top); img->ext_draw_pad = LV_MATH_MAX(img->ext_draw_pad, bottom); - } else if(sign == LV_SIGNAL_HIT_TEST) { lv_hit_test_info_t * info = param; @@ -872,7 +870,6 @@ static lv_res_t lv_img_signal(lv_obj_t * img, lv_signal_t sign, void * param) return res; } - static lv_style_list_t * lv_img_get_style(lv_obj_t * img, uint8_t type) { lv_style_list_t * style_dsc_p; diff --git a/src/lv_widgets/lv_imgbtn.c b/src/lv_widgets/lv_imgbtn.c index f987b3de8..76b9be881 100644 --- a/src/lv_widgets/lv_imgbtn.c +++ b/src/lv_widgets/lv_imgbtn.c @@ -12,7 +12,6 @@ #include "lv_imgbtn.h" #include "lv_label.h" - #if LV_USE_IMGBTN != 0 /********************* diff --git a/src/lv_widgets/lv_imgbtn.h b/src/lv_widgets/lv_imgbtn.h index d205800e2..1f939f934 100644 --- a/src/lv_widgets/lv_imgbtn.h +++ b/src/lv_widgets/lv_imgbtn.h @@ -121,7 +121,6 @@ static inline void lv_imgbtn_set_checkable(lv_obj_t * imgbtn, bool tgl) lv_btn_set_checkable(imgbtn, tgl); } - /*===================== * Getter functions *====================*/ diff --git a/src/lv_widgets/lv_label.c b/src/lv_widgets/lv_label.c index 6c0429a1d..4f43782dd 100644 --- a/src/lv_widgets/lv_label.c +++ b/src/lv_widgets/lv_label.c @@ -119,7 +119,6 @@ lv_obj_t * lv_label_create(lv_obj_t * par, const lv_obj_t * copy) ext->dot.tmp_ptr = NULL; ext->dot_tmp_alloc = 0; - lv_obj_set_design_cb(new_label, lv_label_design); lv_obj_set_signal_cb(new_label, lv_label_signal); @@ -612,7 +611,6 @@ void lv_label_get_letter_pos(const lv_obj_t * label, uint32_t char_id, lv_point_ visual_byte_pos = byte_id - line_start; #endif - /*Calculate the x coordinate*/ lv_coord_t x = _lv_txt_get_width(bidi_txt, visual_byte_pos, font, letter_space, flag); if(char_id != line_start) x += letter_space; @@ -1183,7 +1181,6 @@ void lv_label_refr_text(lv_obj_t * label) uint32_t letter_id = lv_label_get_letter_on(label, &p); - /*Be sure there is space for the dots*/ size_t txt_len = strlen(ext->text); uint32_t byte_id = _lv_txt_encoded_get_byte_id(ext->text, letter_id); diff --git a/src/lv_widgets/lv_label.h b/src/lv_widgets/lv_label.h index 2226326af..c4e4a0236 100644 --- a/src/lv_widgets/lv_label.h +++ b/src/lv_widgets/lv_label.h @@ -265,7 +265,6 @@ uint32_t lv_label_get_text_sel_start(const lv_obj_t * label); */ uint32_t lv_label_get_text_sel_end(const lv_obj_t * label); - lv_style_list_t * lv_label_get_style(lv_obj_t * label, uint8_t type); /*===================== diff --git a/src/lv_widgets/lv_line.h b/src/lv_widgets/lv_line.h index 430a9da01..1f04aebf2 100644 --- a/src/lv_widgets/lv_line.h +++ b/src/lv_widgets/lv_line.h @@ -87,7 +87,6 @@ void lv_line_set_y_invert(lv_obj_t * line, bool en); lv_line_set_y_invert /*The name was inconsistent. In v.6.0 only `lv_line_set_y_invert`will \ work */ - /*===================== * Getter functions *====================*/ diff --git a/src/lv_widgets/lv_linemeter.c b/src/lv_widgets/lv_linemeter.c index 0648b0f86..253137309 100644 --- a/src/lv_widgets/lv_linemeter.c +++ b/src/lv_widgets/lv_linemeter.c @@ -349,7 +349,6 @@ void lv_linemeter_draw_scale(lv_obj_t * lmeter, const lv_area_t * clip_area, uin int16_t mask_in_id = lv_draw_mask_add(&mask_in_param, 0); #endif - #if LV_LINEMETER_PRECISE > 1 mask_area.x1 = x_ofs - r_out; mask_area.x2 = x_ofs + r_out - 1; @@ -490,7 +489,6 @@ void lv_linemeter_draw_scale(lv_obj_t * lmeter, const lv_area_t * clip_area, uin } } - } /********************** diff --git a/src/lv_widgets/lv_linemeter.h b/src/lv_widgets/lv_linemeter.h index c33bffb27..9ced938a0 100644 --- a/src/lv_widgets/lv_linemeter.h +++ b/src/lv_widgets/lv_linemeter.h @@ -147,7 +147,6 @@ uint16_t lv_linemeter_get_scale_angle(const lv_obj_t * lmeter); */ uint16_t lv_linemeter_get_angle_offset(lv_obj_t * lmeter); - void lv_linemeter_draw_scale(lv_obj_t * lmeter, const lv_area_t * clip_area, uint8_t part); /** diff --git a/src/lv_widgets/lv_list.c b/src/lv_widgets/lv_list.c index 8294968a1..a80c454ab 100644 --- a/src/lv_widgets/lv_list.c +++ b/src/lv_widgets/lv_list.c @@ -51,7 +51,6 @@ static lv_signal_cb_t label_signal; static lv_signal_cb_t ancestor_page_signal; static lv_signal_cb_t ancestor_btn_signal; - /********************** * MACROS **********************/ @@ -189,11 +188,9 @@ lv_obj_t * lv_list_add_btn(lv_obj_t * list, const void * img_src, const char * t lv_obj_set_width(btn, w); } - lv_obj_add_protect(btn, LV_PROTECT_PRESS_LOST); lv_obj_set_signal_cb(btn, lv_list_btn_signal); - #if LV_USE_IMG != 0 lv_obj_t * img = NULL; if(img_src) { diff --git a/src/lv_widgets/lv_objmask.c b/src/lv_widgets/lv_objmask.c index ed22bb30b..76e7cd405 100644 --- a/src/lv_widgets/lv_objmask.c +++ b/src/lv_widgets/lv_objmask.c @@ -177,18 +177,14 @@ void lv_objmask_remove_mask(lv_obj_t * objmask, lv_objmask_mask_t * mask) lv_obj_invalidate(objmask); } - - /*===================== * Setter functions *====================*/ - /*===================== * Getter functions *====================*/ - /*===================== * Other functions *====================*/ @@ -287,14 +283,12 @@ static lv_design_res_t lv_objmask_design(lv_obj_t * objmask, const lv_area_t * c lv_draw_mask_add(p_new, m->param); } - } } /*Post draw when the children are drawn*/ else if(mode == LV_DESIGN_DRAW_POST) { lv_objmask_ext_t * ext = lv_obj_get_ext_attr(objmask); - lv_objmask_mask_t * m; _LV_LL_READ(ext->mask_ll, m) { diff --git a/src/lv_widgets/lv_page.c b/src/lv_widgets/lv_page.c index 936537c0a..85cf21253 100644 --- a/src/lv_widgets/lv_page.c +++ b/src/lv_widgets/lv_page.c @@ -155,7 +155,6 @@ lv_obj_t * lv_page_create(lv_obj_t * par, const lv_obj_t * copy) lv_page_set_scrollbar_mode(page, copy_ext->scrlbar.mode); } - scrlbar_refresh(page); LV_LOG_INFO("page created"); @@ -489,7 +488,6 @@ void lv_page_focus(lv_obj_t * page, const lv_obj_t * obj, lv_anim_enable_t anim_ /*if using focus mode, change target to parent*/ obj = lv_obj_get_focused_obj(obj); - /*If obj is higher then the page focus where the "error" is smaller*/ lv_coord_t obj_y = obj->coords.y1 - ext->scrl->coords.y1; lv_coord_t obj_h = lv_obj_get_height(obj); @@ -518,7 +516,6 @@ void lv_page_focus(lv_obj_t * page, const lv_obj_t * obj, lv_anim_enable_t anim_ scrlable_y += page_h - obj_h; } - /*If obj is wider then the page focus where the "error" is smaller*/ lv_coord_t obj_x = obj->coords.x1 - ext->scrl->coords.x1; lv_coord_t obj_w = lv_obj_get_width(obj); @@ -724,7 +721,6 @@ static lv_design_res_t lv_page_design(lv_obj_t * page, const lv_area_t * clip_ar #if LV_USE_ANIMATION { - if(ext->edge_flash.left_ip || ext->edge_flash.right_ip || ext->edge_flash.top_ip || ext->edge_flash.bottom_ip) { lv_area_t flash_area; diff --git a/src/lv_widgets/lv_roller.c b/src/lv_widgets/lv_roller.c index 08477ab11..ba8440762 100644 --- a/src/lv_widgets/lv_roller.c +++ b/src/lv_widgets/lv_roller.c @@ -157,7 +157,6 @@ void lv_roller_set_options(lv_obj_t * roller, const char * options, lv_roller_mo LV_ASSERT_OBJ(roller, LV_OBJX_NAME); LV_ASSERT_STR(options); - lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller); lv_obj_t * label = get_label(roller); @@ -311,7 +310,6 @@ uint16_t lv_roller_get_selected(const lv_obj_t * roller) } } - /** * Get the current selected option as a string * @param ddlist pointer to ddlist object @@ -399,7 +397,6 @@ const char * lv_roller_get_options(const lv_obj_t * roller) return lv_label_get_text(get_label(roller)); } - /********************** * STATIC FUNCTIONS **********************/ @@ -508,7 +505,6 @@ static lv_design_res_t lv_roller_design(lv_obj_t * roller, const lv_area_t * cli return LV_DESIGN_RES_OK; } - /** * Handle the drawing related tasks of the roller's label * @param roller pointer to an object @@ -828,7 +824,6 @@ static void draw_bg(lv_obj_t * roller, const lv_area_t * clip_area) } } - /** * Refresh the position of the roller. It uses the id stored in: ext->ddlist.selected_option_id * @param roller pointer to a roller object @@ -880,7 +875,6 @@ static void refr_position(lv_obj_t * roller, lv_anim_enable_t anim_en) } } - static lv_res_t release_handler(lv_obj_t * roller) { @@ -955,7 +949,6 @@ static void refr_width(lv_obj_t * roller) break; } - if(lv_roller_get_auto_fit(roller) == false) return; lv_coord_t label_w = lv_obj_get_width(label); diff --git a/src/lv_widgets/lv_roller.h b/src/lv_widgets/lv_roller.h index 55dd1fb63..06e9e7383 100644 --- a/src/lv_widgets/lv_roller.h +++ b/src/lv_widgets/lv_roller.h @@ -42,8 +42,6 @@ enum { typedef uint8_t lv_roller_mode_t; - - /*Data of roller*/ typedef struct { lv_page_ext_t page; /*Ext. of ancestor*/ @@ -183,7 +181,6 @@ static inline uint16_t lv_roller_get_anim_time(const lv_obj_t * roller) return lv_page_get_anim_time(roller); } - /********************** * MACROS **********************/ diff --git a/src/lv_widgets/lv_slider.c b/src/lv_widgets/lv_slider.c index 5c77f1ef1..77840e35e 100644 --- a/src/lv_widgets/lv_slider.c +++ b/src/lv_widgets/lv_slider.c @@ -470,7 +470,6 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par return res; } - static lv_style_list_t * lv_slider_get_style(lv_obj_t * slider, uint8_t part) { LV_ASSERT_OBJ(slider, LV_OBJX_NAME); diff --git a/src/lv_widgets/lv_spinbox.c b/src/lv_widgets/lv_spinbox.c index dcd847af9..ebeddcc35 100644 --- a/src/lv_widgets/lv_spinbox.c +++ b/src/lv_widgets/lv_spinbox.c @@ -80,7 +80,6 @@ lv_obj_t * lv_spinbox_create(lv_obj_t * par, const lv_obj_t * copy) ext->range_min = -99999; ext->rollover = false; - /*The signal and design functions are not copied so set them here*/ lv_obj_set_signal_cb(spinbox, lv_spinbox_signal); lv_obj_set_design_cb(spinbox, ancestor_design); /*Leave the Text area's design function*/ @@ -397,7 +396,6 @@ static lv_res_t lv_spinbox_signal(lv_obj_t * spinbox, lv_signal_t sign, void * p } if(sign == LV_SIGNAL_GET_TYPE) return lv_obj_handle_get_type_signal(param, LV_OBJX_NAME); - if(sign == LV_SIGNAL_CLEANUP) { /*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/ } @@ -461,8 +459,6 @@ static lv_res_t lv_spinbox_signal(lv_obj_t * spinbox, lv_signal_t sign, void * p uint16_t i; for(i = 0; i < pos; i++) ext->step *= 10; - - } } else if(sign == LV_SIGNAL_CONTROL) { diff --git a/src/lv_widgets/lv_switch.c b/src/lv_widgets/lv_switch.c index 58e9f0cbf..0a43def6f 100644 --- a/src/lv_widgets/lv_switch.c +++ b/src/lv_widgets/lv_switch.c @@ -254,7 +254,6 @@ static lv_design_res_t lv_switch_design(lv_obj_t * sw, const lv_area_t * clip_ar return LV_DESIGN_RES_OK; } - /** * Signal function of the switch * @param sw pointer to a switch object diff --git a/src/lv_widgets/lv_table.c b/src/lv_widgets/lv_table.c index fb20980eb..fec47276a 100644 --- a/src/lv_widgets/lv_table.c +++ b/src/lv_widgets/lv_table.c @@ -191,7 +191,6 @@ void lv_table_set_cell_value(lv_obj_t * table, uint16_t row, uint16_t col, const refr_size(table); } - /** * Set the value of a cell. Memory will be allocated to store the text by the table. * @param table pointer to a Table object @@ -1055,7 +1054,6 @@ static lv_res_t lv_table_signal(lv_obj_t * table, lv_signal_t sign, void * param return res; } - /** * Get the style descriptor of a part of the object * @param table pointer the object @@ -1115,7 +1113,6 @@ static void refr_size(lv_obj_t * table) font[i] = lv_obj_get_style_text_font(table, LV_TABLE_PART_CELL1 + i); } - for(i = 0; i < ext->row_cnt; i++) { ext->row_h[i] = get_row_height(table, i, font, letter_space, line_space, cell_left, cell_right, cell_top, cell_bottom); diff --git a/src/lv_widgets/lv_tabview.c b/src/lv_widgets/lv_tabview.c index 96200ec0a..b7345c1f1 100644 --- a/src/lv_widgets/lv_tabview.c +++ b/src/lv_widgets/lv_tabview.c @@ -810,7 +810,6 @@ static lv_style_list_t * lv_tabview_get_style(lv_obj_t * tabview, uint8_t part) return style_dsc_p; } - /** * Called when a tab button is clicked * @param tab_btnm pointer to the tab's button matrix object @@ -911,7 +910,6 @@ static void refr_indic_size(lv_obj_t * tabview) lv_obj_set_height(ext->indic, indic_h); } - static void refr_btns_size(lv_obj_t * tabview) { lv_tabview_ext_t * ext = lv_obj_get_ext_attr(tabview); diff --git a/src/lv_widgets/lv_textarea.c b/src/lv_widgets/lv_textarea.c index a207050ba..4b231f07a 100644 --- a/src/lv_widgets/lv_textarea.c +++ b/src/lv_widgets/lv_textarea.c @@ -425,7 +425,6 @@ void lv_textarea_del_char(lv_obj_t * ta) lv_label_set_text(ext->label, label_txt); lv_textarea_clear_selection(ta); - /*If the textarea became empty, invalidate it to hide the placeholder*/ if(ext->placeholder_txt) { const char * txt = lv_label_get_text(ext->label); @@ -504,7 +503,6 @@ void lv_textarea_set_text(lv_obj_t * ta, const char * txt) lv_textarea_set_cursor_pos(ta, LV_TEXTAREA_CURSOR_LAST); } - /*If the textarea is empty, invalidate it to hide the placeholder*/ if(ext->placeholder_txt) { const char * txt_act = lv_label_get_text(ext->label); @@ -1708,7 +1706,6 @@ static bool char_is_accepted(lv_obj_t * ta, uint32_t c) } } - static void refr_cursor_area(lv_obj_t * ta) { lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); diff --git a/src/lv_widgets/lv_tileview.c b/src/lv_widgets/lv_tileview.c index 3fa01503c..5265442d4 100644 --- a/src/lv_widgets/lv_tileview.c +++ b/src/lv_widgets/lv_tileview.c @@ -240,7 +240,6 @@ void lv_tileview_set_tile_act(lv_obj_t * tileview, lv_coord_t x, lv_coord_t y, l lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_obj_set_x); lv_anim_set_time(&a, ext->anim_time); - if(x_coord != x_act) { lv_anim_set_values(&a, x_act, x_coord); lv_anim_start(&a); diff --git a/src/lv_widgets/lv_win.c b/src/lv_widgets/lv_win.c index 332bbc5e1..e744a915e 100644 --- a/src/lv_widgets/lv_win.c +++ b/src/lv_widgets/lv_win.c @@ -516,7 +516,6 @@ uint8_t lv_win_title_get_alignment(lv_obj_t * win) return ext->title_txt_align; } - /*===================== * Other functions *====================*/ @@ -532,7 +531,6 @@ void lv_win_focus(lv_obj_t * win, lv_obj_t * obj, lv_anim_enable_t anim_en) LV_ASSERT_OBJ(win, LV_OBJX_NAME); LV_ASSERT_OBJ(obj, ""); - lv_win_ext_t * ext = lv_obj_get_ext_attr(win); lv_page_focus(ext->page, obj, anim_en); } diff --git a/src/lv_widgets/lv_win.h b/src/lv_widgets/lv_win.h index a0e599f49..ac1f7b1cb 100644 --- a/src/lv_widgets/lv_win.h +++ b/src/lv_widgets/lv_win.h @@ -208,7 +208,6 @@ lv_obj_t * lv_win_get_content(const lv_obj_t * win); */ lv_coord_t lv_win_get_header_height(const lv_obj_t * win); - /** * Get the width of the control buttons on the header * @param win pointer to a window object diff --git a/tests/Makefile b/tests/Makefile index 70a44c1a6..bd7fe3738 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -11,16 +11,14 @@ WARNINGS = -Werror -Wall -Wextra \ -Wempty-body -Wshift-negative-value -Wstack-usage=2048 \ -Wtype-limits -Wsizeof-pointer-memaccess -#-Wno-unused-value -Wno-unused-parameter +#-Wno-unused-value -Wno-unused-parameter OPTIMIZATION ?= -O3 -g0 - CFLAGS ?= -I$(LVGL_DIR)/ $(DEFINES) $(WARNINGS) $(OPTIMIZATION) -I$(LVGL_DIR) -I. LDFLAGS ?= -lpng BIN ?= demo - #Collect the files to compile MAINSRC = ./lv_test_main.c @@ -53,10 +51,9 @@ all: default %.o: %.c @$(CC) $(CFLAGS) -c $< -o $@ @echo "CC $<" - + default: $(AOBJS) $(COBJS) $(MAINOBJ) $(CC) -o $(BIN) $(MAINOBJ) $(AOBJS) $(COBJS) $(LDFLAGS) -clean: +clean: rm -f $(BIN) $(AOBJS) $(COBJS) $(MAINOBJ) - diff --git a/tests/build.py b/tests/build.py index 96e5bb2b8..2f54b2932 100755 --- a/tests/build.py +++ b/tests/build.py @@ -9,22 +9,21 @@ lvgldirname = '"' + lvgldirname + '"' base_defines = '"-DLV_CONF_PATH=' + lvgldirname +'/tests/lv_test_conf.h -DLV_BUILD_TEST"' optimization = '"-O3 -g0"' - def build(name, defines): global base_defines, optimization print("=============================") print(name) print("=============================") - + d_all = base_defines[:-1] + " "; - + for d in defines: d_all += " -D" + d + "=" + str(defines[d]) - + d_all += '"' cmd = "make -j8 BIN=test.bin LVGL_DIR_NAME=" + lvgldirname + " DEFINES=" + d_all + " OPTIMIZATION=" + optimization - + print("---------------------------") print("Clean") print("---------------------------") @@ -34,23 +33,22 @@ def build(name, defines): print("Build") print("---------------------------") ret = os.system(cmd) - if(ret != 0): + if(ret != 0): print("BUILD ERROR! (error code " + str(ret) + ")") exit(1) - + print("---------------------------") print("Run") print("---------------------------") ret = os.system("./test.bin") - if(ret != 0): + if(ret != 0): print("RUN ERROR! (error code " + str(ret) + ")") exit(1) - + print("---------------------------") print("Finished") print("---------------------------") - minimal_monochrome = { "LV_DPI":40, "LV_MEM_SIZE":4*1024, @@ -67,10 +65,10 @@ minimal_monochrome = { "LV_USE_USER_DATA":0, "LV_USE_USER_DATA_FREE":0, "LV_USE_LOG":0, - "LV_USE_THEME_EMPTY":0, - "LV_USE_THEME_MATERIAL":0, - "LV_USE_THEME_MONO":1, - "LV_USE_THEME_TEMPLATE":0, + "LV_USE_THEME_EMPTY":0, + "LV_USE_THEME_MATERIAL":0, + "LV_USE_THEME_MONO":1, + "LV_USE_THEME_TEMPLATE":0, "LV_THEME_DEFAULT_INIT": "\\\"lv_theme_mono_init\\\"", "LV_THEME_DEFAULT_COLOR_PRIMARY": "\\\"LV_COLOR_RED\\\"", "LV_THEME_DEFAULT_COLOR_SECONDARY": "\\\"LV_COLOR_BLUE\\\"", @@ -127,7 +125,7 @@ minimal_monochrome = { "LV_USE_TABLE":0, "LV_USE_TABVIEW":0, "LV_USE_TILEVIEW":0, - "LV_USE_WIN":0 + "LV_USE_WIN":0 } all_obj_minimal_features = { @@ -146,7 +144,7 @@ all_obj_minimal_features = { "LV_USE_USER_DATA":0, "LV_USE_USER_DATA_FREE":0, "LV_USE_LOG":0, - "LV_USE_THEME_MATERIAL":1, + "LV_USE_THEME_MATERIAL":1, "LV_THEME_DEFAULT_INIT": "\\\"lv_theme_material_init\\\"", "LV_THEME_DEFAULT_COLOR_PRIMARY": "\\\"LV_COLOR_RED\\\"", "LV_THEME_DEFAULT_COLOR_SECONDARY": "\\\"LV_COLOR_BLUE\\\"", @@ -203,7 +201,7 @@ all_obj_minimal_features = { "LV_USE_TABLE":1, "LV_USE_TABVIEW":1, "LV_USE_TILEVIEW":1, - "LV_USE_WIN":1 + "LV_USE_WIN":1 } all_obj_all_features = { @@ -223,10 +221,10 @@ all_obj_all_features = { "LV_USE_USER_DATA":1, "LV_USE_USER_DATA_FREE":0, "LV_USE_LOG":1, - "LV_USE_THEME_MATERIAL":1, - "LV_USE_THEME_EMPTY":1, - "LV_USE_THEME_MONO":1, - "LV_USE_THEME_TEMPLATE":1, + "LV_USE_THEME_MATERIAL":1, + "LV_USE_THEME_EMPTY":1, + "LV_USE_THEME_MONO":1, + "LV_USE_THEME_TEMPLATE":1, "LV_THEME_DEFAULT_INIT": "\\\"lv_theme_material_init\\\"", "LV_THEME_DEFAULT_COLOR_PRIMARY": "\\\"LV_COLOR_RED\\\"", "LV_THEME_DEFAULT_COLOR_SECONDARY": "\\\"LV_COLOR_BLUE\\\"", @@ -234,7 +232,7 @@ all_obj_all_features = { "LV_THEME_DEFAULT_FONT_SMALL" : "\\\"&lv_font_montserrat_12\\\"", "LV_THEME_DEFAULT_FONT_NORMAL" : "\\\"&lv_font_montserrat_16\\\"", "LV_THEME_DEFAULT_FONT_SUBTITLE" : "\\\"&lv_font_montserrat_22\\\"", - "LV_THEME_DEFAULT_FONT_TITLE" : "\\\"&lv_font_montserrat_28\\\"", + "LV_THEME_DEFAULT_FONT_TITLE" : "\\\"&lv_font_montserrat_28\\\"", "LV_LOG_PRINTF":0, "LV_USE_DEBUG":0, "LV_USE_ASSERT_NULL":0, @@ -281,10 +279,9 @@ all_obj_all_features = { "LV_USE_TABLE":1, "LV_USE_TABVIEW":1, "LV_USE_TILEVIEW":1, - "LV_USE_WIN":1 + "LV_USE_WIN":1 } - advanced_features = { "LV_DPI":100, "LV_MEM_SIZE":4*1024*1024, @@ -304,9 +301,9 @@ advanced_features = { "LV_USE_USER_DATA":1, "LV_IMG_CACHE_DEF_SIZE":32, "LV_USE_LOG":1, - "LV_USE_THEME_MATERIAL":1, - "LV_USE_THEME_EMPTY":1, - "LV_USE_THEME_TEMPLATE":1, + "LV_USE_THEME_MATERIAL":1, + "LV_USE_THEME_EMPTY":1, + "LV_USE_THEME_TEMPLATE":1, "LV_THEME_DEFAULT_INIT": "\\\"lv_theme_material_init\\\"", "LV_THEME_DEFAULT_COLOR_PRIMARY": "\\\"LV_COLOR_RED\\\"", "LV_THEME_DEFAULT_COLOR_SECONDARY": "\\\"LV_COLOR_BLUE\\\"", @@ -314,7 +311,7 @@ advanced_features = { "LV_THEME_DEFAULT_FONT_SMALL" : "\\\"&lv_font_montserrat_12\\\"", "LV_THEME_DEFAULT_FONT_NORMAL" : "\\\"&lv_font_montserrat_16\\\"", "LV_THEME_DEFAULT_FONT_SUBTITLE" : "\\\"&lv_font_montserrat_22\\\"", - "LV_THEME_DEFAULT_FONT_TITLE" : "\\\"&lv_font_montserrat_28\\\"", + "LV_THEME_DEFAULT_FONT_TITLE" : "\\\"&lv_font_montserrat_28\\\"", "LV_LOG_PRINTF":1, "LV_USE_DEBUG":1, "LV_USE_ASSERT_NULL":1, @@ -369,15 +366,10 @@ advanced_features = { "LV_USE_TABLE":1, "LV_USE_TABVIEW":1, "LV_USE_TILEVIEW":1, - "LV_USE_WIN":1 + "LV_USE_WIN":1 } - build("Minimal monochrome", minimal_monochrome) build("All objects, minimal features", all_obj_minimal_features) build("All objects, all common features", all_obj_all_features) build("All objects, with advanced features", advanced_features) - - - - diff --git a/tests/lv_test_assert.c b/tests/lv_test_assert.c index ce0d7a5ff..3b8dfefb6 100644 --- a/tests/lv_test_assert.c +++ b/tests/lv_test_assert.c @@ -24,7 +24,6 @@ #define PNG_DEBUG 3 #include - /********************* * DEFINES *********************/ @@ -65,7 +64,6 @@ static void png_release(png_img_t * p); * GLOBAL FUNCTIONS **********************/ - void lv_test_print(const char * s, ...) { va_list args; @@ -75,7 +73,6 @@ void lv_test_print(const char * s, ...) va_end(args); } - void lv_test_exit(const char * s, ...) { va_list args; @@ -87,7 +84,6 @@ void lv_test_exit(const char * s, ...) exit(1); } - void lv_test_error(const char * s, ...) { va_list args; @@ -134,7 +130,6 @@ void lv_test_assert_int_lt(int32_t n_ref, int32_t n_act, const char * s) } } - void lv_test_assert_str_eq(const char * s_ref, const char * s_act, const char * s) { if(strcmp(s_ref, s_act) != 0) { @@ -144,7 +139,6 @@ void lv_test_assert_str_eq(const char * s_ref, const char * s_act, const char * } } - void lv_test_assert_array_eq(const uint8_t *p_ref, const uint8_t *p_act, int32_t size, const char * s) { if(memcmp(p_ref, p_act, size) != 0) { @@ -154,7 +148,6 @@ void lv_test_assert_array_eq(const uint8_t *p_ref, const uint8_t *p_act, int32_t } } - void lv_test_assert_ptr_eq(const void * p_ref, const void * p_act, const char * s) { if(p_ref != p_act) { @@ -281,7 +274,6 @@ static void read_png_file(png_img_t * p, const char* file_name) p->number_of_passes = png_set_interlace_handling(p->png_ptr); png_read_update_info(p->png_ptr, p->info_ptr); - /* read file */ if (setjmp(png_jmpbuf(p->png_ptr))) lv_test_exit("[read_png_file] Error during read_image"); @@ -382,4 +374,3 @@ static void png_release(png_img_t * p) // } //} #endif - diff --git a/tests/lv_test_core/lv_test_core.c b/tests/lv_test_core/lv_test_core.c index 37f65464b..d500211ea 100644 --- a/tests/lv_test_core/lv_test_core.c +++ b/tests/lv_test_core/lv_test_core.c @@ -50,7 +50,6 @@ void lv_test_core(void) lv_test_font_loader(); } - /********************** * STATIC FUNCTIONS **********************/ diff --git a/tests/lv_test_core/lv_test_font_loader.c b/tests/lv_test_core/lv_test_font_loader.c index 56a42c2d8..ebc1750d6 100644 --- a/tests/lv_test_core/lv_test_font_loader.c +++ b/tests/lv_test_core/lv_test_font_loader.c @@ -1,215 +1,214 @@ -/** - * @file lv_test_font_loader.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../lvgl.h" -#if LV_BUILD_TEST -#include "../lv_test_assert.h" -#include "../src/lv_font/lv_font_fmt_txt.h" -#include "../src/lv_font/lv_font.h" -#include "../src/lv_font/lv_font_loader.h" - -#include "lv_test_font_loader.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -#if LV_USE_FILESYSTEM -static int compare_fonts(lv_font_t * f1, lv_font_t * f2); -#endif - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -extern lv_font_t font_1; -extern lv_font_t font_2; -extern lv_font_t font_3; - -void lv_test_font_loader(void) -{ -#if LV_USE_FILESYSTEM - lv_font_t * font_1_bin = lv_font_load("f:font_1.fnt"); - lv_font_t * font_2_bin = lv_font_load("f:font_2.fnt"); - lv_font_t * font_3_bin = lv_font_load("f:font_3.fnt"); - - compare_fonts(&font_1, font_1_bin); - compare_fonts(&font_2, font_2_bin); - compare_fonts(&font_3, font_3_bin); - - lv_font_free(font_1_bin); - lv_font_free(font_2_bin); - lv_font_free(font_3_bin); -#else - lv_test_print("SKIP: font load test because it requires LV_USE_FILESYSTEM 1 and LV_FONT_FMT_TXT_LARGE 0"); -#endif -} - -#if LV_USE_FILESYSTEM -static int compare_fonts(lv_font_t * f1, lv_font_t * f2) -{ - lv_test_assert_true(f1 != NULL && f2 != NULL, "font not null"); - - lv_test_assert_ptr_eq(f1->get_glyph_dsc, f2->get_glyph_dsc, "glyph_dsc"); - lv_test_assert_ptr_eq(f1->get_glyph_bitmap, f2->get_glyph_bitmap, "glyph_bitmap"); - lv_test_assert_int_eq(f1->line_height, f2->line_height, "line_height"); - lv_test_assert_int_eq(f1->base_line, f2->base_line, "base_line"); -#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) - lv_test_assert_int_eq(f1->subpx, f2->subpx, "subpx"); -#endif - lv_font_fmt_txt_dsc_t * dsc1 = (lv_font_fmt_txt_dsc_t *) f1->dsc; - lv_font_fmt_txt_dsc_t * dsc2 = (lv_font_fmt_txt_dsc_t *) f2->dsc; - - lv_test_assert_int_eq(dsc1->kern_scale, dsc2->kern_scale, "kern_scale"); - lv_test_assert_int_eq(dsc1->cmap_num, dsc2->cmap_num, "cmap_num"); - lv_test_assert_int_eq(dsc1->bpp, dsc2->bpp, "bpp"); - lv_test_assert_int_eq(dsc1->kern_classes, dsc2->kern_classes, "kern_classes"); - lv_test_assert_int_eq(dsc1->bitmap_format, dsc2->bitmap_format, "bitmap_format"); - - // cmaps - int total_glyphs = 0; - for(int i = 0; i < dsc1->cmap_num; ++i) { - lv_font_fmt_txt_cmap_t * cmaps1 = (lv_font_fmt_txt_cmap_t *) &dsc1->cmaps[i]; - lv_font_fmt_txt_cmap_t * cmaps2 = (lv_font_fmt_txt_cmap_t *) &dsc2->cmaps[i]; - - lv_test_assert_int_eq(cmaps1->range_start, cmaps2->range_start, "range_start"); - lv_test_assert_int_eq(cmaps1->range_length, cmaps2->range_length, "range_length"); - lv_test_assert_int_eq(cmaps1->glyph_id_start, cmaps2->glyph_id_start, "glyph_id_start"); - lv_test_assert_int_eq(cmaps1->type, cmaps2->type, "type"); - lv_test_assert_int_eq(cmaps1->list_length, cmaps2->list_length, "list_length"); - - if(cmaps1->unicode_list != NULL && cmaps2->unicode_list != NULL) { - lv_test_assert_true(cmaps1->unicode_list && cmaps2->unicode_list, "unicode_list"); - - lv_test_assert_array_eq( - (uint8_t *) cmaps1->unicode_list, - (uint8_t *) cmaps2->unicode_list, - sizeof(uint16_t) * cmaps1->list_length, - "unicode_list"); - total_glyphs += cmaps1->list_length; - } - else { - total_glyphs += cmaps1->range_length; - lv_test_assert_ptr_eq(cmaps1->unicode_list, cmaps2->unicode_list, "unicode_list"); - } - - if(cmaps1->glyph_id_ofs_list != NULL && cmaps2->glyph_id_ofs_list != NULL) { - uint8_t * ids1 = (uint8_t *) cmaps1->glyph_id_ofs_list; - uint8_t * ids2 = (uint8_t *) cmaps2->glyph_id_ofs_list; - - lv_test_assert_array_eq(ids1, ids2, cmaps1->list_length, "glyph_id_ofs_list"); - } - else { - lv_test_assert_ptr_eq(cmaps1->glyph_id_ofs_list, cmaps2->glyph_id_ofs_list, "glyph_id_ofs_list"); - } - } - - // kern_dsc - if (dsc1->kern_classes == 1 && dsc2->kern_classes == 1) { - lv_font_fmt_txt_kern_classes_t * kern1 = (lv_font_fmt_txt_kern_classes_t *) dsc1->kern_dsc; - lv_font_fmt_txt_kern_classes_t * kern2 = (lv_font_fmt_txt_kern_classes_t *) dsc2->kern_dsc; - if (kern1 != NULL && kern2 != NULL) { - lv_test_assert_int_eq(kern1->right_class_cnt, kern2->right_class_cnt, "right_class_cnt"); - lv_test_assert_int_eq(kern1->left_class_cnt, kern2->left_class_cnt, "left_class_cnt"); - - lv_test_assert_array_eq( - (uint8_t *) kern1->left_class_mapping, - (uint8_t *) kern2->left_class_mapping, - kern1->left_class_cnt, - "left_class_mapping"); - - lv_test_assert_array_eq( - (uint8_t *) kern1->right_class_mapping, - (uint8_t *) kern2->right_class_mapping, - kern1->right_class_cnt, - "right_class_mapping"); - - lv_test_assert_array_eq( - (uint8_t *) kern1->class_pair_values, - (uint8_t *) kern2->class_pair_values, - kern1->right_class_cnt * kern1->left_class_cnt, - "class_pair_values"); - } - else { - lv_test_assert_ptr_eq(kern1, kern2, "kern"); - } - } - else if (dsc1->kern_classes == 0 && dsc2->kern_classes == 0) { - lv_font_fmt_txt_kern_pair_t * kern1 = (lv_font_fmt_txt_kern_pair_t *) dsc1->kern_dsc; - lv_font_fmt_txt_kern_pair_t * kern2 = (lv_font_fmt_txt_kern_pair_t *) dsc2->kern_dsc; - if (kern1 != NULL && kern2 != NULL) { - lv_test_assert_int_eq(kern1->glyph_ids_size, kern2->glyph_ids_size, "glyph_ids_size"); - lv_test_assert_int_eq(kern1->pair_cnt, kern2->pair_cnt, "pair_cnt"); - - int ids_size; - - if (kern1->glyph_ids_size == 0) { - ids_size = sizeof(int8_t) * 2 * kern1->pair_cnt; - } - else { - ids_size = sizeof(int16_t) * 2 * kern1->pair_cnt; - } - - lv_test_assert_array_eq(kern1->glyph_ids, kern2->glyph_ids, ids_size, "glyph_ids"); - lv_test_assert_array_eq( - (uint8_t * ) kern1->values, - (uint8_t * ) kern2->values, - kern1->pair_cnt, - "glyph_values"); - } - } - - lv_font_fmt_txt_glyph_dsc_t * glyph_dsc1 = (lv_font_fmt_txt_glyph_dsc_t *) dsc1->glyph_dsc; - lv_font_fmt_txt_glyph_dsc_t * glyph_dsc2 = (lv_font_fmt_txt_glyph_dsc_t *) dsc2->glyph_dsc; - - for(int i = 0; i < total_glyphs; ++i) { - if (i < total_glyphs - 1) { - int size1 = glyph_dsc1[i+1].bitmap_index - glyph_dsc1[i].bitmap_index; - - if (size1 > 0) { - lv_test_assert_array_eq( - dsc1->glyph_bitmap + glyph_dsc1[i].bitmap_index, - dsc2->glyph_bitmap + glyph_dsc2[i].bitmap_index, - size1 - 1, "glyph_bitmap"); - } - } - lv_test_assert_int_eq(glyph_dsc1[i].adv_w, glyph_dsc2[i].adv_w, "adv_w"); - lv_test_assert_int_eq(glyph_dsc1[i].box_w, glyph_dsc2[i].box_w, "box_w"); - lv_test_assert_int_eq(glyph_dsc1[i].box_h, glyph_dsc2[i].box_h, "box_h"); - lv_test_assert_int_eq(glyph_dsc1[i].ofs_x, glyph_dsc2[i].ofs_x, "ofs_x"); - lv_test_assert_int_eq(glyph_dsc1[i].ofs_y, glyph_dsc2[i].ofs_y, "ofs_y"); - } - - LV_LOG_INFO("No differences found!"); - return 0; -} -#endif - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif // LV_BUILD_TEST - +/** + * @file lv_test_font_loader.c + * + */ + +/********************* + * INCLUDES + *********************/ + +#include "../../lvgl.h" +#if LV_BUILD_TEST +#include "../lv_test_assert.h" +#include "../src/lv_font/lv_font_fmt_txt.h" +#include "../src/lv_font/lv_font.h" +#include "../src/lv_font/lv_font_loader.h" + +#include "lv_test_font_loader.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +#if LV_USE_FILESYSTEM +static int compare_fonts(lv_font_t * f1, lv_font_t * f2); +#endif + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +extern lv_font_t font_1; +extern lv_font_t font_2; +extern lv_font_t font_3; + +void lv_test_font_loader(void) +{ +#if LV_USE_FILESYSTEM + lv_font_t * font_1_bin = lv_font_load("f:font_1.fnt"); + lv_font_t * font_2_bin = lv_font_load("f:font_2.fnt"); + lv_font_t * font_3_bin = lv_font_load("f:font_3.fnt"); + + compare_fonts(&font_1, font_1_bin); + compare_fonts(&font_2, font_2_bin); + compare_fonts(&font_3, font_3_bin); + + lv_font_free(font_1_bin); + lv_font_free(font_2_bin); + lv_font_free(font_3_bin); +#else + lv_test_print("SKIP: font load test because it requires LV_USE_FILESYSTEM 1 and LV_FONT_FMT_TXT_LARGE 0"); +#endif +} + +#if LV_USE_FILESYSTEM +static int compare_fonts(lv_font_t * f1, lv_font_t * f2) +{ + lv_test_assert_true(f1 != NULL && f2 != NULL, "font not null"); + + lv_test_assert_ptr_eq(f1->get_glyph_dsc, f2->get_glyph_dsc, "glyph_dsc"); + lv_test_assert_ptr_eq(f1->get_glyph_bitmap, f2->get_glyph_bitmap, "glyph_bitmap"); + lv_test_assert_int_eq(f1->line_height, f2->line_height, "line_height"); + lv_test_assert_int_eq(f1->base_line, f2->base_line, "base_line"); +#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) + lv_test_assert_int_eq(f1->subpx, f2->subpx, "subpx"); +#endif + lv_font_fmt_txt_dsc_t * dsc1 = (lv_font_fmt_txt_dsc_t *) f1->dsc; + lv_font_fmt_txt_dsc_t * dsc2 = (lv_font_fmt_txt_dsc_t *) f2->dsc; + + lv_test_assert_int_eq(dsc1->kern_scale, dsc2->kern_scale, "kern_scale"); + lv_test_assert_int_eq(dsc1->cmap_num, dsc2->cmap_num, "cmap_num"); + lv_test_assert_int_eq(dsc1->bpp, dsc2->bpp, "bpp"); + lv_test_assert_int_eq(dsc1->kern_classes, dsc2->kern_classes, "kern_classes"); + lv_test_assert_int_eq(dsc1->bitmap_format, dsc2->bitmap_format, "bitmap_format"); + + // cmaps + int total_glyphs = 0; + for(int i = 0; i < dsc1->cmap_num; ++i) { + lv_font_fmt_txt_cmap_t * cmaps1 = (lv_font_fmt_txt_cmap_t *) &dsc1->cmaps[i]; + lv_font_fmt_txt_cmap_t * cmaps2 = (lv_font_fmt_txt_cmap_t *) &dsc2->cmaps[i]; + + lv_test_assert_int_eq(cmaps1->range_start, cmaps2->range_start, "range_start"); + lv_test_assert_int_eq(cmaps1->range_length, cmaps2->range_length, "range_length"); + lv_test_assert_int_eq(cmaps1->glyph_id_start, cmaps2->glyph_id_start, "glyph_id_start"); + lv_test_assert_int_eq(cmaps1->type, cmaps2->type, "type"); + lv_test_assert_int_eq(cmaps1->list_length, cmaps2->list_length, "list_length"); + + if(cmaps1->unicode_list != NULL && cmaps2->unicode_list != NULL) { + lv_test_assert_true(cmaps1->unicode_list && cmaps2->unicode_list, "unicode_list"); + + lv_test_assert_array_eq( + (uint8_t *) cmaps1->unicode_list, + (uint8_t *) cmaps2->unicode_list, + sizeof(uint16_t) * cmaps1->list_length, + "unicode_list"); + total_glyphs += cmaps1->list_length; + } + else { + total_glyphs += cmaps1->range_length; + lv_test_assert_ptr_eq(cmaps1->unicode_list, cmaps2->unicode_list, "unicode_list"); + } + + if(cmaps1->glyph_id_ofs_list != NULL && cmaps2->glyph_id_ofs_list != NULL) { + uint8_t * ids1 = (uint8_t *) cmaps1->glyph_id_ofs_list; + uint8_t * ids2 = (uint8_t *) cmaps2->glyph_id_ofs_list; + + lv_test_assert_array_eq(ids1, ids2, cmaps1->list_length, "glyph_id_ofs_list"); + } + else { + lv_test_assert_ptr_eq(cmaps1->glyph_id_ofs_list, cmaps2->glyph_id_ofs_list, "glyph_id_ofs_list"); + } + } + + // kern_dsc + if (dsc1->kern_classes == 1 && dsc2->kern_classes == 1) { + lv_font_fmt_txt_kern_classes_t * kern1 = (lv_font_fmt_txt_kern_classes_t *) dsc1->kern_dsc; + lv_font_fmt_txt_kern_classes_t * kern2 = (lv_font_fmt_txt_kern_classes_t *) dsc2->kern_dsc; + if (kern1 != NULL && kern2 != NULL) { + lv_test_assert_int_eq(kern1->right_class_cnt, kern2->right_class_cnt, "right_class_cnt"); + lv_test_assert_int_eq(kern1->left_class_cnt, kern2->left_class_cnt, "left_class_cnt"); + + lv_test_assert_array_eq( + (uint8_t *) kern1->left_class_mapping, + (uint8_t *) kern2->left_class_mapping, + kern1->left_class_cnt, + "left_class_mapping"); + + lv_test_assert_array_eq( + (uint8_t *) kern1->right_class_mapping, + (uint8_t *) kern2->right_class_mapping, + kern1->right_class_cnt, + "right_class_mapping"); + + lv_test_assert_array_eq( + (uint8_t *) kern1->class_pair_values, + (uint8_t *) kern2->class_pair_values, + kern1->right_class_cnt * kern1->left_class_cnt, + "class_pair_values"); + } + else { + lv_test_assert_ptr_eq(kern1, kern2, "kern"); + } + } + else if (dsc1->kern_classes == 0 && dsc2->kern_classes == 0) { + lv_font_fmt_txt_kern_pair_t * kern1 = (lv_font_fmt_txt_kern_pair_t *) dsc1->kern_dsc; + lv_font_fmt_txt_kern_pair_t * kern2 = (lv_font_fmt_txt_kern_pair_t *) dsc2->kern_dsc; + if (kern1 != NULL && kern2 != NULL) { + lv_test_assert_int_eq(kern1->glyph_ids_size, kern2->glyph_ids_size, "glyph_ids_size"); + lv_test_assert_int_eq(kern1->pair_cnt, kern2->pair_cnt, "pair_cnt"); + + int ids_size; + + if (kern1->glyph_ids_size == 0) { + ids_size = sizeof(int8_t) * 2 * kern1->pair_cnt; + } + else { + ids_size = sizeof(int16_t) * 2 * kern1->pair_cnt; + } + + lv_test_assert_array_eq(kern1->glyph_ids, kern2->glyph_ids, ids_size, "glyph_ids"); + lv_test_assert_array_eq( + (uint8_t * ) kern1->values, + (uint8_t * ) kern2->values, + kern1->pair_cnt, + "glyph_values"); + } + } + + lv_font_fmt_txt_glyph_dsc_t * glyph_dsc1 = (lv_font_fmt_txt_glyph_dsc_t *) dsc1->glyph_dsc; + lv_font_fmt_txt_glyph_dsc_t * glyph_dsc2 = (lv_font_fmt_txt_glyph_dsc_t *) dsc2->glyph_dsc; + + for(int i = 0; i < total_glyphs; ++i) { + if (i < total_glyphs - 1) { + int size1 = glyph_dsc1[i+1].bitmap_index - glyph_dsc1[i].bitmap_index; + + if (size1 > 0) { + lv_test_assert_array_eq( + dsc1->glyph_bitmap + glyph_dsc1[i].bitmap_index, + dsc2->glyph_bitmap + glyph_dsc2[i].bitmap_index, + size1 - 1, "glyph_bitmap"); + } + } + lv_test_assert_int_eq(glyph_dsc1[i].adv_w, glyph_dsc2[i].adv_w, "adv_w"); + lv_test_assert_int_eq(glyph_dsc1[i].box_w, glyph_dsc2[i].box_w, "box_w"); + lv_test_assert_int_eq(glyph_dsc1[i].box_h, glyph_dsc2[i].box_h, "box_h"); + lv_test_assert_int_eq(glyph_dsc1[i].ofs_x, glyph_dsc2[i].ofs_x, "ofs_x"); + lv_test_assert_int_eq(glyph_dsc1[i].ofs_y, glyph_dsc2[i].ofs_y, "ofs_y"); + } + + LV_LOG_INFO("No differences found!"); + return 0; +} +#endif + +/********************** + * STATIC FUNCTIONS + **********************/ + +#endif // LV_BUILD_TEST diff --git a/tests/lv_test_core/lv_test_font_loader.h b/tests/lv_test_core/lv_test_font_loader.h index fe29926bf..ffe077e4b 100644 --- a/tests/lv_test_core/lv_test_font_loader.h +++ b/tests/lv_test_core/lv_test_font_loader.h @@ -1,39 +1,38 @@ -/** - * @file lv_font_loader.h - * - */ - -#ifndef LV_TEST_FONT_LOADER_H -#define LV_TEST_FONT_LOADER_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ -void lv_test_font_loader(void); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*LV_TEST_FONT_LOADER_H*/ - +/** + * @file lv_font_loader.h + * + */ + +#ifndef LV_TEST_FONT_LOADER_H +#define LV_TEST_FONT_LOADER_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ +void lv_test_font_loader(void); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*LV_TEST_FONT_LOADER_H*/ diff --git a/tests/lv_test_core/lv_test_obj.c b/tests/lv_test_core/lv_test_obj.c index 455646823..e4708a18b 100644 --- a/tests/lv_test_core/lv_test_obj.c +++ b/tests/lv_test_core/lv_test_obj.c @@ -47,7 +47,6 @@ void lv_test_obj(void) create_delete_change_parent(); } - /********************** * STATIC FUNCTIONS **********************/ @@ -59,7 +58,6 @@ static void create_delete_change_parent(void) lv_test_print("Create, delete, change parent of a simple object:"); lv_test_print("-------------------------------------------------"); - lv_test_print("Create an object on the default screen"); lv_test_assert_int_eq(0, lv_obj_count_children(lv_scr_act()), "Screen's children count before creation"); diff --git a/tests/lv_test_core/lv_test_style.c b/tests/lv_test_core/lv_test_style.c index 0d1f3a5ed..d36676670 100644 --- a/tests/lv_test_core/lv_test_style.c +++ b/tests/lv_test_core/lv_test_style.c @@ -57,7 +57,6 @@ void lv_test_style(void) mem_leak(); } - /********************** * STATIC FUNCTIONS **********************/ @@ -166,7 +165,6 @@ static void add_remove_read_prop(void) _lv_style_list_reset(&style_list); } - static void cascade(void) { lv_test_print(""); @@ -236,7 +234,6 @@ static void cascade(void) lv_test_assert_int_eq(LV_RES_OK, found, "Get an overwritten 'color' property"); lv_test_assert_color_eq(LV_COLOR_BLUE, color, "Get the value of an overwritten 'color' property"); - lv_test_print("Overwrite the properties with the local style"); _lv_style_list_set_local_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, 20); _lv_style_list_set_local_opa(&style_list, LV_STYLE_BG_OPA, LV_OPA_70); @@ -259,7 +256,6 @@ static void cascade(void) lv_test_assert_int_eq(LV_RES_OK, found, "Get a local 'color' property"); lv_test_assert_color_eq(LV_COLOR_LIME, color, "Get the value of a local'color' property"); - /*Clean-up*/ _lv_style_list_reset(&style_list); } @@ -270,7 +266,6 @@ static void copy(void) lv_test_print("Copy styles and style lists"); lv_test_print("---------------------------"); - lv_test_print("Copy a style"); lv_style_t style_src; lv_style_init(&style_src); @@ -362,7 +357,6 @@ static void states(void) _lv_style_set_opa(&style_first, LV_STYLE_BG_OPA, LV_OPA_50); _lv_style_set_opa(&style_first, LV_STYLE_BG_OPA | (LV_STATE_CHECKED | LV_STATE_PRESSED) << LV_STYLE_STATE_POS, LV_OPA_60); - lv_opa_t opa; found = _lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA , &opa); lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'opa' property in normal state"); @@ -380,7 +374,6 @@ static void states(void) lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'opa' property in checked pressed hovered state"); lv_test_assert_int_eq(LV_OPA_60, opa, "Get the value of an 'int' in checked pressed hovered state"); - lv_test_print("Test state precedence in 2 styles"); _lv_style_set_color(&style_first, LV_STYLE_BG_COLOR, LV_COLOR_YELLOW); _lv_style_set_color(&style_first, LV_STYLE_BG_COLOR | (LV_STATE_HOVERED) << LV_STYLE_STATE_POS, LV_COLOR_RED); @@ -417,7 +410,6 @@ static void states(void) _lv_style_list_reset(&style_list); } - static void mem_leak(void) { @@ -491,7 +483,6 @@ static void mem_leak(void) lv_mem_monitor(&mon_end); lv_test_assert_int_lt(sizeof(void*) * 8, mon_start.free_size - mon_end.free_size, "Style memory leak"); - lv_test_print("Add styles"); lv_mem_monitor(&mon_start); for(i = 0; i < 100; i++) { @@ -537,7 +528,6 @@ static void mem_leak(void) _lv_style_list_remove_style(&style_list, &style2); _lv_style_list_add_style(&style_list, &style1); - if(i % 2 != 0) _lv_style_list_set_local_color(&style_list, LV_STYLE_LINE_COLOR, LV_COLOR_RED); _lv_style_list_reset(&style_list); @@ -551,8 +541,6 @@ static void mem_leak(void) lv_mem_monitor(&mon_end); lv_test_assert_int_lt(sizeof(void*) * 8, mon_start.free_size - mon_end.free_size, "Style memory leak"); - - lv_test_print("Complex test"); lv_mem_monitor(&mon_start); @@ -569,7 +557,6 @@ static void mem_leak(void) _lv_style_list_add_style(&style_list, &style1); - if(i % 4 == 0) { _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_CLOSE); } diff --git a/tests/lv_test_fonts/font_1.c b/tests/lv_test_fonts/font_1.c index cb26d658d..6ac794b30 100644 --- a/tests/lv_test_fonts/font_1.c +++ b/tests/lv_test_fonts/font_1.c @@ -709,7 +709,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0xe2, 0xdb, 0xbb, 0x80, 0xb2, 0x88, 0xb0, 0x80 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -904,7 +903,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -1334,7 +1332,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -1362,7 +1359,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 1 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -1380,4 +1376,3 @@ lv_font_t font_1 = { }; #endif /*#if FONT_1*/ - diff --git a/tests/lv_test_fonts/font_2.c b/tests/lv_test_fonts/font_2.c index cb20ac794..9d9c30218 100644 --- a/tests/lv_test_fonts/font_2.c +++ b/tests/lv_test_fonts/font_2.c @@ -739,7 +739,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, 0x0, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -934,7 +933,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * KERNING *----------------*/ - /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { @@ -1364,7 +1362,6 @@ static const int8_t kern_class_values[] = 0, 0, 0, 0, 0 }; - /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { @@ -1392,7 +1389,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 0 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -1410,4 +1406,3 @@ lv_font_t font_2 = { }; #endif /*#if FONT_2*/ - diff --git a/tests/lv_test_fonts/font_3.c b/tests/lv_test_fonts/font_3.c index c0dd3cfbb..d028e8ec5 100644 --- a/tests/lv_test_fonts/font_3.c +++ b/tests/lv_test_fonts/font_3.c @@ -794,7 +794,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0xc1, 0x64, 0xa1, 0x0, 0x54, 0x9a, 0x96, 0x0 }; - /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -902,8 +901,6 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { * CHARACTER MAPPING *--------------------*/ - - /*Collect the unicode lists and glyph_id offsets*/ static const lv_font_fmt_txt_cmap_t cmaps[] = { @@ -913,8 +910,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = } }; - - /*-------------------- * ALL CUSTOM DATA *--------------------*/ @@ -932,7 +927,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bitmap_format = 1 }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -950,4 +944,3 @@ lv_font_t font_3 = { }; #endif /*#if FONT_3*/ - diff --git a/tests/lv_test_main.c b/tests/lv_test_main.c index e910f4891..c590c62fe 100644 --- a/tests/lv_test_main.c +++ b/tests/lv_test_main.c @@ -26,7 +26,6 @@ int main(void) return 0; } - #if LV_USE_FILESYSTEM static lv_fs_res_t open_cb(struct _lv_fs_drv_t * drv, void * file_p, const char * path, lv_fs_mode_t mode) { @@ -144,4 +143,3 @@ uint32_t custom_tick_get(void) } #endif - diff --git a/tests/lv_test_widgets/lv_test_label.c b/tests/lv_test_widgets/lv_test_label.c index 3d0435a2e..586ebd286 100644 --- a/tests/lv_test_widgets/lv_test_label.c +++ b/tests/lv_test_widgets/lv_test_label.c @@ -51,7 +51,6 @@ void lv_test_label(void) #endif } - /********************** * STATIC FUNCTIONS **********************/ From c20d5d81f28b78b450610c223402681e7a435183 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 11 Jan 2021 07:38:17 -0600 Subject: [PATCH 45/62] Minor fix found in Kconfig (#2005) * Trim trailing whitespace from Kconfig * Replace all tab to space in Kconfig * Add more dependence between opions to Kconfig * Add LV_USE_FONT_SUBPX for LV_FONT_SUBPX_BGR in Kconfig * Fix typo error(LV_USE_DROPBOX->LV_USE_DROPDOWN) in Kconfig * Remove LV_THEME_MATERIAL dependence from the child of LV_THEME_DEFAULT_FLAG since LV_THEME_DEFAULT_FLAG already depends on LV_THEME_MATERIAL * Rename LV_MEM_SIZE_BYTES to LV_MEM_SIZE_KILOBYTES since this opion use KiB as the unit --- Kconfig | 129 +++++++++++++++++++++++++----------------- src/lv_conf_kconfig.h | 4 +- 2 files changed, 80 insertions(+), 53 deletions(-) diff --git a/Kconfig b/Kconfig index f306fe790..865c42e47 100644 --- a/Kconfig +++ b/Kconfig @@ -1,7 +1,7 @@ # Kconfig file for LVGL v7.8.1 menu "LVGL configuration" - + config LV_ATTRIBUTE_FAST_MEM_USE_IRAM bool "Set IRAM as LV_ATTRIBUTE_FAST_MEM" help @@ -47,12 +47,14 @@ menu "LVGL configuration" default 8 if LV_COLOR_DEPTH_8 default 16 if LV_COLOR_DEPTH_16 default 32 if LV_COLOR_DEPTH_32 - + config LV_COLOR_16_SWAP bool "Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)." + depends on LV_COLOR_DEPTH_16 config LV_COLOR_SCREEN_TRANSP bool "Enable screen transparency." + depends on LV_COLOR_DEPTH_32 help Useful for OSD or other overlapping GUIs. Requires `LV_COLOR_DEPTH = 32` colors and the screen's style @@ -95,7 +97,7 @@ menu "LVGL configuration" According to the width of the display (hor. res. / dpi) the displays fall in 4 categories. This is the upper limit for medium displays. - + config LV_DISP_LARGE_LIMIT int "Large display limit" default 70 @@ -103,11 +105,11 @@ menu "LVGL configuration" According to the width of the display (hor. res. / dpi) the displays fall in 4 categories. This is the upper limit for large displays. - + menu "Memory manager settings" config LV_MEM_CUSTOM - bool - prompt "If true use custom malloc/free, otherwise use the built-in `lv_mem_alloc` and `lv_mem_free`" + bool + prompt "If true use custom malloc/free, otherwise use the built-in `lv_mem_alloc` and `lv_mem_free`" config LV_MEM_CUSTOM_INCLUDE string @@ -118,19 +120,19 @@ menu "LVGL configuration" config LV_MEM_CUSTOM_ALLOC string prompt "Wrapper to malloc" - default "malloc" + default "malloc" depends on LV_MEM_CUSTOM config LV_MEM_CUSTOM_FREE string prompt "Wrapper to free" - default "free" + default "free" depends on LV_MEM_CUSTOM - config LV_MEM_SIZE_BYTES - int - prompt "Size of the memory used by `lv_mem_alloc` in kilobytes (>= 2kB)" - range 2 128 + config LV_MEM_SIZE_KILOBYTES + int + prompt "Size of the memory used by `lv_mem_alloc` in kilobytes (>= 2kB)" + range 2 128 default 32 depends on !LV_MEM_CUSTOM @@ -138,7 +140,7 @@ menu "LVGL configuration" bool prompt "Use the standard memcpy and memset instead of LVGL's own functions" endmenu - + menu "Indev device settings" config LV_INDEV_DEF_READ_PERIOD int "Input device read period [ms]." @@ -163,7 +165,7 @@ menu "LVGL configuration" default 3 endmenu - + menu "Feature usage" config LV_USE_ANIMATION bool "Enable the Animations." @@ -208,6 +210,7 @@ menu "LVGL configuration" bool "Enable STM32 DMA2D." config LV_GPU_DMA2D_CMSIS_INCLUDE string "include path of CMSIS header of target processor" + depends on LV_USE_GPU_STM32_DMA2D default "" help e.g. "stm32f769xx.h" or "stm32f429xx.h" @@ -215,6 +218,7 @@ menu "LVGL configuration" bool "Use PXP for CPU off-load on NXP RTxxx platforms." config LV_USE_GPU_NXP_PXP_AUTO_INIT bool "Call lv_gpu_nxp_pxp_init() automatically or manually." + depends on LV_USE_GPU_NXP_PXP help 1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c) and call @@ -251,7 +255,7 @@ menu "LVGL configuration" bool "Use the functions and types from the older (v7) API if possible." default y if !LV_CONF_MINIMAL endmenu - + menu "Image decoder and cache" config LV_IMG_CF_INDEXED bool "Enable indexed (pallete) images." @@ -280,7 +284,7 @@ menu "LVGL configuration" menu "HAL Settings" config LV_TICK_CUSTOM - bool + bool prompt "Use a custom tick source" config LV_TICK_CUSTOM_INCLUDE @@ -308,13 +312,13 @@ menu "LVGL configuration" config LV_LOG_LEVEL_TRACE bool "Trace - Detailed information" - config LV_LOG_LEVEL_INFO + config LV_LOG_LEVEL_INFO bool "Info - Log important events" - config LV_LOG_LEVEL_WARN + config LV_LOG_LEVEL_WARN bool "Warn - Log if something unwanted happened" config LV_LOG_LEVEL_ERROR bool "Error - Only critical issues" - config LV_LOG_LEVEL_NONE + config LV_LOG_LEVEL_NONE bool "None - Do not log anything" endchoice @@ -330,15 +334,15 @@ menu "LVGL configuration" config LV_LOG_PRINTF bool "Print the log with 'printf'" if LV_USE_LOG help - Use printf for log output. + Use printf for log output. If not set the user needs to register a callback with `lv_log_register_print_cb`. endmenu - + menu "Debug Settings" config LV_USE_DEBUG bool "Enable Debug" - + config LV_USE_ASSERT_NULL bool "Check if the parameter is NULL. (Quite fast)" default y if !LV_CONF_MINIMAL @@ -349,21 +353,21 @@ menu "LVGL configuration" config LV_USE_ASSERT_MEM_INTEGRITY bool "Check the integrity of `lv_mem` after critical operations. (Slow)" - + config LV_USE_ASSERT_STR bool "Search for NULL, very long strings, invalid characters, and unnatural repetitions. (Slow)" - help + help If disabled `LV_USE_ASSERT_NULL` will be performed instead (if it's enabled). - + config LV_USE_ASSERT_OBJ bool "Check NULL, the object's type and existence (e.g. not deleted). (Quite slow)." - help + help If disabled `LV_USE_ASSERT_NULL` will be performed instead (if it's enabled) - + config LV_USE_ASSERT_STYLE bool "Check if the styles are properly initialized. (Fast)" endmenu - + menu "Font usage" config LV_FONT_FMT_TXT_LARGE bool "Enable it if you have fonts with a lot of characters." @@ -372,13 +376,17 @@ menu "LVGL configuration" but with > 10,000 characters if you see issues probably you need to enable it. + config LV_USE_FONT_SUBPX + bool "Enable subpixel rendering." + config LV_FONT_SUBPX_BGR bool "Use BGR instead RGB for sub-pixel rendering." + depends on LV_USE_FONT_SUBPX help Set the pixel order of the display. Important only if "subpx fonts" are used. With "normal" font it doesn't matter. - + menu "Enable built-in fonts" config LV_FONT_MONTSERRAT_8 bool "Enable Montserrat 8" @@ -527,7 +535,7 @@ menu "LVGL configuration" bool "Simsun 16 CJK" select LV_FONT_SIMSUN_16_CJK endchoice - + choice LV_FONT_DEFAULT_NORMAL prompt "Select theme default normal font" default LV_FONT_DEFAULT_NORMAL_MONTSERRAT_16 if !LV_CONF_MINIMAL @@ -617,7 +625,7 @@ menu "LVGL configuration" bool "Simsun 16 CJK" select LV_FONT_SIMSUN_16_CJK endchoice - + choice LV_FONT_DEFAULT_SUBTITLE prompt "Select theme default subtitle font" default LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_16 if !LV_CONF_MINIMAL @@ -707,7 +715,7 @@ menu "LVGL configuration" bool "Simsun 16 CJK" select LV_FONT_SIMSUN_16_CJK endchoice - + choice LV_FONT_DEFAULT_TITLE prompt "Select theme default title font" default LV_FONT_DEFAULT_TITLE_MONTSERRAT_16 if !LV_CONF_MINIMAL @@ -797,7 +805,7 @@ menu "LVGL configuration" endmenu menu "Theme usage" - menu "Enable theme usage, always enable at least one theme" + menu "Enable theme usage, always enable at least one theme" config LV_THEME_EMPTY bool "Empty: No theme, you can apply your styles as you need." default y if LV_CONF_MINIMAL @@ -808,7 +816,7 @@ menu "LVGL configuration" default y if !LV_CONF_MINIMAL config LV_THEME_MONO bool "Mono: Mono-color theme for monochrome displays" - endmenu + endmenu choice LV_THEME_DEFAULT_INIT prompt "Select theme default init" @@ -830,7 +838,7 @@ menu "LVGL configuration" bool "Default init for mono theme" select LV_THEME_MONO endchoice - + config LV_THEME_DEFAULT_COLOR_PRIMARY hex "Select theme default primary color" range 0x000000 0xFFFFFF @@ -849,7 +857,7 @@ menu "LVGL configuration" choice LV_THEME_DEFAULT_FLAG depends on LV_THEME_MATERIAL - + prompt "Select theme default flag" default LV_THEME_DEFAULT_FLAG_LIGHT help @@ -857,10 +865,8 @@ menu "LVGL configuration" config LV_THEME_DEFAULT_FLAG_LIGHT bool "Light theme" - depends on LV_THEME_MATERIAL config LV_THEME_DEFAULT_FLAG_DARK bool "Dark theme" - depends on LV_THEME_MATERIAL endchoice endmenu @@ -882,39 +888,39 @@ menu "LVGL configuration" config LV_TXT_BREAK_CHARS string "Can break (wrap) texts on these chars" default " ,.;:-_" - + config LV_TXT_LINE_BREAK_LONG_LEN int "Line break long length" default 0 help - If a word is at least this long, will break wherever 'prettiest'. + If a word is at least this long, will break wherever 'prettiest'. To disable, set to a value <= 0. - + config LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN int "Min num chars before break" default 3 + depends on LV_TXT_LINE_BREAK_LONG_LEN > 0 help Minimum number of characters in a long word to put on a line before a break. - Depends on LV_TXT_LINE_BREAK_LONG_LEN - + config LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN int "Min num chars after break" default 3 + depends on LV_TXT_LINE_BREAK_LONG_LEN > 0 help Minimum number of characters in a long word to put on a line after a break. - Depends on LV_TXT_LINE_BREAK_LONG_LEN - + config LV_TXT_COLOR_CMD string "The control character to use for signalling text recoloring" default "#" config LV_USE_BIDI bool "Support bidirectional texts" - help + help Allows mixing Left-to-Right and Right-to-Left texts. The direction will be processed according to the Unicode Bidirectional Algorithm: https://www.w3.org/International/articles/inline-bidi-markup/uba-basics - + choice prompt "Set the default BIDI direction" default LV_BIDI_DIR_AUTO @@ -930,7 +936,7 @@ menu "LVGL configuration" config LV_USE_ARABIC_PERSIAN_CHARS bool "Enable Arabic/Persian processing" - help + help In these languages characters should be replaced with an other form based on their position in the text. @@ -938,14 +944,14 @@ menu "LVGL configuration" bool "Change the built-in (v)snprintf functions" config LV_SPRINTF_DISABLE_FLOAT - bool "Disable float in built-in (v)snprintf functions" if !LV_SPRINTF_CUSTOM + bool "Disable float in built-in (v)snprintf functions" if !LV_SPRINTF_CUSTOM endmenu menu "Widgets" config LV_USE_OBJ_REALIGN bool "Enable `lv_obj_realign()` based on `lv_obj_align()` parameters." default y if !LV_CONF_MINIMAL - + choice prompt "Enable to make the object clickable on a larger area." default LV_USE_EXT_CLICK_AREA_TINY @@ -976,6 +982,7 @@ menu "LVGL configuration" default y if !LV_CONF_MINIMAL config LV_CALENDAR_WEEK_STARTS_MONDAY bool "Calendar week starts monday." + depends on LV_USE_CALENDAR config LV_USE_CANVAS bool "Canvas. Dependencies: lv_img." select LV_USE_IMG @@ -1005,7 +1012,7 @@ menu "LVGL configuration" default y if !LV_CONF_MINIMAL config LV_DROPDOWN_DEF_ANIM_TIME int "Drop down animation time. 0: no animation." - depends on LV_USE_DROPBOX + depends on LV_USE_DROPDOWN default 200 config LV_USE_GAUGE bool "Gauge. Dependencies: lv_bar, lv_linemeter." @@ -1033,13 +1040,17 @@ menu "LVGL configuration" config LV_LABEL_DEF_SCROLL_SPEED int "Hor. or ver. scroll speed [px/sec] in LV_LABEL_LONG_ROLL/ROLL_CIRC mode." default 25 + depends on LV_USE_LABEL config LV_LABEL_WAIT_CHAR_COUNT int "Waiting period at beginning/end of animation cycle." default 3 + depends on LV_USE_LABEL config LV_LABEL_TEXT_SEL bool "Enable selecting text of the label." + depends on LV_USE_LABEL config LV_LABEL_LONG_TXT_HINT bool "Store extra some info in labels (12 bytes) to speed up drawing of very long texts." + depends on LV_USE_LABEL config LV_USE_LED bool "LED." default y if !LV_CONF_MINIMAL @@ -1047,10 +1058,12 @@ menu "LVGL configuration" int "LED minimal brightness." range 0 255 default 120 + depends on LV_USE_LED config LV_LED_BRIGHT_MAX int "LED maximal brightness." range 0 255 default 255 + depends on LV_USE_LED config LV_USE_LINE bool "Line." default y if !LV_CONF_MINIMAL @@ -1064,12 +1077,14 @@ menu "LVGL configuration" config LV_LIST_DEF_ANIM_TIME int "List default animation time of focusing to a list element [ms]. 0: no animation." default 100 + depends on LV_USE_LIST config LV_USE_LINEMETER bool "Line meter." default y if !LV_CONF_MINIMAL choice prompt "Draw line more precisely at cost of performance." default LV_LINEMETER_PRECISE_NO_EXTRA_PRECISION + depends on LV_USE_LINEMETER config LV_LINEMETER_PRECISE_NO_EXTRA_PRECISION bool "0: No extra precision." config LV_LINEMETER_PRECISE_SOME_EXTRA_PRECISION @@ -1093,6 +1108,7 @@ menu "LVGL configuration" config LV_PAGE_DEF_ANIM_TIME int "Focus default animation time [ms]. 0: No animation." default 100 + depends on LV_USE_PAGE config LV_USE_SPINNER bool "Spinner. Dependencies: lv_arc, lv_anim." select LV_USE_ARC @@ -1101,12 +1117,15 @@ menu "LVGL configuration" config LV_SPINNER_DEF_ARC_LENGTH int "Spinner def. arc length [deg]." default 60 + depends on LV_USE_SPINNER config LV_SPINNER_DEF_SPIN_TIME int "Spinner def. spin time [ms]." default 1000 + depends on LV_USE_SPINNER choice prompt "Type of spinner (animation type)." default LV_SPINNER_TYPE_SPINNING_ARC + depends on LV_USE_SPINNER config LV_SPINNER_TYPE_SPINNING_ARC bool "0: Spinner type spinning arc." config LV_SPINNER_TYPE_FILLSPIN_ARC @@ -1121,9 +1140,11 @@ menu "LVGL configuration" config LV_ROLLER_DEF_ANIM_TIME int "Focus animation time [ms]. 0: no animation." default 200 + depends on LV_USE_ROLLER config LV_ROLLER_INF_PAGES int "Number of extra 'pages' when the controller is infinite." default 7 + depends on LV_USE_ROLLER config LV_USE_SLIDER bool "Slider. Dependencies: lv_bar." select LV_USE_BAR @@ -1144,9 +1165,11 @@ menu "LVGL configuration" config LV_TEXTAREA_DEF_CURSOR_BLINK_TIME int "Text area def. cursor blink time [ms]." default 400 + depends on LV_USE_TEXTAREA config LV_TEXTAREA_DEF_PWN_SHOW_TIME int "Text area def. pwn show time [ms]." default 1500 + depends on LV_USE_TEXTAREA config LV_USE_TABLE bool "Table. Dependencies: lv_label." select LV_USE_LABEL @@ -1154,9 +1177,11 @@ menu "LVGL configuration" config LV_TABLE_COL_MAX int "Table col max." default 12 + depends on LV_USE_TABLE config LV_TABLE_CELL_STYLE_CNT int "Table cell style count." default 4 + depends on LV_USE_TABLE config LV_USE_TABVIEW bool "Tab. Dependencies: lv_page, lv_btnm." select LV_USE_PAGE @@ -1165,6 +1190,7 @@ menu "LVGL configuration" config LV_TABVIEW_DEF_ANIM_TIME int "Time of slide animation [ms]. 0: No animation." default 300 + depends on LV_USE_TABVIEW config LV_USE_TILEVIEW bool "Tileview. Dependencies: lv_page." select LV_USE_PAGE @@ -1172,6 +1198,7 @@ menu "LVGL configuration" config LV_TILEVIEW_DEF_ANIM_TIME int "Time of slide animation [ms]. 0: No animation." default 300 + depends on LV_USE_TILEVIEW config LV_USE_WIN bool "Window. Dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page." select LV_USE_CONT diff --git a/src/lv_conf_kconfig.h b/src/lv_conf_kconfig.h index 648edfa0e..3c88c6011 100644 --- a/src/lv_conf_kconfig.h +++ b/src/lv_conf_kconfig.h @@ -30,8 +30,8 @@ extern "C" { *******************/ #ifndef LV_MEM_SIZE -#if defined (CONFIG_LV_MEM_SIZE_BYTES) -#define CONFIG_LV_MEM_SIZE (CONFIG_LV_MEM_SIZE_BYTES * 1024U) +#if defined (CONFIG_LV_MEM_SIZE_KILOBYTES) +#define CONFIG_LV_MEM_SIZE (CONFIG_LV_MEM_SIZE_KILOBYTES * 1024U) #endif #endif From 138fcfec7955c1f37a5bf2372a25bc08cbcb0dc5 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 12 Jan 2021 05:00:20 -0600 Subject: [PATCH 46/62] fix(math): Correct the function argument type declaration (#2013) 1.all argument of _lv_bezier3 should be uint32_t since the input and output are unsigned 2.the return type of _lv_map should be int32_t since the type of output range is int32_t 3.remove the unnecessary cast --- src/lv_misc/lv_math.c | 18 +++++++++--------- src/lv_misc/lv_math.h | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lv_misc/lv_math.c b/src/lv_misc/lv_math.c index b66f75002..45b82cd50 100644 --- a/src/lv_misc/lv_math.c +++ b/src/lv_misc/lv_math.c @@ -83,7 +83,7 @@ LV_ATTRIBUTE_FAST_MEM int16_t _lv_trigo_sin(int16_t angle) * @param u3 end values in range of [0..LV_BEZIER_VAL_MAX] * @return the value calculated from the given parameters in range of [0..LV_BEZIER_VAL_MAX] */ -int32_t _lv_bezier3(uint32_t t, int32_t u0, int32_t u1, int32_t u2, int32_t u3) +uint32_t _lv_bezier3(uint32_t t, uint32_t u0, uint32_t u1, uint32_t u2, uint32_t u3) { uint32_t t_rem = 1024 - t; uint32_t t_rem2 = (t_rem * t_rem) >> 10; @@ -91,10 +91,10 @@ int32_t _lv_bezier3(uint32_t t, int32_t u0, int32_t u1, int32_t u2, int32_t u3) uint32_t t2 = (t * t) >> 10; uint32_t t3 = (t2 * t) >> 10; - uint32_t v1 = ((uint32_t)t_rem3 * u0) >> 10; - uint32_t v2 = ((uint32_t)3 * t_rem2 * t * u1) >> 20; - uint32_t v3 = ((uint32_t)3 * t_rem * t2 * u2) >> 20; - uint32_t v4 = ((uint32_t)t3 * u3) >> 10; + uint32_t v1 = (t_rem3 * u0) >> 10; + uint32_t v2 = (3 * t_rem2 * t * u1) >> 20; + uint32_t v3 = (3 * t_rem * t2 * u2) >> 20; + uint32_t v4 = (t3 * u3) >> 10; return v1 + v2 + v3 + v4; } @@ -118,12 +118,12 @@ LV_ATTRIBUTE_FAST_MEM void _lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask // http://ww1.microchip.com/...en/AppNotes/91040a.pdf do { trial = root + mask; - if((uint32_t)trial * trial <= x) root = trial; + if(trial * trial <= x) root = trial; mask = mask >> 1; } while(mask); - q->i = (uint32_t) root >> 4; - q->f = (uint32_t)(root & 0xf) << 4; + q->i = root >> 4; + q->f = (root & 0xf) << 4; } /** @@ -238,7 +238,7 @@ int64_t _lv_pow(int64_t base, int8_t exp) * @param max_out max output range * @return the mapped number */ -int16_t _lv_map(int32_t x, int32_t min_in, int32_t max_in, int32_t min_out, int32_t max_out) +int32_t _lv_map(int32_t x, int32_t min_in, int32_t max_in, int32_t min_out, int32_t max_out) { if(x <= min_in) return min_out; if(x >= max_in) return max_out; diff --git a/src/lv_misc/lv_math.h b/src/lv_misc/lv_math.h index f734f7b44..1730b4311 100644 --- a/src/lv_misc/lv_math.h +++ b/src/lv_misc/lv_math.h @@ -1,5 +1,5 @@ /** - * @file math_base.h + * @file lv_math.h * */ @@ -74,7 +74,7 @@ LV_ATTRIBUTE_FAST_MEM int16_t _lv_trigo_sin(int16_t angle); * @param u3 end values in range of [0..LV_BEZIER_VAL_MAX] * @return the value calculated from the given parameters in range of [0..LV_BEZIER_VAL_MAX] */ -int32_t _lv_bezier3(uint32_t t, int32_t u0, int32_t u1, int32_t u2, int32_t u3); +uint32_t _lv_bezier3(uint32_t t, uint32_t u0, uint32_t u1, uint32_t u2, uint32_t u3); /** * Calculate the atan2 of a vector. @@ -117,7 +117,7 @@ int64_t _lv_pow(int64_t base, int8_t exp); * @param max_out max output range * @return the mapped number */ -int16_t _lv_map(int32_t x, int32_t min_in, int32_t max_in, int32_t min, int32_t max); +int32_t _lv_map(int32_t x, int32_t min_in, int32_t max_in, int32_t min, int32_t max); /********************** * MACROS From c083d19b52a3f6b9460cb919b15e4e6ad37de1f5 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 12 Jan 2021 05:07:00 -0600 Subject: [PATCH 47/62] Minor fix found in async module (#2015) * fix(async): Move lv_async_info_t from lv_async.h to lv_async.c since the user don't need know the implementation detail * fix(async): Don't set user_data again since lv_task_create already save it for us --- src/lv_misc/lv_async.c | 7 +++++-- src/lv_misc/lv_async.h | 7 ------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/lv_misc/lv_async.c b/src/lv_misc/lv_async.c index 4336ff09a..41ec144a5 100644 --- a/src/lv_misc/lv_async.c +++ b/src/lv_misc/lv_async.c @@ -17,6 +17,11 @@ * TYPEDEFS **********************/ +typedef struct _lv_async_info_t { + lv_async_cb_t cb; + void * user_data; +} lv_async_info_t; + /********************** * STATIC PROTOTYPES **********************/ @@ -55,8 +60,6 @@ lv_res_t lv_async_call(lv_async_cb_t async_xcb, void * user_data) info->cb = async_xcb; info->user_data = user_data; - /* Set the task's user data */ - task->user_data = info; lv_task_set_repeat_count(task, 1); return LV_RES_OK; } diff --git a/src/lv_misc/lv_async.h b/src/lv_misc/lv_async.h index dafa2fc1a..a3a9330b5 100644 --- a/src/lv_misc/lv_async.h +++ b/src/lv_misc/lv_async.h @@ -30,13 +30,6 @@ extern "C" { */ typedef void (*lv_async_cb_t)(void *); -typedef struct _lv_async_info_t { - lv_async_cb_t cb; - void * user_data; -} lv_async_info_t; - -struct _lv_obj_t; - /********************** * GLOBAL PROTOTYPES **********************/ From 486053012dd970211315efbe9e7f56d77935725c Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 12 Jan 2021 05:16:02 -0600 Subject: [PATCH 48/62] Various fs module fix and improvement (#2019) * fix(fs): Check driver ready in lv_fs_dir_open and lv_fs_free_space * fix(fs): Avoid the memory leak in lv_fs_open and lv_fs_dir_open * fix(fs): Fix typo error in lv_fs_trunc(tell_cb should be trunc_cb) * fix(fs): Make lv_fs_dir_close same as lv_fs_close when dir_close_cb equals NULL * fix(fs): Handle the struct cleanup correctly * improve(fs): Don't allocate memory when file_size or rddir_size equal zero pass the address of file_d or dir_d to open_cb or dir_open_cb instead, so implementor can point file_d/dir_d to other location. In many cases(POSIX), file system will allocate the context for us, this improvement could avoid we allocate the 4/8 bytes intermediate space. --- src/lv_misc/lv_fs.c | 95 ++++++++++++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 35 deletions(-) diff --git a/src/lv_misc/lv_fs.c b/src/lv_misc/lv_fs.c index 6b9a1e129..e1641eb2b 100644 --- a/src/lv_misc/lv_fs.c +++ b/src/lv_misc/lv_fs.c @@ -95,18 +95,28 @@ lv_fs_res_t lv_fs_open(lv_fs_file_t * file_p, const char * path, lv_fs_mode_t mo file_p->drv = lv_fs_get_drv(letter); if(file_p->drv == NULL) { - file_p->file_d = NULL; return LV_FS_RES_NOT_EX; } if(file_p->drv->ready_cb != NULL) { if(file_p->drv->ready_cb(file_p->drv) == false) { - file_p->drv = NULL; - file_p->file_d = NULL; + file_p->drv = NULL; return LV_FS_RES_HW_ERR; } } + if(file_p->drv->open_cb == NULL) { + file_p->drv = NULL; + return LV_FS_RES_NOT_IMP; + } + + const char * real_path = lv_fs_get_real_path(path); + + if (file_p->drv->file_size == 0) { /*Is file_d zero size?*/ + /*Pass file_d's address to open_cb, so the implementor can allocate memory byself*/ + return file_p->drv->open_cb(file_p->drv, &file_p->file_d, real_path, mode); + } + file_p->file_d = lv_mem_alloc(file_p->drv->file_size); LV_ASSERT_MEM(file_p->file_d); if(file_p->file_d == NULL) { @@ -114,12 +124,7 @@ lv_fs_res_t lv_fs_open(lv_fs_file_t * file_p, const char * path, lv_fs_mode_t mo return LV_FS_RES_OUT_OF_MEM; /* Out of memory */ } - if(file_p->drv->open_cb == NULL) { - return LV_FS_RES_NOT_IMP; - } - - const char * real_path = lv_fs_get_real_path(path); - lv_fs_res_t res = file_p->drv->open_cb(file_p->drv, file_p->file_d, real_path, mode); + lv_fs_res_t res = file_p->drv->open_cb(file_p->drv, file_p->file_d, real_path, mode); if(res != LV_FS_RES_OK) { lv_mem_free(file_p->file_d); @@ -150,7 +155,6 @@ lv_fs_res_t lv_fs_close(lv_fs_file_t * file_p) lv_mem_free(file_p->file_d); /*Clean up*/ file_p->file_d = NULL; file_p->drv = NULL; - file_p->file_d = NULL; return res; } @@ -258,12 +262,12 @@ lv_fs_res_t lv_fs_seek(lv_fs_file_t * file_p, uint32_t pos) lv_fs_res_t lv_fs_tell(lv_fs_file_t * file_p, uint32_t * pos) { if(file_p->drv == NULL) { - pos = 0; + *pos = 0; return LV_FS_RES_INV_PARAM; } if(file_p->drv->tell_cb == NULL) { - pos = 0; + *pos = 0; return LV_FS_RES_NOT_IMP; } @@ -284,7 +288,7 @@ lv_fs_res_t lv_fs_trunc(lv_fs_file_t * file_p) return LV_FS_RES_INV_PARAM; } - if(file_p->drv->tell_cb == NULL) { + if(file_p->drv->trunc_cb == NULL) { return LV_FS_RES_NOT_IMP; } @@ -355,6 +359,9 @@ lv_fs_res_t lv_fs_rename(const char * oldname, const char * newname) */ lv_fs_res_t lv_fs_dir_open(lv_fs_dir_t * rddir_p, const char * path) { + rddir_p->drv = NULL; + rddir_p->dir_d = NULL; + if(path == NULL) return LV_FS_RES_INV_PARAM; char letter = path[0]; @@ -362,25 +369,43 @@ lv_fs_res_t lv_fs_dir_open(lv_fs_dir_t * rddir_p, const char * path) rddir_p->drv = lv_fs_get_drv(letter); if(rddir_p->drv == NULL) { - rddir_p->dir_d = NULL; return LV_FS_RES_NOT_EX; } - rddir_p->dir_d = lv_mem_alloc(rddir_p->drv->rddir_size); - LV_ASSERT_MEM(rddir_p->dir_d); - if(rddir_p->dir_d == NULL) { - rddir_p->dir_d = NULL; - return LV_FS_RES_OUT_OF_MEM; /* Out of memory */ + if(rddir_p->drv->ready_cb != NULL) { + if(rddir_p->drv->ready_cb(rddir_p->drv) == false) { + rddir_p->drv = NULL; + return LV_FS_RES_HW_ERR; + } } if(rddir_p->drv->dir_open_cb == NULL) { + rddir_p->drv = NULL; return LV_FS_RES_NOT_IMP; } const char * real_path = lv_fs_get_real_path(path); + if (rddir_p->drv->rddir_size == 0) { /*Is dir_d zero size?*/ + /*Pass dir_d's address to dir_open_cb, so the implementor can allocate memory byself*/ + return rddir_p->drv->dir_open_cb(rddir_p->drv, &rddir_p->dir_d, real_path); + } + + rddir_p->dir_d = lv_mem_alloc(rddir_p->drv->rddir_size); + LV_ASSERT_MEM(rddir_p->dir_d); + if(rddir_p->dir_d == NULL) { + rddir_p->drv = NULL; + return LV_FS_RES_OUT_OF_MEM; /* Out of memory */ + } + lv_fs_res_t res = rddir_p->drv->dir_open_cb(rddir_p->drv, rddir_p->dir_d, real_path); + if(res != LV_FS_RES_OK) { + lv_mem_free(rddir_p->dir_d); + rddir_p->dir_d = NULL; + rddir_p->drv = NULL; + } + return res; } @@ -399,6 +424,7 @@ lv_fs_res_t lv_fs_dir_read(lv_fs_dir_t * rddir_p, char * fn) } if(rddir_p->drv->dir_read_cb == NULL) { + fn[0] = '\0'; return LV_FS_RES_NOT_IMP; } @@ -418,19 +444,15 @@ lv_fs_res_t lv_fs_dir_close(lv_fs_dir_t * rddir_p) return LV_FS_RES_INV_PARAM; } - lv_fs_res_t res; - if(rddir_p->drv->dir_close_cb == NULL) { - res = LV_FS_RES_NOT_IMP; - } - else { - res = rddir_p->drv->dir_close_cb(rddir_p->drv, rddir_p->dir_d); + return LV_FS_RES_NOT_IMP; } + lv_fs_res_t res = rddir_p->drv->dir_close_cb(rddir_p->drv, rddir_p->dir_d); + lv_mem_free(rddir_p->dir_d); /*Clean up*/ rddir_p->dir_d = NULL; rddir_p->drv = NULL; - rddir_p->dir_d = NULL; return res; } @@ -450,19 +472,22 @@ lv_fs_res_t lv_fs_free_space(char letter, uint32_t * total_p, uint32_t * free_p) return LV_FS_RES_INV_PARAM; } - lv_fs_res_t res; + if(drv->ready_cb != NULL) { + if(drv->ready_cb(drv) == false) { + return LV_FS_RES_HW_ERR; + } + } if(drv->free_space_cb == NULL) { - res = LV_FS_RES_NOT_IMP; + return LV_FS_RES_NOT_IMP; } - else { - uint32_t total_tmp = 0; - uint32_t free_tmp = 0; - res = drv->free_space_cb(drv, &total_tmp, &free_tmp); - if(total_p != NULL) *total_p = total_tmp; - if(free_p != NULL) *free_p = free_tmp; - } + uint32_t total_tmp = 0; + uint32_t free_tmp = 0; + lv_fs_res_t res = drv->free_space_cb(drv, &total_tmp, &free_tmp); + + if(total_p != NULL) *total_p = total_tmp; + if(free_p != NULL) *free_p = free_tmp; return res; } From d6ca15a74923f2e86ce1e4ee6ee83bb2bbc887b8 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 12 Jan 2021 09:13:41 -0600 Subject: [PATCH 49/62] Move LV_GC_INCLUDE to the common place(gc.h) (#2010) * Move LV_GC_INCLUDE to the common place(gc.h) to avoid the duplication in many source files * fix(theme template): Always initialize _lv_theme_material_styles just like what other theme do --- src/lv_core/lv_group.c | 4 ---- src/lv_core/lv_obj.c | 4 ---- src/lv_core/lv_refr.c | 4 ---- src/lv_draw/lv_draw_mask.c | 4 ---- src/lv_draw/lv_img_cache.c | 3 --- src/lv_draw/lv_img_decoder.c | 4 ---- src/lv_font/lv_font_fmt_txt.c | 4 ---- src/lv_hal/lv_hal_disp.c | 4 ---- src/lv_hal/lv_hal_indev.c | 4 ---- src/lv_misc/lv_anim.c | 4 ---- src/lv_misc/lv_fs.c | 4 ---- src/lv_misc/lv_gc.c | 4 ---- src/lv_misc/lv_gc.h | 1 + src/lv_misc/lv_mem.c | 4 ---- src/lv_misc/lv_task.c | 4 ---- src/lv_themes/lv_theme_empty.c | 4 ---- src/lv_themes/lv_theme_material.c | 4 ---- src/lv_themes/lv_theme_mono.c | 4 ---- src/lv_themes/lv_theme_template.c | 9 --------- 19 files changed, 1 insertion(+), 76 deletions(-) diff --git a/src/lv_core/lv_group.c b/src/lv_core/lv_group.c index 9f2f554dc..ca91a3968 100644 --- a/src/lv_core/lv_group.c +++ b/src/lv_core/lv_group.c @@ -13,10 +13,6 @@ #include "../lv_themes/lv_theme.h" #include "../lv_misc/lv_gc.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index fb409ea16..a03e5cdab 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -30,10 +30,6 @@ #include "../lv_gpu/lv_gpu_nxp_pxp_osa.h" #endif -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - #if defined(LV_USER_DATA_FREE_INCLUDE) #include LV_USER_DATA_FREE_INCLUDE #endif /* LV_USE_USER_DATA_FREE */ diff --git a/src/lv_core/lv_refr.c b/src/lv_core/lv_refr.c index 7572412e4..e8502431b 100644 --- a/src/lv_core/lv_refr.c +++ b/src/lv_core/lv_refr.c @@ -23,10 +23,6 @@ #include "../lv_widgets/lv_label.h" #endif -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_draw/lv_draw_mask.c b/src/lv_draw/lv_draw_mask.c index 130c449f0..b74f2b4b2 100644 --- a/src/lv_draw/lv_draw_mask.c +++ b/src/lv_draw/lv_draw_mask.c @@ -12,10 +12,6 @@ #include "../lv_misc/lv_debug.h" #include "../lv_misc/lv_gc.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_draw/lv_img_cache.c b/src/lv_draw/lv_img_cache.c index 087d36c27..f5dc99d3c 100644 --- a/src/lv_draw/lv_img_cache.c +++ b/src/lv_draw/lv_img_cache.c @@ -13,9 +13,6 @@ #include "../lv_hal/lv_hal_tick.h" #include "../lv_misc/lv_gc.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ /********************* * DEFINES *********************/ diff --git a/src/lv_draw/lv_img_decoder.c b/src/lv_draw/lv_img_decoder.c index c70f32fbe..190edb252 100644 --- a/src/lv_draw/lv_img_decoder.c +++ b/src/lv_draw/lv_img_decoder.c @@ -13,10 +13,6 @@ #include "../lv_misc/lv_color.h" #include "../lv_misc/lv_gc.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_font/lv_font_fmt_txt.c b/src/lv_font/lv_font_fmt_txt.c index 75a084772..e6852baec 100644 --- a/src/lv_font/lv_font_fmt_txt.c +++ b/src/lv_font/lv_font_fmt_txt.c @@ -16,10 +16,6 @@ #include "../lv_misc/lv_utils.h" #include "../lv_misc/lv_mem.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_hal/lv_hal_disp.c b/src/lv_hal/lv_hal_disp.c index a79987cb6..007fdc367 100644 --- a/src/lv_hal/lv_hal_disp.c +++ b/src/lv_hal/lv_hal_disp.c @@ -19,10 +19,6 @@ #include "../lv_core/lv_refr.h" #include "../lv_themes/lv_theme.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_hal/lv_hal_indev.c b/src/lv_hal/lv_hal_indev.c index 2dd402c94..2c088f7e4 100644 --- a/src/lv_hal/lv_hal_indev.c +++ b/src/lv_hal/lv_hal_indev.c @@ -15,10 +15,6 @@ #include "../lv_misc/lv_gc.h" #include "lv_hal_disp.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_misc/lv_anim.c b/src/lv_misc/lv_anim.c index ed54cf635..e22487aa5 100644 --- a/src/lv_misc/lv_anim.c +++ b/src/lv_misc/lv_anim.c @@ -17,10 +17,6 @@ #include "lv_math.h" #include "lv_gc.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_misc/lv_fs.c b/src/lv_misc/lv_fs.c index e1641eb2b..772f1468b 100644 --- a/src/lv_misc/lv_fs.c +++ b/src/lv_misc/lv_fs.c @@ -14,10 +14,6 @@ #include #include "lv_gc.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_misc/lv_gc.c b/src/lv_misc/lv_gc.c index a9b355861..3a37a48c2 100644 --- a/src/lv_misc/lv_gc.c +++ b/src/lv_misc/lv_gc.c @@ -10,10 +10,6 @@ #include "lv_gc.h" #include "string.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_misc/lv_gc.h b/src/lv_misc/lv_gc.h index e1d7f4526..2236ab66d 100644 --- a/src/lv_misc/lv_gc.h +++ b/src/lv_misc/lv_gc.h @@ -52,6 +52,7 @@ extern "C" { #if LV_MEM_CUSTOM != 1 #error "GC requires CUSTOM_MEM" #endif /* LV_MEM_CUSTOM */ +#include LV_GC_INCLUDE #else /* LV_ENABLE_GC */ #define LV_GC_ROOT(x) x #define LV_EXTERN_ROOT(root_type, root_name) extern root_type root_name; diff --git a/src/lv_misc/lv_mem.c b/src/lv_misc/lv_mem.c index 33539391b..119ffadc5 100644 --- a/src/lv_misc/lv_mem.c +++ b/src/lv_misc/lv_mem.c @@ -16,10 +16,6 @@ #include LV_MEM_CUSTOM_INCLUDE #endif -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_misc/lv_task.c b/src/lv_misc/lv_task.c index 04a240b88..2c2223f5c 100644 --- a/src/lv_misc/lv_task.c +++ b/src/lv_misc/lv_task.c @@ -13,10 +13,6 @@ #include "../lv_hal/lv_hal_tick.h" #include "lv_gc.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_themes/lv_theme_empty.c b/src/lv_themes/lv_theme_empty.c index 7d565e475..1d34ee3a4 100644 --- a/src/lv_themes/lv_theme_empty.c +++ b/src/lv_themes/lv_theme_empty.c @@ -13,10 +13,6 @@ #include "../lv_misc/lv_gc.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_themes/lv_theme_material.c b/src/lv_themes/lv_theme_material.c index 73d2e618d..6b71dc9f2 100644 --- a/src/lv_themes/lv_theme_material.c +++ b/src/lv_themes/lv_theme_material.c @@ -12,10 +12,6 @@ #include "../lv_misc/lv_gc.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_themes/lv_theme_mono.c b/src/lv_themes/lv_theme_mono.c index 0f2b1d233..b27975096 100644 --- a/src/lv_themes/lv_theme_mono.c +++ b/src/lv_themes/lv_theme_mono.c @@ -12,10 +12,6 @@ #include "../lv_misc/lv_gc.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ diff --git a/src/lv_themes/lv_theme_template.c b/src/lv_themes/lv_theme_template.c index 5efa05018..a48af7210 100644 --- a/src/lv_themes/lv_theme_template.c +++ b/src/lv_themes/lv_theme_template.c @@ -12,10 +12,6 @@ #include "../lv_misc/lv_gc.h" -#if defined(LV_GC_INCLUDE) - #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ - /********************* * DEFINES *********************/ @@ -342,13 +338,8 @@ lv_theme_t * lv_theme_template_init(lv_color_t color_primary, lv_color_t color_s * styles' data if LVGL is used in a binding (e.g. Micropython) * In a general case styles could be simple `static lv_style_t my style` variables or allocated directly into `styles`*/ if(!inited) { -#if defined(LV_GC_INCLUDE) LV_GC_ROOT(_lv_theme_template_styles) = lv_mem_alloc(sizeof(theme_styles_t)); styles = (theme_styles_t *)LV_GC_ROOT(_lv_theme_template_styles); -#else - styles = lv_mem_alloc(sizeof(theme_styles_t)); -#endif - } theme.color_primary = color_primary; From 9ca4ffd64db6fb00bc71bada2db232e6337c9b69 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 12 Jan 2021 10:01:45 -0600 Subject: [PATCH 50/62] fix(format) correct comments in lv_gc.h, lv_ll.h and lv_log.h (#2016) --- src/lv_hal/lv_hal_tick.c | 4 ++-- src/lv_hal/lv_hal_tick.h | 2 +- src/lv_misc/lv_gc.h | 2 +- src/lv_misc/lv_ll.h | 2 +- src/lv_misc/lv_log.h | 10 +++++----- src/lv_misc/lv_printf.h | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lv_hal/lv_hal_tick.c b/src/lv_hal/lv_hal_tick.c index 3a1a5128a..2ceb7adf6 100644 --- a/src/lv_hal/lv_hal_tick.c +++ b/src/lv_hal/lv_hal_tick.c @@ -1,5 +1,5 @@ /** - * @file systick.c + * @file lv_hal_tick.c * Provide access to the system tick with 1 millisecond resolution */ @@ -76,7 +76,7 @@ uint32_t lv_tick_get(void) /** * Get the elapsed milliseconds since a previous time stamp - * @param prev_tick a previous time stamp (return value of systick_get() ) + * @param prev_tick a previous time stamp (return value of lv_tick_get() ) * @return the elapsed milliseconds since 'prev_tick' */ uint32_t lv_tick_elaps(uint32_t prev_tick) diff --git a/src/lv_hal/lv_hal_tick.h b/src/lv_hal/lv_hal_tick.h index f99d5188c..a6068660c 100644 --- a/src/lv_hal/lv_hal_tick.h +++ b/src/lv_hal/lv_hal_tick.h @@ -51,7 +51,7 @@ uint32_t lv_tick_get(void); /** * Get the elapsed milliseconds since a previous time stamp - * @param prev_tick a previous time stamp (return value of systick_get() ) + * @param prev_tick a previous time stamp (return value of lv_tick_get() ) * @return the elapsed milliseconds since 'prev_tick' */ uint32_t lv_tick_elaps(uint32_t prev_tick); diff --git a/src/lv_misc/lv_gc.h b/src/lv_misc/lv_gc.h index 2236ab66d..915bf39a2 100644 --- a/src/lv_misc/lv_gc.h +++ b/src/lv_misc/lv_gc.h @@ -28,7 +28,7 @@ extern "C" { #define LV_ITERATE_ROOTS(f) \ f(lv_ll_t, _lv_task_ll) /*Linked list to store the lv_tasks*/ \ f(lv_ll_t, _lv_disp_ll) /*Linked list of screens*/ \ - f(lv_ll_t, _lv_indev_ll) /*Linked list of screens*/ \ + f(lv_ll_t, _lv_indev_ll) /*Linked list of input device*/ \ f(lv_ll_t, _lv_drv_ll) \ f(lv_ll_t, _lv_file_ll) \ f(lv_ll_t, _lv_anim_ll) \ diff --git a/src/lv_misc/lv_ll.h b/src/lv_misc/lv_ll.h index 906414d16..a4ce8c64c 100644 --- a/src/lv_misc/lv_ll.h +++ b/src/lv_misc/lv_ll.h @@ -1,5 +1,5 @@ /** - * @file lv_ll.c + * @file lv_ll.h * Handle linked lists. The nodes are dynamically allocated by the 'lv_mem' module. */ diff --git a/src/lv_misc/lv_log.h b/src/lv_misc/lv_log.h index a85427e78..99633a8a2 100644 --- a/src/lv_misc/lv_log.h +++ b/src/lv_misc/lv_log.h @@ -23,12 +23,12 @@ extern "C" { /*Possible log level. For compatibility declare it independently from `LV_USE_LOG`*/ #define LV_LOG_LEVEL_TRACE 0 /**< A lot of logs to give detailed information*/ -#define LV_LOG_LEVEL_INFO 1 /**< Log important events*/ -#define LV_LOG_LEVEL_WARN 2 /**< Log if something unwanted happened but didn't caused problem*/ +#define LV_LOG_LEVEL_INFO 1 /**< Log important events*/ +#define LV_LOG_LEVEL_WARN 2 /**< Log if something unwanted happened but didn't caused problem*/ #define LV_LOG_LEVEL_ERROR 3 /**< Only critical issue, when the system may fail*/ -#define LV_LOG_LEVEL_USER 4 /**< Custom logs from the user*/ -#define LV_LOG_LEVEL_NONE 5 /**< Do not log anything*/ -#define _LV_LOG_LEVEL_NUM 6 /**< Number of log levels */ +#define LV_LOG_LEVEL_USER 4 /**< Custom logs from the user*/ +#define LV_LOG_LEVEL_NONE 5 /**< Do not log anything*/ +#define _LV_LOG_LEVEL_NUM 6 /**< Number of log levels */ LV_EXPORT_CONST_INT(LV_LOG_LEVEL_TRACE); LV_EXPORT_CONST_INT(LV_LOG_LEVEL_INFO); diff --git a/src/lv_misc/lv_printf.h b/src/lv_misc/lv_printf.h index 1f9879f5c..a89617cd0 100644 --- a/src/lv_misc/lv_printf.h +++ b/src/lv_misc/lv_printf.h @@ -64,4 +64,4 @@ int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va); } #endif -#endif // _PRINTF_H_ +#endif // _LV_PRINTF_H_ From bc25998c5b2acc347eade7d3dac29675d81476b8 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 12 Jan 2021 12:26:26 -0600 Subject: [PATCH 51/62] Minor fix found in mem module (#2014) * fix(mem): Utilize ALIGN_MASK as much as possible to avoid check LV_ARCH_64 again and again and correct the comment about MEM_UNIT * fix(mem): Simplify _lv_memset implementation by SET8/SET32/REPEAT8 macro * fix(mem): Handle the out of memory gracefully in _lv_mem_buf_get don't modify the state in the failure * fix(mem): Remove the unnecessary memset, memcpy and assignment --- src/lv_misc/lv_mem.c | 121 ++++++++++++++----------------------------- 1 file changed, 38 insertions(+), 83 deletions(-) diff --git a/src/lv_misc/lv_mem.c b/src/lv_misc/lv_mem.c index 119ffadc5..0bcda313c 100644 --- a/src/lv_misc/lv_mem.c +++ b/src/lv_misc/lv_mem.c @@ -40,11 +40,11 @@ #if LV_ENABLE_GC == 0 /*gc custom allocations must not include header*/ -/*The size of this union must be 4 bytes (uint32_t)*/ +/*The size of this union must be 4/8 bytes (uint32_t/uint64_t)*/ typedef union { struct { MEM_UNIT used : 1; /* 1: if the entry is used*/ - MEM_UNIT d_size : 31; /* Size off the data (1 means 4 bytes)*/ + MEM_UNIT d_size : 31; /* Size of the data*/ } s; MEM_UNIT header; /* The header (used + d_size)*/ } lv_mem_header_t; @@ -100,6 +100,7 @@ static lv_mem_buf_t mem_buf_small[] = {{.p = mem_buf1_32, .size = MEM_BUF_SMALL_ #define COPY32 *d32 = *s32; d32++; s32++; #define COPY8 *d8 = *s8; d8++; s8++; #define SET32(x) *d32 = x; d32++; +#define SET8(x) *d8 = x; d8++; #define REPEAT8(expr) expr expr expr expr expr expr expr expr /********************** @@ -117,14 +118,13 @@ void _lv_mem_init(void) /*Allocate a large array to store the dynamically allocated data*/ static LV_MEM_ATTR MEM_UNIT work_mem_int[LV_MEM_SIZE / sizeof(MEM_UNIT)]; work_mem = (uint8_t *)work_mem_int; - mem_max_size = 0; #else work_mem = (uint8_t *)LV_MEM_ADR; #endif lv_mem_ent_t * full = (lv_mem_ent_t *)work_mem; full->header.s.used = 0; - /*The total mem size id reduced by the first header and the close patterns */ + /*The total mem size reduced by the first header and the close patterns */ full->header.s.d_size = LV_MEM_SIZE - sizeof(lv_mem_header_t); #endif } @@ -136,10 +136,9 @@ void _lv_mem_init(void) void _lv_mem_deinit(void) { #if LV_MEM_CUSTOM == 0 - _lv_memset_00(work_mem, (LV_MEM_SIZE / sizeof(MEM_UNIT)) * sizeof(MEM_UNIT)); lv_mem_ent_t * full = (lv_mem_ent_t *)work_mem; full->header.s.used = 0; - /*The total mem size id reduced by the first header and the close patterns */ + /*The total mem size reduced by the first header and the close patterns */ full->header.s.d_size = LV_MEM_SIZE - sizeof(lv_mem_header_t); #endif } @@ -155,13 +154,8 @@ void * lv_mem_alloc(size_t size) return &zero_mem; } -#ifdef LV_ARCH_64 - /*Round the size up to 8*/ - size = (size + 7) & (~0x7); -#else - /*Round the size up to 4*/ - size = (size + 3) & (~0x3); -#endif + /*Round the size up to ALIGN_MASK*/ + size = (size + ALIGN_MASK) & (~ALIGN_MASK); void * alloc = NULL; #if LV_MEM_CUSTOM == 0 @@ -260,7 +254,6 @@ void lv_mem_free(const void * data) lv_mem_defrag(); } - #endif /*LV_MEM_AUTO_DEFRAG*/ #else /*Use custom, user defined free function*/ #if LV_ENABLE_GC == 0 @@ -283,14 +276,8 @@ void lv_mem_free(const void * data) void * lv_mem_realloc(void * data_p, size_t new_size) { - -#ifdef LV_ARCH_64 - /*Round the size up to 8*/ - new_size = (new_size + 7) & (~0x7); -#else - /*Round the size up to 4*/ - new_size = (new_size + 3) & (~0x3); -#endif + /*Round the size up to ALIGN_MASK*/ + new_size = (new_size + ALIGN_MASK) & (~ALIGN_MASK); /*data_p could be previously freed pointer (in this case it is invalid)*/ if(data_p != NULL) { @@ -321,10 +308,10 @@ void * lv_mem_realloc(void * data_p, size_t new_size) if(data_p != NULL) { /*Copy the old data to the new. Use the smaller size*/ - if(old_size != 0) { + if(old_size != 0 && new_size != 0) { _lv_memcpy(new_p, data_p, LV_MATH_MIN(new_size, old_size)); - lv_mem_free(data_p); } + lv_mem_free(data_p); } return new_p; @@ -415,9 +402,8 @@ void lv_mem_monitor(lv_mem_monitor_t * mon_p) _lv_memset(mon_p, 0, sizeof(lv_mem_monitor_t)); #if LV_MEM_CUSTOM == 0 lv_mem_ent_t * e; - e = NULL; - e = ent_get_next(e); + e = ent_get_next(NULL); while(e != NULL) { if(e->header.s.used == 0) { @@ -435,13 +421,13 @@ void lv_mem_monitor(lv_mem_monitor_t * mon_p) } mon_p->total_size = LV_MEM_SIZE; mon_p->max_used = mem_max_size; - mon_p->used_pct = 100 - (100U * mon_p->free_size) / mon_p->total_size; + mon_p->used_pct = 100 - (100U * mon_p->free_size) / mon_p->total_size; if(mon_p->free_size > 0) { - mon_p->frag_pct = (uint32_t)mon_p->free_biggest_size * 100U / mon_p->free_size; - mon_p->frag_pct = 100 - mon_p->frag_pct; + mon_p->frag_pct = mon_p->free_biggest_size * 100U / mon_p->free_size; + mon_p->frag_pct = 100 - mon_p->frag_pct; } else { - mon_p->frag_pct = 0; /*no fragmentation if all the RAM is used*/ + mon_p->frag_pct = 0; /*no fragmentation if all the RAM is used*/ } #endif } @@ -518,14 +504,16 @@ void * _lv_mem_buf_get(uint32_t size) /*Reallocate a free buffer*/ for(i = 0; i < LV_MEM_BUF_MAX_NUM; i++) { if(LV_GC_ROOT(_lv_mem_buf[i]).used == 0) { + /*if this fails you probably need to increase your LV_MEM_SIZE/heap size*/ + void * buf = lv_mem_realloc(LV_GC_ROOT(_lv_mem_buf[i]).p, size); + if(buf == NULL) { + LV_DEBUG_ASSERT(false, "Out of memory, can't allocate a new buffer (increase your LV_MEM_SIZE/heap size)", 0x00); + return NULL; + } LV_GC_ROOT(_lv_mem_buf[i]).used = 1; LV_GC_ROOT(_lv_mem_buf[i]).size = size; - /*if this fails you probably need to increase your LV_MEM_SIZE/heap size*/ - LV_GC_ROOT(_lv_mem_buf[i]).p = lv_mem_realloc(LV_GC_ROOT(_lv_mem_buf[i]).p, size); - if(LV_GC_ROOT(_lv_mem_buf[i]).p == NULL) { - LV_DEBUG_ASSERT(false, "Out of memory, can't allocate a new buffer (increase your LV_MEM_SIZE/heap size", 0x00); - } - return LV_GC_ROOT(_lv_mem_buf[i]).p; + LV_GC_ROOT(_lv_mem_buf[i]).p = buf; + return LV_GC_ROOT(_lv_mem_buf[i]).p; } } @@ -659,8 +647,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset(void * dst, uint8_t v, size_t len) if(d_align) { d_align = ALIGN_MASK + 1 - d_align; while(d_align && len) { - *d8 = v; - d8++; + SET8(v); len--; d_align--; } @@ -671,14 +658,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset(void * dst, uint8_t v, size_t len) uint32_t * d32 = (uint32_t *)d8; while(len > 32) { - SET32(v32); - SET32(v32); - SET32(v32); - SET32(v32); - SET32(v32); - SET32(v32); - SET32(v32); - SET32(v32); + REPEAT8(SET32(v32)); len -= 32; } @@ -689,8 +669,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset(void * dst, uint8_t v, size_t len) d8 = (uint8_t *)d32; while(len) { - *d8 = v; - d8++; + SET8(v); len--; } } @@ -709,8 +688,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset_00(void * dst, size_t len) if(d_align) { d_align = ALIGN_MASK + 1 - d_align; while(d_align && len) { - *d8 = 0x00; - d8++; + SET8(0); len--; d_align--; } @@ -718,14 +696,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset_00(void * dst, size_t len) uint32_t * d32 = (uint32_t *)d8; while(len > 32) { - SET32(0); - SET32(0); - SET32(0); - SET32(0); - SET32(0); - SET32(0); - SET32(0); - SET32(0); + REPEAT8(SET32(0)); len -= 32; } @@ -736,8 +707,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset_00(void * dst, size_t len) d8 = (uint8_t *)d32; while(len) { - *d8 = 0; - d8++; + SET8(0); len--; } } @@ -756,8 +726,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset_ff(void * dst, size_t len) if(d_align) { d_align = ALIGN_MASK + 1 - d_align; while(d_align && len) { - *d8 = 0xFF; - d8++; + SET8(0xFF); len--; d_align--; } @@ -765,14 +734,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset_ff(void * dst, size_t len) uint32_t * d32 = (uint32_t *)d8; while(len > 32) { - SET32(0xFFFFFFFF); - SET32(0xFFFFFFFF); - SET32(0xFFFFFFFF); - SET32(0xFFFFFFFF); - SET32(0xFFFFFFFF); - SET32(0xFFFFFFFF); - SET32(0xFFFFFFFF); - SET32(0xFFFFFFFF); + REPEAT8(SET32(0xFFFFFFFF)); len -= 32; } @@ -783,8 +745,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_memset_ff(void * dst, size_t len) d8 = (uint8_t *)d32; while(len) { - *d8 = 0xFF; - d8++; + SET8(0xFF); len--; } } @@ -847,14 +808,8 @@ static void * ent_alloc(lv_mem_ent_t * e, size_t size) */ static void ent_trunc(lv_mem_ent_t * e, size_t size) { - -#ifdef LV_ARCH_64 - /*Round the size up to 8*/ - size = (size + 7) & (~0x7); -#else - /*Round the size up to 4*/ - size = (size + 3) & (~0x3); -#endif + /*Round the size up to ALIGN_MASK*/ + size = (size + ALIGN_MASK) & (~ALIGN_MASK); /*Don't let empty space only for a header without data*/ if(e->header.s.d_size == size + sizeof(lv_mem_header_t)) { @@ -867,10 +822,10 @@ static void ent_trunc(lv_mem_ent_t * e, size_t size) lv_mem_ent_t * after_new_e = (lv_mem_ent_t *)&e_data[size]; after_new_e->header.s.used = 0; after_new_e->header.s.d_size = (uint32_t)e->header.s.d_size - size - sizeof(lv_mem_header_t); - } - /* Set the new size for the original entry */ - e->header.s.d_size = (uint32_t)size; + /* Set the new size for the original entry */ + e->header.s.d_size = (uint32_t)size; + } } #endif From 873551bb5e84c259404f3897be6d5ca2584d9e1c Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 15 Jan 2021 13:31:16 -0600 Subject: [PATCH 52/62] fix(area): minor improvements (#2023) * fix(area): Correct r_sqrd and dist(int32_t to uint32_t) since these two variables never become negative * fix(area): Return early in _lv_area_is_in if pointer outside area The origin code always does the full check if radius != 0, but it is unnecessary when is_in equals true. --- src/lv_misc/lv_area.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lv_misc/lv_area.c b/src/lv_misc/lv_area.c index 8f0045583..868af4531 100644 --- a/src/lv_misc/lv_area.c +++ b/src/lv_misc/lv_area.c @@ -239,7 +239,8 @@ bool _lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p, lv_coo is_in = true; } - if(radius == 0) return is_in; + if (!is_in) return false; + if(radius == 0) return true; /*Check if the corner points are inside the radius or not*/ lv_point_t p; @@ -398,8 +399,8 @@ static bool lv_point_within_circle(const lv_area_t * area, const lv_point_t * p) lv_coord_t px = p->x - cx; lv_coord_t py = p->y - cy; - int32_t r_sqrd = r * r; - int32_t dist = (px * px) + (py * py); + uint32_t r_sqrd = r * r; + uint32_t dist = (px * px) + (py * py); if(dist <= r_sqrd) return true; From c9b97feea87b820a68de0b78c6adb61a1527e042 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 17 Jan 2021 06:03:31 -0800 Subject: [PATCH 53/62] fix(formatting): various improvements (#2028) * fix(formatting): Remove the duplicated space * fix(formatting): Remove the duplicated 'the' * fix(spell): run codespell -w for the code base --- CHANGELOG.md | 22 +++++++++++----------- Kconfig | 2 +- docs/ROADMAP.md | 8 ++++---- examples/porting/lv_port_disp_template.c | 2 +- examples/porting/lv_port_fs_template.c | 6 +++--- lv_conf_template.h | 4 ++-- scripts/release/com.py | 2 +- scripts/release/main.py | 2 +- scripts/release/proj.py | 6 +++--- src/lv_conf_kconfig.h | 10 +++++----- src/lv_core/lv_disp.c | 2 +- src/lv_core/lv_disp.h | 6 +++--- src/lv_core/lv_group.c | 4 ++-- src/lv_core/lv_indev.c | 4 ++-- src/lv_core/lv_obj.c | 14 +++++++------- src/lv_core/lv_obj.h | 20 ++++++++++---------- src/lv_core/lv_refr.c | 4 ++-- src/lv_core/lv_refr.h | 2 +- src/lv_core/lv_style.c | 4 ++-- src/lv_core/lv_style.h | 8 ++++---- src/lv_draw/lv_draw_blend.c | 2 +- src/lv_draw/lv_draw_img.c | 4 ++-- src/lv_draw/lv_draw_label.c | 2 +- src/lv_draw/lv_draw_mask.c | 4 ++-- src/lv_draw/lv_draw_rect.c | 6 +++--- src/lv_draw/lv_img_buf.h | 4 ++-- src/lv_font/lv_font.c | 2 +- src/lv_font/lv_font.h | 6 +++--- src/lv_font/lv_font_fmt_txt.h | 4 ++-- src/lv_gpu/lv_gpu_nxp_pxp.c | 2 +- src/lv_gpu/lv_gpu_nxp_pxp.h | 2 +- src/lv_gpu/lv_gpu_stm32_dma2d.c | 2 +- src/lv_hal/lv_hal_disp.h | 2 +- src/lv_hal/lv_hal_indev.c | 2 +- src/lv_misc/lv_anim.c | 4 ++-- src/lv_misc/lv_bidi.c | 4 ++-- src/lv_misc/lv_bidi.h | 6 +++--- src/lv_misc/lv_color.h | 2 +- src/lv_misc/lv_debug.c | 4 ++-- src/lv_misc/lv_fs.c | 4 ++-- src/lv_misc/lv_fs.h | 4 ++-- src/lv_misc/lv_ll.c | 4 ++-- src/lv_misc/lv_ll.h | 2 +- src/lv_misc/lv_log.h | 2 +- src/lv_misc/lv_mem.c | 4 ++-- src/lv_misc/lv_printf.c | 4 ++-- src/lv_misc/lv_task.c | 2 +- src/lv_misc/lv_task.h | 4 ++-- src/lv_misc/lv_txt.c | 6 +++--- src/lv_misc/lv_txt_ap.c | 4 ++-- src/lv_themes/lv_theme_material.c | 2 +- src/lv_widgets/lv_arc.c | 8 ++++---- src/lv_widgets/lv_bar.c | 4 ++-- src/lv_widgets/lv_btn.h | 2 +- src/lv_widgets/lv_btnmatrix.c | 16 ++++++++-------- src/lv_widgets/lv_btnmatrix.h | 14 +++++++------- src/lv_widgets/lv_calendar.c | 12 ++++++------ src/lv_widgets/lv_calendar.h | 8 ++++---- src/lv_widgets/lv_canvas.c | 2 +- src/lv_widgets/lv_canvas.h | 2 +- src/lv_widgets/lv_chart.c | 6 +++--- src/lv_widgets/lv_chart.h | 2 +- src/lv_widgets/lv_checkbox.h | 4 ++-- src/lv_widgets/lv_cont.c | 2 +- src/lv_widgets/lv_dropdown.c | 2 +- src/lv_widgets/lv_dropdown.h | 6 +++--- src/lv_widgets/lv_gauge.h | 2 +- src/lv_widgets/lv_img.c | 2 +- src/lv_widgets/lv_imgbtn.c | 4 ++-- src/lv_widgets/lv_imgbtn.h | 4 ++-- src/lv_widgets/lv_keyboard.c | 4 ++-- src/lv_widgets/lv_keyboard.h | 6 +++--- src/lv_widgets/lv_label.c | 4 ++-- src/lv_widgets/lv_list.h | 6 +++--- src/lv_widgets/lv_msgbox.c | 10 +++++----- src/lv_widgets/lv_msgbox.h | 16 ++++++++-------- src/lv_widgets/lv_page.c | 6 +++--- src/lv_widgets/lv_page.h | 6 +++--- src/lv_widgets/lv_roller.c | 2 +- src/lv_widgets/lv_roller.h | 2 +- src/lv_widgets/lv_slider.h | 2 +- src/lv_widgets/lv_spinbox.h | 2 +- src/lv_widgets/lv_spinner.c | 2 +- src/lv_widgets/lv_spinner.h | 6 +++--- src/lv_widgets/lv_switch.c | 2 +- src/lv_widgets/lv_switch.h | 6 +++--- src/lv_widgets/lv_table.h | 6 +++--- src/lv_widgets/lv_tabview.c | 8 ++++---- src/lv_widgets/lv_tabview.h | 4 ++-- src/lv_widgets/lv_textarea.c | 12 ++++++------ src/lv_widgets/lv_textarea.h | 14 +++++++------- src/lv_widgets/lv_win.c | 2 +- src/lv_widgets/lv_win.h | 10 +++++----- tests/build.py | 4 ++-- tests/lv_test_core/lv_test_style.c | 4 ++-- 95 files changed, 243 insertions(+), 243 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da1ab0b77..edd6f8f64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,10 @@ ## v7.9.1 (Planned at 19.01.2020 ### Bugfixes -- fix(cpicker) fix division by zero +- fix(cpicker) fix division by zero - fix(dropdown) fix selecting options after the last one - fix(msgbox) use the animation time provided -- fix(gpu_nxp_pxp) fix incorrent define name +- fix(gpu_nxp_pxp) fix incorrect define name - fix(indev) don't leave edit mode if there is only one object in the group @@ -14,7 +14,7 @@ ### New features - feat(chart) add lv_chart_remove_series and lv_chart_hide_series -- feat(img_cahce) allow disabling image cacheing +- feat(img_cahce) allow disabling image caching - calendar: make get_day_of_week() public - Added support for Zephyr integration @@ -56,7 +56,7 @@ - fix reference to LV_DRAW_BUF_MAX_NUM in lv_mem.c - fix(polygon draw) join adjacent points if they are on the same coordinate - fix(linemeter) fix invalidation when setting new value -- fix(table) add missing invalidation when changeing cell type +- fix(table) add missing invalidation when changing cell type - refactor(roller) rename LV_ROLLER_MODE_INIFINITE -> LV_ROLLER_MODE_INFINITE ## v7.7.2 (17.11.2020) @@ -66,7 +66,7 @@ - fix(arc) fix and improve arc dragging - label: Repair calculate back `dot` character logical error which cause infinite loop. - fix(theme_material): remove the bottom border from tabview header -- fix(imgbtn) guess a the closest availabe state with valid src +- fix(imgbtn) guess a the closest available state with valid src - fix(spinbox) update cursor position in lv_spinbox_set_step ## v7.7.1 (03.11.2020) @@ -83,7 +83,7 @@ - Allow max. 16 cell types for table - Add `lv_table_set_text_fmt()` - Use margin on calendar header to set distances and padding to the size of the header -- Add `text_sel_bg` style proeprty +- Add `text_sel_bg` style property ### Bugfixes - Theme update to support text selection background @@ -123,7 +123,7 @@ - Add 10px and 8ox built in fonts ### Bugfixes -- Fix unexpeted DEFOCUS on lv_page when clicking to bg after the scrollable +- Fix unexpected DEFOCUS on lv_page when clicking to bg after the scrollable - Fix `lv_obj_del` and `lv_obj_clean` if the children list changed during deletion. - Adjust button matrix button width to include padding when spanning multiple units. - Add rounding to btnmatrix line height calculation @@ -138,10 +138,10 @@ The main new features of v7.4 are run-time font loading, style caching and arc k ### New features - Add `lv_font_load()` function - Loads a `lv_font_t` object from a binary font file - Add `lv_font_free()` function - Frees the memory allocated by the `lv_font_load()` function -- Add style caching to reduce acces time of properties with default value +- Add style caching to reduce access time of properties with default value - arc: add set value by click feature - arc: add `LV_ARC_PART_KNOB` similarly to slider -- send gestures even if the the obejct was dragged. User can check dragging with `lv_indev_is_dragging(lv_indev_act())` in the event function. +- send gestures event if the object was dragged. User can check dragging with `lv_indev_is_dragging(lv_indev_act())` in the event function. ### Bugfixes - Fix color bleeding on border drawing @@ -225,7 +225,7 @@ The main new features of v7.4 are run-time font loading, style caching and arc k - Add lv_btnmatrix_set/get_align capability - DMA2D: Remove dependency on ST CubeMX HAL - Added `max_used` propriety to `lv_mem_monitor_t` struct -- In `lv_init` test if the the strings are UTF-8 encoded. +- In `lv_init` test if the strings are UTF-8 encoded. - Add `user_data` to themes - Add LV_BIG_ENDIAN_SYSTEM flag to lv_conf.h in order to fix displaying images on big endian systems. - Add inline function lv_checkbox_get_state(const lv_obj_t * cb) to extend the checkbox functionality. @@ -279,7 +279,7 @@ The main new features of v7.4 are run-time font loading, style caching and arc k - Remove memcpy from `lv_ll` (caused issues with some optimization settings) - `lv_chart` fix X tick drawing - Fix vertical dashed line drawing -- Some additonal minor fixes and formattings +- Some additional minor fixes and formattings ## v7.0.0 (18.05.2020) diff --git a/Kconfig b/Kconfig index 865c42e47..30fbac070 100644 --- a/Kconfig +++ b/Kconfig @@ -258,7 +258,7 @@ menu "LVGL configuration" menu "Image decoder and cache" config LV_IMG_CF_INDEXED - bool "Enable indexed (pallete) images." + bool "Enable indexed (palette) images." default y if !LV_CONF_MINIMAL config LV_IMG_CF_ALPHA bool "Enable alpha indexed images." diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 93d284678..06509e40d 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -27,7 +27,7 @@ Planned to November/December 2020 - Simplified File system interface ([feat/new_fs_api](https://github.com/lvgl/lvgl/tree/feat/new-fs-api) branch) to make porting easier - Work in progress - Remove the align parameter from `lv_canvas_draw_text` -- Make the copy paramter obsolate in create functions +- Make the copy parameter obsolate in create functions - Optimize and simplifie styles [#1832](https://github.com/lvgl/lvgl/issues/1832) - Use a more generic inheritenace [#1919](https://github.com/lvgl/lvgl/issues/1919) @@ -39,7 +39,7 @@ Planned to November/December 2020 ## v9 - Simplify `group`s. Discussion is [here](https://forum.lvgl.io/t/lv-group-tabindex/2927/3). - Consider direct binary font format support -- Optimize line and cirle drawing and masking +- Optimize line and circle drawing and masking - Reconsider color format management for run time color format setting, and custom color format usage. (Also [RGB888](https://github.com/lvgl/lvgl/issues/1722)) - 9-patch support for `lv_imgbtn`. - Handle stride. See [#1858](https://github.com/lvgl/lvgl/issues/1858) @@ -51,10 +51,10 @@ Planned to November/December 2020 - lv_mem_alloc_aligned(size, align) - Text node. See [#1701](https://github.com/lvgl/lvgl/issues/1701#issuecomment-699479408) - CPP binding. See [Forum](https://forum.lvgl.io/t/is-it-possible-to-officially-support-optional-cpp-api/2736) -- Optmize font decompression +- Optimize font decompression - Switch to RGBA colors in styles - Need coverage report for tests -- Need static analize (via coverity.io or somehing else) +- Need static analyze (via coverity.io or somehing else) - Support dot_begin and dot_middle long modes for labels - Add new label alignment modes. [#1656](https://github.com/lvgl/lvgl/issues/1656) - Support larger images: [#1892](https://github.com/lvgl/lvgl/issues/1892) diff --git a/examples/porting/lv_port_disp_template.c b/examples/porting/lv_port_disp_template.c index 7d8b449d9..a4f95fab4 100644 --- a/examples/porting/lv_port_disp_template.c +++ b/examples/porting/lv_port_disp_template.c @@ -55,7 +55,7 @@ void lv_port_disp_init(void) *----------------------------*/ /* LVGL requires a buffer where it internally draws the widgets. - * Later this buffer will passed your display drivers `flush_cb` to copy its content to your dispay. + * Later this buffer will passed your display drivers `flush_cb` to copy its content to your display. * The buffer has to be greater than 1 display row * * There are three buffering configurations: diff --git a/examples/porting/lv_port_fs_template.c b/examples/porting/lv_port_fs_template.c index 6b376042c..c8f5fe21b 100644 --- a/examples/porting/lv_port_fs_template.c +++ b/examples/porting/lv_port_fs_template.c @@ -80,7 +80,7 @@ void lv_port_fs_init(void) fs_init(); /*--------------------------------------------------- - * Register the file system interface in LVGL + * Register the file system interface in LVGL *--------------------------------------------------*/ /* Add a simple drive to open images */ @@ -117,7 +117,7 @@ void lv_port_fs_init(void) /* Initialize your Storage device and File system. */ static void fs_init(void) { - /*E.g. for FatFS initalize the SD card and FatFS itself*/ + /*E.g. for FatFS initialize the SD card and FatFS itself*/ /*You code here*/ } @@ -262,7 +262,7 @@ static lv_fs_res_t fs_tell (lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) * Delete a file * @param drv pointer to a driver where this function belongs * @param path path of the file to delete - * @return LV_FS_RES_OK or any error from lv_fs_res_t enum + * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ static lv_fs_res_t fs_remove (lv_fs_drv_t * drv, const char *path) { diff --git a/lv_conf_template.h b/lv_conf_template.h index e53e97859..a8f60092f 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -335,7 +335,7 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i * If an invalid parameter is found an error log message is printed and * the MCU halts at the error. (`LV_USE_LOG` should be enabled) * If you are debugging the MCU you can pause - * the debugger to see exactly where the issue is. + * the debugger to see exactly where the issue is. * * The behavior of asserts can be overwritten by redefining them here. * E.g. #define LV_ASSERT_MEM(p) @@ -370,7 +370,7 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i * FONT USAGE *===================*/ -/* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel. +/* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel. * The symbols are available via `LV_SYMBOL_...` defines * More info about fonts: https://docs.lvgl.io/v7/en/html/overview/font.html * To create a new font go to: https://lvgl.com/ttf-font-to-c-array diff --git a/scripts/release/com.py b/scripts/release/com.py index 4126c354d..8a8f4d79d 100755 --- a/scripts/release/com.py +++ b/scripts/release/com.py @@ -14,7 +14,7 @@ def cmd(c, ask_on_err = True): if r: print("### Error: " + str(r)) if ask_on_err: - input("Press Enter to continue exectution...") + input("Press Enter to continue execution...") def define_set(fn, name, value): print("In " + fn + " set " + name + " to " + value) diff --git a/scripts/release/main.py b/scripts/release/main.py index d22d32234..ba9ab2043 100755 --- a/scripts/release/main.py +++ b/scripts/release/main.py @@ -47,7 +47,7 @@ if __name__ == '__main__': # if(len(sys.argv) != 2): # print("Missing argument. Usage ./release.py bugfix | minor | major") -# print("Use minor by deafult") +# print("Use minor by default") # else: # dev_prepare = sys.argv[1] diff --git a/scripts/release/proj.py b/scripts/release/proj.py index 732c200e5..c28fd3207 100755 --- a/scripts/release/proj.py +++ b/scripts/release/proj.py @@ -10,7 +10,7 @@ import com def make(repo_path, auto_push = False): os.chdir("./" + repo_path) com.cmd('git checkout master') - print("Upadte lvgl"); + print("Update lvgl"); os.chdir("./lvgl") com.cmd("git checkout master") com.cmd("git pull origin --tags") @@ -37,11 +37,11 @@ def make(repo_path, auto_push = False): com.define_set("lv_conf.h", str(key), str(val)) if os.path.exists("lv_examples"): - print("Upadte lv_examples"); + print("Update lv_examples"); com.cmd("cd lv_examples; git co " + release_br + "; git pull origin " + release_br) if os.path.exists("lv_drivers"): - print("upadte lv_drivers"); + print("update lv_drivers"); com.cmd("cd lv_drivers " + release_br + "; git pull origin " + release_br) msg = 'Update to ' + ver_str diff --git a/src/lv_conf_kconfig.h b/src/lv_conf_kconfig.h index 3c88c6011..6225ed02a 100644 --- a/src/lv_conf_kconfig.h +++ b/src/lv_conf_kconfig.h @@ -337,9 +337,9 @@ extern "C" { *-----------------*/ #ifndef LV_TEXT_ENC #ifdef CONFIG_LV_TXT_ENC_UTF8 -#define CONFIG_LV_TXT_ENC LV_TXT_ENC_UTF8 +#define CONFIG_LV_TXT_ENC LV_TXT_ENC_UTF8 #elif defined CONFIG_LV_TXT_ENC_ASCII -#define CONFIG_LV_TXT_ENC LV_TXT_ENC_ASCII +#define CONFIG_LV_TXT_ENC LV_TXT_ENC_ASCII #endif #endif @@ -363,11 +363,11 @@ extern "C" { #ifndef LV_USE_EXT_CLICK_AREA #ifdef CONFIG_LV_USE_EXT_CLICK_AREA_OFF -#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_OFF +#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_OFF #elif defined CONFIG_LV_USE_EXT_CLICK_AREA_TINY -#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_TINY +#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_TINY #elif defined CONFIG_LV_USE_EXT_CLICK_AREA_FULL -#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_FULL +#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_FULL #endif #endif diff --git a/src/lv_core/lv_disp.c b/src/lv_core/lv_disp.c index aaa8fb1ae..c88cc9afb 100644 --- a/src/lv_core/lv_disp.c +++ b/src/lv_core/lv_disp.c @@ -106,7 +106,7 @@ lv_obj_t * lv_disp_get_layer_top(lv_disp_t * disp) /** * Return with the sys. layer. (Same on every screen and it is above the normal screen and the top * layer) - * @param disp pointer to display which sys. layer should be get. (NULL to use the default screen) + * @param disp pointer to display which sys. layer should be get. (NULL to use the default screen) * @return pointer to the sys layer object (transparent screen sized lv_obj) */ lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp) diff --git a/src/lv_core/lv_disp.h b/src/lv_core/lv_disp.h index 6353315ec..2206b2f4f 100644 --- a/src/lv_core/lv_disp.h +++ b/src/lv_core/lv_disp.h @@ -73,7 +73,7 @@ lv_obj_t * lv_disp_get_layer_top(lv_disp_t * disp); /** * Return with the sys. layer. (Same on every screen and it is above the normal screen and the top * layer) - * @param disp pointer to display which sys. layer should be get. (NULL to use the default screen) + * @param disp pointer to display which sys. layer should be get. (NULL to use the default screen) * @return pointer to the sys layer object (transparent screen sized lv_obj) */ lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp); @@ -161,7 +161,7 @@ static inline lv_obj_t * lv_scr_act(void) } /** - * Get the top layer of the default display + * Get the top layer of the default display * @return pointer to the top layer */ static inline lv_obj_t * lv_layer_top(void) @@ -171,7 +171,7 @@ static inline lv_obj_t * lv_layer_top(void) /** * Get the active screen of the default display - * @return pointer to the sys layer + * @return pointer to the sys layer */ static inline lv_obj_t * lv_layer_sys(void) { diff --git a/src/lv_core/lv_group.c b/src/lv_core/lv_group.c index ca91a3968..f47494cee 100644 --- a/src/lv_core/lv_group.c +++ b/src/lv_core/lv_group.c @@ -81,7 +81,7 @@ lv_group_t * lv_group_create(void) */ void lv_group_del(lv_group_t * group) { - /*Defocus the the currently focused object*/ + /*Defocus the currently focused object*/ if(group->obj_focus != NULL) { (*group->obj_focus)->signal_cb(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL); lv_obj_invalidate(*group->obj_focus); @@ -185,7 +185,7 @@ void lv_group_remove_obj(lv_obj_t * obj) */ void lv_group_remove_all_objs(lv_group_t * group) { - /*Defocus the the currently focused object*/ + /*Defocus the currently focused object*/ if(group->obj_focus != NULL) { (*group->obj_focus)->signal_cb(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL); lv_obj_invalidate(*group->obj_focus); diff --git a/src/lv_core/lv_indev.c b/src/lv_core/lv_indev.c index 336b377ea..ed0d3a152 100644 --- a/src/lv_core/lv_indev.c +++ b/src/lv_core/lv_indev.c @@ -597,7 +597,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) } /* Save the last keys before anything else. - * They need to be already saved if the the function returns for any reason*/ + * They need to be already saved if the function returns for any reason*/ lv_indev_state_t last_state = i->proc.types.keypad.last_state; i->proc.types.keypad.last_state = data->state; i->proc.types.keypad.last_key = data->key; @@ -803,7 +803,7 @@ static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data) { /* Die gracefully if i->btn_points is NULL */ if(i->btn_points == NULL) { - LV_LOG_WARN("indev_button_proc: btn_points was NULL"); + LV_LOG_WARN("indev_button_proc: btn_points was NULL"); return; } diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index a03e5cdab..4efebbb5d 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -385,7 +385,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy) lv_style_list_init(&new_obj->style_list); if(copy == NULL) { if(parent != NULL) lv_theme_apply(new_obj, LV_THEME_OBJ); - else lv_theme_apply(new_obj, LV_THEME_SCR); + else lv_theme_apply(new_obj, LV_THEME_SCR); } else { lv_style_list_copy(&new_obj->style_list, ©->style_list); @@ -1222,7 +1222,7 @@ void lv_obj_remove_style(lv_obj_t * obj, uint8_t part, lv_style_t * style) * Release all used memories and cancel pending related transitions. * Typically used in `LV_SIGN_CLEAN_UP. * @param obj pointer to an object - * @param part the part of the object which style list should be reseted. + * @param part the part of the object which style list should be reset. * E.g. `LV_OBJ_PART_MAIN`, `LV_BTN_PART_MAIN`, `LV_SLIDER_PART_KNOB` */ void lv_obj_clean_style_list(lv_obj_t * obj, uint8_t part) @@ -1244,7 +1244,7 @@ void lv_obj_clean_style_list(lv_obj_t * obj, uint8_t part) * Release all used memories and cancel pending related transitions. * Also notifies the object about the style change. * @param obj pointer to an object - * @param part the part of the object which style list should be reseted. + * @param part the part of the object which style list should be reset. * E.g. `LV_OBJ_PART_MAIN`, `LV_BTN_PART_MAIN`, `LV_SLIDER_PART_KNOB` */ void lv_obj_reset_style_list(lv_obj_t * obj, uint8_t part) @@ -2388,7 +2388,7 @@ lv_coord_t lv_obj_get_width_margin(lv_obj_t * obj) * Set that width reduced by the left and right padding of the parent. * @param obj pointer to an object * @param div indicates how many columns are assumed. - * If 1 the width will be set the the parent's width + * If 1 the width will be set the parent's width * If 2 only half parent width - inner padding of the parent * If 3 only third parent width - 2 * inner padding of the parent * @param span how many columns are combined @@ -2409,7 +2409,7 @@ lv_coord_t lv_obj_get_width_grid(lv_obj_t * obj, uint8_t div, uint8_t span) * Get that height reduced by the top and bottom padding of the parent. * @param obj pointer to an object * @param div indicates how many rows are assumed. - * If 1 the height will be set the the parent's height + * If 1 the height will be set the parent's height * If 2 only half parent height - inner padding of the parent * If 3 only third parent height - 2 * inner padding of the parent * @param span how many rows are combined @@ -2429,7 +2429,7 @@ lv_coord_t lv_obj_get_height_grid(lv_obj_t * obj, uint8_t div, uint8_t span) /** * Get the automatic realign property of the object. * @param obj pointer to an object - * @return true: auto realign is enabled; false: auto realign is disabled + * @return true: auto realign is enabled; false: auto realign is disabled */ bool lv_obj_get_auto_realign(const lv_obj_t * obj) { @@ -3860,7 +3860,7 @@ static lv_design_res_t lv_obj_design(lv_obj_t * obj, const lv_area_t * clip_area if(lv_obj_get_style_border_blend_mode(obj, LV_OBJ_PART_MAIN) != LV_BLEND_MODE_NORMAL) return LV_DESIGN_RES_NOT_COVER; if(lv_obj_get_style_opa_scale(obj, LV_OBJ_PART_MAIN) < LV_OPA_MAX) return LV_DESIGN_RES_NOT_COVER; - return LV_DESIGN_RES_COVER; + return LV_DESIGN_RES_COVER; } else if(mode == LV_DESIGN_DRAW_MAIN) { diff --git a/src/lv_core/lv_obj.h b/src/lv_core/lv_obj.h index 9551f1c62..c6afb9317 100644 --- a/src/lv_core/lv_obj.h +++ b/src/lv_core/lv_obj.h @@ -43,9 +43,9 @@ extern "C" { #define LV_MAX_ANCESTOR_NUM 8 -#define LV_EXT_CLICK_AREA_OFF 0 -#define LV_EXT_CLICK_AREA_TINY 1 -#define LV_EXT_CLICK_AREA_FULL 2 +#define LV_EXT_CLICK_AREA_OFF 0 +#define LV_EXT_CLICK_AREA_TINY 1 +#define LV_EXT_CLICK_AREA_FULL 2 #define _LV_OBJ_PART_VIRTUAL_FIRST 0x01 #define _LV_OBJ_PART_REAL_FIRST 0x40 @@ -203,7 +203,7 @@ typedef struct _lv_obj_t { lv_design_cb_t design_cb; /**< Object type specific design function*/ void * ext_attr; /**< Object type specific extended data*/ - lv_style_list_t style_list; + lv_style_list_t style_list; #if LV_USE_EXT_CLICK_AREA == LV_EXT_CLICK_AREA_TINY uint8_t ext_click_pad_hor; /**< Extra click padding in horizontal direction */ @@ -577,7 +577,7 @@ void lv_obj_remove_style(lv_obj_t * obj, uint8_t part, lv_style_t * style); * Release all used memories and cancel pending related transitions. * Typically used in `LV_SIGN_CLEAN_UP. * @param obj pointer to an object - * @param part the part of the object which style list should be reseted. + * @param part the part of the object which style list should be reset. * E.g. `LV_OBJ_PART_MAIN`, `LV_BTN_PART_MAIN`, `LV_SLIDER_PART_KNOB` */ void lv_obj_clean_style_list(lv_obj_t * obj, uint8_t part); @@ -587,7 +587,7 @@ void lv_obj_clean_style_list(lv_obj_t * obj, uint8_t part); * Release all used memories and cancel pending related transitions. * Also notifies the object about the style change. * @param obj pointer to an object - * @param part the part of the object which style list should be reseted. + * @param part the part of the object which style list should be reset. * E.g. `LV_OBJ_PART_MAIN`, `LV_BTN_PART_MAIN`, `LV_SLIDER_PART_KNOB` */ void lv_obj_reset_style_list(lv_obj_t * obj, uint8_t part); @@ -676,7 +676,7 @@ void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t type, lv_style_property bool lv_obj_remove_style_local_prop(lv_obj_t * obj, uint8_t part, lv_style_property_t prop); /** - * Enable/disable the use of style cahche for an object + * Enable/disable the use of style cache for an object * @param obj pointer to an object * @param dis true: disable; false: enable (re-enable) */ @@ -1055,7 +1055,7 @@ lv_coord_t lv_obj_get_width_margin(lv_obj_t * obj); * Take paddings into account. * @param obj pointer to an object * @param div indicates how many columns are assumed. - * If 1 the width will be set the the parent's width + * If 1 the width will be set the parent's width * If 2 only half parent width - inner padding of the parent * If 3 only third parent width - 2 * inner padding of the parent * @param span how many columns are combined @@ -1068,7 +1068,7 @@ lv_coord_t lv_obj_get_width_grid(lv_obj_t * obj, uint8_t div, uint8_t span); * Take paddings into account. * @param obj pointer to an object * @param div indicates how many rows are assumed. - * If 1 the height will be set the the parent's height + * If 1 the height will be set the parent's height * If 2 only half parent height - inner padding of the parent * If 3 only third parent height - 2 * inner padding of the parent * @param span how many rows are combined @@ -1079,7 +1079,7 @@ lv_coord_t lv_obj_get_height_grid(lv_obj_t * obj, uint8_t div, uint8_t span); /** * Get the automatic realign property of the object. * @param obj pointer to an object - * @return true: auto realign is enabled; false: auto realign is disabled + * @return true: auto realign is enabled; false: auto realign is disabled */ bool lv_obj_get_auto_realign(const lv_obj_t * obj); diff --git a/src/lv_core/lv_refr.c b/src/lv_core/lv_refr.c index e8502431b..a84a3d917 100644 --- a/src/lv_core/lv_refr.c +++ b/src/lv_core/lv_refr.c @@ -74,7 +74,7 @@ void _lv_refr_init(void) /** * Redraw the invalidated areas now. * Normally the redrawing is periodically executed in `lv_task_handler` but a long blocking process - * can prevent the call of `lv_task_handler`. In this case if the the GUI is updated in the process + * can prevent the call of `lv_task_handler`. In this case if the GUI is updated in the process * (e.g. progress bar) this function can be called when the screen should be updated. * @param disp pointer to display to refresh. NULL to refresh all displays. */ @@ -406,7 +406,7 @@ static void lv_refr_areas(void) /** * Refresh an area if there is Virtual Display Buffer - * @param area_p pointer to an area to refresh + * @param area_p pointer to an area to refresh */ static void lv_refr_area(const lv_area_t * area_p) { diff --git a/src/lv_core/lv_refr.h b/src/lv_core/lv_refr.h index b4c9a85a5..25b598f98 100644 --- a/src/lv_core/lv_refr.h +++ b/src/lv_core/lv_refr.h @@ -50,7 +50,7 @@ void _lv_refr_init(void); /** * Redraw the invalidated areas now. * Normally the redrawing is periodically executed in `lv_task_handler` but a long blocking process - * can prevent the call of `lv_task_handler`. In this case if the the GUI is updated in the process + * can prevent the call of `lv_task_handler`. In this case if the GUI is updated in the process * (e.g. progress bar) this function can be called when the screen should be updated. * @param disp pointer to display to refresh. NULL to refresh all displays. */ diff --git a/src/lv_core/lv_style.c b/src/lv_core/lv_style.c index 2ee6017c9..2e3dcec58 100644 --- a/src/lv_core/lv_style.c +++ b/src/lv_core/lv_style.c @@ -93,7 +93,7 @@ void lv_style_copy(lv_style_t * style_dest, const lv_style_t * style_src) /** * Remove a property from a style * @param style pointer to a style - * @param prop a style property ORed with a state. + * @param prop a style property ORed with a state. * E.g. `LV_STYLE_BORDER_WIDTH | (LV_STATE_PRESSED << LV_STYLE_STATE_POS)` * @return true: the property was found and removed; false: the property wasn't found */ @@ -188,7 +188,7 @@ void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * lis /** * Add a style to a style list. - * Only the the style pointer will be saved so the shouldn't be a local variable. + * Only the style pointer will be saved so the shouldn't be a local variable. * (It should be static, global or dynamically allocated) * @param list pointer to a style list * @param style pointer to a style to add diff --git a/src/lv_core/lv_style.h b/src/lv_core/lv_style.h index 6f62bb1b4..1ff7b3b4d 100644 --- a/src/lv_core/lv_style.h +++ b/src/lv_core/lv_style.h @@ -29,8 +29,8 @@ extern "C" { #define LV_RADIUS_CIRCLE (0x7FFF) /**< A very big radius to always draw as circle*/ LV_EXPORT_CONST_INT(LV_RADIUS_CIRCLE); -#define LV_DEBUG_STYLE_SENTINEL_VALUE 0x2288AAEE -#define LV_DEBUG_STYLE_LIST_SENTINEL_VALUE 0x9977CCBB +#define LV_DEBUG_STYLE_SENTINEL_VALUE 0x2288AAEE +#define LV_DEBUG_STYLE_LIST_SENTINEL_VALUE 0x9977CCBB #define LV_STYLE_PROP_INIT(name, group, id, attr) name = (((group << 4) + id) | ((attr) << 8)) @@ -287,7 +287,7 @@ void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * lis /** * Add a style to a style list. - * Only the the style pointer will be saved so the shouldn't be a local variable. + * Only the style pointer will be saved so the shouldn't be a local variable. * (It should be static, global or dynamically allocated) * @param list pointer to a style list * @param style pointer to a style to add @@ -338,7 +338,7 @@ void lv_style_copy(lv_style_t * dest, const lv_style_t * src); /** * Remove a property from a style * @param style pointer to a style - * @param prop a style property ORed with a state. + * @param prop a style property ORed with a state. * E.g. `LV_STYLE_BORDER_WIDTH | (LV_STATE_PRESSED << LV_STYLE_STATE_POS)` * @return true: the property was found and removed; false: the property wasn't found */ diff --git a/src/lv_draw/lv_draw_blend.c b/src/lv_draw/lv_draw_blend.c index 71fd09e8d..9634e08a4 100644 --- a/src/lv_draw/lv_draw_blend.c +++ b/src/lv_draw/lv_draw_blend.c @@ -191,7 +191,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_ * @param mask_res LV_MASK_RES_COVER: the mask has only 0xff values (no mask), * LV_MASK_RES_TRANSP: the mask has only 0x00 values (full transparent), * LV_MASK_RES_CHANGED: the mask has mixed values - * @param opa overall opacity in 0x00..0xff range + * @param opa overall opacity in 0x00..0xff range * @param mode blend mode from `lv_blend_mode_t` */ LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_area_t * map_area, diff --git a/src/lv_draw/lv_draw_img.c b/src/lv_draw/lv_draw_img.c index 3a07bde4a..a36df449c 100644 --- a/src/lv_draw/lv_draw_img.c +++ b/src/lv_draw/lv_draw_img.c @@ -553,7 +553,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const lv_opa_t px_opa = map_px[LV_IMG_PX_SIZE_ALPHA_BYTE - 1]; mask_buf[px_i] = px_opa; if(px_opa == 0) { -#if LV_COLOR_DEPTH == 32 +#if LV_COLOR_DEPTH == 32 map2[px_i].full = 0; #endif continue; @@ -576,7 +576,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const if(chroma_key) { if(c.full == chroma_keyed_color.full) { mask_buf[px_i] = LV_OPA_TRANSP; -#if LV_COLOR_DEPTH == 32 +#if LV_COLOR_DEPTH == 32 map2[px_i].full = 0; #endif continue; diff --git a/src/lv_draw/lv_draw_label.c b/src/lv_draw/lv_draw_label.c index 8fb92444c..970791ffc 100644 --- a/src/lv_draw/lv_draw_label.c +++ b/src/lv_draw/lv_draw_label.c @@ -411,7 +411,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_letter(const lv_point_t * pos_p, const lv_font_glyph_dsc_t g; bool g_ret = lv_font_get_glyph_dsc(font_p, &g, letter, '\0'); if(g_ret == false) { - /* Add waring if the dsc is not found + /* Add warning if the dsc is not found * but do not print warning for non printable ASCII chars (e.g. '\n')*/ if(letter >= 0x20) { LV_LOG_WARN("lv_draw_letter: glyph dsc. not found"); diff --git a/src/lv_draw/lv_draw_mask.c b/src/lv_draw/lv_draw_mask.c index b74f2b4b2..7fb01ee01 100644 --- a/src/lv_draw/lv_draw_mask.c +++ b/src/lv_draw/lv_draw_mask.c @@ -451,7 +451,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mas int32_t k = - abs_x; if(k < 0) return LV_DRAW_MASK_RES_TRANSP; if(k >= 0 && k < len) _lv_memset_00(&mask_buf[k], len - k); - return LV_DRAW_MASK_RES_CHANGED; + return LV_DRAW_MASK_RES_CHANGED; } } else { @@ -461,7 +461,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mas if(k < 0) k = 0; if(k >= len) return LV_DRAW_MASK_RES_TRANSP; else if(k >= 0 && k < len) _lv_memset_00(&mask_buf[0], k); - return LV_DRAW_MASK_RES_CHANGED; + return LV_DRAW_MASK_RES_CHANGED; } } } diff --git a/src/lv_draw/lv_draw_rect.c b/src/lv_draw/lv_draw_rect.c index d81f1a6fa..b502f8c43 100644 --- a/src/lv_draw/lv_draw_rect.c +++ b/src/lv_draw/lv_draw_rect.c @@ -1027,7 +1027,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord sh_ups_tmp_buf[0] = (mask_line[0] << SHADOW_UPSCALE_SHIFT) / sw; for(i = 1; i < size; i++) { if(mask_line[i] == mask_line[i - 1]) sh_ups_tmp_buf[i] = sh_ups_tmp_buf[i - 1]; - else sh_ups_tmp_buf[i] = (mask_line[i] << SHADOW_UPSCALE_SHIFT) / sw; + else sh_ups_tmp_buf[i] = (mask_line[i] << SHADOW_UPSCALE_SHIFT) / sw; } } @@ -1060,7 +1060,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord sh_buf[0] = (sh_buf[0] << SHADOW_UPSCALE_SHIFT) / sw; for(i = 1; i < (uint32_t) size * size; i++) { if(sh_buf[i] == sh_buf[i - 1]) sh_buf[i] = sh_buf[i - 1]; - else sh_buf[i] = (sh_buf[i] << SHADOW_UPSCALE_SHIFT) / sw; + else sh_buf[i] = (sh_buf[i] << SHADOW_UPSCALE_SHIFT) / sw; } shadow_blur_corner(size, sw, sh_buf); @@ -1113,7 +1113,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t sh_ups_buf[0] = sh_ups_buf[0] / sw; for(i = 1; i < (uint32_t)size * size; i++) { if(sh_ups_buf[i] == sh_ups_buf[i - 1]) sh_ups_buf[i] = sh_ups_buf[i - 1]; - else sh_ups_buf[i] = sh_ups_buf[i] / sw; + else sh_ups_buf[i] = sh_ups_buf[i] / sw; } for(x = 0; x < size; x++) { diff --git a/src/lv_draw/lv_img_buf.h b/src/lv_draw/lv_img_buf.h index 93974b992..908b255e8 100644 --- a/src/lv_draw/lv_img_buf.h +++ b/src/lv_draw/lv_img_buf.h @@ -111,7 +111,7 @@ typedef uint8_t lv_img_cf_t; #if LV_BIG_ENDIAN_SYSTEM typedef struct { - uint32_t h : 11; /*Height of the image map*/ + uint32_t h : 11; /*Height of the image map*/ uint32_t w : 11; /*Width of the image map*/ uint32_t reserved : 2; /*Reserved to be used later*/ uint32_t always_zero : 3; /*It the upper bits of the first byte. Always zero to look like a @@ -129,7 +129,7 @@ typedef struct { uint32_t reserved : 2; /*Reserved to be used later*/ uint32_t w : 11; /*Width of the image map*/ - uint32_t h : 11; /*Height of the image map*/ + uint32_t h : 11; /*Height of the image map*/ } lv_img_header_t; #endif diff --git a/src/lv_font/lv_font.c b/src/lv_font/lv_font.c index 6e6d0ea36..9e3ec2201 100644 --- a/src/lv_font/lv_font.c +++ b/src/lv_font/lv_font.c @@ -43,7 +43,7 @@ * Return with the bitmap of a font. * @param font_p pointer to a font * @param letter an UNICODE character code - * @return pointer to the bitmap of the letter + * @return pointer to the bitmap of the letter */ const uint8_t * lv_font_get_glyph_bitmap(const lv_font_t * font_p, uint32_t letter) { diff --git a/src/lv_font/lv_font.h b/src/lv_font/lv_font.h index d8c69f3f7..04ab30864 100644 --- a/src/lv_font/lv_font.h +++ b/src/lv_font/lv_font.h @@ -55,7 +55,7 @@ typedef uint8_t lv_font_subpx_t; /** Describe the properties of a font*/ typedef struct _lv_font_struct { - /** Get a glyph's descriptor from a font*/ + /** Get a glyph's descriptor from a font*/ bool (*get_glyph_dsc)(const struct _lv_font_struct *, lv_font_glyph_dsc_t *, uint32_t letter, uint32_t letter_next); /** Get a glyph's bitmap from a font*/ @@ -67,7 +67,7 @@ typedef struct _lv_font_struct { uint8_t subpx : 2; /**< An element of `lv_font_subpx_t`*/ int8_t underline_position; /**< Distance between the top of the underline and base line (< 0 means below the base line)*/ - int8_t underline_thickness; /**< Thickness of the underline*/ + int8_t underline_thickness; /**< Thickness of the underline*/ void * dsc; /**< Store implementation specific or run_time data or caching here*/ #if LV_USE_USER_DATA @@ -84,7 +84,7 @@ typedef struct _lv_font_struct { * Return with the bitmap of a font. * @param font_p pointer to a font * @param letter an UNICODE character code - * @return pointer to the bitmap of the letter + * @return pointer to the bitmap of the letter */ const uint8_t * lv_font_get_glyph_bitmap(const lv_font_t * font_p, uint32_t letter); diff --git a/src/lv_font/lv_font_fmt_txt.h b/src/lv_font/lv_font_fmt_txt.h index 99d5ec0aa..1538c2fa6 100644 --- a/src/lv_font/lv_font_fmt_txt.h +++ b/src/lv_font/lv_font_fmt_txt.h @@ -115,7 +115,7 @@ typedef struct { typedef struct { /*To get a kern value of two code points: 1. Get the `glyph_id_left` and `glyph_id_right` from `lv_font_fmt_txt_cmap_t - 2 for(i = 0; i < pair_cnt * 2; i+2) + 2. for(i = 0; i < pair_cnt * 2; i+2) if(gylph_ids[i] == glyph_id_left && gylph_ids[i+1] == glyph_id_right) return values[i / 2]; @@ -130,7 +130,7 @@ typedef struct { typedef struct { /*To get a kern value of two code points: 1. Get the `glyph_id_left` and `glyph_id_right` from `lv_font_fmt_txt_cmap_t - 2 Get the class of the left and right glyphs as `left_class` and `right_class` + 2. Get the class of the left and right glyphs as `left_class` and `right_class` left_class = left_class_mapping[glyph_id_left]; right_class = right_class_mapping[glyph_id_right]; 3. value = class_pair_values[(left_class-1)*right_class_cnt + (right_class-1)] diff --git a/src/lv_gpu/lv_gpu_nxp_pxp.c b/src/lv_gpu/lv_gpu_nxp_pxp.c index c97b068d2..4e4d8ccfd 100644 --- a/src/lv_gpu/lv_gpu_nxp_pxp.c +++ b/src/lv_gpu/lv_gpu_nxp_pxp.c @@ -211,7 +211,7 @@ void lv_gpu_nxp_pxp_fill(lv_color_t * dest_buf, lv_coord_t dest_width, const lv_ * * By default, image is copied directly, with optional opacity configured by \p opa. * Color keying can be enabled by calling lv_gpu_nxp_pxp_enable_color_key() before calling this function. - * Recoloring can be enabled by calling lv_gpu_nxp_pxp_enable_recolor() before calling this function. + * Recoloring can be enabled by calling lv_gpu_nxp_pxp_enable_recolor() before calling this function. * Note that color keying and recoloring at the same time is not supported and black rectangle is rendered. * * @param[in/out] dest destination buffer diff --git a/src/lv_gpu/lv_gpu_nxp_pxp.h b/src/lv_gpu/lv_gpu_nxp_pxp.h index e68d5a1b1..c91d80fd3 100644 --- a/src/lv_gpu/lv_gpu_nxp_pxp.h +++ b/src/lv_gpu/lv_gpu_nxp_pxp.h @@ -131,7 +131,7 @@ void lv_gpu_nxp_pxp_fill(lv_color_t * dest_buf, lv_coord_t dest_width, const lv_ * * By default, image is copied directly, with optional opacity configured by \p opa. * Color keying can be enabled by calling lv_gpu_nxp_pxp_enable_color_key() before calling this function. - * Recoloring can be enabled by calling lv_gpu_nxp_pxp_enable_recolor() before calling this function. + * Recoloring can be enabled by calling lv_gpu_nxp_pxp_enable_recolor() before calling this function. * Note that color keying and recoloring at the same time is not supported and black rectangle is rendered. * * @param[in/out] dest destination buffer diff --git a/src/lv_gpu/lv_gpu_stm32_dma2d.c b/src/lv_gpu/lv_gpu_stm32_dma2d.c index d94e87abf..21fb3001e 100644 --- a/src/lv_gpu/lv_gpu_stm32_dma2d.c +++ b/src/lv_gpu/lv_gpu_stm32_dma2d.c @@ -65,7 +65,7 @@ void lv_gpu_stm32_dma2d_init(void) /* Enable DMA2D clock */ #if defined(STM32F4) || defined(STM32F7) RCC->AHB1ENR |= RCC_AHB1ENR_DMA2DEN; -#elif defined(STM32H7) +#elif defined(STM32H7) RCC->AHB3ENR |= RCC_AHB3ENR_DMA2DEN; #else # warning "LVGL can't enable the clock of DMA2D" diff --git a/src/lv_hal/lv_hal_disp.h b/src/lv_hal/lv_hal_disp.h index cd77c3037..5eba4e266 100644 --- a/src/lv_hal/lv_hal_disp.h +++ b/src/lv_hal/lv_hal_disp.h @@ -78,7 +78,7 @@ typedef struct _disp_drv_t { uint32_t rotated : 1; /**< 1: turn the display by 90 degree. @warning Does not update coordinates for you!*/ #if LV_COLOR_SCREEN_TRANSP - /**Handle if the the screen doesn't have a solid (opa == LV_OPA_COVER) background. + /**Handle if the screen doesn't have a solid (opa == LV_OPA_COVER) background. * Use only if required because it's slower.*/ uint32_t screen_transp : 1; #endif diff --git a/src/lv_hal/lv_hal_indev.c b/src/lv_hal/lv_hal_indev.c index 2c088f7e4..aa706684b 100644 --- a/src/lv_hal/lv_hal_indev.c +++ b/src/lv_hal/lv_hal_indev.c @@ -135,7 +135,7 @@ bool _lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data) data->point.x = indev->proc.types.pointer.act_point.x; data->point.y = indev->proc.types.pointer.act_point.y; } - /*Similarly set at least the last key in case of the the user doesn't set it on release*/ + /*Similarly set at least the last key in case of the user doesn't set it on release*/ else if(indev->driver.type == LV_INDEV_TYPE_KEYPAD) { data->key = indev->proc.types.keypad.last_key; } diff --git a/src/lv_misc/lv_anim.c b/src/lv_misc/lv_anim.c index e22487aa5..4b01b8051 100644 --- a/src/lv_misc/lv_anim.c +++ b/src/lv_misc/lv_anim.c @@ -88,7 +88,7 @@ void lv_anim_init(lv_anim_t * a) void lv_anim_start(lv_anim_t * a) { LV_LOG_TRACE("animation create started") - /* Do not let two animations for the same 'var' with the same 'fp'*/ + /* Do not let two animations for the same 'var' with the same 'fp'*/ if(a->exec_cb != NULL) lv_anim_del(a->var, a->exec_cb); /*fp == NULL would delete all animations of var*/ /*If the list is empty the anim task was suspended and it's last run measure is invalid*/ @@ -456,7 +456,7 @@ static void anim_task(lv_task_t * param) anim_list_changed = false; if(!a->has_run) { - a->has_run = 1; /*The list readying might be reseted so need to know which anim has run already*/ + a->has_run = 1; /*The list readying might be reset so need to know which anim has run already*/ /*The animation will run now for the first time. Call `start_cb`*/ int32_t new_act_time = a->act_time + elaps; diff --git a/src/lv_misc/lv_bidi.c b/src/lv_misc/lv_bidi.c index ea1ab3354..caa463a8c 100644 --- a/src/lv_misc/lv_bidi.c +++ b/src/lv_misc/lv_bidi.c @@ -131,7 +131,7 @@ lv_bidi_dir_t _lv_bidi_detect_base_dir(const char * txt) * @param len length of the line in character count * @param base_dir base direction of the text: `LV_BIDI_DIR_LTR` or `LV_BIDI_DIR_RTL` * @param visual_pos the visual character position which logical position should be get - * @param is_rtl tell the the char at `visual_pos` is RTL or LTR context + * @param is_rtl tell the char at `visual_pos` is RTL or LTR context * @return the logical character position */ uint16_t _lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_t len, lv_bidi_dir_t base_dir, @@ -168,7 +168,7 @@ uint16_t _lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_ * @param len length of the line in character count * @param base_dir base direction of the text: `LV_BIDI_DIR_LTR` or `LV_BIDI_DIR_RTL` * @param logical_pos the logical character position which visual position should be get - * @param is_rtl tell the the char at `logical_pos` is RTL or LTR context + * @param is_rtl tell the char at `logical_pos` is RTL or LTR context * @return the visual character position */ uint16_t _lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t len, lv_bidi_dir_t base_dir, diff --git a/src/lv_misc/lv_bidi.h b/src/lv_misc/lv_bidi.h index fd98009e5..8b2f765db 100644 --- a/src/lv_misc/lv_bidi.h +++ b/src/lv_misc/lv_bidi.h @@ -21,7 +21,7 @@ extern "C" { /********************* * DEFINES *********************/ -/* Special non printable strong characters. +/* Special non printable strong characters. * They can be inserted to texts to affect the run's direction*/ #define LV_BIDI_LRO "\xE2\x80\xAD" /*U+202D*/ #define LV_BIDI_RLO "\xE2\x80\xAE" /*U+202E*/ @@ -72,7 +72,7 @@ lv_bidi_dir_t _lv_bidi_detect_base_dir(const char * txt); * @param len length of the line in character count * @param base_dir base direction of the text: `LV_BIDI_DIR_LTR` or `LV_BIDI_DIR_RTL` * @param visual_pos the visual character position which logical position should be get - * @param is_rtl tell the the char at `visual_pos` is RTL or LTR context + * @param is_rtl tell the char at `visual_pos` is RTL or LTR context * @return the logical character position */ uint16_t _lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_t len, lv_bidi_dir_t base_dir, @@ -87,7 +87,7 @@ uint16_t _lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_ * @param len length of the line in character count * @param base_dir base direction of the text: `LV_BIDI_DIR_LTR` or `LV_BIDI_DIR_RTL` * @param logical_pos the logical character position which visual position should be get - * @param is_rtl tell the the char at `logical_pos` is RTL or LTR context + * @param is_rtl tell the char at `logical_pos` is RTL or LTR context * @return the visual character position */ uint16_t _lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t len, lv_bidi_dir_t base_dir, diff --git a/src/lv_misc/lv_color.h b/src/lv_misc/lv_color.h index 74bd5256c..d0271b0d3 100644 --- a/src/lv_misc/lv_color.h +++ b/src/lv_misc/lv_color.h @@ -104,7 +104,7 @@ enum { #endif /*--------------------------------------- - * Macros for all existing color depths + * Macros for all existing color depths * to set/get values of the color channels *------------------------------------------*/ # define LV_COLOR_SET_R1(c, v) (c).ch.red = (uint8_t)((v) & 0x1) diff --git a/src/lv_misc/lv_debug.c b/src/lv_misc/lv_debug.c index fd5bd86b5..24fc78ff0 100644 --- a/src/lv_misc/lv_debug.c +++ b/src/lv_misc/lv_debug.c @@ -17,11 +17,11 @@ * DEFINES *********************/ #ifndef LV_DEBUG_STR_MAX_LENGTH - #define LV_DEBUG_STR_MAX_LENGTH (1024 * 8) + #define LV_DEBUG_STR_MAX_LENGTH (1024 * 8) #endif #ifndef LV_DEBUG_STR_MAX_REPEAT - #define LV_DEBUG_STR_MAX_REPEAT 8 + #define LV_DEBUG_STR_MAX_REPEAT 8 #endif /********************** * TYPEDEFS diff --git a/src/lv_misc/lv_fs.c b/src/lv_misc/lv_fs.c index 772f1468b..8be49028e 100644 --- a/src/lv_misc/lv_fs.c +++ b/src/lv_misc/lv_fs.c @@ -134,7 +134,7 @@ lv_fs_res_t lv_fs_open(lv_fs_file_t * file_p, const char * path, lv_fs_mode_t mo /** * Close an already opened file * @param file_p pointer to a lv_fs_file_t variable - * @return LV_FS_RES_OK or any error from lv_fs_res_t enum + * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ lv_fs_res_t lv_fs_close(lv_fs_file_t * file_p) { @@ -158,7 +158,7 @@ lv_fs_res_t lv_fs_close(lv_fs_file_t * file_p) /** * Delete a file * @param path path of the file to delete - * @return LV_FS_RES_OK or any error from lv_fs_res_t enum + * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ lv_fs_res_t lv_fs_remove(const char * path) { diff --git a/src/lv_misc/lv_fs.h b/src/lv_misc/lv_fs.h index 2a8e5fcbb..633606ed0 100644 --- a/src/lv_misc/lv_fs.h +++ b/src/lv_misc/lv_fs.h @@ -148,14 +148,14 @@ lv_fs_res_t lv_fs_open(lv_fs_file_t * file_p, const char * path, lv_fs_mode_t mo /** * Close an already opened file * @param file_p pointer to a lv_fs_file_t variable - * @return LV_FS_RES_OK or any error from lv_fs_res_t enum + * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ lv_fs_res_t lv_fs_close(lv_fs_file_t * file_p); /** * Delete a file * @param path path of the file to delete - * @return LV_FS_RES_OK or any error from lv_fs_res_t enum + * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ lv_fs_res_t lv_fs_remove(const char * path); diff --git a/src/lv_misc/lv_ll.c b/src/lv_misc/lv_ll.c index 9f25b8f7f..560136826 100644 --- a/src/lv_misc/lv_ll.c +++ b/src/lv_misc/lv_ll.c @@ -150,7 +150,7 @@ void * _lv_ll_ins_tail(lv_ll_t * ll_p) /** * Remove the node 'node_p' from 'll_p' linked list. - * It does not free the the memory of node. + * It does not free the memory of node. * @param ll_p pointer to the linked list of 'node_p' * @param node_p pointer to node in 'll_p' linked list */ @@ -167,7 +167,7 @@ void _lv_ll_remove(lv_ll_t * ll_p, void * node_p) } } else if(_lv_ll_get_tail(ll_p) == node_p) { - /*The new tail will be the node before 'n_act'*/ + /*The new tail will be the node before 'n_act'*/ ll_p->tail = _lv_ll_get_prev(ll_p, node_p); if(ll_p->tail == NULL) { ll_p->head = NULL; diff --git a/src/lv_misc/lv_ll.h b/src/lv_misc/lv_ll.h index a4ce8c64c..9ccc11009 100644 --- a/src/lv_misc/lv_ll.h +++ b/src/lv_misc/lv_ll.h @@ -71,7 +71,7 @@ void * _lv_ll_ins_tail(lv_ll_t * ll_p); /** * Remove the node 'node_p' from 'll_p' linked list. - * It does not free the the memory of node. + * It does not free the memory of node. * @param ll_p pointer to the linked list of 'node_p' * @param node_p pointer to node in 'll_p' linked list */ diff --git a/src/lv_misc/lv_log.h b/src/lv_misc/lv_log.h index 99633a8a2..fe46cf449 100644 --- a/src/lv_misc/lv_log.h +++ b/src/lv_misc/lv_log.h @@ -108,7 +108,7 @@ void _lv_log_add(lv_log_level_t level, const char * file, int line, const char * #else /*LV_USE_LOG*/ -/*Do nothing if `LV_USE_LOG 0`*/ +/*Do nothing if `LV_USE_LOG 0`*/ #define _lv_log_add(level, file, line, ...) #define LV_LOG_TRACE(...) #define LV_LOG_INFO(...) diff --git a/src/lv_misc/lv_mem.c b/src/lv_misc/lv_mem.c index 0bcda313c..7a7f9e8c8 100644 --- a/src/lv_misc/lv_mem.c +++ b/src/lv_misc/lv_mem.c @@ -57,9 +57,9 @@ typedef struct { #endif /* LV_ENABLE_GC */ #ifdef LV_ARCH_64 - #define ALIGN_MASK 0x7 + #define ALIGN_MASK 0x7 #else - #define ALIGN_MASK 0x3 + #define ALIGN_MASK 0x3 #endif #define MEM_BUF_SMALL_SIZE 16 diff --git a/src/lv_misc/lv_printf.c b/src/lv_misc/lv_printf.c index 525788f5b..bb6f3430b 100644 --- a/src/lv_misc/lv_printf.c +++ b/src/lv_misc/lv_printf.c @@ -68,13 +68,13 @@ // define the default floating point precision // default: 6 digits #ifndef PRINTF_DEFAULT_FLOAT_PRECISION - #define PRINTF_DEFAULT_FLOAT_PRECISION 6U + #define PRINTF_DEFAULT_FLOAT_PRECISION 6U #endif // define the largest float suitable to print with %f // default: 1e9 #ifndef PRINTF_MAX_FLOAT - #define PRINTF_MAX_FLOAT 1e9 + #define PRINTF_MAX_FLOAT 1e9 #endif // support for the long long types (%llu or %p) diff --git a/src/lv_misc/lv_task.c b/src/lv_misc/lv_task.c index 2c2223f5c..c54c41817 100644 --- a/src/lv_misc/lv_task.c +++ b/src/lv_misc/lv_task.c @@ -60,7 +60,7 @@ void _lv_task_core_init(void) } /** - * Call it periodically to handle lv_tasks. + * Call it periodically to handle lv_tasks. * @return the time after which it must be called again */ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) diff --git a/src/lv_misc/lv_task.h b/src/lv_misc/lv_task.h index d3dfc4adb..f9546ab63 100644 --- a/src/lv_misc/lv_task.h +++ b/src/lv_misc/lv_task.h @@ -80,7 +80,7 @@ void _lv_task_core_init(void); //! @cond Doxygen_Suppress /** - * Call it periodically to handle lv_tasks. + * Call it periodically to handle lv_tasks. * @return time till it needs to be run next (in ms) */ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void); @@ -154,7 +154,7 @@ void lv_task_set_repeat_count(lv_task_t * task, int32_t repeat_count); void lv_task_reset(lv_task_t * task); /** - * Enable or disable the whole lv_task handling + * Enable or disable the whole lv_task handling * @param en: true: lv_task handling is running, false: lv_task handling is suspended */ void lv_task_enable(bool en); diff --git a/src/lv_misc/lv_txt.c b/src/lv_misc/lv_txt.c index 0521aab3a..fcb9a7d22 100644 --- a/src/lv_misc/lv_txt.c +++ b/src/lv_misc/lv_txt.c @@ -121,7 +121,7 @@ void _lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t size_res->y += line_space; } - /*Calculate the the longest line*/ + /*Calculate the longest line*/ lv_coord_t act_line_length = _lv_txt_get_width(&text[line_start], new_line_start - line_start, font, letter_space, flag); @@ -225,7 +225,7 @@ static uint32_t lv_txt_get_next_word(const char * txt, const lv_font_t * font, /*Check for new line chars and breakchars*/ if(letter == '\n' || letter == '\r' || is_break_char(letter)) { /* Update the output width on the first character if it fits. - * Must do this here incase first letter is a break character. */ + * Must do this here in case first letter is a break character. */ if(i == 0 && break_index == NO_BREAK_FOUND && word_w_ptr != NULL) *word_w_ptr = cur_w; word_len--; break; @@ -581,7 +581,7 @@ static uint32_t lv_txt_unicode_to_utf8(uint32_t letter_uni) /** * Convert a wide character, e.g. 'Á' little endian to be UTF-8 compatible - * @param c a wide character or a Little endian number + * @param c a wide character or a Little endian number * @return `c` in big endian */ static uint32_t lv_txt_utf8_conv_wc(uint32_t c) diff --git a/src/lv_misc/lv_txt_ap.c b/src/lv_misc/lv_txt_ap.c index 673babeee..6bd7124ac 100644 --- a/src/lv_misc/lv_txt_ap.c +++ b/src/lv_misc/lv_txt_ap.c @@ -114,7 +114,7 @@ uint32_t _lv_txt_ap_calc_bytes_cnt(const char * txt) chars_cnt++; else if(ch_enc < 0x0800) chars_cnt += 2; - else if(ch_enc < 0x010000) + else if(ch_enc < 0x010000) chars_cnt += 3; else chars_cnt += 4; @@ -210,7 +210,7 @@ static uint32_t lv_ap_get_char_index(uint16_t c) if(c == (ap_chars_map[i].char_offset + LV_AP_ALPHABET_BASE_CODE)) return i; else if(c == ap_chars_map[i].char_end_form //is it an End form - || c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_begining_form_offset) //is it a Begining form + || c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_begining_form_offset) //is it a Beginning form || c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_middle_form_offset) //is it a middle form || c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_isolated_form_offset)) { //is it an isolated form return i; diff --git a/src/lv_themes/lv_theme_material.c b/src/lv_themes/lv_theme_material.c index 6b71dc9f2..129ac6693 100644 --- a/src/lv_themes/lv_theme_material.c +++ b/src/lv_themes/lv_theme_material.c @@ -680,7 +680,7 @@ static void page_init(void) lv_style_set_pad_right(&styles->sb, LV_STATE_DEFAULT, LV_DPX(7)); lv_style_set_pad_bottom(&styles->sb, LV_STATE_DEFAULT, LV_DPX(7)); -#if LV_USE_ANIMATION +#if LV_USE_ANIMATION style_init_reset(&styles->edge_flash); lv_style_set_bg_opa(&styles->edge_flash, LV_STATE_DEFAULT, LV_OPA_COVER); lv_style_set_bg_color(&styles->edge_flash, LV_STATE_DEFAULT, lv_color_hex3(0x888)); diff --git a/src/lv_widgets/lv_arc.c b/src/lv_widgets/lv_arc.c index 50b5ba248..f78c8606c 100644 --- a/src/lv_widgets/lv_arc.c +++ b/src/lv_widgets/lv_arc.c @@ -173,7 +173,7 @@ void lv_arc_set_start_angle(lv_obj_t * arc, uint16_t start) LV_ARC_PART_INDIC); } /*Only a smaller incremental move*/ - else if(ext->arc_angle_start < ext->arc_angle_end && start < ext->arc_angle_end) { + else if(ext->arc_angle_start < ext->arc_angle_end && start < ext->arc_angle_end) { inv_arc_area(arc, LV_MATH_MIN(ext->arc_angle_start, start), LV_MATH_MAX(ext->arc_angle_start, start), LV_ARC_PART_INDIC); } @@ -207,7 +207,7 @@ void lv_arc_set_end_angle(lv_obj_t * arc, uint16_t end) inv_arc_area(arc, LV_MATH_MIN(ext->arc_angle_end, end), LV_MATH_MAX(ext->arc_angle_end, end), LV_ARC_PART_INDIC); } /*Only a smaller incremental move*/ - else if(ext->arc_angle_end < ext->arc_angle_start && end < ext->arc_angle_start) { + else if(ext->arc_angle_end < ext->arc_angle_start && end < ext->arc_angle_start) { inv_arc_area(arc, LV_MATH_MIN(ext->arc_angle_end, end), LV_MATH_MAX(ext->arc_angle_end, end), LV_ARC_PART_INDIC); } /*Crossing the end angle makes the whole arc change*/ @@ -263,7 +263,7 @@ void lv_arc_set_bg_start_angle(lv_obj_t * arc, uint16_t start) inv_arc_area(arc, LV_MATH_MIN(ext->bg_angle_start, start), LV_MATH_MAX(ext->bg_angle_start, start), LV_ARC_PART_BG); } /*Only a smaller incremental move*/ - else if(ext->bg_angle_start < ext->bg_angle_end && start < ext->bg_angle_end) { + else if(ext->bg_angle_start < ext->bg_angle_end && start < ext->bg_angle_end) { inv_arc_area(arc, LV_MATH_MIN(ext->bg_angle_start, start), LV_MATH_MAX(ext->bg_angle_start, start), LV_ARC_PART_BG); } /*Crossing the start angle makes the whole arc change*/ @@ -298,7 +298,7 @@ void lv_arc_set_bg_end_angle(lv_obj_t * arc, uint16_t end) inv_arc_area(arc, LV_MATH_MIN(ext->bg_angle_end, end), LV_MATH_MAX(ext->bg_angle_end, end), LV_ARC_PART_BG); } /*Only a smaller incremental move*/ - else if(ext->bg_angle_end < ext->bg_angle_start && end < ext->bg_angle_start) { + else if(ext->bg_angle_end < ext->bg_angle_start && end < ext->bg_angle_start) { inv_arc_area(arc, LV_MATH_MIN(ext->bg_angle_end, end), LV_MATH_MAX(ext->bg_angle_end, end), LV_ARC_PART_BG); } /*Crossing the end angle makes the whole arc change*/ diff --git a/src/lv_widgets/lv_bar.c b/src/lv_widgets/lv_bar.c index 5545f1019..1b18b54c2 100644 --- a/src/lv_widgets/lv_bar.c +++ b/src/lv_widgets/lv_bar.c @@ -23,7 +23,7 @@ *********************/ #define LV_OBJX_NAME "lv_bar" -#define LV_BAR_SIZE_MIN 4 /*hor. pad and ver. pad cannot make the indicator smaller then this [px]*/ +#define LV_BAR_SIZE_MIN 4 /*hor. pad and ver. pad cannot make the indicator smaller then this [px]*/ #if LV_USE_ANIMATION #define LV_BAR_IS_ANIMATING(anim_struct) (((anim_struct).anim_state) != LV_BAR_ANIM_STATE_INV) @@ -109,7 +109,7 @@ lv_obj_t * lv_bar_create(lv_obj_t * par, const lv_obj_t * copy) lv_obj_set_signal_cb(bar, lv_bar_signal); lv_obj_set_design_cb(bar, lv_bar_design); - /*Init the new bar object*/ + /*Init the new bar object*/ if(copy == NULL) { lv_obj_set_click(bar, false); diff --git a/src/lv_widgets/lv_btn.h b/src/lv_widgets/lv_btn.h index 34f72f636..84d1848ba 100644 --- a/src/lv_widgets/lv_btn.h +++ b/src/lv_widgets/lv_btn.h @@ -19,7 +19,7 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_CONT == 0 -#error "lv_btn: lv_cont is required. Enable it in lv_conf.h (LV_USE_CONT 1) " +#error "lv_btn: lv_cont is required. Enable it in lv_conf.h (LV_USE_CONT 1)" #endif #include "lv_cont.h" diff --git a/src/lv_widgets/lv_btnmatrix.c b/src/lv_widgets/lv_btnmatrix.c index 783fc96ed..aa0324202 100644 --- a/src/lv_widgets/lv_btnmatrix.c +++ b/src/lv_widgets/lv_btnmatrix.c @@ -268,7 +268,7 @@ void lv_btnmatrix_set_map(lv_obj_t * btnm, const char * map[]) * the number and order of the individual buttons (i.e. excludes * newline entries). * An element of the map should look like e.g.: - * `ctrl_map[0] = width | LV_BTNMATRIX_CTRL_NO_REPEAT | LV_BTNMATRIX_CTRL_TGL_ENABLE` + * `ctrl_map[0] = width | LV_BTNMATRIX_CTRL_NO_REPEAT | LV_BTNMATRIX_CTRL_TGL_ENABLE` */ void lv_btnmatrix_set_ctrl_map(lv_obj_t * btnm, const lv_btnmatrix_ctrl_t ctrl_map[]) { @@ -476,9 +476,9 @@ bool lv_btnmatrix_get_recolor(const lv_obj_t * btnm) /** * Get the index of the lastly "activated" button by the user (pressed, released etc) - * Useful in the the `event_cb` to get the text of the button, check if hidden etc. + * Useful in the `event_cb` to get the text of the button, check if hidden etc. * @param btnm pointer to button matrix object - * @return index of the last released button (LV_BTNMATRIX_BTN_NONE: if unset) + * @return index of the last released button (LV_BTNMATRIX_BTN_NONE: if unset) */ uint16_t lv_btnmatrix_get_active_btn(const lv_obj_t * btnm) { @@ -490,7 +490,7 @@ uint16_t lv_btnmatrix_get_active_btn(const lv_obj_t * btnm) /** * Get the text of the lastly "activated" button by the user (pressed, released etc) - * Useful in the the `event_cb` + * Useful in the `event_cb` * @param btnm pointer to button matrix object * @return text of the last released button (NULL: if unset) */ @@ -511,7 +511,7 @@ const char * lv_btnmatrix_get_active_btn_text(const lv_obj_t * btnm) * Get the pressed button's index. * The button be really pressed by the user or manually set to pressed with `lv_btnmatrix_set_pressed` * @param btnm pointer to button matrix object - * @return index of the pressed button (LV_BTNMATRIX_BTN_NONE: if unset) + * @return index of the pressed button (LV_BTNMATRIX_BTN_NONE: if unset) */ uint16_t lv_btnmatrix_get_focused_btn(const lv_obj_t * btnm) { @@ -526,7 +526,7 @@ uint16_t lv_btnmatrix_get_focused_btn(const lv_obj_t * btnm) * @param btnm pointer to button matrix object * @param btn_id the index a button not counting new line characters. (The return value of * lv_btnmatrix_get_pressed/released) - * @return text of btn_index` button + * @return text of btn_index` button */ const char * lv_btnmatrix_get_btn_text(const lv_obj_t * btnm, uint16_t btn_id) { @@ -1037,7 +1037,7 @@ static lv_res_t lv_btnmatrix_signal(lv_obj_t * btnm, lv_signal_t sign, void * pa } else if(c == LV_KEY_DOWN) { lv_style_int_t pad_inner = lv_obj_get_style_pad_inner(btnm, LV_BTNMATRIX_PART_BG); - /*Find the area below the the current*/ + /*Find the area below the current*/ if(ext->btn_id_focused == LV_BTNMATRIX_BTN_NONE) { ext->btn_id_focused = 0; } @@ -1063,7 +1063,7 @@ static lv_res_t lv_btnmatrix_signal(lv_obj_t * btnm, lv_signal_t sign, void * pa } else if(c == LV_KEY_UP) { lv_style_int_t pad_inner = lv_obj_get_style_pad_inner(btnm, LV_BTNMATRIX_PART_BG); - /*Find the area below the the current*/ + /*Find the area below the current*/ if(ext->btn_id_focused == LV_BTNMATRIX_BTN_NONE) { ext->btn_id_focused = 0; } diff --git a/src/lv_widgets/lv_btnmatrix.h b/src/lv_widgets/lv_btnmatrix.h index 4fa0f849c..a47e82401 100644 --- a/src/lv_widgets/lv_btnmatrix.h +++ b/src/lv_widgets/lv_btnmatrix.h @@ -104,7 +104,7 @@ void lv_btnmatrix_set_map(lv_obj_t * btnm, const char * map[]); * the number and order of the individual buttons (i.e. excludes * newline entries). * An element of the map should look like e.g.: - * `ctrl_map[0] = width | LV_BTNMATRIX_CTRL_NO_REPEAT | LV_BTNMATRIX_CTRL_TGL_ENABLE` + * `ctrl_map[0] = width | LV_BTNMATRIX_CTRL_NO_REPEAT | LV_BTNMATRIX_CTRL_TGL_ENABLE` */ void lv_btnmatrix_set_ctrl_map(lv_obj_t * btnm, const lv_btnmatrix_ctrl_t ctrl_map[]); @@ -198,15 +198,15 @@ bool lv_btnmatrix_get_recolor(const lv_obj_t * btnm); /** * Get the index of the lastly "activated" button by the user (pressed, released etc) - * Useful in the the `event_cb` to get the text of the button, check if hidden etc. + * Useful in the `event_cb` to get the text of the button, check if hidden etc. * @param btnm pointer to button matrix object - * @return index of the last released button (LV_BTNMATRIX_BTN_NONE: if unset) + * @return index of the last released button (LV_BTNMATRIX_BTN_NONE: if unset) */ uint16_t lv_btnmatrix_get_active_btn(const lv_obj_t * btnm); /** * Get the text of the lastly "activated" button by the user (pressed, released etc) - * Useful in the the `event_cb` + * Useful in the `event_cb` * @param btnm pointer to button matrix object * @return text of the last released button (NULL: if unset) */ @@ -215,7 +215,7 @@ const char * lv_btnmatrix_get_active_btn_text(const lv_obj_t * btnm); /** * Get the focused button's index. * @param btnm pointer to button matrix object - * @return index of the focused button (LV_BTNMATRIX_BTN_NONE: if unset) + * @return index of the focused button (LV_BTNMATRIX_BTN_NONE: if unset) */ uint16_t lv_btnmatrix_get_focused_btn(const lv_obj_t * btnm); @@ -224,7 +224,7 @@ uint16_t lv_btnmatrix_get_focused_btn(const lv_obj_t * btnm); * @param btnm pointer to button matrix object * @param btn_id the index a button not counting new line characters. (The return value of * lv_btnmatrix_get_pressed/released) - * @return text of btn_index` button + * @return text of btn_index` button */ const char * lv_btnmatrix_get_btn_text(const lv_obj_t * btnm, uint16_t btn_id); @@ -247,7 +247,7 @@ bool lv_btnmatrix_get_one_check(const lv_obj_t * btnm); /** * Get the align attribute - * @param btnm pointer to a btnmatrix object + * @param btnm pointer to a btnmatrix object * @return LV_LABEL_ALIGN_LEFT, LV_LABEL_ALIGN_RIGHT or LV_LABEL_ALIGN_CENTER */ lv_label_align_t lv_btnmatrix_get_align(const lv_obj_t * btnm); diff --git a/src/lv_widgets/lv_calendar.c b/src/lv_widgets/lv_calendar.c index 9346ca653..c1643a856 100644 --- a/src/lv_widgets/lv_calendar.c +++ b/src/lv_widgets/lv_calendar.c @@ -215,7 +215,7 @@ void lv_calendar_set_showed_date(lv_obj_t * calendar, lv_calendar_date_t * showe } /** - * Set the the highlighted dates + * Set the highlighted dates * @param calendar pointer to a calendar object * @param highlighted pointer to an `lv_calendar_date_t` array containing the dates. ONLY A POINTER * WILL BE SAVED! CAN'T BE LOCAL ARRAY. @@ -298,7 +298,7 @@ lv_calendar_date_t * lv_calendar_get_showed_date(const lv_obj_t * calendar) } /** - * Get the the pressed date. + * Get the pressed date. * @param calendar pointer to a calendar object * @return pointer to an `lv_calendar_date_t` variable containing the pressed date. * `NULL` if not date pressed (e.g. the header) @@ -312,7 +312,7 @@ lv_calendar_date_t * lv_calendar_get_pressed_date(const lv_obj_t * calendar) } /** - * Get the the highlighted dates + * Get the highlighted dates * @param calendar pointer to a calendar object * @return pointer to an `lv_calendar_date_t` array containing the dates. */ @@ -366,7 +366,7 @@ const char ** lv_calendar_get_month_names(const lv_obj_t * calendar) /** * Get the day of the week * @param year a year - * @param month a month (1..12) + * @param month a month (1..12) * @param day a day (1..31) * @return [0..6] which means [Sun..Sat] or [Mon..Sun] depending on LV_CALENDAR_WEEK_STARTS_MONDAY */ @@ -960,7 +960,7 @@ static void draw_dates(lv_obj_t * calendar, const lv_area_t * clip_area) * @param calendar pointer to a calendar object * @param draw_state which month is drawn (previous, active, next) * @param year a year - * @param month a month [1..12] + * @param month a month [1..12] * @param day a day [1..31] * @return true: highlighted */ @@ -993,7 +993,7 @@ static bool is_highlighted(lv_obj_t * calendar, day_draw_state_t draw_state, int * @param calendar pointer to a calendar object * @param draw_state which month is drawn (previous, active, next) * @param year a year - * @param month a month [1..12] + * @param month a month [1..12] * @param day a day [1..31] * @return true: highlighted */ diff --git a/src/lv_widgets/lv_calendar.h b/src/lv_widgets/lv_calendar.h index 66f2b24ca..c6489b0d8 100644 --- a/src/lv_widgets/lv_calendar.h +++ b/src/lv_widgets/lv_calendar.h @@ -102,7 +102,7 @@ void lv_calendar_set_today_date(lv_obj_t * calendar, lv_calendar_date_t * today) void lv_calendar_set_showed_date(lv_obj_t * calendar, lv_calendar_date_t * showed); /** - * Set the the highlighted dates + * Set the highlighted dates * @param calendar pointer to a calendar object * @param highlighted pointer to an `lv_calendar_date_t` array containing the dates. ONLY A POINTER * WILL BE SAVED! CAN'T BE LOCAL ARRAY. @@ -147,7 +147,7 @@ lv_calendar_date_t * lv_calendar_get_today_date(const lv_obj_t * calendar); lv_calendar_date_t * lv_calendar_get_showed_date(const lv_obj_t * calendar); /** - * Get the the pressed date. + * Get the pressed date. * @param calendar pointer to a calendar object * @return pointer to an `lv_calendar_date_t` variable containing the pressed date. * `NULL` if not date pressed (e.g. the header) @@ -155,7 +155,7 @@ lv_calendar_date_t * lv_calendar_get_showed_date(const lv_obj_t * calendar); lv_calendar_date_t * lv_calendar_get_pressed_date(const lv_obj_t * calendar); /** - * Get the the highlighted dates + * Get the highlighted dates * @param calendar pointer to a calendar object * @return pointer to an `lv_calendar_date_t` array containing the dates. */ @@ -185,7 +185,7 @@ const char ** lv_calendar_get_month_names(const lv_obj_t * calendar); /** * Get the day of the week * @param year a year - * @param month a month (1..12) + * @param month a month (1..12) * @param day a day (1..31) * @return [0..6] which means [Sun..Sat] or [Mon..Sun] depending on LV_CALENDAR_WEEK_STARTS_MONDAY */ diff --git a/src/lv_widgets/lv_canvas.c b/src/lv_widgets/lv_canvas.c index 4203779c6..a5ecf7946 100644 --- a/src/lv_widgets/lv_canvas.c +++ b/src/lv_widgets/lv_canvas.c @@ -1025,7 +1025,7 @@ void lv_canvas_draw_polygon(lv_obj_t * canvas, const lv_point_t points[], uint32 /** * Draw an arc on the canvas * @param canvas pointer to a canvas object - * @param x origo x of the arc + * @param x origo x of the arc * @param y origo y of the arc * @param r radius of the arc * @param start_angle start angle in degrees diff --git a/src/lv_widgets/lv_canvas.h b/src/lv_widgets/lv_canvas.h index 0c9ca80da..13b503b96 100644 --- a/src/lv_widgets/lv_canvas.h +++ b/src/lv_widgets/lv_canvas.h @@ -232,7 +232,7 @@ void lv_canvas_draw_polygon(lv_obj_t * canvas, const lv_point_t points[], uint32 /** * Draw an arc on the canvas * @param canvas pointer to a canvas object - * @param x origo x of the arc + * @param x origo x of the arc * @param y origo y of the arc * @param r radius of the arc * @param start_angle start angle in degrees diff --git a/src/lv_widgets/lv_chart.c b/src/lv_widgets/lv_chart.c index b6ed55ce7..edff8aaeb 100644 --- a/src/lv_widgets/lv_chart.c +++ b/src/lv_widgets/lv_chart.c @@ -424,7 +424,7 @@ void lv_chart_set_point_count(lv_obj_t * chart, uint16_t point_cnt) * Initialize all data points with a value * @param chart pointer to chart object * @param ser pointer to a data series on 'chart' - * @param y the new value for all points + * @param y the new value for all points */ void lv_chart_init_points(lv_obj_t * chart, lv_chart_series_t * ser, lv_coord_t y) { @@ -901,8 +901,8 @@ lv_coord_t lv_chart_get_y_from_index(lv_obj_t * chart, lv_chart_series_t * ser, /** * Get the series area of a chart. - * @param chart pointer to a chart object - * @param series_area pointer to an area variable that the result will be put in. + * @param chart pointer to a chart object + * @param series_area pointer to an area variable that the result will be put in. */ void lv_chart_get_series_area(lv_obj_t * chart, lv_area_t * series_area) { diff --git a/src/lv_widgets/lv_chart.h b/src/lv_widgets/lv_chart.h index df75a6d36..2b1ea07af 100644 --- a/src/lv_widgets/lv_chart.h +++ b/src/lv_widgets/lv_chart.h @@ -223,7 +223,7 @@ void lv_chart_set_point_count(lv_obj_t * chart, uint16_t point_cnt); * Initialize all data points with a value * @param chart pointer to chart object * @param ser pointer to a data series on 'chart' - * @param y the new value for all points + * @param y the new value for all points */ void lv_chart_init_points(lv_obj_t * chart, lv_chart_series_t * ser, lv_coord_t y); diff --git a/src/lv_widgets/lv_checkbox.h b/src/lv_widgets/lv_checkbox.h index 0ea2ecf37..7e301615f 100644 --- a/src/lv_widgets/lv_checkbox.h +++ b/src/lv_widgets/lv_checkbox.h @@ -19,11 +19,11 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_BTN == 0 -#error "lv_cb: lv_btn is required. Enable it in lv_conf.h (LV_USE_BTN 1) " +#error "lv_cb: lv_btn is required. Enable it in lv_conf.h (LV_USE_BTN 1)" #endif #if LV_USE_LABEL == 0 -#error "lv_cb: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1) " +#error "lv_cb: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1)" #endif #include "../lv_core/lv_obj.h" diff --git a/src/lv_widgets/lv_cont.c b/src/lv_widgets/lv_cont.c index 7a21bc2b3..679576a14 100644 --- a/src/lv_widgets/lv_cont.c +++ b/src/lv_widgets/lv_cont.c @@ -508,7 +508,7 @@ static void lv_cont_layout_pretty(lv_obj_t * cont) lv_coord_t pright = lv_obj_get_style_pad_right(cont, LV_CONT_PART_MAIN); lv_coord_t pinner = lv_obj_get_style_pad_inner(cont, LV_CONT_PART_MAIN); - child_rc = child_rs; /*Initially the the row starter and closer is the same*/ + child_rc = child_rs; /*Initially the row starter and closer is the same*/ while(child_rs != NULL) { lv_coord_t h_row = 0; lv_coord_t w_row = pleft + pright; /*The width is at least the left+right pad*/ diff --git a/src/lv_widgets/lv_dropdown.c b/src/lv_widgets/lv_dropdown.c index f33cd3d73..84664e281 100644 --- a/src/lv_widgets/lv_dropdown.c +++ b/src/lv_widgets/lv_dropdown.c @@ -1105,7 +1105,7 @@ static lv_res_t lv_dropdown_page_scrl_signal(lv_obj_t * scrl, lv_signal_t sign, ext->pr_opt_id = LV_DROPDOWN_PR_NONE; lv_obj_invalidate(page); } - else if(sign == LV_SIGNAL_REFR_EXT_DRAW_PAD) { + else if(sign == LV_SIGNAL_REFR_EXT_DRAW_PAD) { /* Make possible to draw on the full width of the background to redraw the selected rectangle * when the ddlist is scrolled in fix height mode. * (The scrollable is scrolled then "select rectangle" is drawn on the bg too)*/ diff --git a/src/lv_widgets/lv_dropdown.h b/src/lv_widgets/lv_dropdown.h index 05c6bb553..7676d2918 100644 --- a/src/lv_widgets/lv_dropdown.h +++ b/src/lv_widgets/lv_dropdown.h @@ -19,11 +19,11 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_PAGE == 0 -#error "lv_ddlist: lv_page is required. Enable it in lv_conf.h (LV_USE_PAGE 1) " +#error "lv_ddlist: lv_page is required. Enable it in lv_conf.h (LV_USE_PAGE 1)" #endif #if LV_USE_LABEL == 0 -#error "lv_ddlist: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1) " +#error "lv_ddlist: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1)" #endif #include "../lv_widgets/lv_page.h" @@ -123,7 +123,7 @@ void lv_dropdown_set_options_static(lv_obj_t * ddlist, const char * options); * Add an options to a drop down list from a string. Only works for dynamic options. * @param ddlist pointer to drop down list object * @param option a string without '\n'. E.g. "Four" - * @param pos the insert position, indexed from 0, LV_DROPDOWN_POS_LAST = end of string + * @param pos the insert position, indexed from 0, LV_DROPDOWN_POS_LAST = end of string */ void lv_dropdown_add_option(lv_obj_t * ddlist, const char * option, uint32_t pos); diff --git a/src/lv_widgets/lv_gauge.h b/src/lv_widgets/lv_gauge.h index c2293dd81..719475779 100644 --- a/src/lv_widgets/lv_gauge.h +++ b/src/lv_widgets/lv_gauge.h @@ -19,7 +19,7 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_LINEMETER == 0 -#error "lv_gauge: lv_linemeter is required. Enable it in lv_conf.h (LV_USE_LINEMETER 1) " +#error "lv_gauge: lv_linemeter is required. Enable it in lv_conf.h (LV_USE_LINEMETER 1)" #endif #include "../lv_core/lv_obj.h" diff --git a/src/lv_widgets/lv_img.c b/src/lv_widgets/lv_img.c index ab77125aa..a85346607 100644 --- a/src/lv_widgets/lv_img.c +++ b/src/lv_widgets/lv_img.c @@ -11,7 +11,7 @@ /*Testing of dependencies*/ #if LV_USE_LABEL == 0 - #error "lv_img: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1) " + #error "lv_img: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1)" #endif #include "../lv_misc/lv_debug.h" diff --git a/src/lv_widgets/lv_imgbtn.c b/src/lv_widgets/lv_imgbtn.c index 76b9be881..a52bdec08 100644 --- a/src/lv_widgets/lv_imgbtn.c +++ b/src/lv_widgets/lv_imgbtn.c @@ -195,7 +195,7 @@ void lv_imgbtn_toggle(lv_obj_t * imgbtn) *====================*/ /** - * Get the images in a given state + * Get the images in a given state * @param imgbtn pointer to an image button object * @param state the state where to get the image (from `lv_btn_state_t`) ` * @return pointer to an image source (a C array or path to a file) @@ -521,7 +521,7 @@ static void refr_img(lv_obj_t * imgbtn) if(info_res == LV_RES_OK) { ext->act_cf = header.cf; if(ext->tiled) lv_obj_set_height(imgbtn, header.h); /*Keep the sure defined width*/ - else lv_obj_set_size(imgbtn, header.w, header.h); + else lv_obj_set_size(imgbtn, header.w, header.h); } else { ext->act_cf = LV_IMG_CF_UNKNOWN; diff --git a/src/lv_widgets/lv_imgbtn.h b/src/lv_widgets/lv_imgbtn.h index 1f939f934..1f3130dff 100644 --- a/src/lv_widgets/lv_imgbtn.h +++ b/src/lv_widgets/lv_imgbtn.h @@ -19,7 +19,7 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_BTN == 0 -#error "lv_imgbtn: lv_btn is required. Enable it in lv_conf.h (LV_USE_BTN 1) " +#error "lv_imgbtn: lv_btn is required. Enable it in lv_conf.h (LV_USE_BTN 1)" #endif #include "../lv_core/lv_obj.h" @@ -127,7 +127,7 @@ static inline void lv_imgbtn_set_checkable(lv_obj_t * imgbtn, bool tgl) #if LV_IMGBTN_TILED == 0 /** - * Get the images in a given state + * Get the images in a given state * @param imgbtn pointer to an image button object * @param state the state where to get the image (from `lv_btn_state_t`) ` * @return pointer to an image source (a C array or path to a file) diff --git a/src/lv_widgets/lv_keyboard.c b/src/lv_widgets/lv_keyboard.c index ae40b4deb..589a5e17e 100644 --- a/src/lv_widgets/lv_keyboard.c +++ b/src/lv_widgets/lv_keyboard.c @@ -329,7 +329,7 @@ bool lv_keyboard_get_cursor_manage(const lv_obj_t * kb) * Default keyboard event to add characters to the Text area and change the map. * If a custom `event_cb` is added to the keyboard this function be called from it to handle the * button clicks - * @param kb pointer to a keyboard + * @param kb pointer to a keyboard * @param event the triggering event */ void lv_keyboard_def_event_cb(lv_obj_t * kb, lv_event_t event) @@ -372,7 +372,7 @@ void lv_keyboard_def_event_cb(lv_obj_t * kb, lv_event_t event) if(res != LV_RES_OK) return; } else { - lv_keyboard_set_textarea(kb, NULL); /*De-assign the text area to hide it cursor if needed*/ + lv_keyboard_set_textarea(kb, NULL); /*De-assign the text area to hide it cursor if needed*/ lv_obj_del(kb); return; } diff --git a/src/lv_widgets/lv_keyboard.h b/src/lv_widgets/lv_keyboard.h index 3edd344b0..626a4d543 100644 --- a/src/lv_widgets/lv_keyboard.h +++ b/src/lv_widgets/lv_keyboard.h @@ -19,11 +19,11 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_BTNMATRIX == 0 -#error "lv_kb: lv_btnm is required. Enable it in lv_conf.h (LV_USE_BTNMATRIX 1) " +#error "lv_kb: lv_btnm is required. Enable it in lv_conf.h (LV_USE_BTNMATRIX 1)" #endif #if LV_USE_TEXTAREA == 0 -#error "lv_kb: lv_ta is required. Enable it in lv_conf.h (LV_USE_TEXTAREA 1) " +#error "lv_kb: lv_ta is required. Enable it in lv_conf.h (LV_USE_TEXTAREA 1)" #endif #include "../lv_core/lv_obj.h" @@ -162,7 +162,7 @@ static inline const char ** lv_keyboard_get_map_array(const lv_obj_t * kb) * Default keyboard event to add characters to the Text area and change the map. * If a custom `event_cb` is added to the keyboard this function be called from it to handle the * button clicks - * @param kb pointer to a keyboard + * @param kb pointer to a keyboard * @param event the triggering event */ void lv_keyboard_def_event_cb(lv_obj_t * kb, lv_event_t event); diff --git a/src/lv_widgets/lv_label.c b/src/lv_widgets/lv_label.c index 4f43782dd..112143b88 100644 --- a/src/lv_widgets/lv_label.c +++ b/src/lv_widgets/lv_label.c @@ -738,7 +738,7 @@ uint32_t lv_label_get_letter_on(const lv_obj_t * label, lv_point_t * pos_in) lv_coord_t gw = lv_font_get_glyph_width(font, letter, letter_next); /*Finish if the x position or the last char of the next line is reached*/ - if(pos.x < x + gw || i + line_start == new_line_start || txt[i_act + line_start] == '\0') { + if(pos.x < x + gw || i + line_start == new_line_start || txt[i_act + line_start] == '\0') { i = i_act; break; } @@ -765,7 +765,7 @@ uint32_t lv_label_get_letter_on(const lv_obj_t * label, lv_point_t * pos_in) logical_pos = _lv_txt_encoded_get_char_id(bidi_txt, i); #endif - return logical_pos + _lv_txt_encoded_get_char_id(txt, line_start); + return logical_pos + _lv_txt_encoded_get_char_id(txt, line_start); } /** diff --git a/src/lv_widgets/lv_list.h b/src/lv_widgets/lv_list.h index f78cd3cf9..4afe245cb 100644 --- a/src/lv_widgets/lv_list.h +++ b/src/lv_widgets/lv_list.h @@ -19,15 +19,15 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_PAGE == 0 -#error "lv_list: lv_page is required. Enable it in lv_conf.h (LV_USE_PAGE 1) " +#error "lv_list: lv_page is required. Enable it in lv_conf.h (LV_USE_PAGE 1)" #endif #if LV_USE_BTN == 0 -#error "lv_list: lv_btn is required. Enable it in lv_conf.h (LV_USE_BTN 1) " +#error "lv_list: lv_btn is required. Enable it in lv_conf.h (LV_USE_BTN 1)" #endif #if LV_USE_LABEL == 0 -#error "lv_list: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1) " +#error "lv_list: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1)" #endif #include "../lv_core/lv_obj.h" diff --git a/src/lv_widgets/lv_msgbox.c b/src/lv_widgets/lv_msgbox.c index 203c8d007..d5669865e 100644 --- a/src/lv_widgets/lv_msgbox.c +++ b/src/lv_widgets/lv_msgbox.c @@ -233,7 +233,7 @@ void lv_msgbox_set_text_fmt(lv_obj_t * mbox, const char * fmt, ...) /** * Set animation duration * @param mbox pointer to a message box object - * @param anim_time animation length in milliseconds (0: no animation) + * @param anim_time animation length in milliseconds (0: no animation) */ void lv_msgbox_set_anim_time(lv_obj_t * mbox, uint16_t anim_time) { @@ -344,9 +344,9 @@ const char * lv_msgbox_get_text(const lv_obj_t * mbox) /** * Get the index of the lastly "activated" button by the user (pressed, released etc) - * Useful in the the `event_cb`. + * Useful in the `event_cb`. * @param mbox pointer to message box object - * @return index of the last released button (LV_BTNMATRIX_BTN_NONE: if unset) + * @return index of the last released button (LV_BTNMATRIX_BTN_NONE: if unset) */ uint16_t lv_msgbox_get_active_btn(lv_obj_t * mbox) { @@ -365,7 +365,7 @@ uint16_t lv_msgbox_get_active_btn(lv_obj_t * mbox) /** * Get the text of the lastly "activated" button by the user (pressed, released etc) - * Useful in the the `event_cb`. + * Useful in the `event_cb`. * @param mbox pointer to message box object * @return text of the last released button (NULL: if unset) */ @@ -383,7 +383,7 @@ const char * lv_msgbox_get_active_btn_text(lv_obj_t * mbox) /** * Get the animation duration (close animation time) * @param mbox pointer to a message box object - * @return animation length in milliseconds (0: no animation) + * @return animation length in milliseconds (0: no animation) */ uint16_t lv_msgbox_get_anim_time(const lv_obj_t * mbox) { diff --git a/src/lv_widgets/lv_msgbox.h b/src/lv_widgets/lv_msgbox.h index 263a442f9..18c3f1246 100644 --- a/src/lv_widgets/lv_msgbox.h +++ b/src/lv_widgets/lv_msgbox.h @@ -19,15 +19,15 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_CONT == 0 -#error "lv_mbox: lv_cont is required. Enable it in lv_conf.h (LV_USE_CONT 1) " +#error "lv_mbox: lv_cont is required. Enable it in lv_conf.h (LV_USE_CONT 1)" #endif #if LV_USE_BTNMATRIX == 0 -#error "lv_mbox: lv_btnm is required. Enable it in lv_conf.h (LV_USE_BTNMATRIX 1) " +#error "lv_mbox: lv_btnm is required. Enable it in lv_conf.h (LV_USE_BTNMATRIX 1)" #endif #if LV_USE_LABEL == 0 -#error "lv_mbox: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1) " +#error "lv_mbox: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1)" #endif #include "../lv_core/lv_obj.h" @@ -109,7 +109,7 @@ void lv_msgbox_set_text_fmt(lv_obj_t * mbox, const char * fmt, ...); /** * Set animation duration * @param mbox pointer to a message box object - * @param anim_time animation length in milliseconds (0: no animation) + * @param anim_time animation length in milliseconds (0: no animation) */ void lv_msgbox_set_anim_time(lv_obj_t * mbox, uint16_t anim_time); @@ -146,15 +146,15 @@ const char * lv_msgbox_get_text(const lv_obj_t * mbox); /** * Get the index of the lastly "activated" button by the user (pressed, released etc) - * Useful in the the `event_cb`. + * Useful in the `event_cb`. * @param mbox pointer to message box object - * @return index of the last released button (LV_BTNMATRIX_BTN_NONE: if unset) + * @return index of the last released button (LV_BTNMATRIX_BTN_NONE: if unset) */ uint16_t lv_msgbox_get_active_btn(lv_obj_t * mbox); /** * Get the text of the lastly "activated" button by the user (pressed, released etc) - * Useful in the the `event_cb`. + * Useful in the `event_cb`. * @param mbox pointer to message box object * @return text of the last released button (NULL: if unset) */ @@ -163,7 +163,7 @@ const char * lv_msgbox_get_active_btn_text(lv_obj_t * mbox); /** * Get the animation duration (close animation time) * @param mbox pointer to a message box object - * @return animation length in milliseconds (0: no animation) + * @return animation length in milliseconds (0: no animation) */ uint16_t lv_msgbox_get_anim_time(const lv_obj_t * mbox); diff --git a/src/lv_widgets/lv_page.c b/src/lv_widgets/lv_page.c index 85cf21253..d04467667 100644 --- a/src/lv_widgets/lv_page.c +++ b/src/lv_widgets/lv_page.c @@ -383,7 +383,7 @@ lv_coord_t lv_page_get_height_fit(lv_obj_t * page) * Take into account the paddings of the background and scrollable too. * @param page pointer to an object * @param div indicates how many columns are assumed. - * If 1 the width will be set the the parent's width + * If 1 the width will be set the parent's width * If 2 only half parent width - inner padding of the parent * If 3 only third parent width - 2 * inner padding of the parent * @param span how many columns are combined @@ -406,7 +406,7 @@ lv_coord_t lv_page_get_width_grid(lv_obj_t * page, uint8_t div, uint8_t span) * Take into account the paddings of the background and scrollable too. * @param obj pointer to an object * @param div indicates how many rows are assumed. - * If 1 the height will be set the the parent's height + * If 1 the height will be set the parent's height * If 2 only half parent height - inner padding of the parent * If 3 only third parent height - 2 * inner padding of the parent * @param span how many rows are combined @@ -536,7 +536,7 @@ void lv_page_focus(lv_obj_t * page, const lv_obj_t * obj, lv_anim_enable_t anim_ scrlable_x = -(obj_x - scrl_left - bg_left); scrlable_x += scrl_left; } - /*Out of the page on the rigth*/ + /*Out of the page on the right*/ else if((obj_w <= page_w && right_err > 0) || (obj_w > page_w && left_err >= right_err)) { /*Calculate a new position and let some space on the side*/ scrlable_x = -(obj_x + scrl_right + bg_right); diff --git a/src/lv_widgets/lv_page.h b/src/lv_widgets/lv_page.h index 051dce509..0894572e8 100644 --- a/src/lv_widgets/lv_page.h +++ b/src/lv_widgets/lv_page.h @@ -19,7 +19,7 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_CONT == 0 -#error "lv_page: lv_cont is required. Enable it in lv_conf.h (LV_USE_CONT 1) " +#error "lv_page: lv_cont is required. Enable it in lv_conf.h (LV_USE_CONT 1)" #endif #include "lv_cont.h" @@ -273,7 +273,7 @@ lv_coord_t lv_page_get_height_fit(lv_obj_t * page); * Take into account the paddings of the background and scrollable too. * @param page pointer to an object * @param div indicates how many columns are assumed. - * If 1 the width will be set the the parent's width + * If 1 the width will be set the parent's width * If 2 only half parent width - inner padding of the parent * If 3 only third parent width - 2 * inner padding of the parent * @param span how many columns are combined @@ -286,7 +286,7 @@ lv_coord_t lv_page_get_width_grid(lv_obj_t * page, uint8_t div, uint8_t span); * Take into account the paddings of the background and scrollable too. * @param page pointer to an object * @param div indicates how many rows are assumed. - * If 1 the height will be set the the parent's height + * If 1 the height will be set the parent's height * If 2 only half parent height - inner padding of the parent * If 3 only third parent height - 2 * inner padding of the parent * @param span how many rows are combined diff --git a/src/lv_widgets/lv_roller.c b/src/lv_widgets/lv_roller.c index ba8440762..1b20332a3 100644 --- a/src/lv_widgets/lv_roller.c +++ b/src/lv_widgets/lv_roller.c @@ -522,7 +522,7 @@ static lv_design_res_t lv_roller_label_design(lv_obj_t * label, const lv_area_t } /*Draw the object*/ else if(mode == LV_DESIGN_DRAW_MAIN) { - /* Split the drawing of the label into an upper (above the selected area) + /* Split the drawing of the label into an upper (above the selected area) * and a lower (below the selected area)*/ lv_obj_t * roller = lv_obj_get_parent(lv_obj_get_parent(label)); const lv_font_t * font = lv_obj_get_style_text_font(roller, LV_ROLLER_PART_BG); diff --git a/src/lv_widgets/lv_roller.h b/src/lv_widgets/lv_roller.h index 06e9e7383..727dc9dab 100644 --- a/src/lv_widgets/lv_roller.h +++ b/src/lv_widgets/lv_roller.h @@ -19,7 +19,7 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_PAGE == 0 -#error "lv_roller: lv_page is required. Enable it in lv_conf.h (LV_USE_PAGE 1) " +#error "lv_roller: lv_page is required. Enable it in lv_conf.h (LV_USE_PAGE 1)" #endif #include "../lv_core/lv_obj.h" diff --git a/src/lv_widgets/lv_slider.h b/src/lv_widgets/lv_slider.h index 2f0d86a44..b2797507f 100644 --- a/src/lv_widgets/lv_slider.h +++ b/src/lv_widgets/lv_slider.h @@ -19,7 +19,7 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_BAR == 0 -#error "lv_slider: lv_bar is required. Enable it in lv_conf.h (LV_USE_BAR 1) " +#error "lv_slider: lv_bar is required. Enable it in lv_conf.h (LV_USE_BAR 1)" #endif #include "../lv_core/lv_obj.h" diff --git a/src/lv_widgets/lv_spinbox.h b/src/lv_widgets/lv_spinbox.h index 83c057f58..93c665d27 100644 --- a/src/lv_widgets/lv_spinbox.h +++ b/src/lv_widgets/lv_spinbox.h @@ -19,7 +19,7 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_TEXTAREA == 0 -#error "lv_spinbox: lv_ta is required. Enable it in lv_conf.h (LV_USE_TEXTAREA 1) " +#error "lv_spinbox: lv_ta is required. Enable it in lv_conf.h (LV_USE_TEXTAREA 1)" #endif #include "../lv_core/lv_obj.h" diff --git a/src/lv_widgets/lv_spinner.c b/src/lv_widgets/lv_spinner.c index 8e0e2dcd0..b7677d3fa 100644 --- a/src/lv_widgets/lv_spinner.c +++ b/src/lv_widgets/lv_spinner.c @@ -121,7 +121,7 @@ lv_obj_t * lv_spinner_create(lv_obj_t * par, const lv_obj_t * copy) *=====================*/ /** - * Set the length of the spinning arc in degrees + * Set the length of the spinning arc in degrees * @param spinner pointer to a spinner object * @param deg length of the arc */ diff --git a/src/lv_widgets/lv_spinner.h b/src/lv_widgets/lv_spinner.h index 6649202e4..dea008819 100644 --- a/src/lv_widgets/lv_spinner.h +++ b/src/lv_widgets/lv_spinner.h @@ -19,11 +19,11 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_ARC == 0 -#error "lv_spinner: lv_arc is required. Enable it in lv_conf.h (LV_USE_ARC 1) " +#error "lv_spinner: lv_arc is required. Enable it in lv_conf.h (LV_USE_ARC 1)" #endif #if LV_USE_ANIMATION == 0 -#error "lv_spinner: animations are required. Enable it in lv_conf.h (LV_USE_ANIMATION 1) " +#error "lv_spinner: animations are required. Enable it in lv_conf.h (LV_USE_ANIMATION 1)" #endif #include "../lv_core/lv_obj.h" @@ -95,7 +95,7 @@ lv_obj_t * lv_spinner_create(lv_obj_t * par, const lv_obj_t * copy); *=====================*/ /** - * Set the length of the spinning arc in degrees + * Set the length of the spinning arc in degrees * @param spinner pointer to a spinner object * @param deg length of the arc */ diff --git a/src/lv_widgets/lv_switch.c b/src/lv_widgets/lv_switch.c index 0a43def6f..9561b7bf7 100644 --- a/src/lv_widgets/lv_switch.c +++ b/src/lv_widgets/lv_switch.c @@ -12,7 +12,7 @@ /*Testing of dependencies*/ #if LV_USE_SLIDER == 0 - #error "lv_sw: lv_slider is required. Enable it in lv_conf.h (LV_USE_SLIDER 1) " + #error "lv_sw: lv_slider is required. Enable it in lv_conf.h (LV_USE_SLIDER 1)" #endif #include "../lv_misc/lv_debug.h" diff --git a/src/lv_widgets/lv_switch.h b/src/lv_widgets/lv_switch.h index 868951cc7..4869100a1 100644 --- a/src/lv_widgets/lv_switch.h +++ b/src/lv_widgets/lv_switch.h @@ -19,7 +19,7 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_SLIDER == 0 -#error "lv_sw: lv_slider is required. Enable it in lv_conf.h (LV_USE_SLIDER 1)" +#error "lv_sw: lv_slider is required. Enable it in lv_conf.h (LV_USE_SLIDER 1)" #endif #include "../lv_core/lv_obj.h" @@ -91,7 +91,7 @@ bool lv_switch_toggle(lv_obj_t * sw, lv_anim_enable_t anim); /** * Set the animation time of the switch - * @param sw pointer to a switch object + * @param sw pointer to a switch object * @param anim_time animation time * @return style pointer to a style */ @@ -116,7 +116,7 @@ static inline bool lv_switch_get_state(const lv_obj_t * sw) /** * Get the animation time of the switch - * @param sw pointer to a switch object + * @param sw pointer to a switch object * @return style pointer to a style */ static inline uint16_t lv_switch_get_anim_time(const lv_obj_t * sw) diff --git a/src/lv_widgets/lv_table.h b/src/lv_widgets/lv_table.h index ea00c45ed..a5b0ab575 100644 --- a/src/lv_widgets/lv_table.h +++ b/src/lv_widgets/lv_table.h @@ -19,7 +19,7 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_LABEL == 0 -#error "lv_table: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1) " +#error "lv_table: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1)" #endif #include "../lv_core/lv_obj.h" @@ -56,7 +56,7 @@ typedef union { struct { uint8_t align : 2; uint8_t right_merge : 1; - uint8_t type : 4; // upto 16 values + uint8_t type : 4; // up to 16 values uint8_t crop : 1; } s; uint8_t format_byte; @@ -78,7 +78,7 @@ uint16_t cell_types : /*Parts of the table*/ enum { LV_TABLE_PART_BG, /* Because of this member, LV_PART.*CELL1 has enum value of 1, */ - LV_TABLE_PART_CELL1, /* LV_PART.*CELL2 has an enum value of 2 and so on upto the maximum */ + LV_TABLE_PART_CELL1, /* LV_PART.*CELL2 has an enum value of 2 and so on up to the maximum */ LV_TABLE_PART_CELL2, /* number of styles specified by LV_TABLE_CELL_STYLE_CNT */ LV_TABLE_PART_CELL3, LV_TABLE_PART_CELL4, /* CELL 5-16 are not needed to be defined, the values in this enum diff --git a/src/lv_widgets/lv_tabview.c b/src/lv_widgets/lv_tabview.c index b7345c1f1..325dbae8c 100644 --- a/src/lv_widgets/lv_tabview.c +++ b/src/lv_widgets/lv_tabview.c @@ -223,7 +223,7 @@ lv_obj_t * lv_tabview_add_tab(lv_obj_t * tabview, const char * name) /*Extend the button matrix map with the new name*/ char * name_dm; - name_dm = lv_mem_alloc(strlen(name) + 1); /*+1 for the the closing '\0' */ + name_dm = lv_mem_alloc(strlen(name) + 1); /*+1 for the closing '\0' */ LV_ASSERT_MEM(name_dm); if(name_dm == NULL) return NULL; strcpy(name_dm, name); @@ -747,15 +747,15 @@ static lv_res_t tabview_scrl_signal(lv_obj_t * tabview_scrl, lv_signal_t sign, v if(tab_page == NULL) return LV_RES_OK; lv_coord_t page_x1 = tab_page->coords.x1 - tabview->coords.x1 + x_predict; lv_coord_t page_x2 = page_x1 + lv_obj_get_width(tabview); - lv_coord_t treshold = lv_obj_get_width(tabview) / 2; + lv_coord_t threshold = lv_obj_get_width(tabview) / 2; lv_bidi_dir_t base_dir = lv_obj_get_base_dir(tabview); int16_t tab_cur = ext->tab_cur; - if(page_x1 > treshold) { + if(page_x1 > threshold) { if(base_dir != LV_BIDI_DIR_RTL) tab_cur--; else tab_cur ++; } - else if(page_x2 < treshold) { + else if(page_x2 < threshold) { if(base_dir != LV_BIDI_DIR_RTL) tab_cur++; else tab_cur --; } diff --git a/src/lv_widgets/lv_tabview.h b/src/lv_widgets/lv_tabview.h index 6970d8e18..4254d29df 100644 --- a/src/lv_widgets/lv_tabview.h +++ b/src/lv_widgets/lv_tabview.h @@ -19,11 +19,11 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_BTNMATRIX == 0 -#error "lv_tabview: lv_btnm is required. Enable it in lv_conf.h (LV_USE_BTNMATRIX 1) " +#error "lv_tabview: lv_btnm is required. Enable it in lv_conf.h (LV_USE_BTNMATRIX 1)" #endif #if LV_USE_PAGE == 0 -#error "lv_tabview: lv_page is required. Enable it in lv_conf.h (LV_USE_PAGE 1) " +#error "lv_tabview: lv_page is required. Enable it in lv_conf.h (LV_USE_PAGE 1)" #endif #include "../lv_core/lv_obj.h" diff --git a/src/lv_widgets/lv_textarea.c b/src/lv_widgets/lv_textarea.c index 4b231f07a..58b1df001 100644 --- a/src/lv_widgets/lv_textarea.c +++ b/src/lv_widgets/lv_textarea.c @@ -688,7 +688,7 @@ void lv_textarea_set_cursor_hidden(lv_obj_t * ta, bool hide) } /** - * Enable/Disable the positioning of the the cursor by clicking the text on the text area. + * Enable/Disable the positioning of the cursor by clicking the text on the text area. * @param ta pointer to a text area object * @param en true: enable click positions; false: disable */ @@ -816,7 +816,7 @@ void lv_textarea_set_text_align(lv_obj_t * ta, lv_label_align_t align) /** * Set a list of characters. Only these characters will be accepted by the text area - * @param ta pointer to Text Area + * @param ta pointer to Text Area * @param list list of characters. Only the pointer is saved. E.g. "+-.,0123456789" */ void lv_textarea_set_accepted_chars(lv_obj_t * ta, const char * list) @@ -830,7 +830,7 @@ void lv_textarea_set_accepted_chars(lv_obj_t * ta, const char * list) /** * Set max length of a Text Area. - * @param ta pointer to Text Area + * @param ta pointer to Text Area * @param num the maximal number of characters can be added (`lv_textarea_set_text` ignores it) */ void lv_textarea_set_max_length(lv_obj_t * ta, uint32_t num) @@ -1058,7 +1058,7 @@ bool lv_textarea_get_one_line(const lv_obj_t * ta) /** * Get a list of accepted characters. - * @param ta pointer to Text Area + * @param ta pointer to Text Area * @return list of accented characters. */ const char * lv_textarea_get_accepted_chars(lv_obj_t * ta) @@ -1072,7 +1072,7 @@ const char * lv_textarea_get_accepted_chars(lv_obj_t * ta) /** * Set max length of a Text Area. - * @param ta pointer to Text Area + * @param ta pointer to Text Area * @return the maximal number of characters to be add */ uint32_t lv_textarea_get_max_length(lv_obj_t * ta) @@ -1301,7 +1301,7 @@ static lv_design_res_t lv_textarea_design(lv_obj_t * ta, const lv_area_t * clip_ /** * An extended scrollable design of the page. Calls the normal design function and draws a cursor. * @param scrl pointer to the scrollable part of the Text area - * @param clip_area the object will be drawn only in this area + * @param clip_area the object will be drawn only in this area * @param mode LV_DESIGN_COVER_CHK: only check if the object fully covers the 'mask_p' area * (return 'true' if yes) * LV_DESIGN_DRAW_MAIN: draw the object (always return 'true') diff --git a/src/lv_widgets/lv_textarea.h b/src/lv_widgets/lv_textarea.h index 5ccb8ac9a..258fb2c41 100644 --- a/src/lv_widgets/lv_textarea.h +++ b/src/lv_widgets/lv_textarea.h @@ -19,11 +19,11 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_PAGE == 0 -#error "lv_ta: lv_page is required. Enable it in lv_conf.h (LV_USE_PAGE 1) " +#error "lv_ta: lv_page is required. Enable it in lv_conf.h (LV_USE_PAGE 1)" #endif #if LV_USE_LABEL == 0 -#error "lv_ta: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1) " +#error "lv_ta: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1)" #endif #include "../lv_core/lv_obj.h" @@ -166,7 +166,7 @@ void lv_textarea_set_cursor_pos(lv_obj_t * ta, int32_t pos); void lv_textarea_set_cursor_hidden(lv_obj_t * ta, bool hide); /** - * Enable/Disable the positioning of the the cursor by clicking the text on the text area. + * Enable/Disable the positioning of the cursor by clicking the text on the text area. * @param ta pointer to a text area object * @param en true: enable click positions; false: disable */ @@ -197,14 +197,14 @@ void lv_textarea_set_text_align(lv_obj_t * ta, lv_label_align_t align); /** * Set a list of characters. Only these characters will be accepted by the text area - * @param ta pointer to Text Area + * @param ta pointer to Text Area * @param list list of characters. Only the pointer is saved. E.g. "+-.,0123456789" */ void lv_textarea_set_accepted_chars(lv_obj_t * ta, const char * list); /** * Set max length of a Text Area. - * @param ta pointer to Text Area + * @param ta pointer to Text Area * @param num the maximal number of characters can be added (`lv_textarea_set_text` ignores it) */ void lv_textarea_set_max_length(lv_obj_t * ta, uint32_t num); @@ -333,14 +333,14 @@ bool lv_textarea_get_one_line(const lv_obj_t * ta); /** * Get a list of accepted characters. - * @param ta pointer to Text Area + * @param ta pointer to Text Area * @return list of accented characters. */ const char * lv_textarea_get_accepted_chars(lv_obj_t * ta); /** * Get max length of a Text Area. - * @param ta pointer to Text Area + * @param ta pointer to Text Area * @return the maximal number of characters to be add */ uint32_t lv_textarea_get_max_length(lv_obj_t * ta); diff --git a/src/lv_widgets/lv_win.c b/src/lv_widgets/lv_win.c index e744a915e..83ba6973d 100644 --- a/src/lv_widgets/lv_win.c +++ b/src/lv_widgets/lv_win.c @@ -439,7 +439,7 @@ lv_coord_t lv_win_get_btn_width(lv_obj_t * win) } /** - * Get the pointer of a widow from one of its control button. + * Get the pointer of a widow from one of its control button. * It is useful in the action of the control buttons where only button is known. * @param ctrl_btn pointer to a control button of a window * @return pointer to the window of 'ctrl_btn' diff --git a/src/lv_widgets/lv_win.h b/src/lv_widgets/lv_win.h index ac1f7b1cb..09236d1cc 100644 --- a/src/lv_widgets/lv_win.h +++ b/src/lv_widgets/lv_win.h @@ -19,19 +19,19 @@ extern "C" { /*Testing of dependencies*/ #if LV_USE_BTN == 0 -#error "lv_win: lv_btn is required. Enable it in lv_conf.h (LV_USE_BTN 1) " +#error "lv_win: lv_btn is required. Enable it in lv_conf.h (LV_USE_BTN 1)" #endif #if LV_USE_LABEL == 0 -#error "lv_win: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1) " +#error "lv_win: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1)" #endif #if LV_USE_IMG == 0 -#error "lv_win: lv_img is required. Enable it in lv_conf.h (LV_USE_IMG 1) " +#error "lv_win: lv_img is required. Enable it in lv_conf.h (LV_USE_IMG 1)" #endif #if LV_USE_PAGE == 0 -#error "lv_win: lv_page is required. Enable it in lv_conf.h (LV_USE_PAGE 1) " +#error "lv_win: lv_page is required. Enable it in lv_conf.h (LV_USE_PAGE 1)" #endif #include "../lv_core/lv_obj.h" @@ -216,7 +216,7 @@ lv_coord_t lv_win_get_header_height(const lv_obj_t * win); lv_coord_t lv_win_get_btn_width(lv_obj_t * win); /** - * Get the pointer of a widow from one of its control button. + * Get the pointer of a widow from one of its control button. * It is useful in the action of the control buttons where only button is known. * @param ctrl_btn pointer to a control button of a window * @return pointer to the window of 'ctrl_btn' diff --git a/tests/build.py b/tests/build.py index 2f54b2932..43b613447 100755 --- a/tests/build.py +++ b/tests/build.py @@ -34,7 +34,7 @@ def build(name, defines): print("---------------------------") ret = os.system(cmd) if(ret != 0): - print("BUILD ERROR! (error code " + str(ret) + ")") + print("BUILD ERROR! (error code " + str(ret) + ")") exit(1) print("---------------------------") @@ -42,7 +42,7 @@ def build(name, defines): print("---------------------------") ret = os.system("./test.bin") if(ret != 0): - print("RUN ERROR! (error code " + str(ret) + ")") + print("RUN ERROR! (error code " + str(ret) + ")") exit(1) print("---------------------------") diff --git a/tests/lv_test_core/lv_test_style.c b/tests/lv_test_core/lv_test_style.c index d36676670..f0ddf7b6d 100644 --- a/tests/lv_test_core/lv_test_style.c +++ b/tests/lv_test_core/lv_test_style.c @@ -147,7 +147,7 @@ static void add_remove_read_prop(void) lv_test_assert_int_eq(LV_RES_OK, found, "Get an existing 'color' property"); lv_test_assert_color_eq(LV_COLOR_RED, color, "Get the value of a 'color' property"); - lv_test_print("Reset the the style"); + lv_test_print("Reset the style"); lv_style_reset(&style); found = _lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'int' property from a reseted style"); @@ -414,7 +414,7 @@ static void mem_leak(void) { lv_test_print(""); - lv_test_print("Test style set, add, remove memory leak"); + lv_test_print("Test style set, add, remove memory leak"); lv_test_print("----------------------------------------"); lv_mem_monitor_t mon_start; From a637f415d77053782cc18c12e9c6d0fb0240ac1f Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 18 Jan 2021 00:13:42 -0800 Subject: [PATCH 54/62] Fix minor issue found in color module (#2024) * fix(color): Return the opposite value in lv_color_premult when LV_COLOR_DEPTH equals 1 and correct the comment too * fix(color): Correct the comment and alignment issue * fix(color): Remove LV_COLOR_[SET|GET]_G16_SWAP to simplify LV_COLOR_16_SWAP process * fix(color): Correct the cast usage * fix(color): Remove LV_MATH_ABS in lv_color_rgb_to_hsv since delta can never become a negative number * fix(color): Align LV_COLOR_[SET|GET]_A1 with other similar macro --- src/lv_misc/lv_color.c | 7 +- src/lv_misc/lv_color.h | 145 +++++++++++++++++++---------------------- 2 files changed, 68 insertions(+), 84 deletions(-) diff --git a/src/lv_misc/lv_color.c b/src/lv_misc/lv_color.c index f48bff581..11f33618b 100644 --- a/src/lv_misc/lv_color.c +++ b/src/lv_misc/lv_color.c @@ -7,7 +7,6 @@ * INCLUDES *********************/ #include "lv_color.h" -#include "lv_math.h" /********************* * DEFINES @@ -33,10 +32,6 @@ * GLOBAL FUNCTIONS **********************/ -/********************** - * STATIC FUNCTIONS - **********************/ - LV_ATTRIBUTE_FAST_MEM void lv_color_fill(lv_color_t * buf, lv_color_t color, uint32_t px_num) { #if LV_COLOR_DEPTH == 16 @@ -224,7 +219,7 @@ lv_color_hsv_t lv_color_rgb_to_hsv(uint8_t r8, uint8_t g8, uint8_t b8) hsv.v = (100 * rgbMax) >> 10; int32_t delta = rgbMax - rgbMin; - if(LV_MATH_ABS(delta) < 3) { + if(delta < 3) { hsv.h = 0; hsv.s = 0; return hsv; diff --git a/src/lv_misc/lv_color.h b/src/lv_misc/lv_color.h index d0271b0d3..942139678 100644 --- a/src/lv_misc/lv_color.h +++ b/src/lv_misc/lv_color.h @@ -18,7 +18,7 @@ extern "C" { /*Error checking*/ #if LV_COLOR_DEPTH == 24 -#error "LV_COLOR_DEPTH 24 is deprecated. Use LV_COLOR_DEPTH 32 instead (lv_conf.h)" +#error "LV_COLOR_DEPTH 24 is deprecated. Use LV_COLOR_DEPTH 32 instead (lv_conf.h)" #endif #if LV_COLOR_DEPTH != 32 && LV_COLOR_SCREEN_TRANSP != 0 @@ -34,24 +34,24 @@ extern "C" { /********************* * DEFINES *********************/ -#define LV_COLOR_WHITE LV_COLOR_MAKE(0xFF, 0xFF, 0xFF) -#define LV_COLOR_SILVER LV_COLOR_MAKE(0xC0, 0xC0, 0xC0) -#define LV_COLOR_GRAY LV_COLOR_MAKE(0x80, 0x80, 0x80) -#define LV_COLOR_BLACK LV_COLOR_MAKE(0x00, 0x00, 0x00) -#define LV_COLOR_RED LV_COLOR_MAKE(0xFF, 0x00, 0x00) -#define LV_COLOR_MAROON LV_COLOR_MAKE(0x80, 0x00, 0x00) -#define LV_COLOR_YELLOW LV_COLOR_MAKE(0xFF, 0xFF, 0x00) -#define LV_COLOR_OLIVE LV_COLOR_MAKE(0x80, 0x80, 0x00) -#define LV_COLOR_LIME LV_COLOR_MAKE(0x00, 0xFF, 0x00) -#define LV_COLOR_GREEN LV_COLOR_MAKE(0x00, 0x80, 0x00) -#define LV_COLOR_CYAN LV_COLOR_MAKE(0x00, 0xFF, 0xFF) -#define LV_COLOR_AQUA LV_COLOR_CYAN -#define LV_COLOR_TEAL LV_COLOR_MAKE(0x00, 0x80, 0x80) -#define LV_COLOR_BLUE LV_COLOR_MAKE(0x00, 0x00, 0xFF) -#define LV_COLOR_NAVY LV_COLOR_MAKE(0x00, 0x00, 0x80) +#define LV_COLOR_WHITE LV_COLOR_MAKE(0xFF, 0xFF, 0xFF) +#define LV_COLOR_SILVER LV_COLOR_MAKE(0xC0, 0xC0, 0xC0) +#define LV_COLOR_GRAY LV_COLOR_MAKE(0x80, 0x80, 0x80) +#define LV_COLOR_BLACK LV_COLOR_MAKE(0x00, 0x00, 0x00) +#define LV_COLOR_RED LV_COLOR_MAKE(0xFF, 0x00, 0x00) +#define LV_COLOR_MAROON LV_COLOR_MAKE(0x80, 0x00, 0x00) +#define LV_COLOR_YELLOW LV_COLOR_MAKE(0xFF, 0xFF, 0x00) +#define LV_COLOR_OLIVE LV_COLOR_MAKE(0x80, 0x80, 0x00) +#define LV_COLOR_LIME LV_COLOR_MAKE(0x00, 0xFF, 0x00) +#define LV_COLOR_GREEN LV_COLOR_MAKE(0x00, 0x80, 0x00) +#define LV_COLOR_CYAN LV_COLOR_MAKE(0x00, 0xFF, 0xFF) +#define LV_COLOR_AQUA LV_COLOR_CYAN +#define LV_COLOR_TEAL LV_COLOR_MAKE(0x00, 0x80, 0x80) +#define LV_COLOR_BLUE LV_COLOR_MAKE(0x00, 0x00, 0xFF) +#define LV_COLOR_NAVY LV_COLOR_MAKE(0x00, 0x00, 0x80) #define LV_COLOR_MAGENTA LV_COLOR_MAKE(0xFF, 0x00, 0xFF) -#define LV_COLOR_PURPLE LV_COLOR_MAKE(0x80, 0x00, 0x80) -#define LV_COLOR_ORANGE LV_COLOR_MAKE(0xFF, 0xA5, 0x00) +#define LV_COLOR_PURPLE LV_COLOR_MAKE(0x80, 0x00, 0x80) +#define LV_COLOR_ORANGE LV_COLOR_MAKE(0xFF, 0xA5, 0x00) /** * Opacity percentages. @@ -110,16 +110,16 @@ enum { # define LV_COLOR_SET_R1(c, v) (c).ch.red = (uint8_t)((v) & 0x1) # define LV_COLOR_SET_G1(c, v) (c).ch.green = (uint8_t)((v) & 0x1) # define LV_COLOR_SET_B1(c, v) (c).ch.blue = (uint8_t)((v) & 0x1) -# define LV_COLOR_SET_A1(c, v) +# define LV_COLOR_SET_A1(c, v) do {} while(0) # define LV_COLOR_GET_R1(c) (c).ch.red # define LV_COLOR_GET_G1(c) (c).ch.green # define LV_COLOR_GET_B1(c) (c).ch.blue -# define LV_COLOR_GET_A1(c) 1 +# define LV_COLOR_GET_A1(c) 0xFF -# define LV_COLOR_SET_R8(c, v) (c).ch.red = (uint8_t)(v) & 0x7U -# define LV_COLOR_SET_G8(c, v) (c).ch.green = (uint8_t)(v) & 0x7U -# define LV_COLOR_SET_B8(c, v) (c).ch.blue = (uint8_t)(v) & 0x3U +# define LV_COLOR_SET_R8(c, v) (c).ch.red = (uint8_t)((v) & 0x7U) +# define LV_COLOR_SET_G8(c, v) (c).ch.green = (uint8_t)((v) & 0x7U) +# define LV_COLOR_SET_B8(c, v) (c).ch.blue = (uint8_t)((v) & 0x3U) # define LV_COLOR_SET_A8(c, v) do {} while(0) # define LV_COLOR_GET_R8(c) (c).ch.red @@ -127,22 +127,28 @@ enum { # define LV_COLOR_GET_B8(c) (c).ch.blue # define LV_COLOR_GET_A8(c) 0xFF -# define LV_COLOR_SET_R16(c, v) (c).ch.red = (uint8_t)(v) & 0x1FU -# define LV_COLOR_SET_G16(c, v) (c).ch.green = (uint8_t)(v) & 0x3FU -# define LV_COLOR_SET_G16_SWAP(c, v) {(c).ch.green_h = (uint8_t)(((v) >> 3) & 0x7); (c).ch.green_l = (uint8_t)((v) & 0x7);} -# define LV_COLOR_SET_B16(c, v) (c).ch.blue = (uint8_t)(v) & 0x1FU +# define LV_COLOR_SET_R16(c, v) (c).ch.red = (uint8_t)((v) & 0x1FU) +#if LV_COLOR_16_SWAP == 0 +# define LV_COLOR_SET_G16(c, v) (c).ch.green = (uint8_t)((v) & 0x3FU) +#else +# define LV_COLOR_SET_G16(c, v) {(c).ch.green_h = (uint8_t)(((v) >> 3) & 0x7); (c).ch.green_l = (uint8_t)((v) & 0x7);} +#endif +# define LV_COLOR_SET_B16(c, v) (c).ch.blue = (uint8_t)((v) & 0x1FU) # define LV_COLOR_SET_A16(c, v) do {} while(0) # define LV_COLOR_GET_R16(c) (c).ch.red +#if LV_COLOR_16_SWAP == 0 # define LV_COLOR_GET_G16(c) (c).ch.green -# define LV_COLOR_GET_G16_SWAP(c) (((c).ch.green_h << 3) + (c).ch.green_l) +#else +# define LV_COLOR_GET_G16(c) (((c).ch.green_h << 3) + (c).ch.green_l) +#endif # define LV_COLOR_GET_B16(c) (c).ch.blue # define LV_COLOR_GET_A16(c) 0xFF -# define LV_COLOR_SET_R32(c, v) (c).ch.red = (uint32_t)((v) & 0xFF) -# define LV_COLOR_SET_G32(c, v) (c).ch.green = (uint32_t)((v) & 0xFF) -# define LV_COLOR_SET_B32(c, v) (c).ch.blue = (uint32_t)((v) & 0xFF) -# define LV_COLOR_SET_A32(c, v) (c).ch.alpha = (uint32_t)((v) & 0xFF) +# define LV_COLOR_SET_R32(c, v) (c).ch.red = (uint8_t)((v) & 0xFF) +# define LV_COLOR_SET_G32(c, v) (c).ch.green = (uint8_t)((v) & 0xFF) +# define LV_COLOR_SET_B32(c, v) (c).ch.blue = (uint8_t)((v) & 0xFF) +# define LV_COLOR_SET_A32(c, v) (c).ch.alpha = (uint8_t)((v) & 0xFF) # define LV_COLOR_GET_R32(c) (c).ch.red # define LV_COLOR_GET_G32(c) (c).ch.green @@ -177,22 +183,14 @@ enum { #elif LV_COLOR_DEPTH == 16 # define LV_COLOR_SET_R(c, v) LV_COLOR_SET_R16(c,v) -# if LV_COLOR_16_SWAP == 0 -# define LV_COLOR_SET_G(c, v) LV_COLOR_SET_G16(c,v) -# else -# define LV_COLOR_SET_G(c, v) LV_COLOR_SET_G16_SWAP(c,v) -# endif +# define LV_COLOR_SET_G(c, v) LV_COLOR_SET_G16(c,v) # define LV_COLOR_SET_B(c, v) LV_COLOR_SET_B16(c,v) # define LV_COLOR_SET_A(c, v) LV_COLOR_SET_A16(c,v) # define LV_COLOR_GET_R(c) LV_COLOR_GET_R16(c) -# if LV_COLOR_16_SWAP == 0 -# define LV_COLOR_GET_G(c) LV_COLOR_GET_G16(c) -# else -# define LV_COLOR_GET_G(c) LV_COLOR_GET_G16_SWAP(c) -# endif -# define LV_COLOR_GET_B(c) LV_COLOR_GET_B16(c) -# define LV_COLOR_GET_A(c) LV_COLOR_GET_A16(c) +# define LV_COLOR_GET_G(c) LV_COLOR_GET_G16(c) +# define LV_COLOR_GET_B(c) LV_COLOR_GET_B16(c) +# define LV_COLOR_GET_A(c) LV_COLOR_GET_A16(c) #elif LV_COLOR_DEPTH == 32 # define LV_COLOR_SET_R(c, v) LV_COLOR_SET_R32(c,v) @@ -296,12 +294,12 @@ typedef uint8_t lv_opa_t; /*In color conversations: * - When converting to bigger color type the LSB weight of 1 LSB is calculated * E.g. 16 bit Red has 5 bits - * 8 bit Red has 2 bits + * 8 bit Red has 3 bits * ---------------------- - * 8 bit red LSB = (2^5 - 1) / (2^2 - 1) = 31 / 3 = 10 + * 8 bit red LSB = (2^5 - 1) / (2^3 - 1) = 31 / 7 = 4 * * - When calculating to smaller color type simply shift out the LSBs - * E.g. 8 bit Red has 2 bits + * E.g. 8 bit Red has 3 bits * 16 bit Red has 5 bits * ---------------------- * Shift right with 5 - 3 = 2 @@ -345,15 +343,15 @@ static inline uint8_t lv_color_to8(lv_color_t color) return color.full; #elif LV_COLOR_DEPTH == 16 lv_color8_t ret; - LV_COLOR_SET_R8(ret, LV_COLOR_GET_R(color) >> 2); /* 5 - 3 = 2*/ + LV_COLOR_SET_R8(ret, LV_COLOR_GET_R(color) >> 2); /* 5 - 3 = 2*/ LV_COLOR_SET_G8(ret, LV_COLOR_GET_G(color) >> 3); /* 6 - 3 = 3*/ - LV_COLOR_SET_B8(ret, LV_COLOR_GET_B(color) >> 3); /* 5 - 2 = 3*/ + LV_COLOR_SET_B8(ret, LV_COLOR_GET_B(color) >> 3); /* 5 - 2 = 3*/ return ret.full; #elif LV_COLOR_DEPTH == 32 lv_color8_t ret; - LV_COLOR_SET_R8(ret, LV_COLOR_GET_R(color) >> 5); /* 8 - 3 = 5*/ + LV_COLOR_SET_R8(ret, LV_COLOR_GET_R(color) >> 5); /* 8 - 3 = 5*/ LV_COLOR_SET_G8(ret, LV_COLOR_GET_G(color) >> 5); /* 8 - 3 = 5*/ - LV_COLOR_SET_B8(ret, LV_COLOR_GET_B(color) >> 6); /* 8 - 2 = 6*/ + LV_COLOR_SET_B8(ret, LV_COLOR_GET_B(color) >> 6); /* 8 - 2 = 6*/ return ret.full; #endif } @@ -367,26 +365,17 @@ static inline uint16_t lv_color_to16(lv_color_t color) return 0xFFFF; #elif LV_COLOR_DEPTH == 8 lv_color16_t ret; - LV_COLOR_SET_R16(ret, LV_COLOR_GET_R(color) * 4); /*(2^5 - 1)/(2^3 - 1) = 31/7 = 4*/ -#if LV_COLOR_16_SWAP == 0 - LV_COLOR_SET_G16(ret, LV_COLOR_GET_G(color) * 9); /*(2^6 - 1)/(2^3 - 1) = 63/7 = 9*/ -#else - LV_COLOR_SET_G16_SWAP(ret, (LV_COLOR_GET_G(color) * 9)); /*(2^6 - 1)/(2^3 - 1) = 63/7 = 9*/ -#endif - LV_COLOR_SET_B16(ret, LV_COLOR_GET_B(color) * 10); /*(2^5 - 1)/(2^2 - 1) = 31/3 = 10*/ + LV_COLOR_SET_R16(ret, LV_COLOR_GET_R(color) * 4); /*(2^5 - 1)/(2^3 - 1) = 31/7 = 4*/ + LV_COLOR_SET_G16(ret, LV_COLOR_GET_G(color) * 9); /*(2^6 - 1)/(2^3 - 1) = 63/7 = 9*/ + LV_COLOR_SET_B16(ret, LV_COLOR_GET_B(color) * 10); /*(2^5 - 1)/(2^2 - 1) = 31/3 = 10*/ return ret.full; #elif LV_COLOR_DEPTH == 16 return color.full; #elif LV_COLOR_DEPTH == 32 lv_color16_t ret; - LV_COLOR_SET_R16(ret, LV_COLOR_GET_R(color) >> 3); /* 8 - 5 = 3*/ - -#if LV_COLOR_16_SWAP == 0 + LV_COLOR_SET_R16(ret, LV_COLOR_GET_R(color) >> 3); /* 8 - 5 = 3*/ LV_COLOR_SET_G16(ret, LV_COLOR_GET_G(color) >> 2); /* 8 - 6 = 2*/ -#else - LV_COLOR_SET_G16_SWAP(ret, ret.ch.green_h = (LV_COLOR_GET_G(color) >> 2); /*(2^6 - 1)/(2^3 - 1) = 63/7 = 9*/ -#endif - LV_COLOR_SET_B16(ret, LV_COLOR_GET_B(color) >> 3); /* 8 - 5 = 3*/ + LV_COLOR_SET_B16(ret, LV_COLOR_GET_B(color) >> 3); /* 8 - 5 = 3*/ return ret.full; #endif } @@ -400,9 +389,9 @@ static inline uint32_t lv_color_to32(lv_color_t color) return 0xFFFFFFFF; #elif LV_COLOR_DEPTH == 8 lv_color32_t ret; - LV_COLOR_SET_R32(ret, LV_COLOR_GET_R(color) * 36); /*(2^8 - 1)/(2^3 - 1) = 255/7 = 36*/ + LV_COLOR_SET_R32(ret, LV_COLOR_GET_R(color) * 36); /*(2^8 - 1)/(2^3 - 1) = 255/7 = 36*/ LV_COLOR_SET_G32(ret, LV_COLOR_GET_G(color) * 36); /*(2^8 - 1)/(2^3 - 1) = 255/7 = 36*/ - LV_COLOR_SET_B32(ret, LV_COLOR_GET_B(color) * 85); /*(2^8 - 1)/(2^2 - 1) = 255/3 = 85*/ + LV_COLOR_SET_B32(ret, LV_COLOR_GET_B(color) * 85); /*(2^8 - 1)/(2^2 - 1) = 255/3 = 85*/ LV_COLOR_SET_A32(ret, 0xFF); return ret.full; #elif LV_COLOR_DEPTH == 16 @@ -493,9 +482,9 @@ LV_ATTRIBUTE_FAST_MEM static inline void lv_color_premult(lv_color_t c, uint8_t /** * Mix two colors with a given ratio. It runs faster then `lv_color_mix` but requires some pre computation. - * @param c1 The first color. Should be preprocessed with `lv_color_premult(c1)` + * @param premult_c1 The first color. Should be preprocessed with `lv_color_premult(c1)` * @param c2 The second color. As it is no pre computation required on it - * @param mix The ratio of the colors. 0: full `c2`, 255: full `c1`, 127: half `c1` and half `c2`. + * @param mix The ratio of the colors. 0: full `c1`, 255: full `c2`, 127: half `c1` and half `c2`. * Should be modified like mix = `255 - mix` * @return the mixed color * @note 255 won't give clearly `c1`. @@ -505,9 +494,9 @@ LV_ATTRIBUTE_FAST_MEM static inline lv_color_t lv_color_mix_premult(uint16_t * p lv_color_t ret; #if LV_COLOR_DEPTH != 1 /*LV_COLOR_DEPTH == 8, 16 or 32*/ - LV_COLOR_SET_R(ret, LV_MATH_UDIV255((uint16_t) premult_c1[0] + LV_COLOR_GET_R(c2) * mix + LV_COLOR_MIX_ROUND_OFS)); - LV_COLOR_SET_G(ret, LV_MATH_UDIV255((uint16_t) premult_c1[1] + LV_COLOR_GET_G(c2) * mix + LV_COLOR_MIX_ROUND_OFS)); - LV_COLOR_SET_B(ret, LV_MATH_UDIV255((uint16_t) premult_c1[2] + LV_COLOR_GET_B(c2) * mix + LV_COLOR_MIX_ROUND_OFS)); + LV_COLOR_SET_R(ret, LV_MATH_UDIV255(premult_c1[0] + LV_COLOR_GET_R(c2) * mix + LV_COLOR_MIX_ROUND_OFS)); + LV_COLOR_SET_G(ret, LV_MATH_UDIV255(premult_c1[1] + LV_COLOR_GET_G(c2) * mix + LV_COLOR_MIX_ROUND_OFS)); + LV_COLOR_SET_B(ret, LV_MATH_UDIV255(premult_c1[2] + LV_COLOR_GET_B(c2) * mix + LV_COLOR_MIX_ROUND_OFS)); LV_COLOR_SET_A(ret, 0xFF); #else /*LV_COLOR_DEPTH == 1*/ @@ -516,14 +505,14 @@ LV_ATTRIBUTE_FAST_MEM static inline lv_color_t lv_color_mix_premult(uint16_t * p LV_COLOR_SET_R(c1, premult_c1[0]); LV_COLOR_SET_G(c1, premult_c1[1]); LV_COLOR_SET_B(c1, premult_c1[2]); - ret.full = mix > LV_OPA_50 ? c1.full : c2.full; + ret.full = mix > LV_OPA_50 ? c2.full : c1.full; #endif return ret; } /** - * Mix two colors. Both color can have alpha value. It requires ARGB888 colors. + * Mix two colors. Both color can have alpha value. * @param bg_color background color * @param bg_opa alpha of the background color * @param fg_color foreground color @@ -574,7 +563,7 @@ LV_ATTRIBUTE_FAST_MEM static inline void lv_color_mix_with_alpha(lv_color_t bg_c ; } lv_opa_t ratio = (uint16_t)((uint16_t)fg_opa * 255) / res_opa_saved; - res_color_saved = lv_color_mix(fg_color, bg_color, ratio); + res_color_saved = lv_color_mix(fg_color, bg_color, ratio); } @@ -633,9 +622,9 @@ static inline uint8_t lv_color_brightness(lv_color_t color) #define LV_COLOR_MAKE(r8, g8, b8) (_LV_COLOR_MAKE_TYPE_HELPER{{(uint8_t)((b8 >> 6) & 0x3U), (uint8_t)((g8 >> 5) & 0x7U), (uint8_t)((r8 >> 5) & 0x7U)}}) #elif LV_COLOR_DEPTH == 16 #if LV_COLOR_16_SWAP == 0 -#define LV_COLOR_MAKE(r8, g8, b8) (_LV_COLOR_MAKE_TYPE_HELPER{{(uint16_t)((b8 >> 3) & 0x1FU), (uint16_t)((g8 >> 2) & 0x3FU), (uint16_t)((r8 >> 3) & 0x1FU)}}) +#define LV_COLOR_MAKE(r8, g8, b8) (_LV_COLOR_MAKE_TYPE_HELPER{{(uint8_t)((b8 >> 3) & 0x1FU), (uint8_t)((g8 >> 2) & 0x3FU), (uint8_t)((r8 >> 3) & 0x1FU)}}) #else -#define LV_COLOR_MAKE(r8, g8, b8) (_LV_COLOR_MAKE_TYPE_HELPER{{(uint16_t)((g8 >> 5) & 0x7U), (uint16_t)((r8 >> 3) & 0x1FU), (uint16_t)((b8 >> 3) & 0x1FU), (uint16_t)((g8 >> 2) & 0x7U)}}) +#define LV_COLOR_MAKE(r8, g8, b8) (_LV_COLOR_MAKE_TYPE_HELPER{{(uint8_t)((g8 >> 5) & 0x7U), (uint8_t)((r8 >> 3) & 0x1FU), (uint8_t)((b8 >> 3) & 0x1FU), (uint8_t)((g8 >> 2) & 0x7U)}}) #endif #elif LV_COLOR_DEPTH == 32 #define LV_COLOR_MAKE(r8, g8, b8) (_LV_COLOR_MAKE_TYPE_HELPER{{b8, g8, r8, 0xff}}) /*Fix 0xff alpha*/ @@ -699,4 +688,4 @@ lv_color_hsv_t lv_color_to_hsv(lv_color_t color); } /* extern "C" */ #endif -#endif /*USE_COLOR*/ +#endif /*LV_COLOR_H*/ From 60be7c1ceecf26bcc7413e80ddb2f154a5f6b5e5 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 19 Jan 2021 01:08:30 -0800 Subject: [PATCH 55/62] Fix minor issues found in task module (#2029) * fix(task): Remove the unnecessary cast and init and correct the comment too * fix(task): Implement lv_task_create directly to avoid lv_task_set_prio which is a time consuming operation. * fix(task): Exclude the return value computing from the idle time and change handler_start and time_till_next to local variables * fix(task): Remove zero task_deleted and task_created in lv_task_exec since the loop in lv_task_handler already do the same thing --- src/lv_misc/lv_task.c | 100 +++++++++++++++++------------------------- src/lv_misc/lv_task.h | 6 +-- 2 files changed, 44 insertions(+), 62 deletions(-) diff --git a/src/lv_misc/lv_task.c b/src/lv_misc/lv_task.c index c54c41817..147ada68e 100644 --- a/src/lv_misc/lv_task.c +++ b/src/lv_misc/lv_task.c @@ -1,6 +1,6 @@ /** * @file lv_task.c - * An 'lv_task' is a void (*fp) (void* param) type function which will be called periodically. + * An 'lv_task' is a void (*fp) (struct _lv_task_t* param) type function which will be called periodically. * A priority (5 levels + disable) can be assigned to lv_tasks. */ @@ -54,7 +54,6 @@ void _lv_task_core_init(void) { _lv_ll_init(&LV_GC_ROOT(_lv_task_ll), sizeof(lv_task_t)); - task_list_changed = false; /*Initially enable the lv_task handling*/ lv_task_enable(true); } @@ -65,7 +64,6 @@ void _lv_task_core_init(void) */ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) { - LV_LOG_TRACE("lv_task_handler started"); /*Avoid concurrent running of the task handler*/ @@ -73,17 +71,15 @@ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) if(already_running) return 1; already_running = true; - static uint32_t idle_period_start = 0; - static uint32_t handler_start = 0; - static uint32_t busy_time = 0; - static uint32_t time_till_next; - if(lv_task_run == false) { already_running = false; /*Release mutex*/ return 1; } - handler_start = lv_tick_get(); + static uint32_t idle_period_start = 0; + static uint32_t busy_time = 0; + + uint32_t handler_start = lv_tick_get(); /* Run all task from the highest to the lowest priority * If a lower priority task is executed check task again from the highest priority @@ -95,6 +91,7 @@ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) end_flag = true; task_deleted = false; task_created = false; + task_list_changed = false; LV_GC_ROOT(_lv_task_act) = _lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll)); while(LV_GC_ROOT(_lv_task_act)) { /* The task might be deleted if it runs only once ('once = 1') @@ -102,7 +99,7 @@ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) next = _lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), LV_GC_ROOT(_lv_task_act)); /*We reach priority of the turned off task. There is nothing more to do.*/ - if(((lv_task_t *)LV_GC_ROOT(_lv_task_act))->prio == LV_TASK_PRIO_OFF) { + if(LV_GC_ROOT(_lv_task_act)->prio == LV_TASK_PRIO_OFF) { break; } @@ -115,12 +112,12 @@ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) } /*Just try to run the tasks with highest priority.*/ - if(((lv_task_t *)LV_GC_ROOT(_lv_task_act))->prio == LV_TASK_PRIO_HIGHEST) { + if(LV_GC_ROOT(_lv_task_act)->prio == LV_TASK_PRIO_HIGHEST) { lv_task_exec(LV_GC_ROOT(_lv_task_act)); } /*Tasks with higher priority than the interrupted shall be run in every case*/ else if(task_interrupter) { - if(((lv_task_t *)LV_GC_ROOT(_lv_task_act))->prio > task_interrupter->prio) { + if(LV_GC_ROOT(_lv_task_act)->prio > task_interrupter->prio) { if(lv_task_exec(LV_GC_ROOT(_lv_task_act))) { if(!task_created && !task_deleted) { /*Check all tasks again from the highest priority */ @@ -152,7 +149,6 @@ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) if(task_list_changed) { task_interrupter = NULL; end_flag = false; - task_list_changed = false; break; } @@ -160,28 +156,25 @@ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) } } while(!end_flag); + uint32_t time_till_next = LV_NO_TASK_READY; + next = _lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll)); + while(next && next->prio != LV_TASK_PRIO_OFF) { + uint32_t delay = lv_task_time_remaining(next); + if(delay < time_till_next) + time_till_next = delay; + + next = _lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), next); /*Find the next task*/ + } + busy_time += lv_tick_elaps(handler_start); uint32_t idle_period_time = lv_tick_elaps(idle_period_start); if(idle_period_time >= IDLE_MEAS_PERIOD) { - - idle_last = (uint32_t)((uint32_t)busy_time * 100) / IDLE_MEAS_PERIOD; /*Calculate the busy percentage*/ - idle_last = idle_last > 100 ? 0 : 100 - idle_last; /*But we need idle time*/ + idle_last = (busy_time * 100) / idle_period_time; /*Calculate the busy percentage*/ + idle_last = idle_last > 100 ? 0 : 100 - idle_last; /*But we need idle time*/ busy_time = 0; idle_period_start = lv_tick_get(); } - time_till_next = LV_NO_TASK_READY; - next = _lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll)); - while(next) { - if(next->prio != LV_TASK_PRIO_OFF) { - uint32_t delay = lv_task_time_remaining(next); - if(delay < time_till_next) - time_till_next = delay; - } - - next = _lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), next); /*Find the next task*/ - } - already_running = false; /*Release the mutex*/ LV_LOG_TRACE("lv_task_handler ready"); @@ -193,6 +186,21 @@ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) * @return pointer to the created task */ lv_task_t * lv_task_create_basic(void) +{ + return lv_task_create(NULL, DEF_PERIOD, DEF_PRIO, NULL); +} + +/** + * Create a new lv_task + * @param task_xcb a callback which is the task itself. It will be called periodically. + * (the 'x' in the argument name indicates that its not a fully generic function because it not follows + * the `func_name(object, callback, ...)` convention) + * @param period call period in ms unit + * @param prio priority of the task (LV_TASK_PRIO_OFF means the task is stopped) + * @param user_data custom parameter + * @return pointer to the new task + */ +lv_task_t * lv_task_create(lv_task_cb_t task_xcb, uint32_t period, lv_task_prio_t prio, void * user_data) { lv_task_t * new_task = NULL; lv_task_t * tmp; @@ -209,7 +217,7 @@ lv_task_t * lv_task_create_basic(void) /*Insert the new task to proper place according to its priority*/ else { do { - if(tmp->prio <= DEF_PRIO) { + if(tmp->prio <= prio) { new_task = _lv_ll_ins_prev(&LV_GC_ROOT(_lv_task_ll), tmp); LV_ASSERT_MEM(new_task); if(new_task == NULL) return NULL; @@ -227,44 +235,20 @@ lv_task_t * lv_task_create_basic(void) } task_list_changed = true; - new_task->period = DEF_PERIOD; - new_task->task_cb = NULL; - new_task->prio = DEF_PRIO; + new_task->period = period; + new_task->task_cb = task_xcb; + new_task->prio = prio; new_task->repeat_count = -1; new_task->last_run = lv_tick_get(); - new_task->user_data = NULL; + new_task->user_data = user_data; task_created = true; return new_task; } -/** - * Create a new lv_task - * @param task_xcb a callback which is the task itself. It will be called periodically. - * (the 'x' in the argument name indicates that its not a fully generic function because it not follows - * the `func_name(object, callback, ...)` convention) - * @param period call period in ms unit - * @param prio priority of the task (LV_TASK_PRIO_OFF means the task is stopped) - * @param user_data custom parameter - * @return pointer to the new task - */ -lv_task_t * lv_task_create(lv_task_cb_t task_xcb, uint32_t period, lv_task_prio_t prio, void * user_data) -{ - lv_task_t * new_task = lv_task_create_basic(); - LV_ASSERT_MEM(new_task); - if(new_task == NULL) return NULL; - - lv_task_set_cb(new_task, task_xcb); - lv_task_set_period(new_task, period); - lv_task_set_prio(new_task, prio); - new_task->user_data = user_data; - - return new_task; -} - /** * Set the callback the task (the function to call periodically) * @param task pointer to a task @@ -399,8 +383,6 @@ static bool lv_task_exec(lv_task_t * task) if(lv_task_time_remaining(task) == 0) { task->last_run = lv_tick_get(); - task_deleted = false; - task_created = false; if(task->task_cb) task->task_cb(task); /*Delete if it was a one shot lv_task*/ diff --git a/src/lv_misc/lv_task.h b/src/lv_misc/lv_task.h index f9546ab63..9b5bfde12 100644 --- a/src/lv_misc/lv_task.h +++ b/src/lv_misc/lv_task.h @@ -1,6 +1,6 @@ /** - * @file lv_task.c - * An 'lv_task' is a void (*fp) (void* param) type function which will be called periodically. + * @file lv_task.h + * An 'lv_task' is a void (*fp) (struct _lv_task_t* param) type function which will be called periodically. * A priority (5 levels + disable) can be assigned to lv_tasks. */ @@ -36,7 +36,7 @@ extern "C" { struct _lv_task_t; /** - * Tasks execute this type type of functions. + * Tasks execute this type of functions. */ typedef void (*lv_task_cb_t)(struct _lv_task_t *); From c03ffd7c3cbcc77622c89bcb6582b872f434b622 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 19 Jan 2021 14:31:47 +0100 Subject: [PATCH 56/62] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index edd6f8f64..50b21a225 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ - fix(indev) don't leave edit mode if there is only one object in the group -## v7.9.0 (Plann1d at 05.01.2020 +## v7.9.0 ### New features - feat(chart) add lv_chart_remove_series and lv_chart_hide_series From b639ddc3bc55aeaa963caa54c396c37b762c7b6a Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 19 Jan 2021 14:32:22 +0100 Subject: [PATCH 57/62] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50b21a225..80ff8525a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## v7.9.1 (Planned at 19.01.2020 +## v7.9.1 (Planned at 19.01.2020) ### Bugfixes - fix(cpicker) fix division by zero From 0aefab358b1c43f1dbb03cb65160f395032dc00d Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 19 Jan 2021 14:36:38 +0100 Subject: [PATCH 58/62] Release v7.9.1 --- lvgl.h | 2 +- src/lv_conf_internal.h | 7 +++++-- src/lv_core/lv_indev.c | 2 +- src/lv_misc/lv_area.c | 2 +- src/lv_misc/lv_fs.c | 4 ++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lvgl.h b/lvgl.h index 283013150..ff2ee801f 100644 --- a/lvgl.h +++ b/lvgl.h @@ -16,7 +16,7 @@ extern "C" { #define LVGL_VERSION_MAJOR 7 #define LVGL_VERSION_MINOR 9 #define LVGL_VERSION_PATCH 1 -#define LVGL_VERSION_INFO "dev" +#define LVGL_VERSION_INFO "" /********************* * INCLUDES diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index fb75f7031..ae3805c05 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -748,6 +748,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ #endif #endif /*LV_TICK_CUSTOM*/ + /*================ * Log settings *===============*/ @@ -795,7 +796,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ * If an invalid parameter is found an error log message is printed and * the MCU halts at the error. (`LV_USE_LOG` should be enabled) * If you are debugging the MCU you can pause - * the debugger to see exactly where the issue is. + * the debugger to see exactly where the issue is. * * The behavior of asserts can be overwritten by redefining them here. * E.g. #define LV_ASSERT_MEM(p) @@ -872,7 +873,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ * FONT USAGE *===================*/ -/* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel. +/* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel. * The symbols are available via `LV_SYMBOL_...` defines * More info about fonts: https://docs.lvgl.io/v7/en/html/overview/font.html * To create a new font go to: https://lvgl.com/ttf-font-to-c-array @@ -1987,6 +1988,8 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ #endif #endif + + /*If running without lv_conf.h add typdesf with default value*/ #if defined(LV_CONF_SKIP) diff --git a/src/lv_core/lv_indev.c b/src/lv_core/lv_indev.c index ed0d3a152..bf39ccdeb 100644 --- a/src/lv_core/lv_indev.c +++ b/src/lv_core/lv_indev.c @@ -669,7 +669,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) /*On enter long press toggle edit mode.*/ if(editable) { /*Don't leave edit mode if there is only one object (nowhere to navigate)*/ - if (_lv_ll_get_len(&g->obj_ll) > 1 ) { + if(_lv_ll_get_len(&g->obj_ll) > 1) { lv_group_set_editing(g, lv_group_get_editing(g) ? false : true); /*Toggle edit mode on long press*/ } } diff --git a/src/lv_misc/lv_area.c b/src/lv_misc/lv_area.c index 868af4531..0fea68328 100644 --- a/src/lv_misc/lv_area.c +++ b/src/lv_misc/lv_area.c @@ -239,7 +239,7 @@ bool _lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p, lv_coo is_in = true; } - if (!is_in) return false; + if(!is_in) return false; if(radius == 0) return true; /*Check if the corner points are inside the radius or not*/ diff --git a/src/lv_misc/lv_fs.c b/src/lv_misc/lv_fs.c index 8be49028e..6f66c765d 100644 --- a/src/lv_misc/lv_fs.c +++ b/src/lv_misc/lv_fs.c @@ -108,7 +108,7 @@ lv_fs_res_t lv_fs_open(lv_fs_file_t * file_p, const char * path, lv_fs_mode_t mo const char * real_path = lv_fs_get_real_path(path); - if (file_p->drv->file_size == 0) { /*Is file_d zero size?*/ + if(file_p->drv->file_size == 0) { /*Is file_d zero size?*/ /*Pass file_d's address to open_cb, so the implementor can allocate memory byself*/ return file_p->drv->open_cb(file_p->drv, &file_p->file_d, real_path, mode); } @@ -382,7 +382,7 @@ lv_fs_res_t lv_fs_dir_open(lv_fs_dir_t * rddir_p, const char * path) const char * real_path = lv_fs_get_real_path(path); - if (rddir_p->drv->rddir_size == 0) { /*Is dir_d zero size?*/ + if(rddir_p->drv->rddir_size == 0) { /*Is dir_d zero size?*/ /*Pass dir_d's address to dir_open_cb, so the implementor can allocate memory byself*/ return rddir_p->drv->dir_open_cb(rddir_p->drv, &rddir_p->dir_d, real_path); } From aaf4ee95f199d957b1b31ac21a3dbed068b48896 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 19 Jan 2021 14:53:54 +0100 Subject: [PATCH 59/62] fix(release script) add missed merging of lv_examples to release branch --- scripts/release/release.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/release/release.py b/scripts/release/release.py index fb7b7e7a8..1e6037df5 100755 --- a/scripts/release/release.py +++ b/scripts/release/release.py @@ -94,6 +94,8 @@ def lv_examples_release(ver): com.push('origin master') com.push('origin --tags') + update_release_branch(release_br) + os.chdir("../") def lv_drivers_release(ver): From f6fe3dcc8c89a2de94f16abc6bfe2b1b5773de97 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 19 Jan 2021 15:57:27 +0100 Subject: [PATCH 60/62] Update ROADMAP.md --- docs/ROADMAP.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 06509e40d..8513d5dab 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -35,6 +35,8 @@ Planned to November/December 2020 - Add radio button widget - Unit testing (gtest?). See [#1658](https://github.com/lvgl/lvgl/issues/1658) - Benchmarking (gem5?). See [#1660](https://github.com/lvgl/lvgl/issues/1660) +- chart: pre-delete `X` pint after the lastly set +- chart: autoscroll to the right ## v9 - Simplify `group`s. Discussion is [here](https://forum.lvgl.io/t/lv-group-tabindex/2927/3). From 762c0a3274dc7a576a620fc72cb4a9dfe27bc4b6 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 20 Jan 2021 11:56:54 +0100 Subject: [PATCH 61/62] Update ROADMAP.md --- docs/ROADMAP.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 8513d5dab..a606894f9 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -50,6 +50,7 @@ Planned to November/December 2020 - Allow snapshoting object to tranfrom them to images ## Ideas +- Use [generate-changelog](https://github.com/lob/generate-changelog) to automatically generate changelog - lv_mem_alloc_aligned(size, align) - Text node. See [#1701](https://github.com/lvgl/lvgl/issues/1701#issuecomment-699479408) - CPP binding. See [Forum](https://forum.lvgl.io/t/is-it-possible-to-officially-support-optional-cpp-api/2736) From eaacde672263f3e4285625c158e943a7f9465b62 Mon Sep 17 00:00:00 2001 From: Linch Date: Wed, 20 Jan 2021 18:57:33 +0800 Subject: [PATCH 62/62] fixs draw pattern stack-use-after-scope error (#2030) * fixs draw pattern stack-use-after-scope error * Update CHANGELOG.md --- CHANGELOG.md | 1 + src/lv_draw/lv_draw_rect.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80ff8525a..5dcbf770a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - fix(msgbox) use the animation time provided - fix(gpu_nxp_pxp) fix incorrect define name - fix(indev) don't leave edit mode if there is only one object in the group +- fix(draw_rect) fix draw pattern stack-use-after-scope error ## v7.9.0 diff --git a/src/lv_draw/lv_draw_rect.c b/src/lv_draw/lv_draw_rect.c index b502f8c43..070fcc06b 100644 --- a/src/lv_draw/lv_draw_rect.c +++ b/src/lv_draw/lv_draw_rect.c @@ -1230,9 +1230,9 @@ static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, const if(img_w == 0 || img_h == 0) return; lv_area_t coords_tmp; + lv_draw_mask_radius_param_t radius_mask_param; if(dsc->pattern_repeat) { - lv_draw_mask_radius_param_t radius_mask_param; lv_draw_mask_radius_init(&radius_mask_param, coords, dsc->radius, false); int16_t radius_mask_id = lv_draw_mask_add(&radius_mask_param, NULL); @@ -1271,7 +1271,6 @@ static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, const int16_t radius_mask_id = LV_MASK_ID_INV; if(_lv_area_is_in(&coords_tmp, coords, dsc->radius) == false) { - lv_draw_mask_radius_param_t radius_mask_param; lv_draw_mask_radius_init(&radius_mask_param, coords, dsc->radius, false); radius_mask_id = lv_draw_mask_add(&radius_mask_param, NULL); }