From 18984c29a3c4cb625a22fa1e111ddf36e103af92 Mon Sep 17 00:00:00 2001 From: Mikkeli Matlock Date: Mon, 16 Feb 2026 22:28:26 +0900 Subject: [PATCH] smooth scrolling --- components/dashboard_ui/dashboard_ui.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/dashboard_ui/dashboard_ui.c b/components/dashboard_ui/dashboard_ui.c index fd15897..3384972 100644 --- a/components/dashboard_ui/dashboard_ui.c +++ b/components/dashboard_ui/dashboard_ui.c @@ -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;