+ added helper scripts

+ moved uis into own files
+ log is not rerendered in full anymore
This commit is contained in:
Timo Niemann
2026-07-01 15:11:25 +02:00
parent 28d0fcc7dc
commit b7d7665fde
11 changed files with 588 additions and 408 deletions
+3 -3
View File
@@ -1,12 +1,12 @@
#pragma once
#pragma once
#include "lcd/ui_log.h"
typedef enum {
UI_VIEW_LOG,
UI_VIEW_IMAGE_BROWSER,
} ui_view_t;
void ui_log_append(const char *text);
void ui_log_appendf(const char *format, ...);
void create_log_ui(void);
void create_image_browser_ui(void);
+16
View File
@@ -0,0 +1,16 @@
#pragma once
#include <stddef.h>
#include "lvgl.h"
// Builds the image-browser view (tileview with tiles, or the empty-state
// placeholder) onto the given screen. The caller must hold the LVGL lock.
void ui_image_browser_build_view(lv_obj_t *screen);
// Stops the slideshow and clears browser state; call before the active screen
// is cleared.
void ui_image_browser_reset(void);
// Number of images shown by the most recent build (used for logging).
size_t ui_image_browser_get_image_count(void);
+12
View File
@@ -0,0 +1,12 @@
#pragma once
#include "lvgl.h"
#include "lcd/ui.h"
// Shared coordinator helpers used by the log and image-browser view modules.
// Makes an object toggle between the log and image-browser views when clicked.
void ui_attach_toggle(lv_obj_t *object);
// Returns the currently active view.
ui_view_t ui_current_view(void);
+15
View File
@@ -0,0 +1,15 @@
#pragma once
#include "lvgl.h"
// Appends a line to the scrollback log. Safe to call before the log view
// exists and from any task; the line is always stored in the ring buffer.
void ui_log_append(const char *text);
void ui_log_appendf(const char *format, ...);
// Builds the log view (title + textarea) onto the given screen and restores
// the ring-buffer history. The caller must hold the LVGL lock.
void ui_log_build_view(lv_obj_t *screen);
// Drops the textarea reference; call before the active screen is cleared.
void ui_log_detach(void);