]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Check for a new serial port every second
authorNic Aitch <nic@nicinabox.com>
Tue, 7 Feb 2017 01:57:34 +0000 (19:57 -0600)
committerNic Aitch <nic@nicinabox.com>
Tue, 7 Feb 2017 01:57:34 +0000 (19:57 -0600)
keyboards/lets_split/rules.mk

index 0dc5491302e909d0d29451cbd47b6646fa3a9326..0efa785505a707c0a5138b13e8ef653034ddf7b8 100644 (file)
@@ -76,10 +76,12 @@ CUSTOM_MATRIX = yes
 
 avrdude: build
        ls /dev/tty* > /tmp/1; \
-       echo "Reset your Pro Micro then hit any key to continue..."; \
-       read -n 1 -s; \
-       ls /dev/tty* > /tmp/2; \
-       USB=`diff /tmp/1 /tmp/2 | grep '>' | sed -e 's/> //'`; \
+       echo "Reset your Pro Micro now"; \
+       while [[ -z $$USB ]]; do \
+         sleep 1; \
+         ls /dev/tty* > /tmp/2; \
+         USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
+       done; \
        avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex
 
 .PHONY: avrdude