summaryrefslogtreecommitdiffstats
path: root/movement/make
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2022-04-20 17:18:58 -0400
committerJoey Castillo <joeycastillo@utexas.edu>2022-04-20 17:21:47 -0400
commitb0bdf35d8f6340be04aebe7fbd368418d8c15043 (patch)
treeabf080fb2529452db286673fee1c4772a3006048 /movement/make
parent263e7c6543ab580bed0567b018d1f198f918a64b (diff)
downloadSensor-Watch-b0bdf35d8f6340be04aebe7fbd368418d8c15043.tar.gz
Sensor-Watch-b0bdf35d8f6340be04aebe7fbd368418d8c15043.tar.bz2
Sensor-Watch-b0bdf35d8f6340be04aebe7fbd368418d8c15043.zip
add mechanism for building alternate firmware images
Diffstat (limited to 'movement/make')
-rwxr-xr-xmovement/make/.gitignore1
-rwxr-xr-xmovement/make/make_alternate_fw.sh36
2 files changed, 37 insertions, 0 deletions
diff --git a/movement/make/.gitignore b/movement/make/.gitignore
index 3722ac63..45eba6ef 100755
--- a/movement/make/.gitignore
+++ b/movement/make/.gitignore
@@ -1 +1,2 @@
build/
+firmware/
diff --git a/movement/make/make_alternate_fw.sh b/movement/make/make_alternate_fw.sh
new file mode 100755
index 00000000..575c9e52
--- /dev/null
+++ b/movement/make/make_alternate_fw.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+fw_dir="firmware/download"
+sim_dir="firmware/simulate"
+colors=("green" "blue")
+variants=("standard" "alt_time" "deep_space_now" "focus" "the_athlete" "the_backpacker" "the_stargazer")
+
+if [ -d "$fw_dir" ] ; then
+ rm -r "$fw_dir"
+fi
+if [ -d "$sim_dir" ] ; then
+ rm -r "$sim_dir"
+fi
+
+mkdir -p "$fw_dir"
+mkdir -p "$sim_dir"
+
+for variant in "${variants[@]}"
+do
+ VARIANT=$(echo "$variant" | tr '[:lower:]' '[:upper:]')
+ for color in "${colors[@]}"
+ do
+ COLOR=$(echo "$color" | tr '[:lower:]' '[:upper:]')
+ make clean
+ make LED=$COLOR FIRMWARE=$VARIANT
+ mv "build/watch.uf2" "$fw_dir/$variant-$color.uf2"
+ done
+ make clean
+ emmake make FIRMWARE=$VARIANT
+ mkdir "$sim_dir/$variant/"
+ mv "build/watch.wasm" "$sim_dir/$variant/"
+ mv "build/watch.js" "$sim_dir/$variant/"
+ mv "build/watch.html" "$sim_dir/$variant/index.html"
+done
+
+echo "Done."