New form factor: a plain RP2040 Pico + Pico Scroll Pack (PIM545) -- a 17x7 single-colour LED matrix + 4 buttons. The 7x17 matrix maps onto the editor's lane x step pad grid. - pico-scroll/: CircuitPython firmware (DEVICE_ID "G"). Engine/scheduler/SysEx/ live-sync copied verbatim from pico-explorer (engine byte-identical, so it stays on the track-format conformance lineage); vendored bulk-framebuffer IS31FL3731 driver (pins/map verified from pimoroni-pico); three LED views (Grid/Pendulum/BPM); 4-button input. Audio over USB-MIDI (no onboard speaker); optional P_BUZZER. - grid.html + info-grid.html: widget page (canvas mirrors the 3 LED views) + spec page with a ~$29 BOM. - Registered in build.sh (precompile + ASCII assert + pm_g1_circuitpy.zip), deploy.sh, embed.js, embed.html, index.html gallery, and both editors' FW_PATHS (device id G). - docs/rust-port.md: core/driver architecture (pm-core no_std engine+protocol; per-board drivers behind embedded-hal/embedded-graphics traits). CLAUDE.md + livesync-protocol.md note the new edition + device id. Python firmware stays in parallel with Rust (no abandonment yet). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
22 lines
1.1 KiB
Python
22 lines
1.1 KiB
Python
# boot.py - runs once at power-on (before USB connects); decides who owns the filesystem.
|
|
#
|
|
# DEFAULT = appliance mode: the FIRMWARE owns the drive, so it can save your practice log to
|
|
# /history.json and write /programs.json that the editor pushes over USB-MIDI. The drive is then
|
|
# READ-ONLY to the computer - which also protects the firmware from accidental deletion.
|
|
#
|
|
# HOLD BUTTON A (GP12 on the Pico Scroll Pack) WHILE PLUGGING IN = editor mode: the drive is
|
|
# writable by the computer, so you can drag programs.json / app.mpy on from any OS or browser
|
|
# (the universal fallback). Reset afterwards to return to appliance mode.
|
|
#
|
|
# Also frees a USB endpoint (disables unused HID) and makes sure USB-MIDI is available.
|
|
import board, digitalio, storage, usb_hid, usb_midi
|
|
try: usb_hid.disable()
|
|
except Exception: pass
|
|
usb_midi.enable()
|
|
a = digitalio.DigitalInOut(board.GP12)
|
|
a.switch_to_input(pull=digitalio.Pull.UP)
|
|
appliance = a.value # value True (pull-up, not pressed) -> appliance mode
|
|
a.deinit()
|
|
if appliance:
|
|
try: storage.remount("/", readonly=False) # writable by code, read-only to the computer
|
|
except Exception: pass
|