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/touch.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'main/touch.c') diff --git a/main/touch.c b/main/touch.c index f13183d..4d8003f 100644 --- a/main/touch.c +++ b/main/touch.c @@ -10,6 +10,7 @@ #include "freertos/task.h" #include "display.h" +#include "local_screens.h" #include "state_machine.h" #include "viewport_state.h" @@ -80,10 +81,13 @@ static void touch_task(void *arg) if (dt_ms > 0 && dt_ms <= TAP_MAX_MS) { last_tap_us = now; - viewport_run_state_t cur = state_machine_current(); + // Cancel any BOOT-button identity overlay so a tap-to-sleep + // doesn't fight the overlay timer trying to restore content. + if (local_screens_overlay_active()) local_screens_overlay_dismiss(); viewport_run_state_t target = - (cur == VIEWPORT_STATE_AWAKE) ? VIEWPORT_STATE_ASLEEP - : VIEWPORT_STATE_AWAKE; + (state_machine_current() == VIEWPORT_STATE_AWAKE) + ? VIEWPORT_STATE_ASLEEP + : VIEWPORT_STATE_AWAKE; ESP_LOGI(TAG, "tap (%lu ms) -> %s", (unsigned long)dt_ms, target == VIEWPORT_STATE_AWAKE ? "wake" : "sleep"); state_machine_set_local(target); -- cgit v1.2.3