Display quick fixes: instant screen switches, deferred NVS saves, dark OTA writes, version label
Firmware / build (push) Successful in 4m30s
Firmware / build (push) Successful in 4m30s
- screen switches use LV_SCR_LOAD_ANIM_NONE: full-screen fades were re-rendered and blended in software every frame and stuttered at 1024x600 - Tunables: NVS write 3 s after the last change or on leaving the Tuning screen (Tunables::flush()), not per tap - each flash write flickers the RGB panel - OTA: backlight off while the image is written, with full-screen notices before and after; tunables flushed before any reboot - firmware version shown bottom-right on every screen (lv_layer_top) - docs: CLAUDE.md, wiki ota-updates, open-questions #13, log Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,9 +6,32 @@
|
||||
#include "display/lvgl_v8_port.h"
|
||||
#include "ui/ui.h"
|
||||
#include "driveline_screen.h"
|
||||
#include "config/ota_config.h" // FW_VERSION
|
||||
|
||||
namespace DisplayInit {
|
||||
|
||||
static Backlight* g_backlight = nullptr;
|
||||
|
||||
/**
|
||||
* Firmware version, bottom-right on every screen. Lives on lv_layer_top(), which
|
||||
* sits above all screens and survives screen switches. Labels aren't
|
||||
* clickable, so it never steals touches or swipes from the screen below.
|
||||
* Call with the LVGL lock held.
|
||||
*/
|
||||
static void createVersionLabel() {
|
||||
lv_obj_t* lbl = lv_label_create(lv_layer_top());
|
||||
lv_label_set_text(lbl, "A " FW_VERSION);
|
||||
lv_obj_set_style_text_font(lbl, &lv_font_montserrat_14, 0);
|
||||
lv_obj_set_style_text_color(lbl, lv_color_hex(0x808080), 0);
|
||||
lv_obj_align(lbl, LV_ALIGN_BOTTOM_RIGHT, -8, -4);
|
||||
}
|
||||
|
||||
void setBacklight(bool on) {
|
||||
if (g_backlight == nullptr) return;
|
||||
if (on) g_backlight->on();
|
||||
else g_backlight->off();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// PUBLIC API IMPLEMENTATION
|
||||
// ============================================================================
|
||||
@@ -76,6 +99,7 @@ DisplayObjects init() {
|
||||
// empty placeholder now (the SquareLine Home screen was removed 2026-09-21);
|
||||
// swap while the backlight is still off so there's no flash.
|
||||
DrivelineScreen::show();
|
||||
createVersionLabel();
|
||||
lvgl_port_unlock();
|
||||
Serial.println("[DisplayInit] Step 13: SquareLine UI loaded successfully!");
|
||||
|
||||
@@ -91,6 +115,7 @@ DisplayObjects init() {
|
||||
Serial.println("[DisplayInit] Display initialization complete!");
|
||||
|
||||
// Return board and backlight objects for later use
|
||||
g_backlight = backlight;
|
||||
return {board, backlight};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user