summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/avr.mk5
1 files changed, 5 insertions, 0 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk
index d942e7ade5..a44e15700e 100644
--- a/tmk_core/avr.mk
+++ b/tmk_core/avr.mk
@@ -248,7 +248,12 @@ hid_bootloader: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware
# Convert hex to bin.
bin: $(BUILD_DIR)/$(TARGET).hex
+ifeq ($(BOOTLOADER),lufa-ms)
+ $(eval BIN_PADDING=$(shell n=`expr 32768 - $(BOOTLOADER_SIZE)` && echo $$(($$n)) || echo 0))
+ $(OBJCOPY) -Iihex -Obinary $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin --pad-to $(BIN_PADDING)
+else
$(OBJCOPY) -Iihex -Obinary $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
+endif
$(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin;
# copy bin to FLASH.bin