📄 burn
字号:
#!/bin/bashpython -c 'import systry: import serialexcept ImportError, e: sys.exit(1)'if [[ $? != 0 ]]then echo "Please install PySerial first." exit 2fiTOS_DELUGE=`type -p tos-deluge`if [[ ! -x ${TOS_DELUGE} ]] ; then TOS_DELUGE=../../../../tools/tinyos/misc/tos-delugefi 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 or iris" exit 2fiPPORT=$1CPORT=$1PLATFORM=$2if [ $# -eq 3 ]; then CPORT=$2 PLATFORM=$3fiif [ ${PLATFORM} != 'micaz' -a ${PLATFORM} != 'telosb' -a ${PLATFORM} != 'iris' ]; then echo "\"${PLATFORM}\" is not a supported platform" exit 2fiif ! [ -a ${TOSDIR}/lib/tosboot/build/${PLATFORM}/main.ihex ]then echo ========================== Compile tosboot for ${PLATFORM} =========================== ( cd $TOSDIR/lib/tosboot ; make ${PLATFORM} ) fimake cleanecho ============================ Compile and load Blink ============================if [ $PLATFORM == 'micaz' ]then CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} install mib510,${PPORT}elif [ $PLATFORM == 'telosb' ]then CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} install bsl,${PPORT}elif [ $PLATFORM == 'iris' ]then CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} install mib510,${PPORT}fiecho ' +-------------------------------------------------------+'echo ' | |'echo ' | At this point the first led (red) should be blinking. |'echo ' | |'echo ' | Press ENTER to continue... |'echo ' | |'echo ' +-------------------------------------------------------+'readecho ============================= Compile a new Blink ==============================CFLAGS=-DBLINK_REVERSE\ -DDELUGE_BASESTATION make ${PLATFORM}echo =============================== Upload the image ===============================${TOS_DELUGE} ${CPORT} ${PLATFORM} -i 1 build/${PLATFORM}/tos_image.xmlecho ' +----------------------------------------------------------------+'echo ' | |'echo ' | In the next step the following things will take place: |'echo ' | - the mote will be rebooted |'echo ' | - all the leds will blink for some time as the |'echo ' | reprogramming by tosboot takes place. |'echo ' | - a fading of the leds will indicate the exiting from tosboot. |'echo ' | - the mote should start blinking the 3rd led (blue/yellow). |'echo ' | |'echo ' | Press ENTER to continue... |'echo ' | |'echo ' +----------------------------------------------------------------+'readecho =========================== Reboot the base station ============================${TOS_DELUGE} ${CPORT} ${PLATFORM} -r 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -