1
0
Fork 0

Add message to avrdude script that it can't used within WSL currently

This commit is contained in:
Danny Nguyen 2017-08-16 17:36:34 -04:00 committed by Jack Humbert
parent 4e73b0b8d7
commit 71d1c02a9b
1 changed files with 16 additions and 12 deletions

View File

@ -145,18 +145,22 @@ dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep
$(DFU_PROGRAMMER) $(MCU) reset $(DFU_PROGRAMMER) $(MCU) reset
avrdude: $(BUILD_DIR)/$(TARGET).hex avrdude: $(BUILD_DIR)/$(TARGET).hex
ls /dev/tty* > /tmp/1; \ if grep -q -s Microsoft /proc/version; then \
echo "Detecting Pro Micro port, reset your Pro Micro now.\c"; \ echo 'ERROR: Pro Micros can not be flashed within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'; \
while [ -z $$USB ]; do \ else \
sleep 1; \ ls /dev/tty* > /tmp/1; \
echo ".\c"; \ echo "Detecting Pro Micro port, reset your Pro Micro now.\c"; \
ls /dev/tty* > /tmp/2; \ while [ -z $$USB ]; do \
USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \ sleep 1; \
done; \ echo ".\c"; \
echo ""; \ ls /dev/tty* > /tmp/2; \
echo "Detected Pro Micro port at $$USB"; \ USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
sleep 1; \ done; \
avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex echo ""; \
echo "Detected Pro Micro port at $$USB"; \
sleep 1; \
avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex; \
fi
# Convert hex to bin. # Convert hex to bin.
flashbin: $(BUILD_DIR)/$(TARGET).hex flashbin: $(BUILD_DIR)/$(TARGET).hex