Improve build+flash script ergonomics

This commit is contained in:
Tangent Wantwight 2021-07-04 20:30:27 -04:00
parent 5cd4d306f8
commit 6112d634af
1 changed files with 5 additions and 3 deletions

View File

@ -2,6 +2,8 @@
set -e set -e
cd "$(dirname "$0")"
cargo build --release --features $1 cargo build --release --features $1
APPLET=harrogate APPLET=harrogate
@ -11,12 +13,12 @@ test -e "$TARGET_BIN" || {
exit 1 exit 1
} }
arm-none-eabi-objcopy -O binary "$TARGET_BIN" flash.bin arm-none-eabi-objcopy -O binary "$TARGET_BIN" image.bin
uf2conv-rs flash.bin -o flash.uf2 uf2conv-rs image.bin -o image.uf2
sudo mount LABEL=ITSYBOOT mnt/ sudo mount LABEL=ITSYBOOT mnt/
echo "Flashing..." echo "Flashing..."
sudo cp flash.uf2 mnt/flash.uf2 sudo cp image.uf2 mnt/image.uf2
sync sync
echo "Done." echo "Done."
sudo umount mnt/ sudo umount mnt/