]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
Now populates BusDevice and BME280
authorCefn Hoile <github.com@cefn.com>
Tue, 20 Feb 2018 17:08:24 +0000 (17:08 +0000)
committerCefn Hoile <github.com@cefn.com>
Tue, 20 Feb 2018 17:08:24 +0000 (17:08 +0000)
python/upload_feather_huzzah_circuitpython_put.sh
python/upload_feather_huzzah_micropython_put.sh

index 100ab1516f598635957d1444bdd1af57cad916df..f7a3bb02d51929eb88eea5562d527ac8ea3100d5 100755 (executable)
@@ -7,13 +7,20 @@ find testing -type d | \
         grep -v -E '^testing/implementation/micropython*' | \
         xargs -n1 -I {} sh -c "echo Creating directory {} ...; ampy --port ${PORT} mkdir --exists-okay  {}"
 
-# put top-level modules in place
-for NAME in agnostic unittest
+# put top-level .py modules in place
+for NAME in agnostic
 do
     echo "Copying ${NAME}.py ..."
     ampy --port ${PORT} put ${NAME}.py ${NAME}.py
 done
 
+# put top-level .mpy modules in place
+for NAME in unittest
+do
+    echo "Copying ${NAME}.mpy ..."
+    ampy --port ${PORT} put ${NAME}.mpy ${NAME}.mpy
+done
+
 # recursively sync module folders excluding packages
 # already provided by circuitpython, and excluding
 # testing packages targeting micropython
@@ -24,3 +31,24 @@ do
     grep -v -E '^testing/mcp.py' | \
     xargs -n1 -I {} sh -c "echo Copying {} ...; ampy --port ${PORT} put {} {}"
 done
+
+cd ../../
+
+
+
+# I2C dependencies
+echo "Copying module adafruit_bus_device..."
+cd Adafruit_CircuitPython_BusDevice # change into different repo
+ampy --port ${PORT} mkdir --exists-okay adafruit_bus_device
+ampy --port ${PORT} put adafruit_bus_device/__init__.py adafruit_bus_device/__init__.py
+ampy --port ${PORT} put adafruit_bus_device/i2c_device.py adafruit_bus_device/i2c_device.py
+cd ../
+
+# Compile BME280 to bytecode
+./circuitpython_2.2.3/mpy-cross/mpy-cross Adafruit_CircuitPython_BME280/adafruit_bme280.py
+
+# BME280 dependencies
+echo "Copying module adafruit_bme..."
+cd Adafruit_CircuitPython_BME280 # change into different repo
+ampy --port ${PORT} put adafruit_bme280.mpy adafruit_bme280.mpy
+cd ../
index 0f201181279e777186a346e3ec5ca9f4871a1957..2b7537db416e246eade98583ffd75c58abc26d23 100755 (executable)
@@ -2,9 +2,9 @@
 PORT=/dev/ttyUSB0
 
 # filter directories, and create relevant ones on the board
-find testing -type d | \
+find . -type d -mindepth 1 | \
         grep -v -E "(.(git|idea|vscode)|__pycache__)" | \
-        xargs -n1 -I {} sh -c "echo Creating directory {} ...; ampy --port ${PORT} mkdir --exists-okay  {}"
+        xargs -n1 -I {} sh -c "echo Creating directory {} ...; ampy --port ${PORT} mkdir --exists-okay {}"
 
 # put top-level modules in place
 for NAME in agnostic unittest
@@ -18,3 +18,19 @@ for NAME in board digitalio mcp microcontroller testing
 do
     find ${NAME} -name '*.py'| xargs -n1 -I {} sh -c "echo Copying {} ...; ampy --port ${PORT} put {} {}"
 done
+
+cd ../../ # change into folder containing repo
+
+# I2C dependencies
+echo "Copying module adafruit_bus_device..."
+cd Adafruit_CircuitPython_BusDevice # change into different repo
+ampy --port ${PORT} mkdir --exists-okay adafruit_bus_device
+ampy --port ${PORT} put adafruit_bus_device/__init__.py adafruit_bus_device/__init__.py
+ampy --port ${PORT} put adafruit_bus_device/i2c_device.py adafruit_bus_device/i2c_device.py
+cd ../
+
+# BME280 dependencies
+echo "Copying module adafruit_bme..."
+cd Adafruit_CircuitPython_BME280 # change into different repo
+ampy --port ${PORT} put adafruit_bme280.py adafruit_bme280.py
+cd ../