]> Repositories - Adafruit_Blinka-hackapet.git/blob - python/upload_feather_huzzah_circuitpython_put.sh
Moved unittest module into separate test directory
[Adafruit_Blinka-hackapet.git] / python / upload_feather_huzzah_circuitpython_put.sh
1 #!/bin/sh
2 PORT=/dev/ttyUSB0
3
4 # create only relevant directories on the board
5 find testing -type d | \
6         grep -v -E "(^./.git|^./.idea|^./.vscode|__pycache__)" | \
7         grep -v -E '^testing/implementation/micropython*' | \
8         xargs -n1 -I {} sh -c "echo Creating directory {} ...; ampy --port ${PORT} mkdir --exists-okay  {}"
9
10 # put top-level .py modules in place
11 for NAME in agnostic
12 do
13     echo "Copying ${NAME}.py ..."
14     ampy --port ${PORT} put ${NAME}.py ${NAME}.py
15 done
16
17 # put top-level .mpy modules in place
18 for NAME in unittest
19 do
20     echo "Copying ${NAME}.mpy ..."
21     ampy --port ${PORT} put ${NAME}.mpy ${NAME}.mpy
22 done
23
24 # recursively sync module folders excluding packages
25 # already provided by circuitpython, and excluding
26 # testing packages targeting micropython
27 for NAME in testing
28 do
29     find ${NAME} -name '*.py'| \
30     grep -v -E '^testing/implementation/micropython*' | \
31     grep -v -E '^testing/mcp.py' | \
32     xargs -n1 -I {} sh -c "echo Copying {} ...; ampy --port ${PORT} put {} {}"
33 done
34
35 cd ../../
36
37
38
39 # I2C dependencies
40 echo "Copying module adafruit_bus_device..."
41 cd Adafruit_CircuitPython_BusDevice # change into different repo
42 ampy --port ${PORT} mkdir --exists-okay adafruit_bus_device
43 ampy --port ${PORT} put adafruit_bus_device/__init__.py adafruit_bus_device/__init__.py
44 ampy --port ${PORT} put adafruit_bus_device/i2c_device.py adafruit_bus_device/i2c_device.py
45 cd ../
46
47 # Compile BME280 to bytecode
48 ./circuitpython_2.2.3/mpy-cross/mpy-cross Adafruit_CircuitPython_BME280/adafruit_bme280.py
49
50 # BME280 dependencies
51 echo "Copying module adafruit_bme..."
52 cd Adafruit_CircuitPython_BME280 # change into different repo
53 ampy --port ${PORT} put adafruit_bme280.mpy adafruit_bme280.mpy
54 cd ../