/dist/ECv3.6/load_firmware.sh
http://github.com/makerbot/G3Firmware · Shell · 45 lines · 32 code · 8 blank · 5 comment · 5 complexity · bd559fe8459caf5b3e6be7d1db891dad MD5 · raw file
- #!/bin/bash
- MAC_TOOLS_HOME=/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr
- # Look for avrdude
- if [ ! $AVRDUDE ]; then
- if [ `which avrdude` ]; then
- echo "Using default avrdude installed on system."
- AVRDUDE=`which avrdude`
- elif [ -a ${MAC_TOOLS_HOME}/bin/avrdude ]; then
- echo "Found an avrdude installation in the default Mac Arduino location."
- AVRDUDE=${MAC_TOOLS_HOME}/bin/avrdude
- AD_CONF=${MAC_TOOLS_HOME}/etc/avrdude.conf
- else
- echo "Couldn't find a valid AVRDUDE installation. Try setting the"
- echo "AVRDUDE environment variable to the location of your AVRDUDE"
- echo "installation. You may also need to set the AD_CONF variable"
- echo "to the location of your avrdude.conf file, if your installation"
- echo "of AVRDUDE doesn't support USBTinyISP out of the box."
- exit 1
- fi
- fi
- FIRMWARE=EC-ecv34-v3.0
- FWDIR=`dirname $0`
- while true; do
- echo "Press ENTER to upload $FIRMWARE"
- read
- if [ $AD_CONF ]; then
- CONF_FLAGS="-C $AD_CONF "
- fi
- # Burn firmware
- $AVRDUDE $CONF_FLAGS -v -pm168 -cstk500v1 -P/dev/ttyUSB0 -b19200 -Uflash:w:${FWDIR}/${FIRMWARE}.hex:i
- done
- #!/bin/bash
- while true; do
- echo "Press ENTER to upload"
- read
- # Burn lock bits and fuses
- done