]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - tmk_core/rules.mk
Add my keymap
[max/tmk_keyboard.git] / tmk_core / rules.mk
index a0a7c3e5ce01aacb59cae8b2919e15a7f9cf060e..3c386b1f7f340a164ff91a7418b96011b04a03f0 100644 (file)
@@ -411,6 +411,9 @@ gccversion :
 program: $(TARGET).hex $(TARGET).eep
        $(PROGRAM_CMD)
 
+dude: $(TARGET).hex
+       avrdude -p$(MCU) -cavr109 -b57600 -Uflash:w:$(TARGET).hex -P$(DEV)
+
 teensy: $(TARGET).hex
        teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
 
@@ -420,17 +423,21 @@ flip: $(TARGET).hex
        batchisp -hardware usb -device $(MCU) -operation start reset 0
 
 dfu: $(TARGET).hex
-       @until dfu-programmer atmega32u4 get bootloader-version > /dev/null 2>&1; do \
+       @echo -n dfu-programmer: waiting
+       @until dfu-programmer $(MCU) get bootloader-version > /dev/null 2>&1; do \
                echo  -n "."; \
                sleep 1; \
        done
-ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1)))
+       @echo
+
+ifeq ($(shell dfu-programmer --version 2>&1 | grep -q 0.7; echo $$?),0)
        dfu-programmer $(MCU) erase --force
 else
        dfu-programmer $(MCU) erase
 endif
+
        dfu-programmer $(MCU) flash $(TARGET).hex
-       dfu-programmer $(MCU) reset
+       dfu-programmer $(MCU) reset || true # ignore exit code
        
 dfu-start:
        dfu-programmer $(MCU) reset
@@ -444,11 +451,7 @@ flip-ee: $(TARGET).hex $(TARGET).eep
        $(REMOVE) $(TARGET)eep.hex
 
 dfu-ee: $(TARGET).hex $(TARGET).eep
-ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1)))
        dfu-programmer $(MCU) flash --eeprom $(TARGET).eep
-else
-       dfu-programmer $(MCU) flash-eeprom $(TARGET).eep
-endif
        dfu-programmer $(MCU) reset