Rust sibling of pico-scroll/app.py — the PM_G-1 'Grid' 17x7 LED metronome on a plain RP2040 Pico (thumbv6m, not the Pico 2). LED-first milestone: - IS31FL3731 driver: vendored bulk 144-byte framebuffer, one I2C block write per frame (port of the CircuitPython Matrix; the is31fl3731 crate isn't used). - Polymeter scheduler driven by track-format::schedule::lane_durs (the cross-impl contract) + per-lane step clocks + tempo ramp + gap-trainer. - 4-button input (A play/stop·hold=view, B next-track·hold=next-setlist, X/Y tempo). - Built-in set lists; 3 views: Ticker (default), Grid, Pendulum. - Ticker (user-designed): name infinite-scrolls left; BPM pinned right rotated 90 CCW = hundreds dot-bar (1 dot/100) + last 2 digits rotated. 130 -> 1 dot + '30'. - Build scaffolding: rp2040-hal 0.10 + boot2, memory.x, build.sh + uf2.py (RP2040 family id). thumbv6m-none-eabi added to rust/Containerfile. Excluded from the host workspace like pm-kit. Compiles clean -> 48 KB pm-grid.uf2. Audio (USB-MIDI; the board has no speaker), live-sync, firmware push, practice log and playback-flow auto-advance are deferred to the next milestone (as on pm-kit). Also: delete COORDINATION.md (solo now); docs/rust-port.md updated with pm-grid status + corrected Grid driver-matrix row. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
23 lines
947 B
Bash
Executable file
23 lines
947 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Build pm-grid for the RP2040 and produce pm-grid.uf2.
|
|
# Flash: hold BOOTSEL on the Pico, plug in USB, drag pm-grid.uf2 onto the RPI-RP2 drive.
|
|
#
|
|
# ./build.sh
|
|
#
|
|
# Override the runtime with RUNTIME=docker ./build.sh
|
|
set -euo pipefail
|
|
|
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # rust/pm-grid
|
|
REPO="$(cd "$DIR/../.." && pwd)" # repo root
|
|
RUNTIME="${RUNTIME:-podman}"
|
|
IMG="pm-rust:2"
|
|
|
|
"$RUNTIME" run --rm -v "$REPO":/work:Z -w /work/rust/pm-grid "$IMG" bash -c '
|
|
set -e
|
|
rustup component add llvm-tools-preview >/dev/null 2>&1 || true
|
|
cargo build --release
|
|
OBJCOPY="$(rustc --print sysroot)/lib/rustlib/$(rustc -vV | sed -n "s/host: //p")/bin/llvm-objcopy"
|
|
"$OBJCOPY" -O binary target/thumbv6m-none-eabi/release/pm-grid pm-grid.bin
|
|
'
|
|
python3 "$DIR/uf2.py" "$DIR/pm-grid.bin" "$DIR/pm-grid.uf2"
|
|
echo "→ $DIR/pm-grid.uf2 (hold BOOTSEL on the Pico, drag this onto the RPI-RP2 drive)"
|