micropython-samples/fastbuild/buildpyb

45 wiersze
926 B
Plaintext
Czysty Zwykły widok Historia

2016-11-26 14:03:24 +00:00
#! /bin/bash
2016-11-27 13:49:44 +00:00
# Detect attached pyboard variant build and deploy
# Assumes only one device attached and that this will appear as /dev/pyboard (udev rule)
2016-11-26 14:03:24 +00:00
# requires pyb_check
2016-11-27 13:49:44 +00:00
# Also requires the pyboard.py utility to be on the path (micropython/tools/pyboard.py)
2016-11-26 14:03:24 +00:00
2016-11-27 13:56:27 +00:00
export MPDIR='/mnt/qnap2/data/Projects/MicroPython/micropython'
export MPDEVICE='/dev/pyboard'
2016-11-26 14:03:24 +00:00
BOARD=""
if pyb_check PYBV11
then
BOARD="PYBV11"
fi
if pyb_check PYBV10
then
BOARD="PYBV10"
fi
if pyb_check PYBLITEV10
then
BOARD="PYBLITEV10"
fi
2016-11-27 13:49:44 +00:00
echo Building for $BOARD
2016-11-26 14:03:24 +00:00
if [ $BOARD ]
then
2016-11-27 13:56:27 +00:00
cd $MPDIR/stmhal
2016-11-26 14:03:24 +00:00
if [ $# -eq 1 ] && [ $1 = "--clean" ]
then
make BOARD=$BOARD clean
fi
if make -j 8 BOARD=$BOARD FROZEN_MPY_DIR=modules && pyb_boot
then
sleep 1
sudo make BOARD=$BOARD deploy
cd -
sleep 1
rshell
else
echo Build failure
fi
else
echo Incorrect board type
fi