Skip to content

Commit

Permalink
Only search through newly detected devices and discard ones that disa…
Browse files Browse the repository at this point in the history
…ppeared
  • Loading branch information
nooges authored and jackhumbert committed Feb 8, 2018
1 parent 53ff8a3 commit 361810d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tmk_core/avr.mk
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,11 @@ avrdude: $(BUILD_DIR)/$(TARGET).hex check-size
ls /dev/tty* > /tmp/1; \
echo -e "Detecting USB port, reset your controller now.\c"; \
while [ -z $$USB ]; do \
sleep 1; \
echo -e ".\c"; \
sleep 0.5; \
ls /dev/tty* > /tmp/2; \
USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
USB=`comm -13 /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
mv /tmp/2 /tmp/1; \
done; \
echo ""; \
echo "Detected controller on USB port at $$USB"; \
Expand Down

0 comments on commit 361810d

Please sign in to comment.