Browse Source

Move avrdude flashing script from individual keyboard rules.mk to common location and improve script.

Port detection script is now more informative and better handles first time flashing of a Pro Micro
pull/1542/head
Danny Nguyen 6 years ago
committed by Jack Humbert
parent
commit
e0caf94323
10 changed files with 14 additions and 108 deletions
  1. +0
    -12
      keyboards/deltasplit75/rules.mk
  2. +0
    -12
      keyboards/handwired/atreus50/rules.mk
  3. +0
    -12
      keyboards/handwired/magicforce61/rules.mk
  4. +0
    -12
      keyboards/handwired/magicforce68/rules.mk
  5. +0
    -12
      keyboards/handwired/numpad20/rules.mk
  6. +0
    -12
      keyboards/handwired/ortho5x13/rules.mk
  7. +0
    -12
      keyboards/lets_split/rules.mk
  8. +0
    -12
      keyboards/nyquist/rules.mk
  9. +0
    -12
      keyboards/orthodox/rules.mk
  10. +14
    -0
      tmk_core/avr.mk

+ 0
- 12
keyboards/deltasplit75/rules.mk View File

@ -73,15 +73,3 @@ USE_I2C ?= yes
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
CUSTOM_MATRIX = yes
avrdude: build
ls /dev/tty* > /tmp/1; \
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
- 12
keyboards/handwired/atreus50/rules.mk View File

@ -67,15 +67,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
avrdude: build
ls /dev/tty* > /tmp/1; \
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
- 12
keyboards/handwired/magicforce61/rules.mk View File

@ -69,15 +69,3 @@ AUDIO_ENABLE ?= no # Audio output on port C6
ifndef QUANTUM_DIR
include ../../../Makefile
endif
avrdude: build
ls /dev/tty* > /tmp/1; \
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
- 12
keyboards/handwired/magicforce68/rules.mk View File

@ -69,15 +69,3 @@ AUDIO_ENABLE = no # Audio output on port C6
ifndef QUANTUM_DIR
include ../../../Makefile
endif
avrdude: build
ls /dev/tty* > /tmp/1; \
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
- 12
keyboards/handwired/numpad20/rules.mk View File

@ -69,15 +69,3 @@ AUDIO_ENABLE = no # Audio output on port C6
ifndef QUANTUM_DIR
include ../../../Makefile
endif
avrdude: build
ls /dev/tty* > /tmp/1; \
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
- 12
keyboards/handwired/ortho5x13/rules.mk View File

@ -69,15 +69,3 @@ AUDIO_ENABLE = no # Audio output on port C6
ifndef QUANTUM_DIR
include ../../../Makefile
endif
avrdude: build
ls /dev/tty* > /tmp/1; \
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
- 12
keyboards/lets_split/rules.mk View File

@ -74,15 +74,3 @@ USE_I2C = yes
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
CUSTOM_MATRIX = yes
avrdude: build
ls /dev/tty* > /tmp/1; \
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
- 12
keyboards/nyquist/rules.mk View File

@ -73,15 +73,3 @@ USE_I2C = yes
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
CUSTOM_MATRIX = yes
avrdude: build
ls /dev/tty* > /tmp/1; \
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
- 12
keyboards/orthodox/rules.mk View File

@ -73,15 +73,3 @@ USE_I2C = yes
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
CUSTOM_MATRIX = yes
avrdude: build
ls /dev/tty* > /tmp/1; \
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

+ 14
- 0
tmk_core/avr.mk View File

@ -144,6 +144,20 @@ dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep
fi
$(DFU_PROGRAMMER) $(MCU) reset
avrdude: $(BUILD_DIR)/$(TARGET).hex
ls /dev/tty* > /tmp/1; \
echo "Detecting Pro Micro port, reset your Pro Micro now.\c"; \
while [ -z $$USB ]; do \
sleep 1; \
echo ".\c"; \
ls /dev/tty* > /tmp/2; \
USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
done; \
echo ""; \
echo "Detected Pro Micro port at $$USB"; \
sleep 1; \
avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex
# Convert hex to bin.
flashbin: $(BUILD_DIR)/$(TARGET).hex
$(OBJCOPY) -Iihex -Obinary $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin


Loading…
Cancel
Save