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