; firmware/MEMLNaut-NISPS/platformio.ini — MEMLNaut-NISPS firmware, PlatformIO build. ; ; One [env:] per firmware variant. The variant list here IS the ; registry — there is no separate .ino comment-registry to keep in sync. ; Each normal-mode env sets MEMLNAUT_MODE_TYPE to one of the type aliases ; declared in glue/mode_select.hpp; the `selftest` env sets NISPS_SELFTEST=1 ; instead (see src/main.cpp for the fork). ; ; Build one variant: pio run -e pafsynth ; Build a bare `pio run` (no -e): only the hardware's current shipped variant ; (`default_envs` below). Build everything: `pio run -e a -e b -e c ...` (list ; every env; PlatformIO has no "all" shorthand) or scripts/build-firmware.sh ; --all. ; ; NOTE on `pio run`'s own "Flash: NN%" console line: for this board, PlatformIO's ; generic size checker (builder/tools/piosize.py) counts any PROGBITS+ALLOC ; section toward "flash used" — which double-counts .data (it's genuinely ; flash-resident AND ram-resident: its initialiser image lives in flash, its ; runtime copy lives in RAM). Arduino-CLI's own "Sketch uses" line does not ; do this (flash = .text + .rodata only). For modes with large MLP nets ; (.data-heavy), PlatformIO's console number reads far larger than ; arduino-cli's for the identical binary — not a real regression. Compare ; `arm-none-eabi-size -A` section-by-section (text+rodata vs. data+bss) if ; a number here looks alarming. [platformio] default_envs = slpworkshop [env] ; earlephilhower's arduino-pico core via the community PlatformIO platform ; wrapper (the same pattern firmware/useq-celium/main/platformio.ini uses). ; platform_packages pins the EXACT framework + toolchain versions this repo's ; arduino-cli setup uses today (boards.txt v5.5.1 / toolchain 4.1.0-1aec55e, ; gcc 14.3.0) so PlatformIO and arduino-cli produce comparable binaries. platform = https://github.com/maxgerhardt/platform-raspberrypi.git platform_packages = earlephilhower/framework-arduinopico @ https://github.com/earlephilhower/arduino-pico.git#5.5.1 board = solderparty_rp2350_stamp_xl framework = arduino board_build.core = earlephilhower ; Matches the board's default 150 MHz menu.freq entry (arduino-cli FQBN ; leaves this at its default too — see boards.txt menu.freq.150). board_build.f_cpu = 150000000L ; arduino-cli builds this firmware with FQBN ; rp2040:rp2040:solderparty_rp2350_stamp_xl:opt=Optimize3 (-O3) plus ; --build-property compiler.cpp.extra_flags=-std=gnu++20. The arduino-pico ; PlatformIO builder appends its OWN default `-std=gnu++17 -Os` AFTER project ; build_flags (verified via `pio run -v`: project flags land first, then the ; framework's, and GCC honours the LAST -std/-O on the command line) — so ; build_unflags is required to actually remove them; simply listing our own ; flags in build_flags is not enough to win. build_unflags = -std=gnu++17 -Os build_flags = -std=gnu++20 -O3 ; nisps/ stays platform-neutral at the repo root (shared with the WASM ; build) — reached via -I, never copied or symlinked into firmware/. -I${PROJECT_DIR}/../.. ; glue/ headers, reached as "glue/x.hpp" from src/main.cpp. -I${PROJECT_DIR} ; ---- TFT_eSPI hardware config (was: setup-firmware-toolchain.sh mutating ; the GLOBALLY installed TFT_eSPI library's User_Setup.h). USER_SETUP_LOADED ; makes TFT_eSPI's User_Setup_Select.h skip its own bundled setup files ; entirely (see TFT_eSPI/User_Setup_Select.h: "Lets PlatformIO users define ; settings in platformio.ini") — this is TFT_eSPI's own documented recipe, ; not a repo-invented hack. Values below are the MEMLNaut panel config that ; used to live in ; src/memllib/hardware/memlnaut/Setup9999_MEMLNaut.h.renameme. -D USER_SETUP_LOADED=1 -D USER_SETUP_ID=60 -D ILI9341_DRIVER=1 -D TFT_MISO=16 -D TFT_MOSI=3 -D TFT_SCLK=2 -D TFT_CS=20 -D TFT_DC=18 -D TFT_RST=22 -D TOUCH_CS=21 -D LOAD_GLCD=1 -D LOAD_FONT2=1 -D LOAD_FONT4=1 -D LOAD_FONT6=1 -D LOAD_FONT7=1 -D LOAD_FONT8=1 -D LOAD_GFXFF=1 -D SMOOTH_FONT=1 -D SPI_FREQUENCY=70000000 -D SPI_READ_FREQUENCY=20000000 -D SPI_TOUCH_FREQUENCY=2500000 ; Pinned to the exact versions setup-firmware-toolchain.sh installs via ; arduino-cli today (arduino-cli lib list), for a fair size comparison. ; TFT_eWidget@0.0.5 isn't in the PlatformIO registry (it only carries 0.0.6+), ; so it's pinned straight from upstream's matching git tag instead. lib_deps = bodmer/TFT_eSPI@2.5.43 https://github.com/Bodmer/TFT_eWidget.git#v0.0.5 FortySevenEffects/MIDI Library@5.0.2 upload_protocol = picotool monitor_speed = 115200 ; ===================================================================== ; Normal-mode variants — one nisps::modes::*Mode each. ; ===================================================================== [env:soundanalysismidi] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModeSoundAnalysisMIDI [env:xiasri] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModeXIASRI [env:verbfx] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModeVerbFX [env:breakor] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModeBreakOr [env:elysiamorfs] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModeElysiamorfs [env:channelstrip] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModeChannelStrip [env:pafsynth] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModePAFSynth [env:memlcelium] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModeMEMLCelium [env:slpworkshop] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModeSLPWorkshop ; ---- External-synth MIDI-CC variants (joystick -> MLP -> MIDI CC) ---- [env:extsynthsub37] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModeExtSynthSub37 [env:extsynthsubphatty] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModeExtSynthSubPhatty [env:extsynthpro12] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModeExtSynthPro12 [env:extsynthanalogkeys] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModeExtSynthAnalogKeys [env:extsynthhydrasynth] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModeExtSynthHydrasynth [env:extsynthjd800] build_flags = ${env.build_flags} -D MEMLNAUT_MODE_TYPE=MEMLNautModeExtSynthJD800 ; ===================================================================== ; SelfTest — guided hardware bring-up rig (no engine, no ML). ; ===================================================================== [env:selftest] build_flags = ${env.build_flags} -D NISPS_SELFTEST=1