diff options
| author | Danny Nguyen <danny@80pct.com> | 2017-08-03 14:23:12 -0400 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2017-08-03 20:56:21 -0400 |
| commit | e0caf94323d5cc0baae38af11984902fb1a5375f (patch) | |
| tree | bb77118d1e2d8a283d4257229ebea275d04dead7 /tmk_core | |
| parent | 83b35bf6f68d16910b2acfaffa21c82f4ffbfd3a (diff) | |
| download | qmk_firmware-e0caf94323d5cc0baae38af11984902fb1a5375f.tar.gz qmk_firmware-e0caf94323d5cc0baae38af11984902fb1a5375f.zip | |
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
Diffstat (limited to 'tmk_core')
| -rw-r--r-- | tmk_core/avr.mk | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 4af34ba57..0d0eec3bf 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk | |||
| @@ -144,6 +144,20 @@ dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep | |||
| 144 | fi | 144 | fi |
| 145 | $(DFU_PROGRAMMER) $(MCU) reset | 145 | $(DFU_PROGRAMMER) $(MCU) reset |
| 146 | 146 | ||
| 147 | avrdude: $(BUILD_DIR)/$(TARGET).hex | ||
| 148 | ls /dev/tty* > /tmp/1; \ | ||
| 149 | echo "Detecting Pro Micro port, reset your Pro Micro now.\c"; \ | ||
| 150 | while [ -z $$USB ]; do \ | ||
| 151 | sleep 1; \ | ||
| 152 | echo ".\c"; \ | ||
| 153 | ls /dev/tty* > /tmp/2; \ | ||
| 154 | USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \ | ||
| 155 | done; \ | ||
| 156 | echo ""; \ | ||
| 157 | echo "Detected Pro Micro port at $$USB"; \ | ||
| 158 | sleep 1; \ | ||
| 159 | avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex | ||
| 160 | |||
| 147 | # Convert hex to bin. | 161 | # Convert hex to bin. |
| 148 | flashbin: $(BUILD_DIR)/$(TARGET).hex | 162 | flashbin: $(BUILD_DIR)/$(TARGET).hex |
| 149 | $(OBJCOPY) -Iihex -Obinary $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin | 163 | $(OBJCOPY) -Iihex -Obinary $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin |
