From 48c63c6420de5e537758236af84ab391eba3660e Mon Sep 17 00:00:00 2001 From: fauxpark Date: Sun, 8 Aug 2021 18:38:33 +1000 Subject: [PATCH] Add padding to LUFA-MS .BIN files --- 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