#! /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) export MPDIR='/mnt/qnap2/data/Projects/MicroPython/micropython' export MPDEVICE='/dev/pyboard' 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 $MPDIR/stmhal 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