From d3932a104cb1db7e9436f5c16ee58cf3684e8b3a Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 10 Aug 2021 18:03:04 +1000 Subject: 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 690154535b..d0a1b86ca4 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 -- cgit v1.2.3