From ff2cf4be1634b5d41a5f80bef506a35ed7b74b6d Mon Sep 17 00:00:00 2001 From: Fabian Blatz Date: Sun, 26 Jan 2025 18:19:39 +0100 Subject: [PATCH] modules: lvgl: Update OSAL implementation The LVGL OSAL also tries to set the name of threads. Adjust the function signature accordingly. Also deal with the fact that the type `lv_thread_prio_t` is not part of the private api and requires a LV_USE_PRIVATE_API symbol to be enabled. Signed-off-by: Fabian Blatz --- modules/lvgl/Kconfig | 4 ++++ modules/lvgl/lvgl_zephyr_osal.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/lvgl/Kconfig b/modules/lvgl/Kconfig index 803243fa43e..8084dd11a33 100644 --- a/modules/lvgl/Kconfig +++ b/modules/lvgl/Kconfig @@ -22,6 +22,9 @@ config LV_CONF_SKIP bool default n +config LV_USE_PRIVATE_API + bool + config LV_USE_LOG bool @@ -158,6 +161,7 @@ config LV_DRAW_DMA2D_HAL_INCLUDE config LV_Z_USE_OSAL bool "Use OSAL enabling parallel rendering" depends on DYNAMIC_THREAD + select LV_USE_PRIVATE_API help Use the Zephyr LVGL OSAL to enable parallel rendering pipelines. diff --git a/modules/lvgl/lvgl_zephyr_osal.c b/modules/lvgl/lvgl_zephyr_osal.c index 84c118f0020..fd5adb220c6 100644 --- a/modules/lvgl/lvgl_zephyr_osal.c +++ b/modules/lvgl/lvgl_zephyr_osal.c @@ -13,8 +13,8 @@ LOG_MODULE_DECLARE(lvgl, CONFIG_LV_Z_LOG_LEVEL); typedef void (*lv_thread_entry)(void *); static void thread_entry(void *thread, void *cb, void *user_data); -lv_result_t lv_thread_init(lv_thread_t *thread, lv_thread_prio_t prio, void (*callback)(void *), - size_t stack_size, void *user_data) +lv_result_t lv_thread_init(lv_thread_t *thread, const char *const name, lv_thread_prio_t prio, + void (*callback)(void *), size_t stack_size, void *user_data) { int thread_priority; @@ -29,6 +29,8 @@ lv_result_t lv_thread_init(lv_thread_t *thread, lv_thread_prio_t prio, void (*ca thread->tid = k_thread_create(&thread->thread, thread->stack, stack_size, thread_entry, thread, callback, user_data, thread_priority, 0, K_NO_WAIT); + k_thread_name_set(thread->tid, name); + return LV_RESULT_OK; }