diff --git a/build.sh b/build.sh index bd01dc9..a0633a7 100755 --- a/build.sh +++ b/build.sh @@ -15,9 +15,9 @@ mkdir -p dist # Precompile the PM_K-1 CircuitPython firmware to .mpy. CircuitPython compiles a ~56KB .py at boot, # which fragments the heap and OOMs on the RP2040; a precompiled .mpy loads without compiling. Needs # Adafruit's mpy-cross matching the device's CircuitPython (10.2.1) -> emits CircuitPython mpy v6. -MPYC="tools/mpy-cross" +MPYC="$PWD/tools/mpy-cross"; ROOT="$PWD" [[ -x "$MPYC" ]] || { echo "error: $MPYC missing (Adafruit mpy-cross for CircuitPython 10.2.1)" >&2; exit 1; } -"$MPYC" pico-cp/app.py -o dist/app.mpy +( cd pico-cp && "$MPYC" app.py -o "$ROOT/dist/app.mpy" ) # compile from pico-cp/ so tracebacks read "app.py" echo "precompiled dist/app.mpy ($(stat -c%s dist/app.mpy) bytes <- $(stat -c%s pico-cp/app.py) source)" python3 - <<'PY' diff --git a/pico-cp/__pycache__/app.cpython-312.pyc b/pico-cp/__pycache__/app.cpython-312.pyc index 511ca05..0d4042b 100644 Binary files a/pico-cp/__pycache__/app.cpython-312.pyc and b/pico-cp/__pycache__/app.cpython-312.pyc differ diff --git a/pico-cp/app.py b/pico-cp/app.py index d0e97ac..dbc1287 100644 --- a/pico-cp/app.py +++ b/pico-cp/app.py @@ -18,7 +18,7 @@ import board, busio, digitalio, analogio, pwmio, displayio, vectorio, time, json, gc, os, supervisor supervisor.runtime.autoreload = False # we write our own files (log + pushed programs); never self-restart -APP_VERSION = "0.0.10" # firmware version (the A/B updater pushes/compares this) +APP_VERSION = "0.0.11" # firmware version (the A/B updater pushes/compares this) try: import rtc # set from the editor's clock SysEx so the log has real timestamps except ImportError: @@ -292,8 +292,9 @@ def lane_to_str(L): # serialize a lane back if L['mute']: s += '!' return s -def _slkey(t): # normalise a title for built-in/user de-duplication - return "".join(c.lower() for c in t if c.isalnum()) +_ALNUM = "abcdefghijklmnopqrstuvwxyz0123456789" +def _slkey(t): # normalise a title for built-in/user de-dup (no str.isalnum on CircuitPython) + return "".join(c for c in t.lower() if c in _ALNUM) def load_user_setlists(): # User playlists from /programs.json (pushed by the editor). New {setlists:[{title,programs:[..]}]} form, # or the old flat {programs:[..]} (one list). Built-ins are baked in BUILTIN_SETLISTS, never here.