From: Cefn Hoile Date: Mon, 26 Feb 2018 19:49:55 +0000 (+0000) Subject: Sync procedure for pyboard testing. X-Git-Tag: 0.1.0~4^2~19 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/ba4b66024f9426096195bfc78a84f2591a488efc?ds=sidebyside Sync procedure for pyboard testing. --- diff --git a/test/scripts/upload_pyboard_micropython_cp.sh b/test/scripts/upload_pyboard_micropython_cp.sh new file mode 100755 index 0000000..a565e6a --- /dev/null +++ b/test/scripts/upload_pyboard_micropython_cp.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +export PORT="/dev/ttyUSB0" +export MPYCROSS=`realpath ../../../micropython/mpy-cross/mpy-cross` +export COPY="cp --parents " +export ROOT="/media/cefn/PYBFLASH/" + + +# switch to test sources +cd ../src +# compile source .py files to .mpy +find . -type f -name '*.py' | \ + xargs -n1 -I {} sh -c "echo compiling {} ...; ${MPYCROSS} {}" +# upload bytecode .mpy files +find ./ -type f -name '*.mpy' | \ + sed "s|^\./||" | \ + xargs -n1 -I {} sh -c "echo uploading {} ...; ${COPY} {} ${ROOT}" + +#switch to test libraries +cd ../libraries/ + +# Compile adafruit libraries to bytecode and upload +for SUBMODULE in gps # `find . -mindepth 1 -maxdepth 1 -type d ` +do + cd ${SUBMODULE} + # compile adafruit library .py files to .mpy + find . -type f -name '*.py' | \ + grep -v -E "(^./conf.py|^./docs/conf.py|^./setup.py|^./example.*)" | \ + xargs -n1 -I {} sh -c "echo compiling {} ...; ${MPYCROSS} {}" + # upload adafruit library .mpy files + find ./ -type f -name '*.mpy' | \ + sed "s|^\./||" | \ + xargs -n1 -I {} sh -c "echo uploading {} ...; ${COPY} {} ${ROOT}" + cd ../ +done + +# switch to adafruit_blinka source +cd ../../src + +# compile adafruit blinka .py files to .mpy +find . -type f -name '*.py' | \ + xargs -n1 -I {} sh -c "echo compiling {} ...; ${MPYCROSS} {}" +# upload adafruit blinka .mpy files +find ./ -type f -name '*.mpy' | \ + sed "s|^\./||" | \ + xargs -n1 -I {} sh -c "echo uploading {} ...; ${COPY} {} ${ROOT}"