diff options
| author | Selene ToyKeeper | 2018-11-08 17:45:09 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2018-11-08 17:45:09 -0700 |
| commit | e143d03198ff1d16cc91ed94d5ea529170e9bfbf (patch) | |
| tree | 0f5ebc8816bea516722dfec7ea832994e4b3c9bf /bin/flash.sh | |
| parent | added lantern pin layout (diff) | |
| parent | Made it easier to override hwdef-*.h values in cfg-*.h files. (diff) | |
| download | anduril-e143d03198ff1d16cc91ed94d5ea529170e9bfbf.tar.gz anduril-e143d03198ff1d16cc91ed94d5ea529170e9bfbf.tar.bz2 anduril-e143d03198ff1d16cc91ed94d5ea529170e9bfbf.zip | |
merged upstream changes from fsm branch
Diffstat (limited to 'bin/flash.sh')
| -rwxr-xr-x | bin/flash.sh | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/bin/flash.sh b/bin/flash.sh index 9c2ef82..0423c90 100755 --- a/bin/flash.sh +++ b/bin/flash.sh @@ -1,3 +1,19 @@ -#/bin/sh -FIRMWARE=$1 -avrdude -c usbasp -p t13 -u -Uflash:w:$FIRMWARE -Ulfuse:w:0x75:m -Uhfuse:w:0xFF:m +#!/bin/bash + +# Flashes both fuses and firmware. + +if [ -z "$1" ]; then + echo "Usage: flash.sh MCU myprogram[.hex]" + echo "MCU is a number, like '13' for attiny13 or '841' for attiny841" + echo "The .hex suffix is optional." + exit +fi + +set -e + +BASEDIR=$(dirname "$0") +export ATTINY=$1 ; shift +export PROGRAM=$1 ; shift +if [ ! -f "$PROGRAM" ]; then PROGRAM="$PROGRAM".hex ; fi +$BASEDIR/flash-tiny"$ATTINY"-fuses.sh +$BASEDIR/flash-tiny"$ATTINY".sh "$PROGRAM" |
