smooth scrolling

This commit is contained in:
Mikkeli Matlock
2026-02-16 22:28:26 +09:00
parent 7555efcba9
commit 18984c29a3

View File

@@ -132,7 +132,9 @@ static void scroll_timer_cb(lv_timer_t *timer)
cur_y = 0;
}
lv_obj_scroll_to_y(tbl_services, cur_y + s_row_h, LV_ANIM_OFF);
// lv_obj_scroll_to_y(tbl_services, cur_y + s_row_h, LV_ANIM_OFF);
const int delta_y = s_row_h / 8;
lv_obj_scroll_to_y(tbl_services, cur_y + delta_y, LV_ANIM_ON);
}
/* Measure row height, compute visible rows, append duplicates for seamless loop */
@@ -281,8 +283,8 @@ static void create_main_section(lv_obj_t *parent)
lv_table_set_cell_value(tbl_services, i, 1, "---");
}
/* Auto-scroll timer: 2 second period */
s_scroll_timer = lv_timer_create(scroll_timer_cb, 2048, NULL);
/* Timer for each shift of 1/8 line's height */
s_scroll_timer = lv_timer_create(scroll_timer_cb, 200, NULL);
/* === Left column: Pi Vitals (below services) === */
int rx = 0;