Root cause (on device): sound_engine zero-initialized i2s_pin_config_t, leaving mck_io_num == 0. i2s_set_pin() then claimed GPIO0 — an MCLK-capable pin on the S3 and the trackball centre / BOOT line — as its MCLK output. Verified on device with a diagnostic build: pin0 read LOW at idle, exactly one latched FALLING edge, clicks never registered. - sound_engine: set pins.mck_io_num = I2S_PIN_NO_CHANGE explicitly. - NetDeck: register the trackball click on release with contact-bounce collapse (the proven CrtTerminal pattern); pollTouch re-arms when isPressed() stays true but getPoint() reports no points (stuck GT911 IRQ on some units). - Emulator parity (so this class of bug dies before flashing): GPIO-matrix pin-ownership model in the shim — i2s_set_pin() claims its pins, claimed pins are dead inputs (digitalRead LOW, no edges, loud WARNING on claim/ISR collisions); host pin writes go through emu::setPin/togglePin with an edge-accurate ISR latch (a full press+release pulse between dispatches no longer gets swallowed); E2E inits SDL_INIT_AUDIO so the I2S path actually runs there. Regression coverage: e2e/trackball_click (fails on the old engine), unit/shim_claimed_pin_is_dead_input, unit/shim_edge_survives_same_dispatch_pulse. - Makefile: firmware step follows the sketch move (root platformio.ini, src_dir = src/netdeck). - HW.md: new notes file for emulator-vs-hardware quirks and the on-device debugging recipe. On-device verified: clicks register in both views (beacon drops, node routing). Fast layer 23 unit + 7 integration green. Note: e2e boot_and_controls + network_journey failures are pre-existing at HEAD (reproduced on a clean stash before this change).
50 lines
2.0 KiB
Makefile
50 lines
2.0 KiB
Makefile
# T-Deck workspace — one common build command per app that builds BOTH
|
|
# targets (SDL2 emulator + ESP32-S3 firmware), so a change can never leave
|
|
# one of them silently broken.
|
|
#
|
|
# make netdeck build the NetDeck emulator AND the T-Deck firmware
|
|
# make netdeck-test run the full headless test suite:
|
|
# unit + integration (fast, deterministic)
|
|
# + E2E journeys (separate build, real loop(),
|
|
# ~1-2 min wall time)
|
|
# make netdeck-test-unit fast layer only (unit + integration, seconds) —
|
|
# also what the pre-commit hook runs
|
|
# make netdeck-test-e2e E2E layer only
|
|
# make hooks enable the pre-commit hook for this clone
|
|
# (= git config core.hooksPath .githooks)
|
|
#
|
|
# Firmware builds need platformio: either `pio` on PATH or the default
|
|
# ~/.platformio/penv/bin/pio install.
|
|
|
|
PIO := $(shell command -v pio 2>/dev/null || echo $(HOME)/.platformio/penv/bin/pio)
|
|
|
|
ifeq ($(wildcard $(PIO)),)
|
|
$(error pio not found — put it on PATH or install to ~/.platformio)
|
|
endif
|
|
|
|
netdeck:
|
|
@echo "=== [1/2] NetDeck firmware (ESP32-S3, pio) ==="
|
|
$(PIO) run -e T-Deck
|
|
@echo "=== [2/2] NetDeck emulator (SDL3) ==="
|
|
$(MAKE) --no-print-directory -C emulator APP=NetDeck
|
|
@echo "=== both NetDeck targets built OK ==="
|
|
|
|
netdeck-test:
|
|
@echo "=== NetDeck tests: unit + integration + E2E ==="
|
|
$(MAKE) --no-print-directory -C emulator APP=NetDeck test
|
|
$(MAKE) --no-print-directory -C emulator APP=NetDeck test-e2e
|
|
|
|
netdeck-test-unit:
|
|
$(MAKE) --no-print-directory -C emulator APP=NetDeck test
|
|
|
|
netdeck-test-e2e:
|
|
$(MAKE) --no-print-directory -C emulator APP=NetDeck test-e2e
|
|
|
|
# install the pre-commit hook into this clone (hooks are not versioned in
|
|
# .git/hooks; the repo ships them under .githooks/ instead)
|
|
hooks:
|
|
git config core.hooksPath .githooks
|
|
@echo "pre-commit hook enabled: make netdeck-test-unit runs before every commit"
|
|
|
|
.PHONY: netdeck netdeck-test netdeck-test-unit netdeck-test-e2e hooks
|