lvgl: configure app dimensions in main recipe file instead of lv-drivers.inc

This change isn't functional, but necessary if we want to be able to separate
the logic in the include file and the demo recipe. This way the include file is
agnostic and can be included into other recipes if needed.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
Gabriel Valcazar 2023-11-23 13:28:58 +01:00
parent b7ce8d4997
commit c497caca66
2 changed files with 9 additions and 4 deletions

View File

@ -14,8 +14,6 @@ LVGL_CONFIG_USE_FBDEV = "${@bb.utils.contains('PACKAGECONFIG', 'fbdev', '1', '0'
LVGL_CONFIG_USE_SDL = "${@bb.utils.contains('PACKAGECONFIG', 'sdl', '1', '0', d)}"
LVGL_CONFIG_USE_WAYLAND = "${@bb.utils.contains('PACKAGECONFIG', 'wayland', '1', '0', d)}"
LVGL_CONFIG_HOR_RES ?= "800"
LVGL_CONFIG_VER_RES ?= "480"
ALLOW_EMPTY:${PN} = "1"
@ -39,8 +37,6 @@ do_configure:append() {
-e "s|\(^# define USE_SDL \).*|# define USE_SDL ${LVGL_CONFIG_USE_SDL}|g" \
\
-e "s|\(^# define USE_WAYLAND \).*|# define USE_WAYLAND ${LVGL_CONFIG_USE_WAYLAND}|g" \
-e "s|\(^#define *LV_DRV_DISP_HOR_RES *\).*|\1${LVGL_CONFIG_HOR_RES}|g" \
-e "s|\(^#define *LV_DRV_DISP_VER_RES *\).*|\1${LVGL_CONFIG_VER_RES}|g" \
\
-i "${S}/lv_drv_conf.h"
}

View File

@ -32,6 +32,9 @@ TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm"
# Change DRM card used for i.MX8-based platforms
LVGL_CONFIG_DRM_CARD:mx8-generic-bsp = "/dev/dri/card1"
LVGL_CONFIG_HOR_RES ?= "800"
LVGL_CONFIG_VER_RES ?= "480"
do_configure:prepend() {
if [ "${LVGL_CONFIG_USE_DRM}" -eq 1 ] ; then
# Add libdrm build dependency
@ -47,6 +50,12 @@ do_configure:prepend() {
# Add wayland build dependencies
sed -i '/^target_link_libraries/ s@lvgl::drivers@& wayland-client wayland-cursor xkbcommon@' "${S}/CMakeLists.txt"
fi
# Configure the app's dimensions
sed -e "s|\(^#define *LV_DRV_DISP_HOR_RES *\).*|\1${LVGL_CONFIG_HOR_RES}|g" \
-e "s|\(^#define *LV_DRV_DISP_VER_RES *\).*|\1${LVGL_CONFIG_VER_RES}|g" \
\
-i "${S}/lv_drv_conf.h"
}
do_install:append() {