diff --git a/main/modes/routine.c b/main/modes/routine.c index 6403b70..55cbb24 100644 --- a/main/modes/routine.c +++ b/main/modes/routine.c @@ -324,7 +324,13 @@ static void build_step_screen(void) lv_obj_set_style_text_font(dl, &lisael_font_24, 0); lv_obj_center(dl); - lv_screen_load_anim(scr, LV_SCR_LOAD_ANIM_MOVE_LEFT, 200, 0, true); + // Keep the memoized choice screen (s_root) alive on the first hop into a + // routine: when s_step_screen is NULL we are coming FROM the choice screen, + // so auto_del must be false to prevent LVGL from deleting s_root at the end + // of the transition. On subsequent step→step hops s_step_screen is the + // previous (transient) step screen, which LVGL can safely delete. + bool del_prev = (s_step_screen != NULL); + lv_screen_load_anim(scr, LV_SCR_LOAD_ANIM_MOVE_LEFT, 200, 0, del_prev); s_step_screen = scr; play_step_audio(); }