]> Repositories - Adafruit_Blinka-hackapet.git/blob - python/upload_feather_huzzah_micropython_put.sh
Workaround for (bug in?) Micropython import logic. Frequency a keyword not positional...
[Adafruit_Blinka-hackapet.git] / python / upload_feather_huzzah_micropython_put.sh
1 #!/bin/sh
2 PORT=/dev/ttyUSB0
3
4 # filter directories, and create relevant ones on the board
5 find . -type d -mindepth 1 | \
6         grep -v -E "(.(git|idea|vscode)|__pycache__)" | \
7         xargs -n1 -I {} sh -c "echo Creating directory {} ...; ampy --port ${PORT} mkdir --exists-okay {}"
8
9 # put top-level modules in place
10 for NAME in agnostic unittest
11 do
12     echo "Copying ${NAME}.py ..."
13     ampy --port ${PORT} put ${NAME}.py ${NAME}.py
14 done
15
16 # recursively sync folders of nested packages
17 for NAME in board digitalio mcp microcontroller testing
18 do
19     find ${NAME} -name '*.py'| xargs -n1 -I {} sh -c "echo Copying {} ...; ampy --port ${PORT} put {} {}"
20 done
21
22 cd ../../ # change into folder containing repo
23
24 # I2C dependencies
25 echo "Copying module adafruit_bus_device..."
26 cd Adafruit_CircuitPython_BusDevice # change into different repo
27 ampy --port ${PORT} mkdir --exists-okay adafruit_bus_device
28 ampy --port ${PORT} put adafruit_bus_device/__init__.py adafruit_bus_device/__init__.py
29 ampy --port ${PORT} put adafruit_bus_device/i2c_device.py adafruit_bus_device/i2c_device.py
30 cd ../
31
32 # BME280 dependencies
33 echo "Copying module adafruit_bme..."
34 cd Adafruit_CircuitPython_BME280 # change into different repo
35 ampy --port ${PORT} put adafruit_bme280.py adafruit_bme280.py
36 cd ../