Skip to content

Commit

Permalink
Add padding to LUFA-MS .BIN files (qmk#13922)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored Aug 10, 2021
1 parent ad59326 commit 906308e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tmk_core/avr.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 906308e

Please sign in to comment.