From bf08ff444ee8fd3a370ac7c039788eebdf92885f Mon Sep 17 00:00:00 2001 From: Carlos Diaz Date: Tue, 1 Dec 2020 08:04:20 -0600 Subject: [PATCH] Update Kconfig. (#1917) * Kconfig: Add missing _HEX to LV_COLOR_TRANSP option. * lv_conf_checker: Define LV_CONF_SKIP if CONFIG_LV_CONF_SKIP is defined. * fix(indev): disabled object shouldn't absorb clicks but let the parent to be clicked * Update README.md * fix(arabic): support processing again alraedy processed texts with _lv_txt_ap_proc * fix(textarea): support Arabic letter connections fixes #1888 * Fix #1924: incorrect date on changelog December 1st is two weeks from 7.7.2 release. * Kconfig: Fix LV_CONF_MINIMAL related options. * fix(arabic): support Arabic letter connections fixes #1920 * fix(arabic): support Arabic letter connections in value string property * Update CHANGELOG.md * Update CHANGELOG.md * Kconfig: Add Zephyr specific code. * fix: fix double include in lv_obj.c fix #1926 * Removed trailing semi-colon from macros (#1928) * Removed commented out test definition Removed commented out test definition LV_BUILD_TEST * Remove blank line * Fix comment spelling * Added blank line * Removed trailing semi-colon in macros * fix(indev): in LV_INDEV_TYPE_BUTTON recognize 1 cycle long presses too Fixes https://forum.lvgl.io/t/bug-in-indev-button-proc-misses-buttons-that-are-pressed-for-a-single-callback/3699 * fix(arc): make arc work with encoder fixes https://forum.lvgl.io/t/lv-arc-with-encoder-lv-group/3769 * fix(slider): adjusting the left knob too with encoder https://forum.lvgl.io/t/slider-with-2-knobs-and-encoder-functionality/3770 * fix(arc_draw): remove statments that do nothing fix #1930 * Change LV_DRAW_BUF_MAX_NUM to LV_MEM_BUF_MAX_NUM (#1931) * Update CHANGELOG.md * fix(draw polygon): join adjacent points if they are on the same coordinate * fix(draw polygon): fix memory leak and vertex joining * fix(style): invalidate cache on every PART Inherited properties on parts other than MAIN needs to be recached on property change beacuse they are inherted from MAIN fixes #1933 * fix(anim): fix bounce path * fix(slider): do not let edit left knob in non-range mode * Update ROADMAP.md * Fix hardfault when DCache is disabled with no callback (#1935) * fix(linemeter): fix invalidation when setting new value The old complex but more optimal invalidation was buggy in some cases fixes #1904 * fix(linemeter): fix invalidation when setting new value The old complex but more optimal invalidation was buggy in some cases fixes #1904 * fix(table): add missing invalidation when changeing cell type fixes https://forum.lvgl.io/t/bug-of-table-click-to-change-style/3842 * CMakeLists.txt: Let the user configure whether LV_ATTRIBUTE_FAST_MEM is IRAM_ATTR (#1939) * fix(slider): fix left/right knob control with encoder * fix(img): increase the size of invalidated area in lv_img_set_zoom Becasue of the pivot placement there can be some rounding errors * feat(perf_monitor): add lv_refr_get_fps_avg() * Add 8px and 10px montserrat fonts to build (#1941) * Fix #1942: lv_textarea_set_pwd_mode not changing to bullets Thanks to @fvanroie for investigating. * fix(material): make button pressed color darker (#1940) * simplify touch handling in the Arduino example * Update ROADMAP.md * Update ROADMAP.md * feat(lv_conf_kconfig): add LV_CONF_KCONFIG_EXTERNAL_INCLUDE Co-authored-by: Gabor Kiss-Vamosi Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com> Co-authored-by: xennex22 <25083624+xennex22@users.noreply.github.com> Co-authored-by: incity <610455681@qq.com> Co-authored-by: Andrey Co-authored-by: defogprog <22955033+defogprog@users.noreply.github.com> --- Kconfig | 20 ++++++++++------ scripts/lv_conf_checker.py | 4 ++++ src/lv_conf_kconfig.h | 22 ++++++++++------- src/lv_conf_zephyr.h | 49 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 15 deletions(-) create mode 100644 src/lv_conf_zephyr.h diff --git a/Kconfig b/Kconfig index 3561e062e7..11447f6311 100644 --- a/Kconfig +++ b/Kconfig @@ -58,7 +58,7 @@ menu "LVGL configuration" Requires `LV_COLOR_DEPTH = 32` colors and the screen's style should be modified: `style.body.opa = ...`. - config LV_COLOR_TRANSP + config LV_COLOR_TRANSP_HEX hex "Images pixels with this color will not be drawn (with chroma keying)." depends on LV_COLOR_SCREEN_TRANSP range 0x000000 0xFFFFFF @@ -332,7 +332,7 @@ menu "LVGL configuration" bool "Enable Montserrat 12" config LV_FONT_MONTSERRAT_14 bool "Enable Montserrat 14" - default y + default y if !LV_CONF_MINIMAL config LV_FONT_MONTSERRAT_16 bool "Enable Montserrat 16" config LV_FONT_MONTSERRAT_18 @@ -369,6 +369,7 @@ menu "LVGL configuration" bool "Enable Montserrat 48" config LV_FONT_UNSCII_8 bool "Enable UNSCII 8 (Perfect monospace font)" + default y if LV_CONF_MINIMAL config LV_FONT_UNSCII_16 bool "Enable UNSCII 16 (Perfect monospace font)" config LV_FONT_MONTSERRAT12SUBPX @@ -383,7 +384,8 @@ menu "LVGL configuration" choice LV_FONT_DEFAULT_SMALL prompt "Select theme default small font" - default LV_FONT_DEFAULT_SMALL_MONTSERRAT_16 + default LV_FONT_DEFAULT_SMALL_MONTSERRAT_16 if !LV_CONF_MINIMAL + default LV_FONT_DEFAULT_SMALL_UNSCII_8 if LV_CONF_MINIMAL help Select theme default small font @@ -472,7 +474,8 @@ menu "LVGL configuration" choice LV_FONT_DEFAULT_NORMAL prompt "Select theme default normal font" - default LV_FONT_DEFAULT_NORMAL_MONTSERRAT_16 + default LV_FONT_DEFAULT_NORMAL_MONTSERRAT_16 if !LV_CONF_MINIMAL + default LV_FONT_DEFAULT_NORMAL_UNSCII_8 if LV_CONF_MINIMAL help Select theme default normal font @@ -561,7 +564,8 @@ menu "LVGL configuration" choice LV_FONT_DEFAULT_SUBTITLE prompt "Select theme default subtitle font" - default LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_16 + default LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_16 if !LV_CONF_MINIMAL + default LV_FONT_DEFAULT_SUBTITLE_UNSCII_8 if LV_CONF_MINIMAL help Select theme default subtitle font @@ -650,7 +654,8 @@ menu "LVGL configuration" choice LV_FONT_DEFAULT_TITLE prompt "Select theme default title font" - default LV_FONT_DEFAULT_TITLE_MONTSERRAT_16 + default LV_FONT_DEFAULT_TITLE_MONTSERRAT_16 if !LV_CONF_MINIMAL + default LV_FONT_DEFAULT_TITLE_UNSCII_8 if LV_CONF_MINIMAL help Select theme default title font @@ -751,7 +756,8 @@ menu "LVGL configuration" choice LV_THEME_DEFAULT_INIT prompt "Select theme default init" - default LV_THEME_DEFAULT_INIT_MATERIAL + default LV_THEME_DEFAULT_INIT_MATERIAL if !LV_CONF_MINIMAL + default LV_THEME_DEFAULT_INIT_EMPTY if LV_CONF_MINIMAL help Select theme default init diff --git a/scripts/lv_conf_checker.py b/scripts/lv_conf_checker.py index bed793bf2c..bc3e008ece 100755 --- a/scripts/lv_conf_checker.py +++ b/scripts/lv_conf_checker.py @@ -38,6 +38,10 @@ fout.write( /* Handle special Kconfig options */ #include "lv_conf_kconfig.h" +#ifdef CONFIG_LV_CONF_SKIP +#define LV_CONF_SKIP +#endif + /* If "lv_conf.h" is available from here try to use it later.*/ #if defined __has_include # if __has_include("lv_conf.h") diff --git a/src/lv_conf_kconfig.h b/src/lv_conf_kconfig.h index e3f91e8001..c9a5ce8db8 100644 --- a/src/lv_conf_kconfig.h +++ b/src/lv_conf_kconfig.h @@ -10,14 +10,20 @@ extern "C" { #endif -#if defined ESP_PLATFORM -#include "sdkconfig.h" -#include "esp_attr.h" -#endif - -#ifdef __NuttX__ -#include -#endif +#ifdef LV_CONF_KCONFIG_EXTERNAL_INCLUDE +# include LV_CONF_KCONFIG_EXTERNAL_INCLUDE +#else + +# if defined ESP_PLATFORM +# include "sdkconfig.h" +# include "esp_attr.h" +# endif + +# ifdef __NuttX__ +# include +# endif + +#endif /*LV_CONF_KCONFIG_EXTERNAL_INCLUDE*/ /******************* * LV_MEM_SIZE diff --git a/src/lv_conf_zephyr.h b/src/lv_conf_zephyr.h new file mode 100644 index 0000000000..a140ccd610 --- /dev/null +++ b/src/lv_conf_zephyr.h @@ -0,0 +1,49 @@ +/* + * 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