From d5cdb6b4e4424d80ac9bfd8e12c129334c23d6f2 Mon Sep 17 00:00:00 2001 From: Luke Hoersten Date: Sun, 14 Jun 2026 15:53:33 -0500 Subject: M3 WIP: DSI bring-up + state machine + identity overlay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DSI / panel: - LDO_VO3 acquired at 2500 mV (VDD_MIPI_DPHY) — without this the PHY PLL busy-waits forever inside esp_lcd_new_dsi_bus. - PSRAM bumped to 200 MHz (CONFIG_IDF_EXPERIMENTAL_FEATURES) to keep the DPI fed without underruns. - Pi-7"-style 800x480 panel init (REG_POWERON, PORTA/PORTB/PWM/PORTC) + 16-bit RGB565 framebuffer with portrait-mode rotation buffer in PSRAM. Currently shows garbled output — known issue, next commit switches to the TC358762-bridge-aware init sequence. State + UX: - viewport_state simplified to AWAKE/ASLEEP only; "unconfigured" is a flag, not a state. Tap always toggles; content choice (identity vs frame) is driven by the configured flag. - BOOT button arms a 15 s identity overlay via local_screens_overlay; expired callback returns to prior state. - Boot-done indicator: two backlight flashes (no usable LED GPIO on the Waveshare board — GPIO 35 BOOT is shared with EMAC TXD1). - Best-effort subsystem init in app_main; display init deferred to its own task so a panel hang can't block networking. Display test pattern: solid R/G/B for 2 s each on boot to characterize the garble independent of text rendering. --- main/local_screens.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'main/local_screens.h') diff --git a/main/local_screens.h b/main/local_screens.h index ffe9a3d..f1e4876 100644 --- a/main/local_screens.h +++ b/main/local_screens.h @@ -1,5 +1,7 @@ #pragma once +#include + #include "esp_err.h" // Initialize the local-screen renderer. Allocates a PSRAM scratch buffer @@ -20,9 +22,15 @@ esp_err_t local_screens_show_ip(void); // until the next /frame arrives. esp_err_t local_screens_show_loading(void); -// Repaint the current best screen for `state`. Used after the BOOT-button -// 15-second overlay expires. -// UNCONFIGURED -> IP screen -// ASLEEP -> (caller handles backlight; this paints a black FB) -// AWAKE -> black FB; Scrypted's next /frame restores live content -esp_err_t local_screens_restore_for_state(void); +// Show the identity ("who am I") screen for `duration_ms`, then drop the +// backlight off. Used by the BOOT button short-press (any state) and by +// the touch handler when the device is unconfigured. +esp_err_t local_screens_overlay(uint32_t duration_ms); + +// True while the identity overlay is currently shown (timer armed). +// Used by the touch handler to make a second tap dismiss the overlay +// instead of re-arming it. +bool local_screens_overlay_active(void); + +// Dismiss the overlay now: cancel the timer and drop the backlight. +void local_screens_overlay_dismiss(void); -- cgit v1.2.3