From 906308e69be07cc160f3fac3a3db68a140e6f9ac 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 690154535bc6..d0a1b86ca4b7 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -239,7 +239,12 @@ bootloadHID: $(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