Skip to content

Commit 55e642c

Browse files
hakehuangnashif
authored andcommitted
samples: lvgl: make lvgl demo testable with twister
1. add lvgl status output after starts 2. add extra_args platfrom filterable 3. add some platfroms shield as extra_args Signed-off-by: Hake Huang <[email protected]>
1 parent de104f2 commit 55e642c

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#
2+
# Copyright 2024, NXP
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
# Sample will allocate buffer equal to: (panelwidth / 8) * (panelwidth / 4) * pixel depth. For a
8+
# 1280x720 display in a 16-bpp format (e.g. RGB565), this is (1280 / 8) * (720 / 4) * 2 = 57600
9+
# bytes. We include 128 bytes of padding for kernel heap structures
10+
CONFIG_HEAP_MEM_POOL_SIZE=57600

samples/modules/lvgl/demos/sample.yaml

+11-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@ sample:
44
common:
55
modules:
66
- lvgl
7-
harness: none
7+
harness: console
88
filter: dt_chosen_enabled("zephyr,display")
9+
extra_args:
10+
- platform:mimxrt1060_evk:SHIELD=rk043fn66hs_ctg
11+
- platform:mimxrt1170_evk/mimxrt1176/cm7:SHIELD=rk055hdmipi4ma0
12+
- platform:mimxrt595_evk/mimxrt595s/cm33:SHIELD=rk055hdmipi4ma0
913
tags:
1014
- samples
1115
- display
1216
- lvgl
1317
- gui
18+
harness_config:
19+
fixture: fixture_display
20+
type: one_line
21+
regex:
22+
- "\\[\\w+ free bytes, \\w+ allocated bytes, overhead = \\w+ bytes | lvgl in malloc mode\\]"
1423
tests:
1524
sample.modules.lvgl.demo_music:
1625
extra_configs:
@@ -24,6 +33,7 @@ tests:
2433
sample.modules.lvgl.demo_widgets:
2534
extra_configs:
2635
- CONFIG_LV_Z_DEMO_WIDGETS=y
36+
2737
sample.modules.lvgl.demos.st_b_lcd40_dsi1_mb1166:
2838
filter: dt_compat_enabled("orisetech,otm8009a")
2939
platform_allow: stm32h747i_disco/stm32h747xx/m7

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
#include <zephyr/kernel.h>
88
#include <zephyr/drivers/display.h>
99
#include <lvgl.h>
10+
#include <lvgl_mem.h>
1011
#include <lv_demos.h>
12+
#include <stdio.h>
1113

1214
#define LOG_LEVEL CONFIG_LOG_DEFAULT_LEVEL
1315
#include <zephyr/logging/log.h>
@@ -38,7 +40,11 @@ int main(void)
3840

3941
lv_task_handler();
4042
display_blanking_off(display_dev);
41-
43+
#ifdef CONFIG_LV_Z_MEM_POOL_SYS_HEAP
44+
lvgl_print_heap_info(false);
45+
#else
46+
printf("lvgl in malloc mode\n");
47+
#endif
4248
while (1) {
4349
uint32_t sleep_ms = lv_task_handler();
4450

0 commit comments

Comments
 (0)