clement a8af29068b
CI / platformio (pull_request) Failing after 4m50s
CI / platformio (push) Failing after 10m23s
feat(gamebook): full-height scrolling text + real pad mapping
Context:
Two issues on the Freenove gamebook: (1) long passages were clipped —
the reading band was small and text overflowed; (2) the 5-way pad was
decoded wrong, so navigation felt random, and on this unit the physical
Up button is electrically dead (held = no voltage change).

Approach:
Give the reading text the whole screen height in a vertically
scrollable container, split selection from scrolling, and remap the
keys to the pad's MEASURED voltages.

Changes:
- display_ui: gamebook view reworked — compact title, a full-height
  scrollable reading container (the body wraps and scrolls, never
  clipped), and a one-line choice selector pinned at the bottom; new
  display_ui_gamebook_scroll() + reset-on-new-passage; show() gains a
  reset_scroll arg; body buffer 512 -> 1100.
- gamebook.c: controls matched to the measured ladder
  (key2=LEFT, key4=DOWN, key5=RIGHT, key1=CLICK; key3 unused; Up dead):
  Left/Right scroll the text up/down, Down cycles the answer, Click
  validates; library nav cycles tiles without needing Up.

Impact:
Long passages are fully readable (they scroll), and all four working
pad buttons do the right thing; nothing depends on the dead Up button.
Hardware-calibrated against the real pad voltages.
2026-06-19 23:56:45 +02:00
2026-04-03 07:36:51 +02:00
2026-06-10 13:49:10 +02:00

ESP32_ZACUS

Workspace firmware centré sur une seule cible: Freenove FNK0102H avec ui_freenove_allinone.

Docs canoniques

  • docs/QUICKSTART.md: bootstrap, build, flash, monitor, smoke.
  • docs/FNK0102H_SOURCE_OF_TRUTH.md: matrice board/config/pins/support.
  • README_ESP32_ZACUS.md: notes runtime et signatures série utiles.

Deux firmwares

  • ui_freenove_allinone/ — firmware Arduino/PlatformIO historique (UI/audio/caméra/réseau), chemin release stabilisé.
  • idf_zacus/ — firmware master ESP-IDF 5.4 (migration en cours, branche feat/idf-migration) : voix NPC (esp-sr wakeword + bridge WS), énigmes locales P1 son / P3 QR (caméra OV3660 + micro), écran LVGL (vue scène, viewfinder, shell Workbench, intro cracktro), et une surface REST de jeu (/game/step, /game/puzzle_state, /game/file). Voir idf_zacus/README.md.
  • box3_voice/ — firmware annexe ESP32-S3-BOX-3 : pipeline voix + générateur de stimulus (/stim/qr, /stim/melody) pour exercer les énigmes du master. Voir box3_voice/README.md.

Arborescence utile

  • platformio.ini: env PlatformIO canonique freenove_esp32s3_full_with_ui.
  • ui_freenove_allinone/: firmware Arduino UI/audio/caméra/réseau.
  • idf_zacus/: firmware master ESP-IDF (énigmes locales, écran LVGL, REST de jeu).
  • box3_voice/: firmware BOX-3 (voix + générateur de stimulus QR/mélodie).
  • data/: contenu LittleFS.
  • lib/: bibliothèques runtime.
  • scripts/: bootstrap et scripts repo.
  • tests/: harness Sprint 1, Sprint 2, Sprint 3, Phase 9.

Environnements supportés

  • freenove_esp32s3_full_with_ui: chemin release/stabilisation.
  • freenove_esp32s3: alias du chemin canonique.
  • freenove_esp32s3_touch: expérimental, hors release, sans CI.

Démarrage rapide

./scripts/bootstrap_platformio.sh
./scripts/doctor_repo.sh
source .venv/bin/activate
python -m platformio run -e freenove_esp32s3_full_with_ui
python -m platformio run -e freenove_esp32s3_full_with_ui -t buildfs
python -m platformio run -e freenove_esp32s3_full_with_ui -t uploadfs --upload-port <PORT>
python -m platformio run -e freenove_esp32s3_full_with_ui -t upload --upload-port <PORT>
python -m platformio device monitor -b 115200 --port <PORT>

Guardrails runtime

  • Si la PSRAM est détectée, le firmware démarre normalement puis autorise le réseau après validation UI.
  • Si la PSRAM n'est pas détectée, le firmware bascule en safe diagnostic mode.
  • En mode diagnostic, le firmware garde uniquement la pile série, l'affichage minimal et les boutons physiques.
  • En mode diagnostic, caméra, FX, micro, audio, Wi-Fi, ESP-NOW, WebUI et partage de fichiers restent coupés.

Vérifications minimales

./scripts/doctor_repo.sh
./scripts/check_memory_budget.sh --env freenove_esp32s3_full_with_ui --max-ram 75 --max-flash 80 --yes
python tests/sprint1_utility_contract.py --mode serial --port <PORT>
python tests/sprint2_capture_contract.py --mode serial --port <PORT>
python tests/sprint3_audio_contract.py --mode serial --port <PORT>
python tests/phase9_ui_validation.py --port <PORT>

Audit & Execution Plan (2026-03-10)

Snapshot

  • Priority: P2
  • Tech profile: embedded
  • Workflows: yes
  • Tests: yes
  • Debt markers: 0
  • Source files: 258

Corrections Prioritaires

  • Vérifier target PlatformIO et budget mémoire
  • Ajouter/fiabiliser les commandes de vérification automatiques.
  • Clore les points bloquants avant optimisation avancée.

Optimisation

  • Identifier le hotspot principal et mesurer avant/après.
  • Réduire la complexité des modules les plus touchés.

Mémoire chantier

  • Control plane: /Users/electron/.codex/memories/electron_rare_chantier
  • Repo card: /Users/electron/.codex/memories/electron_rare_chantier/REPOS/ESP32_ZACUS.md
S
Description
ESP32 ZACUS — firmware ESP32 pour le projet Le Mystere du Professeur Zacus
Readme 11 MiB
Languages
C 75.4%
C++ 22%
Python 2.1%
Shell 0.3%
CMake 0.1%