Skip to content

Commit eecd7f5

Browse files
committed
samples: subsys: display: lvgl: Migrate to v9.2
This patch changes the functions unsed in the subsys demo that are part of the api map to anticipate their deprecation. Signed-off-by: Fabian Blatz <[email protected]>
1 parent c8d3f7e commit eecd7f5

File tree

1 file changed

+8
-8
lines changed
  • samples/subsys/display/lvgl/src

1 file changed

+8
-8
lines changed

samples/subsys/display/lvgl/src/main.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ int main(void)
9999
lv_obj_t *arc;
100100
lv_group_t *arc_group;
101101

102-
arc = lv_arc_create(lv_scr_act());
102+
arc = lv_arc_create(lv_screen_active());
103103
lv_obj_align(arc, LV_ALIGN_CENTER, 0, -15);
104104
lv_obj_set_size(arc, 150, 150);
105105

@@ -113,9 +113,9 @@ int main(void)
113113
lv_group_t *btn_matrix_group;
114114
static const char *const btnm_map[] = {"1", "2", "3", "4", ""};
115115

116-
btn_matrix = lv_btnmatrix_create(lv_scr_act());
116+
btn_matrix = lv_buttonmatrix_create(lv_screen_active());
117117
lv_obj_align(btn_matrix, LV_ALIGN_CENTER, 0, 70);
118-
lv_btnmatrix_set_map(btn_matrix, (const char **)btnm_map);
118+
lv_buttonmatrix_set_map(btn_matrix, (const char **)btnm_map);
119119
lv_obj_set_size(btn_matrix, 100, 50);
120120

121121
btn_matrix_group = lv_group_create();
@@ -126,30 +126,30 @@ int main(void)
126126
if (IS_ENABLED(CONFIG_LV_Z_POINTER_INPUT)) {
127127
lv_obj_t *hello_world_button;
128128

129-
hello_world_button = lv_btn_create(lv_scr_act());
129+
hello_world_button = lv_button_create(lv_screen_active());
130130
lv_obj_align(hello_world_button, LV_ALIGN_CENTER, 0, -15);
131131
lv_obj_add_event_cb(hello_world_button, lv_btn_click_callback, LV_EVENT_CLICKED,
132132
NULL);
133133
hello_world_label = lv_label_create(hello_world_button);
134134
} else {
135-
hello_world_label = lv_label_create(lv_scr_act());
135+
hello_world_label = lv_label_create(lv_screen_active());
136136
}
137137

138138
lv_label_set_text(hello_world_label, "Hello world!");
139139
lv_obj_align(hello_world_label, LV_ALIGN_CENTER, 0, 0);
140140

141-
count_label = lv_label_create(lv_scr_act());
141+
count_label = lv_label_create(lv_screen_active());
142142
lv_obj_align(count_label, LV_ALIGN_BOTTOM_MID, 0, 0);
143143

144-
lv_task_handler();
144+
lv_timer_handler();
145145
display_blanking_off(display_dev);
146146

147147
while (1) {
148148
if ((count % 100) == 0U) {
149149
sprintf(count_str, "%d", count/100U);
150150
lv_label_set_text(count_label, count_str);
151151
}
152-
lv_task_handler();
152+
lv_timer_handler();
153153
++count;
154154
k_sleep(K_MSEC(10));
155155
}

0 commit comments

Comments
 (0)