Permalink
Browse files

and for other script as well

  • Loading branch information...
1 parent 35a01ac commit 8d126dc0df53bbb85ea3da7cd57595e0a0788974 Adam Mayer committed Dec 15, 2009
Showing with 37 additions and 2 deletions.
  1. +37 −2 dist/ArduinoSlave/burn.sh
View
@@ -1,11 +1,46 @@
#!/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=ArduinoSlaveExtruder-v1.6+BL
+
+while true; do
+ echo "Press ENTER to upload $FIRMWARE"
+ read
+ if [ $AD_CONF ]; then
+ CONF_FLAGS="-C $AD_CONF "
+ fi
+ # Burn lock bits and fuses
+ $AVRDUDE $CONF_FLAGS -v -pm168 -cusbtiny -e -Ulock:w:0x3F:m -Uefuse:w:0x00:m -Uhfuse:w:0xdd:m -Ulfuse:w:0xff:m
+ # Burn firmware
+ $AVRDUDE $CONF_FLAGS -v -pm168 -cusbtiny -Uflash:w:./ArduinoSlaveExtruder-v1.6+BL.hex:i -Ulock:w:0x0F:m
+done
+
+#!/bin/bash
+
while true; do
echo "Press ENTER to upload"
read
# Burn lock bits and fuses
- avrdude -v -pm168 -cusbtiny -e -Ulock:w:0x3F:m -Uefuse:w:0x00:m -Uhfuse:w:0xdd:m -Ulfuse:w:0xff:m
- avrdude -v -pm168 -cusbtiny -Uflash:w:./ArduinoSlaveExtruder-v1.6+BL.hex:i -Ulock:w:0x0F:m
done

0 comments on commit 8d126dc

Please sign in to comment.