]> Repositories - Adafruit_Blinka-hackapet.git/blob - test/scripts/upload_pyboard_micropython_cp.sh
add missing module
[Adafruit_Blinka-hackapet.git] / test / scripts / upload_pyboard_micropython_cp.sh
1 #!/bin/sh
2
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/"
7
8
9 # switch to test sources
10 cd ../src
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' | \
16         sed "s|^\./||" | \
17         xargs -n1 -I {} sh -c "echo uploading {} ...; ${COPY} {} ${ROOT}"
18
19 #switch to test libraries
20 cd ../libraries/
21
22 # Compile adafruit libraries to bytecode and upload
23 for SUBMODULE in gps # `find . -mindepth 1 -maxdepth 1 -type d `
24 do
25     cd ${SUBMODULE}
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' | \
32             sed "s|^\./||" | \
33             xargs -n1 -I {} sh -c "echo uploading {} ...; ${COPY} {} ${ROOT}"
34     cd ../
35 done
36
37 # switch to adafruit_blinka source
38 cd ../../src
39
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' | \
45         sed "s|^\./||" | \
46         xargs -n1 -I {} sh -c "echo uploading {} ...; ${COPY} {} ${ROOT}"