X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/f555ad7ced743a19eb1eefaf5eaf536fcbe58d80..b35f93a372d8c872aebab4e3626bfc58d85b84d7:/Bootloaders/DFU/makefile diff --git a/Bootloaders/DFU/makefile b/Bootloaders/DFU/makefile index 061fb39b2..d77933b6b 100644 --- a/Bootloaders/DFU/makefile +++ b/Bootloaders/DFU/makefile @@ -51,6 +51,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -86,11 +90,13 @@ F_CLOCK = $(F_CPU) # Starting byte address of the bootloader, as a byte address - computed via the formula -# BOOT_START = ((TOTAL_FLASH_BYTES - BOOTLOADER_SECTION_SIZE_BYTES) * 1024) +# BOOT_START = ((FLASH_SIZE_KB - BOOT_SECTION_SIZE_KB) * 1024) # # Note that the bootloader size and start address given in AVRStudio is in words and not # bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC. -BOOT_START = 0x1E000 +FLASH_SIZE_KB = 128 +BOOT_SECTION_SIZE_KB = 4 +BOOT_START = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc) # Output format. (can be srec, ihex, binary) @@ -180,7 +186,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += -DBOOT_START_ADDR=$(BOOT_START)UL CDEFS += $(LUFA_OPTS) @@ -192,6 +198,7 @@ ADEFS += -DBOARD=BOARD_$(BOARD) ADEFS += -DBOOT_START_ADDR=$(BOOT_START)UL ADEFS += $(LUFA_OPTS) + # Place -D or -U options here for C++ sources CPPDEFS = -DF_CPU=$(F_CPU)UL CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL