diff mbox series

[meta-oe,2/5] lvgl: Activate custom tick implementation

Message ID 20230507132349.10674-2-marex@denx.de
State Under Review
Headers show
Series [meta-oe,1/5] lvgl: Upgrade lvgl to 8.3.7 and lv-driver to 8.3.0 | expand

Commit Message

Marek Vasut May 7, 2023, 1:23 p.m. UTC
Use a custom tick source that tells the elapsed time in milliseconds.
It removes the need to manually update the tick with `lv_tick_inc()`.
This is the behavior which ought to be used for LVGL running on Linux
compared to LVGL running on microcontroller.

Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Fabio Estevam <festevam@denx.de>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: Martin Jansa <martin.jansa@gmail.com>
Cc: Philippe Coval <philippe.coval.ext@huawei.com>
Cc: Philippe Coval <philippe.coval@huawei.com>
---
 meta-oe/recipes-graphics/lvgl/lvgl_8.3.7.bb | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/meta-oe/recipes-graphics/lvgl/lvgl_8.3.7.bb b/meta-oe/recipes-graphics/lvgl/lvgl_8.3.7.bb
index a82ab3b74..5f3fc44cf 100644
--- a/meta-oe/recipes-graphics/lvgl/lvgl_8.3.7.bb
+++ b/meta-oe/recipes-graphics/lvgl/lvgl_8.3.7.bb
@@ -28,6 +28,11 @@  do_configure:prepend() {
     [ -r "${S}/lv_conf.h" ] \
         || sed -e 's|#if 0 .*Set it to "1" to enable .*|#if 1 // Enabled|g' \
 	    -e "s|\(#define LV_MEM_CUSTOM .*\)0|\1${LVGL_CONFIG_LV_MEM_CUSTOM}|g" \
+	    \
+	    -e "s|\(#define LV_TICK_CUSTOM \).*|\1 1|g" \
+	    -e "s|\(#define LV_TICK_CUSTOM_INCLUDE \).*|\1 <stdint.h>|g" \
+	    -e "s|\(#define LV_TICK_CUSTOM_SYS_TIME_EXPR \).*|extern uint32_t custom_tick_get(void);\n\1 (custom_tick_get())|g" \
+	    \
             < "${S}/lv_conf_template.h" > "${S}/lv_conf.h"
 }