src.nth.io/

summaryrefslogtreecommitdiff
path: root/main/app_main.c
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-06-14 20:11:21 -0500
committerLuke Hoersten <[email protected]>2026-06-14 20:11:21 -0500
commit865c4859d710870245ae7954e729edcaf442a921 (patch)
treec22cb7d60fb8ea3bba6e9e85b45779d0dfa87d4f /main/app_main.c
parent8e2de89efb540fd6a3dce2086216d3afc49e6831 (diff)
Default name = MAC; brief wake on boot; drop dead touch defences
- Seed viewport_name with the full base MAC, colons stripped (e8:f6:0a:e0:90:94 → "e8f60ae09094"). Stable across reboots, globally unique, 12 alphanumeric chars — well inside the mDNS hostname limit even with the "viewport-" prefix. - Add a mac_str field to viewport_state and expose it as the new "mac" key in GET /state and as a "mac" line on the info screen. - "Configured" no longer requires a viewport_name (it always has the MAC default); the scrypted URL alone gates outbound POSTs and the loading-vs-info screen choice. - Strip viewport_name[0] fallbacks in http_api / mdns / local_screens now that the field is never empty. - Replace the wake-on-boot-stays-on behaviour with a ~600 ms flash followed by sleep — long enough for the FT5426 touch IC to come out of its initial unresponsive state, short enough that an idle device doesn't burn the backlight. - Drop the touch defensive cruft added when we were chasing a PoE-power theory: the DEV_MODE=0x00 write at init, the touch_reset_pulse() call at init, and the runtime wedge-self-heal in the polling loop didn't actually fix anything — the wake-on-boot flash did. Also delete the display_touch_reset_pulse() helper since it now has zero callers.
Diffstat (limited to 'main/app_main.c')
-rw-r--r--main/app_main.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/main/app_main.c b/main/app_main.c
index c411c46..a60496d 100644
--- a/main/app_main.c
+++ b/main/app_main.c
@@ -103,13 +103,16 @@ static void display_setup_task(void *arg)
ESP_LOGI(TAG, "display subsystems [%s] up", flags);
- // Wake the display on boot. Empirically the FT5426 touch IC only
- // reports contacts when the LCD is actively streaming with the
- // backlight on — booting straight into ASLEEP leaves taps silently
- // unread. The idle timer (idle_timeout_ms) puts the device back to
- // sleep on its own if nothing happens.
+ // Briefly wake the display on boot so the FT5426 touch IC can come
+ // out of its initial unresponsive state — empirically it only
+ // reports contacts when the LCD has been actively streaming with
+ // the backlight on at least once since power-up. A 600 ms flash is
+ // enough; we then sleep so an idle device doesn't burn the
+ // backlight until the idle timer fires.
if (dsp_err == ESP_OK) {
state_machine_set(VIEWPORT_STATE_AWAKE);
+ vTaskDelay(pdMS_TO_TICKS(600));
+ state_machine_set(VIEWPORT_STATE_ASLEEP);
}
vTaskDelete(NULL);