PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1#!/bin/bash
 2
 3MAC_TOOLS_HOME=/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr
 4
 5# Look for avrdude
 6if [ ! $AVRDUDE ]; then
 7    if [ `which avrdude` ]; then
 8	echo "Using default avrdude installed on system."
 9	AVRDUDE=`which avrdude`
10    elif [ -a ${MAC_TOOLS_HOME}/bin/avrdude ]; then
11	echo "Found an avrdude installation in the default Mac Arduino location."
12	AVRDUDE=${MAC_TOOLS_HOME}/bin/avrdude
13	AD_CONF=${MAC_TOOLS_HOME}/etc/avrdude.conf
14    else
15	echo "Couldn't find a valid AVRDUDE installation.  Try setting the"
16	echo "AVRDUDE environment variable to the location of your AVRDUDE"
17	echo "installation.  You may also need to set the AD_CONF variable"
18	echo "to the location of your avrdude.conf file, if your installation"
19	echo "of AVRDUDE doesn't support USBTinyISP out of the box."
20	exit 1
21    fi
22fi
23
24FIRMWARE=EC-ecv34-v3.0
25FWDIR=`dirname $0`
26
27while true; do
28    echo "Press ENTER to upload $FIRMWARE"
29    read
30    if [ $AD_CONF ]; then
31	CONF_FLAGS="-C $AD_CONF "
32    fi
33    # Burn firmware
34    $AVRDUDE $CONF_FLAGS -v -pm168 -cstk500v1 -P/dev/ttyUSB0 -b19200 -Uflash:w:${FWDIR}/${FIRMWARE}.hex:i
35done
36
37#!/bin/bash
38
39while true; do
40    echo "Press ENTER to upload"
41    read
42    # Burn lock bits and fuses
43done
44
45