Skip to content

Commit a93e6c2

Browse files
uLipecfriedt
authored andcommitted
samples: modules: lvgl: demos: added new test cases
that uses the LVGL internal workqueue option to drive the LVGL core automatically Signed-off-by: Felipe Neves <[email protected]>
1 parent 744ee20 commit a93e6c2

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

samples/modules/lvgl/demos/sample.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ tests:
4141
sample.modules.lvgl.demo_render:
4242
extra_configs:
4343
- CONFIG_LV_Z_DEMO_RENDER=y
44+
sample.modules.lvgl.demo_benchmark.lvgl_auto:
45+
extra_configs:
46+
- CONFIG_LV_Z_DEMO_BENCHMARK=y
47+
- CONFIG_LV_USE_DEMO_WIDGETS=y
48+
- CONFIG_LV_Z_RUN_LVGL_ON_WORKQUEUE=y
49+
- CONFIG_LV_Z_LVGL_WORKQUEUE_STACK_SIZE=8192
50+
- CONFIG_LV_Z_LVGL_WORKQUEUE_PRIORITY=0
4451
sample.modules.lvgl.demos.st_b_lcd40_dsi1_mb1166:
4552
filter: dt_compat_enabled("orisetech,otm8009a")
4653
platform_allow: stm32h747i_disco/stm32h747xx/m7

samples/modules/lvgl/demos/src/main.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,24 @@ int main(void)
5353
#error Enable one of the demos CONFIG_LV_Z_DEMO_*
5454
#endif
5555

56+
#ifndef CONFIG_LV_Z_RUN_LVGL_ON_WORKQUEUE
5657
lv_timer_handler();
58+
#endif
59+
5760
display_blanking_off(display_dev);
5861
#ifdef CONFIG_LV_Z_MEM_POOL_SYS_HEAP
5962
lvgl_print_heap_info(false);
6063
#else
6164
printf("lvgl in malloc mode\n");
6265
#endif
6366
while (1) {
67+
#ifndef CONFIG_LV_Z_RUN_LVGL_ON_WORKQUEUE
6468
uint32_t sleep_ms = lv_timer_handler();
65-
6669
k_msleep(MIN(sleep_ms, INT32_MAX));
70+
#else
71+
/* LVGL managed by dedicated workqueue, just put an application side delay */
72+
k_msleep(10);
73+
#endif
6774
#ifdef CONFIG_LV_Z_DEMO_RENDER_SCENE_DYNAMIC
6875
if (sys_timepoint_expired(next_scene_switch)) {
6976
cur_scene = (cur_scene + 1) % LV_DEMO_RENDER_SCENE_NUM;

0 commit comments

Comments
 (0)