micropython-samples/fastbuild/buildpyb

40 wiersze
960 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-12-01 17:21:11 +00:00
MPDEVICE='/dev/pyboard'
# Determine board type
BOARD=$(pyb_check $MPDEVICE)
2016-11-26 14:03:24 +00:00
2016-12-01 17:21:11 +00:00
# Check for user override of frozen directory
if [ $FROZEN_DIR ]
then
echo Frozen modules located in $FROZEN_DIR
else
FROZEN_DIR='modules'
fi
2016-11-26 14:03:24 +00:00
if [ $BOARD ]
then
echo Building for $BOARD
cd $MPDIR/ports/stm32
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=$FROZEN_DIR FROZEN_MANIFEST= && pyb_boot $MPDEVICE
2016-11-26 14:03:24 +00:00
then
sleep 1
make PYTHON=python3 BOARD=$BOARD FROZEN_MPY_DIR=$FROZEN_DIR FROZEN_MANIFEST= deploy
2016-11-26 14:03:24 +00:00
else
echo Build failure
fi
cd -
2016-11-26 14:03:24 +00:00
else
echo Incorrect board type
fi