]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - apps/tests/deluge/Blink/burn
Deluge T2 support for Epic. This includes support for at45db161d and some refactoring...
[tinyos-2.x.git] / apps / tests / deluge / Blink / burn
index ce7b1b26aa5c4da3202a5bb36bf86b41762c9c94..e43e7b0c71bd8254f1a77441fa4137000257fca6 100755 (executable)
@@ -18,17 +18,24 @@ if [[ ! -x ${TOS_DELUGE} ]] ; then
     TOS_DELUGE=../../../../tools/tinyos/misc/tos-deluge
 fi 
 
-if [ $# -ne 2 ]; then
-  echo "Usage: $0 <port> <platform>"
-  echo "<port>       For example, /dev/ttyUSB0"
-  echo "<platform>   \"micaz\", \"telosb\""
+if [[ $# -ne 2 && $# -ne 3 ]]; then
+  echo "Usage: $0 <port> [<comm_port>] <platform>"
+  echo "  <port>       /dev/ttyUSB0"
+  echo "  <comm_port>  /dev/ttyUSB1"
+  echo "  <platform>   micaz, telosb, iris or epic"
   exit 2
 fi
 
-PORT=$1
+PPORT=$1
+CPORT=$1
 PLATFORM=$2
 
-if [ ${PLATFORM} != 'micaz' -a ${PLATFORM} != 'telosb' ]; then
+if [ $# -eq 3 ]; then
+ CPORT=$2
+ PLATFORM=$3
+fi
+
+if [ ${PLATFORM} != 'micaz' -a ${PLATFORM} != 'telosb' -a ${PLATFORM} != 'iris' -a ${PLATFORM} != 'epic' ]; then
   echo "\"${PLATFORM}\" is not a supported platform"
   exit 2
 fi
@@ -44,12 +51,16 @@ make clean
 echo ============================ Compile and load Blink ============================
 if [ $PLATFORM == 'micaz' ]
 then
-  CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} install mib510,${PORT}
-elif [ $PLATFORM == 'telosb' ]
+  CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} install mib510,${PPORT}
+elif [ $PLATFORM == 'telosb' -o $PLATFORM == 'epic' ]
 then
-  CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} install bsl,${PORT}
+  CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} install bsl,${PPORT}
+elif [ $PLATFORM == 'iris' ]
+then
+  CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} install mib510,${PPORT}
 fi
 
+
 echo '           +-------------------------------------------------------+'
 echo '           |                                                       |'
 echo '           | At this point the first led (red) should be blinking. |'
@@ -63,7 +74,7 @@ echo  ============================= Compile a new Blink ========================
 CFLAGS=-DBLINK_REVERSE\ -DDELUGE_BASESTATION make ${PLATFORM}
 
 echo =============================== Upload the image ===============================
-${TOS_DELUGE} ${PORT} ${PLATFORM} -i 0 build/${PLATFORM}/tos_image.xml
+${TOS_DELUGE} ${CPORT} ${PLATFORM} -i 1 build/${PLATFORM}/tos_image.xml
 
 echo '       +----------------------------------------------------------------+'
 echo '       |                                                                |'
@@ -80,4 +91,4 @@ echo '       +----------------------------------------------------------------+'
 read
 
 echo =========================== Reboot the base station ============================
-${TOS_DELUGE} ${PORT} ${PLATFORM} -b 0 
+${TOS_DELUGE} ${CPORT} ${PLATFORM} -r 1