Skip to content

Commit

Permalink
Merge pull request #1072 from nicinabox/improve-ls-avrdude-target
Browse files Browse the repository at this point in the history
Check for Pro Micro serial port automatically
  • Loading branch information
jackhumbert authored Feb 7, 2017
2 parents 42ea912 + 3dbdd15 commit d639bd2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions keyboards/lets_split/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d639bd2

Please sign in to comment.