From b05d90bd1291eefc4bcdf8ea94cf905201fa8195 Mon Sep 17 00:00:00 2001 From: Dejvino Date: Sat, 14 Nov 2026 12:15:01 +0100 Subject: [PATCH] NetDeck: move sketch to src/netdeck/ next to nd_layout.h - src/netdeck/NetDeck.ino (git mv); the ../../src/netdeck include became a plain "nd_layout.h" - examples/NetDeck/platformio.ini: src_dir = ../../src/netdeck, -I . for utilities.h (pio build green: RAM 8.6%, Flash 5.6%) - emulator Makefile: NetDeck APP_DIR -> ../src/netdeck, extra -I for utilities.h; make APP=NetDeck + smoke verified green - STATUS.md: notes the new source layout --- .gitignore | 1 + emulator/Makefile | 6 +++++- examples/NetDeck/platformio.ini | 9 ++++++--- {examples/NetDeck => src/netdeck}/NetDeck.ino | 2 +- src/netdeck/STATUS.md | 10 ++++++++++ src/netdeck/nd_layout.h | 2 +- 6 files changed, 24 insertions(+), 6 deletions(-) rename {examples/NetDeck => src/netdeck}/NetDeck.ino (99%) diff --git a/.gitignore b/.gitignore index 85c2c1e..6969f81 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ emulator/*-emu emulator/*-prefs.cfg emulator/m0_*.bmp emulator/m0_*.png +emulator/smoke_frame.bmp diff --git a/emulator/Makefile b/emulator/Makefile index df1b74d..81a4e51 100644 --- a/emulator/Makefile +++ b/emulator/Makefile @@ -22,6 +22,10 @@ APP_TITLE := CRT Terminal endif ifeq ($(APP),NetDeck) APP_TITLE := NetDeck // Breach & Board +# the sketch moved to src/netdeck (next to nd_layout.h); its hardware +# shim header utilities.h stays with the pio project in examples/NetDeck +APP_DIR := ../src/netdeck +APP_EXTRA_INC := ../examples/NetDeck endif ifeq ($(APP),Lotus3) APP_TITLE := Lotus 3 @@ -35,7 +39,7 @@ APP_TITLE ?= $(APP) CXX ?= g++ CXXFLAGS ?= -std=gnu++17 -O2 -Wall -Wextra SDLFLAGS := -I/usr/include/SDL2 -INC := -Isrc/shim -I$(APP_DIR) +INC := -Isrc/shim -I$(APP_DIR) $(if $(APP_EXTRA_INC),-I$(APP_EXTRA_INC)) LIBS := -lSDL2 -lSDL2_ttf DEFS += -DAPP_INO='"$(APP).ino"' -DAPP_NAME='"$(APP_TITLE)"' diff --git a/examples/NetDeck/platformio.ini b/examples/NetDeck/platformio.ini index 1034181..08c10ce 100644 --- a/examples/NetDeck/platformio.ini +++ b/examples/NetDeck/platformio.ini @@ -3,13 +3,14 @@ ; The root platformio.ini's src_dir is global, so this sketch ships its own ; project config: build with pio run -d examples/NetDeck ; Board + shared library discovery point back at the repo root. +; The sketch source itself lives in src/netdeck/ next to nd_layout.h; +; utilities.h (T-Deck pin map) is found via the -I project-root flag below. [platformio] default_envs = T-Deck boards_dir = ../../boards -; sketch lives at the project root (the emulator Makefile includes it from -; there), so scan the project root instead of a src/ folder -src_dir = . +; sketch + its headers live in ../../src/netdeck +src_dir = ../../src/netdeck [env:T-Deck] platform = espressif32@6.3.0 @@ -20,6 +21,8 @@ upload_speed = 921600 monitor_speed = 115200 build_flags = -DBOARD_HAS_PSRAM=1 + ; utilities.h (T-Deck pin map) still lives in this project dir + -I . -DCORE_DEBUG_LEVEL=1 -DARDUINO_USB_CDC_ON_BOOT=1 -DDISABLE_ALL_LIBRARY_WARNINGS diff --git a/examples/NetDeck/NetDeck.ino b/src/netdeck/NetDeck.ino similarity index 99% rename from examples/NetDeck/NetDeck.ino rename to src/netdeck/NetDeck.ino index 7219034..cac9876 100644 --- a/examples/NetDeck/NetDeck.ino +++ b/src/netdeck/NetDeck.ino @@ -44,7 +44,7 @@ #include #include "utilities.h" #include "TouchDrvGT911.hpp" -#include "../../src/netdeck/nd_layout.h" +#include "nd_layout.h" // --------------------------------------------------------------------------- // Hardware + full-frame rendering (M1 anti-flicker pattern) diff --git a/src/netdeck/STATUS.md b/src/netdeck/STATUS.md index 5963b9d..c7844e5 100644 --- a/src/netdeck/STATUS.md +++ b/src/netdeck/STATUS.md @@ -133,3 +133,13 @@ message). The litmus-test loop (crack HIVE, FRENZY the turret, dash the squad through) completes in M4; until then the loss path + reset are the verifiable branches. On-device check still pending (inherits the M1 checklist in §M1 above). + +### Source layout (this commit) + +The sketch moved from `examples/NetDeck/NetDeck.ino` to +`src/netdeck/NetDeck.ino`, next to `nd_layout.h` (the relative include +became a plain `#include "nd_layout.h"`). Build configs stay put: +`examples/NetDeck/platformio.ini` now sets `src_dir = ../../src/netdeck` +(plus `-I .` for `utilities.h`), and the emulator Makefile points NetDeck's +`APP_DIR` at `../src/netdeck`. `pio run -d examples/NetDeck` and +`make APP=NetDeck` are both verified green from the new location. diff --git a/src/netdeck/nd_layout.h b/src/netdeck/nd_layout.h index c3c20cb..3693ea6 100644 --- a/src/netdeck/nd_layout.h +++ b/src/netdeck/nd_layout.h @@ -5,7 +5,7 @@ * layout described in DESIGN.md §3 and the fixed-timestep * engine loop from DESIGN.md §6. * - * Header-only: included by the sketch (examples/NetDeck) from both the + * Header-only: included by the sketch (src/netdeck) from both the * PlatformIO firmware build and the SDL2 emulator build. */ #pragma once