From f859375284f5a27f5b4f8cbe654e305ca3face17 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 16 Jul 2019 01:28:23 -0700 Subject: Expand bootloader target to support most AVR boards (#6255) * Update the :bootloader target to pass along correct hardware info * Update make scripts to properly grab the settings (a big thanks to @yanfali) * Remove LUFA debug warnings --- tmk_core/avr.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tmk_core') diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 670e141bfd..5bfd5a9b0d 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -310,7 +310,11 @@ extcoff: $(BUILD_DIR)/$(TARGET).elf bootloader: make -C lib/lufa/Bootloaders/DFU/ clean $(TMK_DIR)/make_dfu_header.sh $(ALL_CONFIGS) - make -C lib/lufa/Bootloaders/DFU/ + $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne '/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0)) + $(eval PROGRAM_SIZE_KB=$(shell n=`expr $(MAX_SIZE) / 1024` && echo $$(($$n)) || echo 0)) + $(eval BOOT_SECTION_SIZE_KB=$(shell n=`expr $(BOOTLOADER_SIZE) / 1024` && echo $$(($$n)) || echo 0)) + $(eval FLASH_SIZE_KB=$(shell n=`expr $(PROGRAM_SIZE_KB) + $(BOOT_SECTION_SIZE_KB)` && echo $$(($$n)) || echo 0)) + make -C lib/lufa/Bootloaders/DFU/ MCU=$(MCU) ARCH=$(ARCH) F_CPU=$(F_CPU) FLASH_SIZE_KB=$(FLASH_SIZE_KB) BOOT_SECTION_SIZE_KB=$(BOOT_SECTION_SIZE_KB) printf "BootloaderDFU.hex copied to $(TARGET)_bootloader.hex\n" cp lib/lufa/Bootloaders/DFU/BootloaderDFU.hex $(TARGET)_bootloader.hex -- cgit v1.2.3