Pārlūkot izejas kodu

Added paramter / option for flashing port

Janco Kock 9 gadi atpakaļ
vecāks
revīzija
e11238866b
1 mainītis faili ar 8 papildinājumiem un 1 dzēšanām
  1. 8 1
      make.sh

+ 8 - 1
make.sh

@@ -1,4 +1,11 @@
 #!/bin/bash
+if [ "$1" == "" ]; then
+	echo "Only building, not flashing. Add a tty port for flashing."
+else
+	port="/dev/ttyUSB0";
+fi
+
+
 echo "Uploading to the server.."
 command="curl http://imegumii.space:12001/upradio.php -w '\n'  --progress-bar  ";
 for i in *.c *.h; do
@@ -14,7 +21,7 @@ if [ "$output" = "success" ]; then
 	echo "Downloading hex file.."
 	wget http://imegumii.space:12001/source/ipac.hex -q --show-progress;
 	echo "Starting flash..";
-	mono internetradioflash.exe f=ipac.hex p="/dev/ttyUSB0"
+	mono internetradioflash.exe f=ipac.hex p="$port"
 else
 	echo "Errors when making; Stopped";
 fi