Skip to content

Commit f25a8aa

Browse files
faxe1008kartben
authored andcommitted
samples: modules: lvgl: transparency: Migrate to v9.2
Removes the LV_COLOR_SCREEN_TRANSP Kconfig option as its not part of the modules Kconfig anymore and renames the functions according to the new v9.2 API. Signed-off-by: Fabian Blatz <[email protected]>
1 parent 472caa9 commit f25a8aa

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

samples/modules/lvgl/screen_transparency/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ CONFIG_LOG=y
44
CONFIG_LVGL=y
55
CONFIG_LV_Z_MEM_POOL_SIZE=16384
66
CONFIG_LV_COLOR_DEPTH_32=y
7-
CONFIG_LV_COLOR_SCREEN_TRANSP=y
87

98
CONFIG_DISPLAY=y

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ static void initialize_gui(void)
2121
lv_obj_t *label;
2222

2323
/* Configure screen and background for transparency */
24-
lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_TRANSP, LV_PART_MAIN);
25-
lv_disp_set_bg_opa(NULL, LV_OPA_TRANSP);
26-
lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x000000), LV_PART_MAIN);
24+
lv_obj_set_style_bg_opa(lv_screen_active(), LV_OPA_TRANSP, LV_PART_MAIN);
25+
lv_obj_set_style_bg_opa(lv_layer_bottom(), LV_OPA_TRANSP, LV_PART_MAIN);
2726

2827
/* Create a label, set its text and align it to the center */
29-
label = lv_label_create(lv_scr_act());
28+
label = lv_label_create(lv_screen_active());
3029
lv_label_set_text(label, "Hello, world!");
31-
lv_obj_set_style_text_color(lv_scr_act(), lv_color_hex(0xff00ff), LV_PART_MAIN);
30+
lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0xff00ff), LV_PART_MAIN);
3231
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
3332
}
3433

@@ -60,11 +59,11 @@ int main(void)
6059

6160
initialize_gui();
6261

63-
lv_task_handler();
62+
lv_timer_handler();
6463
display_blanking_off(display_dev);
6564

6665
while (1) {
67-
uint32_t sleep_ms = lv_task_handler();
66+
uint32_t sleep_ms = lv_timer_handler();
6867

6968
k_msleep(MIN(sleep_ms, INT32_MAX));
7069
}

0 commit comments

Comments
 (0)