Preserve firmware variant capitalization
This commit is contained in:
parent
d1c12dd2b1
commit
6b26168a29
6 changed files with 16 additions and 12 deletions
|
|
@ -4,3 +4,4 @@
|
||||||
{"id":"int-4ab84a6f","kind":"field_change","created_at":"2026-04-15T15:37:55.547397813Z","actor":"w1n5t0n","issue_id":"meml-efb2","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Added variant-aware firmware build selection and interactive prompting"}}
|
{"id":"int-4ab84a6f","kind":"field_change","created_at":"2026-04-15T15:37:55.547397813Z","actor":"w1n5t0n","issue_id":"meml-efb2","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Added variant-aware firmware build selection and interactive prompting"}}
|
||||||
{"id":"int-6deafb72","kind":"field_change","created_at":"2026-04-15T15:44:14.681880459Z","actor":"w1n5t0n","issue_id":"meml-zbbs","extra":{"field":"status","new_value":"in_progress","old_value":"open"}}
|
{"id":"int-6deafb72","kind":"field_change","created_at":"2026-04-15T15:44:14.681880459Z","actor":"w1n5t0n","issue_id":"meml-zbbs","extra":{"field":"status","new_value":"in_progress","old_value":"open"}}
|
||||||
{"id":"int-fd7690f3","kind":"field_change","created_at":"2026-04-15T15:44:48.605669713Z","actor":"w1n5t0n","issue_id":"meml-zbbs","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Prompt variant selection now uses /dev/tty so interactive shells are detected correctly"}}
|
{"id":"int-fd7690f3","kind":"field_change","created_at":"2026-04-15T15:44:48.605669713Z","actor":"w1n5t0n","issue_id":"meml-zbbs","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Prompt variant selection now uses /dev/tty so interactive shells are detected correctly"}}
|
||||||
|
{"id":"int-672df751","kind":"field_change","created_at":"2026-04-15T15:45:23.772401653Z","actor":"w1n5t0n","issue_id":"meml-oq1q","extra":{"field":"status","new_value":"in_progress","old_value":"open"}}
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,7 @@ git submodule update --init --recursive
|
||||||
scripts/build-firmware.sh
|
scripts/build-firmware.sh
|
||||||
|
|
||||||
# Build a specific variant
|
# Build a specific variant
|
||||||
scripts/build-firmware.sh memlcelium
|
scripts/build-firmware.sh MEMLCelium
|
||||||
|
|
||||||
# Flash a previously-built UF2
|
# Flash a previously-built UF2
|
||||||
scripts/flash-firmware.sh
|
scripts/flash-firmware.sh
|
||||||
|
|
|
||||||
2
MAP.md
2
MAP.md
|
|
@ -53,7 +53,7 @@ MEMLNaut-NISPS: Neural Interactive Shaping of Parameter Spaces. Two living artef
|
||||||
- `README.md` — short quickstart.
|
- `README.md` — short quickstart.
|
||||||
|
|
||||||
## Entry points
|
## Entry points
|
||||||
- **Firmware**: `scripts/build-firmware.sh`, `scripts/flash-firmware.sh`, or `scripts/build-and-flash-firmware.sh` (requires submodules initialised). `build-firmware.sh` can take an explicit variant name like `memlcelium` or prompt interactively from the parsed `MEMLNautMode*` list and rewrite the active mode in `MEMLNaut-NISPS.ino`. The scripts target `rp2040:rp2040:solderparty_rp2350_stamp_xl:opt=Optimize3` and force C++20. Execution = `setup()`/`loop()` on Core 0, `setup1()`/`loop1()` on Core 1, audio ISR on Core 1.
|
- **Firmware**: `scripts/build-firmware.sh`, `scripts/flash-firmware.sh`, or `scripts/build-and-flash-firmware.sh` (requires submodules initialised). `build-firmware.sh` can take an explicit variant name like `MEMLCelium` or prompt interactively from the parsed `MEMLNautMode*` list and rewrite the active mode in `MEMLNaut-NISPS.ino`. Matching is case-insensitive, but user-facing prompts preserve the canonical mode capitalization. The scripts target `rp2040:rp2040:solderparty_rp2350_stamp_xl:opt=Optimize3` and force C++20. Execution = `setup()`/`loop()` on Core 0, `setup1()`/`loop1()` on Core 1, audio ISR on Core 1.
|
||||||
- **Playground**: `cd playground && python3 -m http.server` (or `serve.sh` / `serve-coop.py`), open `a-immersive.html`. Append `?debug=1` to expose `window.__nisps`.
|
- **Playground**: `cd playground && python3 -m http.server` (or `serve.sh` / `serve-coop.py`), open `a-immersive.html`. Append `?debug=1` to expose `window.__nisps`.
|
||||||
- **WASM rebuild**: `cd playground/wasm && ./build.sh` (needs `emcc`).
|
- **WASM rebuild**: `cd playground/wasm && ./build.sh` (needs `emcc`).
|
||||||
- **Tests**: `npx playwright test` (auto-spawns server on 7331).
|
- **Tests**: `npx playwright test` (auto-spawns server on 7331).
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ scripts/build-and-flash-firmware.sh
|
||||||
Notes:
|
Notes:
|
||||||
- The scripts build for `rp2040:rp2040:solderparty_rp2350_stamp_xl` with `Optimize3`.
|
- The scripts build for `rp2040:rp2040:solderparty_rp2350_stamp_xl` with `Optimize3`.
|
||||||
- The build forces C++20 because the firmware uses `std::span` and concepts.
|
- The build forces C++20 because the firmware uses `std::span` and concepts.
|
||||||
- `build-firmware.sh` accepts an optional variant name such as `memlcelium` or `breakor`. If you omit it in an interactive shell, the script parses `MEMLNaut-NISPS.ino`, prompts for a variant, and rewrites the active `MEMLNAUT_MODE_TYPE` before building.
|
- `build-firmware.sh` accepts an optional variant name such as `MEMLCelium` or `BreakOr`. Matching remains case-insensitive, so `memlcelium` still works. If you omit it in an interactive shell, the script parses `MEMLNaut-NISPS.ino`, prompts for a variant, and rewrites the active `MEMLNAUT_MODE_TYPE` before building.
|
||||||
- `flash-firmware.sh` accepts an optional mountpoint argument, or auto-detects common UF2 bootloader mounts such as `/run/media/$USER/RP2350` and `/run/media/$USER/RPI-RP2`.
|
- `flash-firmware.sh` accepts an optional mountpoint argument, or auto-detects common UF2 bootloader mounts such as `/run/media/$USER/RP2350` and `/run/media/$USER/RPI-RP2`.
|
||||||
|
|
||||||
## Web Playground
|
## Web Playground
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ echo "Building firmware:"
|
||||||
echo " sketch: $SKETCH_PATH"
|
echo " sketch: $SKETCH_PATH"
|
||||||
echo " fqbn: $FQBN"
|
echo " fqbn: $FQBN"
|
||||||
echo " out: $BUILD_DIR"
|
echo " out: $BUILD_DIR"
|
||||||
echo " variant: $(variant_alias "$ACTIVE_FIRMWARE_VARIANT")"
|
echo " variant: $(variant_display_name "$ACTIVE_FIRMWARE_VARIANT")"
|
||||||
|
|
||||||
compile_args=(
|
compile_args=(
|
||||||
compile
|
compile
|
||||||
|
|
|
||||||
|
|
@ -114,10 +114,13 @@ load_firmware_variants() {
|
||||||
)"
|
)"
|
||||||
}
|
}
|
||||||
|
|
||||||
variant_alias() {
|
variant_display_name() {
|
||||||
local variant="$1"
|
local variant="$1"
|
||||||
variant="${variant#MEMLNautMode}"
|
printf '%s\n' "${variant#MEMLNautMode}"
|
||||||
printf '%s\n' "$variant" | tr '[:upper:]' '[:lower:]'
|
}
|
||||||
|
|
||||||
|
variant_alias() {
|
||||||
|
variant_display_name "$1" | tr '[:upper:]' '[:lower:]'
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve_firmware_variant() {
|
resolve_firmware_variant() {
|
||||||
|
|
@ -154,7 +157,7 @@ choose_firmware_variant() {
|
||||||
echo "error: unknown firmware variant: $requested" >&2
|
echo "error: unknown firmware variant: $requested" >&2
|
||||||
echo "available variants:" >&2
|
echo "available variants:" >&2
|
||||||
for variant in "${FIRMWARE_VARIANTS[@]}"; do
|
for variant in "${FIRMWARE_VARIANTS[@]}"; do
|
||||||
echo " - $(variant_alias "$variant") ($variant)" >&2
|
echo " - $(variant_display_name "$variant") ($variant)" >&2
|
||||||
done
|
done
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -164,9 +167,9 @@ choose_firmware_variant() {
|
||||||
local idx=1
|
local idx=1
|
||||||
for variant in "${FIRMWARE_VARIANTS[@]}"; do
|
for variant in "${FIRMWARE_VARIANTS[@]}"; do
|
||||||
if [[ "$variant" == "$ACTIVE_FIRMWARE_VARIANT" ]]; then
|
if [[ "$variant" == "$ACTIVE_FIRMWARE_VARIANT" ]]; then
|
||||||
printf ' %d) %s (%s, current)\n' "$idx" "$(variant_alias "$variant")" "$variant" >&"$tty_fd"
|
printf ' %d) %s (%s, current)\n' "$idx" "$(variant_display_name "$variant")" "$variant" >&"$tty_fd"
|
||||||
else
|
else
|
||||||
printf ' %d) %s (%s)\n' "$idx" "$(variant_alias "$variant")" "$variant" >&"$tty_fd"
|
printf ' %d) %s (%s)\n' "$idx" "$(variant_display_name "$variant")" "$variant" >&"$tty_fd"
|
||||||
fi
|
fi
|
||||||
idx=$((idx + 1))
|
idx=$((idx + 1))
|
||||||
done
|
done
|
||||||
|
|
@ -190,7 +193,7 @@ choose_firmware_variant() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$ACTIVE_FIRMWARE_VARIANT" ]]; then
|
if [[ -n "$ACTIVE_FIRMWARE_VARIANT" ]]; then
|
||||||
echo "No variant specified and no interactive terminal available; using current variant: $(variant_alias "$ACTIVE_FIRMWARE_VARIANT")" >&2
|
echo "No variant specified and no interactive terminal available; using current variant: $(variant_display_name "$ACTIVE_FIRMWARE_VARIANT")" >&2
|
||||||
printf '%s\n' "$ACTIVE_FIRMWARE_VARIANT"
|
printf '%s\n' "$ACTIVE_FIRMWARE_VARIANT"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
@ -237,5 +240,5 @@ sketch_path.write_text("\n".join(updated) + "\n")
|
||||||
PY
|
PY
|
||||||
|
|
||||||
ACTIVE_FIRMWARE_VARIANT="$selected"
|
ACTIVE_FIRMWARE_VARIANT="$selected"
|
||||||
echo "Selected firmware variant: $(variant_alias "$selected") ($selected)"
|
echo "Selected firmware variant: $(variant_display_name "$selected") ($selected)"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue