aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/avr.mk
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/avr.mk')
-rw-r--r--tmk_core/avr.mk12
1 files changed, 11 insertions, 1 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk
index 2f955b18f..add904c9c 100644
--- a/tmk_core/avr.mk
+++ b/tmk_core/avr.mk
@@ -169,7 +169,8 @@ dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep
169 fi 169 fi
170 $(DFU_PROGRAMMER) $(MCU) reset 170 $(DFU_PROGRAMMER) $(MCU) reset
171 171
172avrdude: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware 172define EXEC_AVRDUDE
173 USB= ;\
173 if $(GREP) -q -s Microsoft /proc/version; then \ 174 if $(GREP) -q -s Microsoft /proc/version; then \
174 echo 'ERROR: AVR flashing cannot be automated within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'; \ 175 echo 'ERROR: AVR flashing cannot be automated within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'; \
175 else \ 176 else \
@@ -191,6 +192,15 @@ avrdude: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware
191 sleep 1; \ 192 sleep 1; \
192 avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex; \ 193 avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex; \
193 fi 194 fi
195endef
196
197avrdude: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware
198 $(call EXEC_AVRDUDE)
199
200avrdude-loop: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware
201 while true; do \
202 $(call EXEC_AVRDUDE) ; \
203 done
194 204
195# Convert hex to bin. 205# Convert hex to bin.
196bin: $(BUILD_DIR)/$(TARGET).hex 206bin: $(BUILD_DIR)/$(TARGET).hex