From 6ef355f172e78ae85040c100c5c8e36bea5212e1 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 10 Aug 2021 18:03:04 +1000 Subject: [PATCH] Add padding to LUFA-MS .BIN files (#13922) --- tmk_core/avr.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index d942e7ade523..a44e15700e38 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