From 1f8cce48aa4c85e822b40270dc3419354bf8c334 Mon Sep 17 00:00:00 2001 From: raw-designs Date: Tue, 11 Aug 2026 01:20:49 +0200 Subject: [PATCH] fix(P4): Compiler-Warnungen des Display-Builds beseitigt (1.1.1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Von 68 Warnungen (arduino-cli --warnings all) auf eine einzige, die im ESP32-Core-SDK steckt und nicht im Projekt behebbar ist. - LV_FS_DEFAULT_DRIVE_LETTER heißt ab LVGL 9.3 LV_FS_DEFAULT_DRIVER_LETTER. Der alte Name funktionierte weiter, löste aber in lv_api_map_v9_1.h ein #warning in JEDER Übersetzungseinheit aus, die lvgl.h einbindet — allein rund 60 Warnungen pro Build, die alles andere zugedeckt haben. In lv_conf.h umbenannt. - LV_PART_* und LV_STATE_* sind in LVGL 9 verschiedene Enum-Typen; die direkte |-Verknüpfung ist in C++20 abgekündigt. Neues Makro TH_SEL(part, state) in theme.h castet beide auf lv_style_selector_t (ohnehin uint32_t), 5 Stellen. - Bug-Fix: Der Puffer der Cold-Extraction-Infozeile auf der Brew-Seite war mit 192 Bytes zu klein für den ~205 Zeichen langen Text (das "°" zählt doppelt), die letzte Zeile wurde abgeschnitten. Jetzt 256 Bytes. Co-Authored-By: Claude Opus 5 --- JC_Display_Firmware/Changelog.txt | 15 +++++++++++++++ JC_Display_Firmware/config.h | 2 +- JC_Display_Firmware/lv_conf.h | 5 ++++- JC_Display_Firmware/theme.h | 7 ++++++- JC_Display_Firmware/ui.cpp | 10 +++++----- 5 files changed, 31 insertions(+), 8 deletions(-) diff --git a/JC_Display_Firmware/Changelog.txt b/JC_Display_Firmware/Changelog.txt index 9d16d08..4509fbe 100644 --- a/JC_Display_Firmware/Changelog.txt +++ b/JC_Display_Firmware/Changelog.txt @@ -1,3 +1,18 @@ +Version 1.1.1: +- Compiler-Warnungen des P4-Builds aufgeräumt (rein technisch, keine Funktionsänderung): + - „LV_FS_DEFAULT_DRIVE_LETTER is deprecated": Die Option heißt ab LVGL 9.3 + LV_FS_DEFAULT_DRIVER_LETTER. Der alte Name funktionierte zwar noch, löste aber in + lv_api_map_v9_1.h ein #warning aus - und zwar in JEDER Übersetzungseinheit, die lvgl.h + einbindet. Das allein waren rund 60 Warnungen pro Build, die alles andere zugedeckt haben. + In lv_conf.h umbenannt. + - „bitwise operation between different enumeration types is deprecated": LV_PART_* und + LV_STATE_* sind in LVGL 9 zwei verschiedene Enum-Typen; sie direkt mit | zu verknüpfen ist + in C++20 abgekündigt. Neues Makro TH_SEL(part, state) in theme.h castet beide auf + lv_style_selector_t (ohnehin uint32_t). Betraf 5 Stellen in ui.cpp und theme.h. +- Bug-Fix: Der Puffer für die Cold-Extraction-Infozeile auf der Brew-Seite war mit 192 Bytes + zu klein - der Text ist rund 205 Zeichen lang (das „°" zählt als zwei Bytes), die letzte + Zeile wurde also abgeschnitten. Jetzt 256 Bytes. + Version 1.1.0: - Cold Extraction am Display bedienbar (braucht S3-Firmware ab 5.3.2): - Neuer Schalter „Cold Extraction" auf der Seite „Temperaturen" unter „Modi", darunter eine diff --git a/JC_Display_Firmware/config.h b/JC_Display_Firmware/config.h index 1ea6025..e1b5ffe 100644 --- a/JC_Display_Firmware/config.h +++ b/JC_Display_Firmware/config.h @@ -65,7 +65,7 @@ // ------------------------------------------------------------------------------------- // Firmware // ------------------------------------------------------------------------------------- -#define DISPLAY_FW_VERSION "1.1.0" // Firmware-Stand der P4-Display-Steuerung (Info-Seite) +#define DISPLAY_FW_VERSION "1.1.1" // Firmware-Stand der P4-Display-Steuerung (Info-Seite) // ------------------------------------------------------------------------------------- // Protokoll diff --git a/JC_Display_Firmware/lv_conf.h b/JC_Display_Firmware/lv_conf.h index cb776ed..0e47eca 100644 --- a/JC_Display_Firmware/lv_conf.h +++ b/JC_Display_Firmware/lv_conf.h @@ -727,7 +727,10 @@ /*File system interfaces for common APIs */ /*Setting a default driver letter allows skipping the driver prefix in filepaths*/ -#define LV_FS_DEFAULT_DRIVE_LETTER '\0' +/* Ab LVGL 9.3 heisst die Option LV_FS_DEFAULT_DRIVER_LETTER. Der alte Name wird zwar noch + uebersetzt, loest aber in lv_api_map_v9_1.h ein #warning aus - und zwar in JEDER + Uebersetzungseinheit, die lvgl.h einbindet (~60 Warnungen pro Build). */ +#define LV_FS_DEFAULT_DRIVER_LETTER '\0' /*API for fopen, fread, etc*/ #define LV_USE_FS_STDIO 0 diff --git a/JC_Display_Firmware/theme.h b/JC_Display_Firmware/theme.h index ce43224..0d25f1b 100644 --- a/JC_Display_Firmware/theme.h +++ b/JC_Display_Firmware/theme.h @@ -25,6 +25,11 @@ #define COL_BORDER lv_color_hex(0x555555) #define COL_INPUT_BG lv_color_hex(0x101010) +// Style-Selektor aus Part + State. LV_PART_* und LV_STATE_* sind in LVGL 9 zwei +// verschiedene Enum-Typen; sie direkt mit | zu verknuepfen ist in C++20 deprecated +// (-Wdeprecated-enum-enum-conversion). Der Zieltyp ist ohnehin uint32_t. +#define TH_SEL(part, state) ((lv_style_selector_t)(part) | (lv_style_selector_t)(state)) + // ---- Karte (dunkel, abgerundet) ---- static inline lv_obj_t* th_card(lv_obj_t* parent) { lv_obj_t* c = lv_obj_create(parent); @@ -61,7 +66,7 @@ static inline lv_obj_t* th_textarea(lv_obj_t* parent, bool oneLine) { lv_textarea_set_one_line(ta, oneLine); lv_obj_set_style_bg_color(ta, COL_INPUT_BG, 0); lv_obj_set_style_border_color(ta, COL_BORDER, 0); - lv_obj_set_style_border_color(ta, COL_ACCENT, LV_PART_MAIN | LV_STATE_FOCUSED); + lv_obj_set_style_border_color(ta, COL_ACCENT, TH_SEL(LV_PART_MAIN, LV_STATE_FOCUSED)); lv_obj_set_style_border_width(ta, 1, 0); lv_obj_set_style_radius(ta, 8, 0); lv_obj_set_style_text_color(ta, COL_TEXT, 0); diff --git a/JC_Display_Firmware/ui.cpp b/JC_Display_Firmware/ui.cpp index bc92abf..e80f410 100644 --- a/JC_Display_Firmware/ui.cpp +++ b/JC_Display_Firmware/ui.cpp @@ -389,7 +389,7 @@ static lv_obj_t* row(lv_obj_t* parent, const char* label) { static lv_obj_t* add_switch(lv_obj_t* parent, const char* label) { lv_obj_t* r = row(parent, label); lv_obj_t* sw = lv_switch_create(r); - lv_obj_set_style_bg_color(sw, COL_ACCENT, LV_PART_INDICATOR | LV_STATE_CHECKED); + lv_obj_set_style_bg_color(sw, COL_ACCENT, TH_SEL(LV_PART_INDICATOR, LV_STATE_CHECKED)); return sw; } static lv_obj_t* add_num(lv_obj_t* parent, const char* label) { @@ -2348,7 +2348,7 @@ static void build_wifi(lv_obj_t* p) { // Aktionszeile: Scan + gewaehltes Netz lv_obj_t* ar = row(p, nullptr); g_btnScan = th_accent_button(ar, LV_SYMBOL_REFRESH " Netzwerke suchen"); - lv_obj_set_style_bg_opa(g_btnScan, LV_OPA_40, LV_PART_MAIN | LV_STATE_DISABLED); + lv_obj_set_style_bg_opa(g_btnScan, LV_OPA_40, TH_SEL(LV_PART_MAIN, LV_STATE_DISABLED)); lv_obj_add_event_cb(g_btnScan, wifi_scan_cb, LV_EVENT_CLICKED, nullptr); lblWifiSel = lv_label_create(ar); lv_label_set_text(lblWifiSel, "Netz: -"); @@ -2585,13 +2585,13 @@ static void build_profiles(lv_obj_t* p) { lv_obj_set_style_text_color(profDetailLbl, COL_TEXT_DIM, 0); profLoadBtn = th_accent_button(dcard, "Profil laden"); lv_obj_set_width(profLoadBtn, LV_PCT(100)); - lv_obj_set_style_bg_opa(profLoadBtn, LV_OPA_40, LV_PART_MAIN | LV_STATE_DISABLED); + lv_obj_set_style_bg_opa(profLoadBtn, LV_OPA_40, TH_SEL(LV_PART_MAIN, LV_STATE_DISABLED)); lv_obj_add_state(profLoadBtn, LV_STATE_DISABLED); lv_obj_add_event_cb(profLoadBtn, prof_do_load_cb, LV_EVENT_CLICKED, nullptr); profDelBtn = th_button(dcard, "Profil löschen", COL_DANGER, COL_TEXT); lv_obj_set_width(profDelBtn, LV_PCT(100)); - lv_obj_set_style_bg_opa(profDelBtn, LV_OPA_40, LV_PART_MAIN | LV_STATE_DISABLED); + lv_obj_set_style_bg_opa(profDelBtn, LV_OPA_40, TH_SEL(LV_PART_MAIN, LV_STATE_DISABLED)); lv_obj_add_state(profDelBtn, LV_STATE_DISABLED); lv_obj_add_event_cb(profDelBtn, prof_delete_cb, LV_EVENT_CLICKED, nullptr); } @@ -3870,7 +3870,7 @@ void ui_update(const MachineState& st) { } if (lblBrewColdEx) { if (st.cxEnabled) { - char b[192]; + char b[256]; // der Text ist ~205 Zeichen lang (das ° zaehlt als 2 Bytes) snprintf(b, sizeof(b), "Cold Extraction (nur Anzeige, Einstellung in der Web-UI):\n" "Freigabe < %.1f °C | Vorbenetzung %.0f s | Ziel %.0f g | max. %.0f s\n"