Files
picomap/load.sh
2026-04-02 22:15:10 +09:00

23 lines
390 B
Bash
Executable File

#!/bin/bash
set -e
BUILDDIR="$(dirname "$0")/build"
echo "Building..."
make -C "$BUILDDIR"
DEV=$(ls /dev/cu.usbmodem* 2>/dev/null | head -1)
if [ -n "$DEV" ]; then
echo "Sending 'b' to $DEV to enter BOOTSEL mode..."
printf 'b' > "$DEV"
sleep 2
fi
echo "Loading firmware..."
picotool load -f "$BUILDDIR/picomap.uf2"
echo "Rebooting..."
picotool reboot || true
echo "Done."