X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;ds=sidebyside;f=tmk_core%2Frules.mk;h=0d0b6afbb125fc72067da8758956cb9b770cc6bc;hb=acbea7fb15c7d2bbfce7261e7e8acb110438a9e5;hp=a790f874bc9c93eb8d0fb3add10a177753767706;hpb=a3d96d3aa96318d339a67de1085e0ae495d57c84;p=max%2Ftmk_keyboard.git diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index a790f874..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,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))) +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