aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/amj60/keymaps/iso_split_rshift/build.sh
diff options
context:
space:
mode:
authorXyverz <xyverz@gmail.com>2016-08-19 22:50:55 -0700
committerXyverz <xyverz@gmail.com>2016-08-19 22:50:55 -0700
commit70d4ea7904ef6063b83b34985294a9b9e578be62 (patch)
treeb183763c85a581c7213cd2c247a9f30a75ee0576 /keyboards/amj60/keymaps/iso_split_rshift/build.sh
parente4984f65decbd005d147d29b56d7a0c7d7a8dafd (diff)
parenta3a312f8f4f4d836de494fe3502ea3175ba2a22c (diff)
downloadfirmware-70d4ea7904ef6063b83b34985294a9b9e578be62.tar.gz
firmware-70d4ea7904ef6063b83b34985294a9b9e578be62.tar.bz2
firmware-70d4ea7904ef6063b83b34985294a9b9e578be62.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'keyboards/amj60/keymaps/iso_split_rshift/build.sh')
-rwxr-xr-xkeyboards/amj60/keymaps/iso_split_rshift/build.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/keyboards/amj60/keymaps/iso_split_rshift/build.sh b/keyboards/amj60/keymaps/iso_split_rshift/build.sh
new file mode 100755
index 000000000..6b4b4568f
--- /dev/null
+++ b/keyboards/amj60/keymaps/iso_split_rshift/build.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+# adjust for cpu
+# -j 16 gave best result on a hyperthreaded quad core core i7
+
+LIMIT=10
+THREADS="-j 16"
+KMAP=iso_split_rshift
+
+echo "We need sudo later"
+sudo ls 2>&1 /dev/null
+
+function wait_bootloader {
+ echo "Waiting for Bootloader..."
+ local STARTTIME=$(date +"%s")
+ local REMIND=0
+ local EXEC=dfu-programmer
+ local TARGET=atmega32u4
+ while true
+ do
+ sudo $EXEC $TARGET get > /dev/null 2>&1
+ [ $? -eq 0 ] && break
+ ENDTIME=$(date +"%s")
+ DURATION=$(($ENDTIME-$STARTTIME))
+ if [ $REMIND -eq 0 -a $DURATION -gt $LIMIT ]
+ then
+ echo "Did you forget to press the reset button?"
+ REMIND=1
+ fi
+ sleep 1
+ done
+}
+make clean
+make KEYMAP=${KMAP} ${THREADS}
+if [[ $? -eq 0 ]]
+then
+ echo "please trigger flashing!"
+ wait_bootloader
+ sudo make KEYMAP=${KMAP} dfu ${THREADS}
+else
+ echo "make failed"
+ exit 77
+fi