diff --git a/lib/gui/lvgl/Kconfig b/lib/gui/lvgl/Kconfig index ab5fd214ede91..f51ed24315848 100644 --- a/lib/gui/lvgl/Kconfig +++ b/lib/gui/lvgl/Kconfig @@ -1,5 +1,6 @@ # Copyright (c) 2018-2019 Jan Van Winkel # Copyright (c) 2020 Teslabs Engineering S.L. +# Copyright (c) 2021 Krivorot Oleg # SPDX-License-Identifier: Apache-2.0 menuconfig LVGL @@ -21,6 +22,22 @@ config APP_LINK_WITH_LVGL disabled if the include paths for LVGL are causing aliasing issues for 'app'. +config LVGL_USE_USER_CONFIG + bool "Use user config file" + help + Include a custom preferences file (lv_conf_user.h by default; see + LVGL_USER_CONFIG_FILE). In the file, you can set the preferences + that cannot be set using Kconfig (e.g. custom fonts). + +config LVGL_USER_CONFIG_FILE + string "User config file name" + default "lv_conf_user.h" + depends on LVGL_USE_USER_CONFIG + help + This file should be located in the root folder of the project, + or in any folder, the path to which is registered in root + CMakeLists.txt using the macro zephyr_include_directories() + rsource "Kconfig.graphical" rsource "Kconfig.memory" rsource "Kconfig.input" diff --git a/lib/gui/lvgl/lv_conf.h b/lib/gui/lvgl/lv_conf.h index 2d577bef320b0..eda640d64c7e1 100644 --- a/lib/gui/lvgl/lv_conf.h +++ b/lib/gui/lvgl/lv_conf.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2018-2020 Jan Van Winkel * Copyright (c) 2020 Teslabs Engineering S.L. + * Copyright (c) 2021 Krivorot Oleg * * SPDX-License-Identifier: Apache-2.0 */ @@ -871,4 +872,8 @@ typedef void *lv_obj_user_data_t; #define LV_USE_WIN IS_ENABLED(CONFIG_LVGL_USE_WIN) +#ifdef CONFIG_LVGL_USE_USER_CONFIG +#include CONFIG_LVGL_USER_CONFIG_FILE +#endif + #endif /* ZEPHYR_LIB_GUI_LVGL_LV_CONF_H_ */