X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=tmk_core%2Frules.mk;h=0d0b6afbb125fc72067da8758956cb9b770cc6bc;hb=1fc989947a338492315b07d1abf70fce1664f1b1;hp=d06756638c32a5e2692cb1b77f040c56171cd1b2;hpb=79cfa894afbc0a94ac642f57de905d9afc068ce7;p=max%2Ftmk_keyboard.git diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index d0675663..0d0b6afb 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -124,6 +124,7 @@ CFLAGS += -O$(OPT) CFLAGS += -funsigned-char CFLAGS += -funsigned-bitfields CFLAGS += -ffunction-sections +CFLAGS += -fdata-sections CFLAGS += -fno-inline-small-functions CFLAGS += -fpack-struct CFLAGS += -fshort-enums @@ -419,12 +420,18 @@ flip: $(TARGET).hex batchisp -hardware usb -device $(MCU) -operation start reset 0 dfu: $(TARGET).hex -ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1))) + @echo -n dfu-programmer: waiting + @until dfu-programmer $(MCU) get bootloader-version > /dev/null 2>&1; do \ + echo -n "."; \ + sleep 1; \ + done + @echo + +ifneq (, $(findstring 0.7, $(shell dfu-programmer 2>/dev/null && dfu-programmer --version 2>&1))) dfu-programmer $(MCU) erase --force else dfu-programmer $(MCU) erase endif - dfu-programmer $(MCU) erase dfu-programmer $(MCU) flash $(TARGET).hex dfu-programmer $(MCU) reset @@ -440,7 +447,11 @@ flip-ee: $(TARGET).hex $(TARGET).eep $(REMOVE) $(TARGET)eep.hex dfu-ee: $(TARGET).hex $(TARGET).eep - dfu-programmer $(MCU) eeprom-flash $(TARGET).eep +ifneq (, $(findstring 0.7, $(shell dfu-programmer 2>/dev/null && 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