3 export PORT="/dev/ttyUSB0"
4 export MPYCROSS=`realpath ../../../micropython/mpy-cross/mpy-cross`
5 export COPY="cp --parents "
6 export ROOT="/media/cefn/PYBFLASH/"
9 # switch to test sources
11 # compile source .py files to .mpy
12 find . -type f -name '*.py' | \
13 xargs -n1 -I {} sh -c "echo compiling {} ...; ${MPYCROSS} {}"
14 # upload bytecode .mpy files
15 find ./ -type f -name '*.mpy' | \
17 xargs -n1 -I {} sh -c "echo uploading {} ...; ${COPY} {} ${ROOT}"
19 #switch to test libraries
22 # Compile adafruit libraries to bytecode and upload
23 for SUBMODULE in gps # `find . -mindepth 1 -maxdepth 1 -type d `
26 # compile adafruit library .py files to .mpy
27 find . -type f -name '*.py' | \
28 grep -v -E "(^./conf.py|^./docs/conf.py|^./setup.py|^./example.*)" | \
29 xargs -n1 -I {} sh -c "echo compiling {} ...; ${MPYCROSS} {}"
30 # upload adafruit library .mpy files
31 find ./ -type f -name '*.mpy' | \
33 xargs -n1 -I {} sh -c "echo uploading {} ...; ${COPY} {} ${ROOT}"
37 # switch to adafruit_blinka source
40 # compile adafruit blinka .py files to .mpy
41 find . -type f -name '*.py' | \
42 xargs -n1 -I {} sh -c "echo compiling {} ...; ${MPYCROSS} {}"
43 # upload adafruit blinka .mpy files
44 find ./ -type f -name '*.mpy' | \
46 xargs -n1 -I {} sh -c "echo uploading {} ...; ${COPY} {} ${ROOT}"