chore: branch setup — version.txt, platformio.ini envs, qio_qspi

This commit is contained in:
eddy 2026-08-01 00:18:16 +02:00
commit a371e29058
4 changed files with 58 additions and 6 deletions

3
.gitignore vendored
View file

@ -1,3 +1,6 @@
# Generated from version.txt
src/version.h
# PlatformIO # PlatformIO
.pio/ .pio/
.pioenvs/ .pioenvs/

View file

@ -1,18 +1,38 @@
[env:m5stack-atoms3r] [env:s3lite-server]
platform = espressif32@6.7.0 platform = espressif32@6.7.0
board = esp32-s3-devkitc-1 board = esp32-s3-devkitc-1
framework = arduino framework = arduino
board_build.arduino.memory_type = qio_opi board_build.arduino.memory_type = qio_qspi
build_flags = build_flags =
-DESP32S3 -DESP32S3
-DBOARD_HAS_PSRAM
-mfix-esp32-psram-cache-issue
-DCORE_DEBUG_LEVEL=5 -DCORE_DEBUG_LEVEL=5
-DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1 -DARDUINO_USB_MODE=1
-DCONFIG_BT_NIMBLE_ENABLED
lib_deps = lib_deps =
fastled/FastLED@^3
h2zero/NimBLE-Arduino@^2 h2zero/NimBLE-Arduino@^2
upload_port = /dev/ttyACM1 upload_port = /dev/ttyACM1
upload_speed = 115200 upload_speed = 115200
upload_flags = --no-stub upload_flags = --no-stub
build_src_filter = +<main.cpp> -<client.cpp>
extra_scripts = pre:tools/pio_version_pre.py
[env:s3lite-client]
platform = espressif32@6.7.0
board = esp32-s3-devkitc-1
framework = arduino
board_build.arduino.memory_type = qio_qspi
build_flags =
-DESP32S3
-DCORE_DEBUG_LEVEL=5
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
-DDEVICE_ID=1
lib_deps =
fastled/FastLED@^3
h2zero/NimBLE-Arduino@^2
upload_port = /dev/ttyACM2
upload_speed = 115200
upload_flags = --no-stub
build_src_filter = +<client.cpp> -<main.cpp>
extra_scripts = pre:tools/pio_version_pre.py

27
tools/pio_version_pre.py Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env python3
"""Pre-build: generate src/version.h from version.txt so the firmware
uses the single source of truth for version numbers."""
Import("env")
import os
project_dir = env.subst("$PROJECT_DIR")
ver_file = os.path.join(project_dir, "version.txt")
out_file = os.path.join(project_dir, "src", "version.h")
versions = {}
with open(ver_file) as f:
for line in f:
line = line.strip()
if "=" in line:
k, v = line.split("=", 1)
versions[k.strip()] = v.strip()
header = f"""// Auto-generated from version.txt — DO NOT EDIT
#define FIRMWARE_VERSION_SERVER "{versions['server']}"
#define FIRMWARE_VERSION_CLIENT "{versions['client']}"
"""
with open(out_file, "w") as f:
f.write(header)
print(f" versions: server={versions['server']} client={versions['client']} -> src/version.h")

2
version.txt Normal file
View file

@ -0,0 +1,2 @@
server=6
client=1