|
@@ -6,7 +6,7 @@ set -e
|
|
################
|
|
################
|
|
CWD="$(pwd)" # current working directory
|
|
CWD="$(pwd)" # current working directory
|
|
flash_arduino="u2" # u2 or ftdi
|
|
flash_arduino="u2" # u2 or ftdi
|
|
-arduino_device="ttyUSB0" # ls /dev/tty* and find your arduino
|
|
|
|
|
|
+arduino_device="ttyACM0" # ls /dev/tty* and find your arduino
|
|
mega=2560 #2560 or 1280
|
|
mega=2560 #2560 or 1280
|
|
|
|
|
|
script_version="1.0.0"
|
|
script_version="1.0.0"
|
|
@@ -26,12 +26,26 @@ echo -e "\e[97m\u2551 Release date: \e[93m"$rdate"\e[0m\e[97m \u2551\e[0
|
|
echo -n -e "\e[97m\u255A"
|
|
echo -n -e "\e[97m\u255A"
|
|
for j in {1..34}; do echo -e -n "\u2550";done
|
|
for j in {1..34}; do echo -e -n "\u2550";done
|
|
echo -e -n "\u255D\e[0m"
|
|
echo -e -n "\u255D\e[0m"
|
|
|
|
+if [ -a /dev/ttyACM0 ]
|
|
|
|
+then
|
|
|
|
+arduino_device="ttyACM0"
|
|
echo
|
|
echo
|
|
|
|
|
|
|
|
|
|
function arduino_ {
|
|
function arduino_ {
|
|
echo -e ""
|
|
echo -e ""
|
|
echo -e "\e[92m\e[4mBuild Arduino SPIFlash tools:\e[0m\e[24m"
|
|
echo -e "\e[92m\e[4mBuild Arduino SPIFlash tools:\e[0m\e[24m"
|
|
|
|
+if [ -a /dev/ttyACM0 ]
|
|
|
|
+then
|
|
|
|
+arduino_device="ttyACM0"
|
|
|
|
+fi
|
|
|
|
+if [ -a /dev/ttyUSB0 ]
|
|
|
|
+then
|
|
|
|
+arduino_device="ttyUSB0"
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+echo "Arduino device found at: $arduino_device"
|
|
|
|
+echo ""
|
|
|
|
|
|
echo -e "\n\e[93mPerforming Update :\e[0m"
|
|
echo -e "\n\e[93mPerforming Update :\e[0m"
|
|
sudo apt-get install flashrom gcc-avr binutils-avr gdb-avr avr-libc avrdude libpci-dev git libusb-1.0-0-dev libftdi-dev -y
|
|
sudo apt-get install flashrom gcc-avr binutils-avr gdb-avr avr-libc avrdude libpci-dev git libusb-1.0-0-dev libftdi-dev -y
|