refactor: move the v2 controller to the repository root

The ESP-IDF project, docs, tools, tests and web UI move from v2/ to the
root, and the Makefile, README, build scripts and test runner drop the
v2/ prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-11-02 23:44:58 +13:00
1 parent 71bd320661
commit 1c222771a5
66 files changed
+30 -31

No files matched your search

+12 -13
View File
@@ -1,4 +1,4 @@
# Build, flash and monitor the v2 ESP32-S3 controller (ESP-IDF in Docker).
# Build, flash and monitor the ESP32-S3 controller (ESP-IDF in Docker).
#
# make list the targets
# make build minify the web UI, then build the firmware
@@ -11,9 +11,8 @@
PORT ?= /dev/ttyACM0
IDF_IMAGE ?= espressif/idf:v5.5.5
SECS ?= 10
V2 := v2
DOCKER_RUN = docker run --rm -v "$(CURDIR)/$(V2)":/project -w /project
DOCKER_RUN = docker run --rm -v "$(CURDIR)":/project -w /project
DEVICE = --device=$(PORT)
# Interactive terminal only when there is one (monitor needs it, CI does not have it)
TTY := $(shell [ -t 0 ] && echo -it)
@@ -26,7 +25,7 @@ FIX_OWNER = chown -R $(OWNER) /project
.PHONY: help web build flash ota monitor flash-monitor log size menuconfig clean fullclean erase test test-driver test-envelope
help:
@echo "v2 controller (ESP32-S3):"
@echo "LED controller (ESP32-S3):"
@echo " make build minify + gzip the web UI, then build the firmware"
@echo " make flash flash firmware and web UI to PORT ($(PORT))"
@echo " make ota HOST=ip build, then upload the firmware (web UI included) over Ethernet (no USB)"
@@ -44,7 +43,7 @@ help:
# --- web UI ---------------------------------------------------------------
web:
cd $(V2) && tools/build_web.sh
tools/build_web.sh
# --- firmware -------------------------------------------------------------
build: web
@@ -55,7 +54,7 @@ flash: build
ota: build
@test -n "$(HOST)" || { echo "usage: make ota HOST=<controller ip>"; exit 1; }
python3 $(V2)/tools/ota.py $(HOST)
python3 tools/ota.py $(HOST)
monitor:
$(DOCKER_RUN) $(TTY) $(DEVICE) $(IDF_IMAGE) idf.py -p $(PORT) monitor
@@ -64,7 +63,7 @@ flash-monitor: flash monitor
# Non-interactive: reset the board and print what it says for SECS seconds
log:
python3 $(V2)/tools/serial_log.py $(PORT) $(SECS)
python3 tools/serial_log.py $(PORT) $(SECS)
size:
$(DOCKER_RUN) $(IDF_IMAGE) bash -c 'idf.py size; rc=$$?; $(FIX_OWNER); exit $$rc'
@@ -76,23 +75,23 @@ erase:
$(DOCKER_RUN) $(DEVICE) $(IDF_IMAGE) idf.py -p $(PORT) erase-flash
clean:
rm -rf $(V2)/build
rm -rf build
fullclean: clean
rm -rf $(V2)/sdkconfig $(V2)/sdkconfig.old $(V2)/www_dist
rm -rf sdkconfig sdkconfig.old www_dist
# --- tests ----------------------------------------------------------------
test: test-driver test-envelope
# Host-side unit tests for the driver's link layer and beat sync (pure Python)
test-driver:
python3 $(V2)/tools/run_driver_tests.py
python3 tools/run_driver_tests.py
# The C envelope packer must produce the same bytes as v2/test/binary_envelope.py
# The C envelope packer must produce the same bytes as test/binary_envelope.py
test-envelope:
@tmp=$$(mktemp -d); \
(cd $(V2)/test && python3 env_check.py) > $$tmp/py.txt; \
docker run --rm -v "$(CURDIR)/$(V2)":/project -w /project/test $(IDF_IMAGE) bash -c \
(cd test && python3 env_check.py) > $$tmp/py.txt; \
docker run --rm -v "$(CURDIR)":/project -w /project/test $(IDF_IMAGE) bash -c \
'gcc -Wall -I/opt/esp/idf/components/json/cJSON env_host.c ../main/envelope.c /opt/esp/idf/components/json/cJSON/cJSON.c -o /tmp/t -lm && /tmp/t' 2>&1 | tail -2 > $$tmp/c.txt; \
if diff -q $$tmp/py.txt $$tmp/c.txt >/dev/null; then echo "envelope: C and Python agree"; rm -rf $$tmp; \
else echo "envelope: MISMATCH"; diff $$tmp/py.txt $$tmp/c.txt; rm -rf $$tmp; exit 1; fi