From 12983474041041d992540872a6eca8ff3b5cf92f Mon Sep 17 00:00:00 2001 From: Timo Niemann Date: Wed, 1 Jul 2026 15:29:52 +0200 Subject: [PATCH] splitted ui_toggle_view_event_cb into synced and asynced variant --- main/lcd/ui.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main/lcd/ui.c b/main/lcd/ui.c index f0aab58..2ea70b9 100644 --- a/main/lcd/ui.c +++ b/main/lcd/ui.c @@ -17,13 +17,17 @@ ui_view_t ui_current_view(void){ return current_view; } -static void ui_toggle_view_event_cb(lv_event_t *event){ - if(lv_event_get_code(event) != LV_EVENT_CLICKED) return; - +static void ui_toggle_view_async_cb(void *param){ + (void)param; if(current_view == UI_VIEW_IMAGE_BROWSER) ui_build_log_view_locked(); else ui_build_image_browser_view_locked(); } +static void ui_toggle_view_event_cb(lv_event_t *event){ + if(lv_event_get_code(event) != LV_EVENT_CLICKED) return; + lv_async_call(ui_toggle_view_async_cb, NULL); +} + void ui_attach_toggle(lv_obj_t *object){ lv_obj_add_flag(object, LV_OBJ_FLAG_CLICKABLE); lv_obj_add_event_cb(object, ui_toggle_view_event_cb, LV_EVENT_CLICKED, NULL); @@ -55,7 +59,6 @@ void create_log_ui(void){ ui_build_log_view_locked(); lvgl_port_unlock(); - ui_log_append("Boot UI ready"); ESP_LOGI(TAG, "Log UI created"); ui_log_append("Log UI created"); }