Files
pictureFrame-firmware/platformio.ini
T
football2801 6a924963e5 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.
2026-05-08 23:48:20 -04:00

95 lines
3.2 KiB
INI

; pictureFrame firmware build environments.
;
; Layout: shared sources at src/ root + panel-specific implementations at
; src/panels/{vendor}/v{N}/. Each panel/version gets its own [env:...] block
; that sets dimensions, pins, and panel-id via build_flags, and selects its
; driver via build_src_filter. New panel = new env block + new
; src/panels/{vendor}/v{N}/ folder + new data/{vendor}-v{N}/ folder. No
; surgery to existing envs.
;
; Old envs preserved as historical snapshots — re-flashing units in the
; 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 ──
[env:waveshare73-v1]
platform = espressif32
board = esp32dev
framework = arduino
upload_port = /dev/ttyUSB0
monitor_port = /dev/ttyUSB0
monitor_speed = 115200
board_build.filesystem = littlefs
build_src_filter =
+<main.cpp>
+<panels/waveshare73/v1/>
build_flags =
-DEPD_WIDTH=800
-DEPD_HEIGHT=480
-DMAX_PANEL_WIDTH=800
-DPIN_SCK=18
-DPIN_MOSI=23
-DPIN_CS=5
-DPIN_DC=17
-DPIN_RST=16
-DPIN_BUSY=4
-DPANEL_ID=\"waveshare-7.3-spectra6\"
lib_deps =
ricmoo/QRCode@^0.0.1
; ── Hardware visual test: flash a single image from data/waveshare73-v1/img.bin ──
; No WiFi, no server.
; 1. pio run -e test-display --target uploadfs (upload data/)
; 2. pio run -e test-display --target upload (upload sketch)
[env:test-display]
extends = env:waveshare73-v1
build_src_filter =
+<test_display.cpp>
+<panels/waveshare73/v1/>
build_flags =
${env:waveshare73-v1.build_flags}
-DENV_TEST_DISPLAY
; ── Visual hardware tests for the sync-fail / no-WiFi border ──
; Reads the cached /img.bin from LittleFS and draws it with a yellow / red
; border. Sets NVS err_border=1 so the next normal-firmware boot exercises
; the recovery redraw via 304. Flow:
; 1. pio run -e sim-yellow --target upload (see yellow border)
; 2. pio run -e sim-red --target upload (see red border)
; 3. pio run -e waveshare73-v1 --target upload (back to normal; verifies 304 recovery)
[env:sim-yellow]
extends = env:waveshare73-v1
build_src_filter =
+<sim_border.cpp>
+<panels/waveshare73/v1/>
build_flags =
${env:waveshare73-v1.build_flags}
-DSIM_BORDER
-DSIM_BORDER_COLOR=COLOR_YELLOW
[env:sim-red]
extends = env:waveshare73-v1
build_src_filter =
+<sim_border.cpp>
+<panels/waveshare73/v1/>
build_flags =
${env:waveshare73-v1.build_flags}
-DSIM_BORDER
-DSIM_BORDER_COLOR=COLOR_RED
; ── Native unit tests — no hardware, uses test/mocks/ ──
[env:native-test]
platform = native
lib_deps =
throwtheswitch/Unity@^2.6
build_flags = -DUNIT_TEST -std=c++17 -iquote test/mocks -iquote test -Itest/mocks -Itest
test_build_src = no