Files
pictureFrame-firmware/platformio.ini
T
football2801 569bec322f feat(13e6): bring up Waveshare 13.3" Spectra-6 end-to-end
Adds a second panel target alongside the 7.3":
- src/panels/waveshare13e6/v1/ — full epd.h impl with hardware SPI on
  FSPI, dual-CS dispatch (CS_M/CS_S split halves), PSRAM framebuffer
  for image/QR/setup-screen render paths
- src/test_display_13e6.cpp + [env:test-display-13e6] — self-contained
  first-pixels color-bar smoke test, kept as a hardware diagnostic
- [env:waveshare13e6-v1] — production env: ESP32-S3-WROOM-2 N32R16V
  with OPI flash + OPI PSRAM (the WROOM-2 is octal flash; QIO mode
  crashes at do_core_init startup.c:328)
- scripts/gen_screens_13e6.py + data/waveshare13e6-v1/ — 1200x1600
  portrait setup screens with QR overlay regions matching the driver
- scripts/data_dir.py — extra_scripts shim that routes uploadfs to the
  right data/ tree based on $PIOENV (PlatformIO ignores per-env data_dir)
- src/epd.h: epd_setup_pins() abstraction so each panel driver owns its
  own pinMode + SPI.begin; main/test_display/sim_border lose all
  panel-specific GPIO and call epd_setup_pins() once at boot
- src/operation.h: report PANEL_ID via X-Panel-Id header on every poll
  so the server can auto-correct Device.model

7.3" production env stays byte-identical, all 43 native tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 15:53:51 -04:00

153 lines
5.0 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 is single project-wide in [platformio]; PlatformIO silently
; ignores it inside [env:…] blocks. To route uploadfs to the right
; LittleFS payload per panel (waveshare73-v1 vs waveshare13e6-v1), each
; env wires in scripts/data_dir.py via extra_scripts, which overrides
; PROJECT_DATA_DIR from $PIOENV before SCons evaluates uploadfs.
; The project-level default below keeps tooling that runs outside a
; specific env (e.g. raw `pio run`) pointed at the 7.3" payload.
[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
extra_scripts = pre:scripts/data_dir.py
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
; ── Production firmware: Waveshare 13.3" Spectra-6 + ESP32-S3-ePaper-13.3E6 ──
; All-in-one board: ESP32-S3-WROOM-2-N32R16V (32MB OPI flash, 16MB OPI PSRAM),
; CH343 USB-serial on USB-C. PIN_CS aliases CS_M only to satisfy config.h's
; required-pin check — the driver uses CS_M / CS_S explicitly, never PIN_CS.
[env:waveshare13e6-v1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 115200
board_build.flash_size = 32MB
board_build.flash_mode = opi
board_upload.flash_size = 32MB
board_build.arduino.memory_type = opi_opi
board_build.filesystem = littlefs
extra_scripts = pre:scripts/data_dir.py
build_src_filter =
+<main.cpp>
+<panels/waveshare13e6/v1/>
build_flags =
-DEPD_WIDTH=1200
-DEPD_HEIGHT=1600
-DMAX_PANEL_WIDTH=1200
-DPIN_SCK=9
-DPIN_MOSI=46
-DPIN_CS=10
-DPIN_CS_M=10
-DPIN_CS_S=3
-DPIN_DC=11
-DPIN_RST=2
-DPIN_BUSY=12
-DPIN_PWR=1
-DPANEL_ID=\"waveshare-13.3-spectra6\"
-DBOARD_HAS_PSRAM
lib_deps =
ricmoo/QRCode@^0.0.1
; ── First-pixels smoke test for ESP32-S3-ePaper-13.3E6 ──
; Self-contained color-bar bringup, no LittleFS / no shared driver. Kept
; alongside the production env as a fallback for hardware diagnostics:
; if waveshare13e6-v1 misbehaves, this verifies the panel + SPI bus alone.
; pio run -e test-display-13e6 --target upload
[env:test-display-13e6]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 115200
board_build.flash_size = 32MB
board_build.flash_mode = opi
board_upload.flash_size = 32MB
board_build.arduino.memory_type = opi_opi
build_src_filter =
+<test_display_13e6.cpp>
build_flags =
-DENV_TEST_DISPLAY_13E6
-DBOARD_HAS_PSRAM
; ── 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