]> git.earman.xyz Git - sensor-watch.git/commitdiff
add script for bulk flashing boards
authorJoey Castillo <joeycastillo@utexas.edu>
Sat, 17 Sep 2022 03:54:36 +0000 (22:54 -0500)
committerJoey Castillo <joeycastillo@utexas.edu>
Sat, 17 Sep 2022 03:54:36 +0000 (22:54 -0500)
utils/movement_bulk_installer/shipboards.sh [new file with mode: 0755]
utils/movement_bulk_installer/standard-green.uf2 [new file with mode: 0644]

diff --git a/utils/movement_bulk_installer/shipboards.sh b/utils/movement_bulk_installer/shipboards.sh
new file mode 100755 (executable)
index 0000000..537eae6
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/bash
+RED='\033[0;101m'
+GREEN='\033[1;32m'
+END='\033[0m'
+while [ true ] ; do
+    echo "Waiting for board"
+    false
+    while [ true ] ; do
+        stat /Volumes/WATCHBOOT &> /dev/null
+        if [ $? -eq 0 ]
+        then
+            break
+        fi
+        sleep 0.5
+    done
+    sleep 0.5
+    clear
+    cp ./standard-green.uf2 /Volumes/WATCHBOOT/
+    if [ $? -eq 0 ]
+    then
+        echo -e "${GREEN}Success!${END} Board flashed successfully!"
+    else
+        echo -e "${RED}FAILURE:${END} Board did not flash successfully."
+        echo -ne '\a'
+        echo -ne '\a'
+    fi
+    while [ true ] ; do
+        stat /Volumes/WATCHBOOT &> /dev/null
+        if [ $? -eq 0 ]
+        then
+            sleep 0.5
+        else
+            break
+        fi
+    done
+    echo -ne '\a'
+done
diff --git a/utils/movement_bulk_installer/standard-green.uf2 b/utils/movement_bulk_installer/standard-green.uf2
new file mode 100644 (file)
index 0000000..e7f80e9
Binary files /dev/null and b/utils/movement_bulk_installer/standard-green.uf2 differ