src.nth.io/

summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-06-14 21:10:26 -0500
committerLuke Hoersten <[email protected]>2026-06-14 21:10:26 -0500
commit0f0f5dfd4f2910eb8d0e4360d27b7e51a9a14fe7 (patch)
treea10693dee9385c8588f7c2a46edb38d0c1ce800e /main
parentbea6b50ddaf4809402c132d721bfd4be7c971382 (diff)
state_machine: paint placeholder before wake — no more stale-frame flash
On wake, display_wake() turned the backlight on first and then the local_screens_show_loading / show_info call repainted the framebuffer. For a few ms the user saw the previous /frame's contents (the last camera snapshot from the prior wake cycle) before the new screen landed. Swap the order: paint the placeholder first, then turn the backlight on.
Diffstat (limited to 'main')
-rw-r--r--main/state_machine.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/state_machine.c b/main/state_machine.c
index 0a6d491..c2b43c8 100644
--- a/main/state_machine.c
+++ b/main/state_machine.c
@@ -55,12 +55,14 @@ esp_err_t state_machine_set(viewport_run_state_t target)
if (target == VIEWPORT_STATE_AWAKE) {
if (display_is_up()) {
- display_wake();
- // Content choice: a configured device shows "Loading…" until
+ // Paint the placeholder BEFORE turning the backlight on so the
+ // user never glimpses the stale /frame contents from the
+ // previous wake cycle. Configured devices show "Loading…" until
// Scrypted pushes a /frame; a device with no scrypted URL
// shows the info screen since there's no Scrypted to push.
if (configured) local_screens_show_loading();
else local_screens_show_info();
+ display_wake();
}
arm_idle_timer(idle_ms);
ESP_LOGI(TAG, "AWAKE (%s)", configured ? "configured" : "no scrypted URL");