micropython-samples/fastbuild/buildpyb

44 wiersze
896 B
Bash
Executable File

#! /bin/bash
# Detect attached pyboard variant build and deploy
# Assumes only one device attached and that this will appear as /dev/pyboard (udev rule)
# requires pyb_check
# Also requires the pyboard.py utility to be on the path (micropython/tools/pyboard.py)
DIRECTORY='/mnt/qnap2/data/Projects/MicroPython/micropython/stmhal'
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
echo Building for $BOARD
if [ $BOARD ]
then
cd $DIRECTORY
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