fix(build): move data_dir to [platformio] section so uploadfs sees the panel files

PlatformIO silently ignores data_dir inside [env:…] blocks (it warned
"Ignore unknown configuration option `data_dir`" on every run, but we
read past it). Without a recognized data_dir, uploadfs packed the entire
project data/ root into LittleFS, putting every file under
/waveshare73-v1/<file> instead of /<file>. The firmware looks at /, so
draw_from_lfs fell back to its solid-yellow epd_fill — a blank yellow
panel after a fresh uploadfs.

Moving the directive to the project-level [platformio] section makes
PlatformIO honor it. All envs currently target the V1 panel so a single
project-level data_dir is fine; when a second panel ships, swap via an
extra_scripts shim that picks the dir from \$PIOENV before uploadfs runs.
This commit is contained in:
2026-05-08 23:48:20 -04:00
parent fb4c5ff5d3
commit 6a924963e5
+9 -1
View File
@@ -10,6 +10,15 @@
; Old envs preserved as historical snapshots — re-flashing units in the ; Old envs preserved as historical snapshots — re-flashing units in the
; field stays a one-line `pio run -e <env> --target upload` command. ; field stays a one-line `pio run -e <env> --target upload` command.
; data_dir lives at project level (PlatformIO ignores it inside [env:…]
; blocks — the silent ignore once led to a LittleFS upload that put every
; file under /waveshare73-v1/ instead of /, blanking the panel to the
; epd_fill yellow fallback). All current envs target the V1 panel; when
; a second panel ships, swap this via an extra_scripts shim that picks
; the dir from $PIOENV before uploadfs runs.
[platformio]
data_dir = data/waveshare73-v1
; ── Production firmware: Waveshare 7.3" Spectra-6 + ESP32 dev breakout ── ; ── Production firmware: Waveshare 7.3" Spectra-6 + ESP32 dev breakout ──
[env:waveshare73-v1] [env:waveshare73-v1]
platform = espressif32 platform = espressif32
@@ -19,7 +28,6 @@ upload_port = /dev/ttyUSB0
monitor_port = /dev/ttyUSB0 monitor_port = /dev/ttyUSB0
monitor_speed = 115200 monitor_speed = 115200
board_build.filesystem = littlefs board_build.filesystem = littlefs
data_dir = data/waveshare73-v1
build_src_filter = build_src_filter =
+<main.cpp> +<main.cpp>
+<panels/waveshare73/v1/> +<panels/waveshare73/v1/>