Skip to content

Commit 4b3f802

Browse files
committed
chore(wayland) align with driver, wait only if the cycle was fully completed
1 parent 0aa1198 commit 4b3f802

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

main.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,17 @@ static void default_run_loop(void)
8787

8888
static void wayland_run_loop(void)
8989
{
90+
bool completed;
9091

9192
/* Handle LVGL tasks */
9293
while (1) {
9394

94-
lv_wayland_timer_handler();
95-
usleep(LV_DEF_REFR_PERIOD * 1000);
95+
completed = lv_wayland_timer_handler();
96+
97+
if (completed) {
98+
/* wait only if the cycle was completed */
99+
usleep(LV_DEF_REFR_PERIOD * 1000);
100+
}
96101

97102
/* Run until the last window closes */
98103
if (!lv_wayland_window_is_open(NULL)) {

0 commit comments

Comments
 (0)