Skip to content

Commit 19c431b

Browse files
author
Krivorot Oleg
committed
lib/gui/lvgl: Add user config file
Add custom preferences file, for example to enable custom fonts and change preferences. Signed-off-by: Krivorot Oleg krivorot.oleg@gmail.com
1 parent b4faf7f commit 19c431b

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

lib/gui/lvgl/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) 2018-2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
22
# Copyright (c) 2020 Teslabs Engineering S.L.
3+
# Copyright (c) 2021 Krivorot Oleg <krivorot.oleg@gmail.com>
34
# SPDX-License-Identifier: Apache-2.0
45

56
menuconfig LVGL
@@ -21,6 +22,22 @@ config APP_LINK_WITH_LVGL
2122
disabled if the include paths for LVGL are causing aliasing
2223
issues for 'app'.
2324

25+
config LVGL_USE_USER_CONFIG
26+
bool "Use user config file"
27+
help
28+
Include a custom preferences file (lv_conf_user.h by default; see
29+
LVGL_USER_CONFIG_FILE). In the file, you can set the preferences
30+
that cannot be set using Kconfig (e.g. custom fonts).
31+
32+
config LVGL_USER_CONFIG_FILE
33+
string "User config file name"
34+
default "lv_conf_user.h"
35+
depends on LVGL_USE_USER_CONFIG
36+
help
37+
This file should be located in the root folder of the project,
38+
or in any folder, the path to which is registered in root
39+
CMakeLists.txt using the macro zephyr_include_directories()
40+
2441
rsource "Kconfig.graphical"
2542
rsource "Kconfig.memory"
2643
rsource "Kconfig.input"

lib/gui/lvgl/lv_conf.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Copyright (c) 2018-2020 Jan Van Winkel <jan.van_winkel@dxplore.eu>
33
* Copyright (c) 2020 Teslabs Engineering S.L.
4+
* Copyright (c) 2021 Krivorot Oleg <krivorot.oleg@gmail.com>
45
*
56
* SPDX-License-Identifier: Apache-2.0
67
*/
@@ -871,4 +872,8 @@ typedef void *lv_obj_user_data_t;
871872

872873
#define LV_USE_WIN IS_ENABLED(CONFIG_LVGL_USE_WIN)
873874

875+
#ifdef CONFIG_LVGL_USE_USER_CONFIG
876+
#include CONFIG_LVGL_USER_CONFIG_FILE
877+
#endif
878+
874879
#endif /* ZEPHYR_LIB_GUI_LVGL_LV_CONF_H_ */

0 commit comments

Comments
 (0)