From a60b53005a59de08c09d5937c2b5046335343b28 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Wed, 28 Apr 2021 08:55:46 +0200 Subject: [PATCH] pkg/lvgl: model dependency resolution in Kconfig --- pkg/lvgl/Kconfig | 60 ++++++++++++++++++++++++++++ sys/auto_init/Kconfig | 7 +++- sys/auto_init/screen/Kconfig | 9 +++++ tests/pkg_lvgl/app.config.test | 2 + tests/pkg_lvgl_touch/app.config.test | 5 +++ 5 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 sys/auto_init/screen/Kconfig create mode 100644 tests/pkg_lvgl/app.config.test create mode 100644 tests/pkg_lvgl_touch/app.config.test diff --git a/pkg/lvgl/Kconfig b/pkg/lvgl/Kconfig index 5dcfd0f353..47423ffaa4 100644 --- a/pkg/lvgl/Kconfig +++ b/pkg/lvgl/Kconfig @@ -5,6 +5,66 @@ # directory for more details. # +if TEST_KCONFIG + +menuconfig PACKAGE_LVGL + bool "LVGL package" + imply MODULE_AUTO_INIT_SCREEN + select MODULE_LVGL + select MODULE_LVGL_CORE + select MODULE_LVGL_DRAW + select MODULE_LVGL_FONT + select MODULE_LVGL_HAL + select MODULE_LVGL_MISC + select MODULE_LVGL_THEMES + select MODULE_LVGL_WIDGETS + + # lvgl is not compatible with non 32bit platforms + # Building lv_misc triggers the error: + # "left shift count >= width of type [-Werror=shift-count-overflow]" + depends on !HAS_ARCH_8BIT + depends on !HAS_ARCH_16BIT + +if PACKAGE_LVGL + +config MODULE_LVGL_CONTRIB + bool "Contrib" + select MODULE_DISP_DEV + select MODULE_CORE_THREAD_FLAGS + select MODULE_XTIMER + +config MODULE_LVGL_CONTRIB_TOUCH + bool "Touch support" + select MODULE_TOUCH_DEV + +endif # PACKAGE_LVGL + +config MODULE_LVGL + bool + +config MODULE_LVGL_CORE + bool + +config MODULE_LVGL_DRAW + bool + +config MODULE_LVGL_FONT + bool + +config MODULE_LVGL_HAL + bool + +config MODULE_LVGL_MISC + bool + +config MODULE_LVGL_THEMES + bool + +config MODULE_LVGL_WIDGETS + bool + +endif # TEST_KCONFIG + menuconfig KCONFIG_USEPKG_LVGL bool "Configure LVGL" depends on USEPKG_LVGL diff --git a/sys/auto_init/Kconfig b/sys/auto_init/Kconfig index 3208d8da7e..7c7dcc09dc 100644 --- a/sys/auto_init/Kconfig +++ b/sys/auto_init/Kconfig @@ -5,7 +5,7 @@ # directory for more details. # -config MODULE_AUTO_INIT +menuconfig MODULE_AUTO_INIT bool "Auto-initialization system" default y depends on TEST_KCONFIG @@ -14,4 +14,9 @@ config MODULE_AUTO_INIT drivers, or network interfaces) on start-up automatically. Disable if a more custom initialization is required. If unsure, say Y. +if MODULE_AUTO_INIT + +rsource "screen/Kconfig" rsource "multimedia/Kconfig" + +endif # MODULE_AUTO_INIT diff --git a/sys/auto_init/screen/Kconfig b/sys/auto_init/screen/Kconfig new file mode 100644 index 0000000000..e822c22620 --- /dev/null +++ b/sys/auto_init/screen/Kconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2021 HAW Hamburg +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config MODULE_AUTO_INIT_SCREEN + bool "Auto-initialize screens" diff --git a/tests/pkg_lvgl/app.config.test b/tests/pkg_lvgl/app.config.test new file mode 100644 index 0000000000..76c76f4330 --- /dev/null +++ b/tests/pkg_lvgl/app.config.test @@ -0,0 +1,2 @@ +CONFIG_PACKAGE_LVGL=y +CONFIG_MODULE_LVGL_CONTRIB=y diff --git a/tests/pkg_lvgl_touch/app.config.test b/tests/pkg_lvgl_touch/app.config.test new file mode 100644 index 0000000000..19adbf3bb9 --- /dev/null +++ b/tests/pkg_lvgl_touch/app.config.test @@ -0,0 +1,5 @@ +CONFIG_PACKAGE_LVGL=y +CONFIG_MODULE_LVGL_CONTRIB=y + +# Add touch capabilities +CONFIG_MODULE_LVGL_CONTRIB_TOUCH=y