From edfb8a94ebc33e6b985b75d208b51b87b945f7b0 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Fri, 11 Mar 2011 16:21:39 -0300 Subject: [PATCH] atusb/fw/Makefile: clean up handing of boot loader base address - Makefile (BOOT_ADDR, boot.elf): use variable instead of hiding the address in a command - Makefile (CFLAGS): pass BOOT_ADDR as a macro - Makefile: removed commented-out application flashing code --- atusb/fw/Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/atusb/fw/Makefile b/atusb/fw/Makefile index 7ef86cb..81c755d 100644 --- a/atusb/fw/Makefile +++ b/atusb/fw/Makefile @@ -14,12 +14,13 @@ SHELL = /bin/bash NAME = atusb -CFLAGS = -g -mmcu=$(CHIP) \ +CFLAGS = -g -mmcu=$(CHIP) -DBOOT_ADDR=$(BOOT_ADDR) \ -Wall -Wextra -Wshadow -Werror -Wno-unused-parameter \ -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes CHIP=atmega32u2 HOST=jlime +BOOT_ADDR=0x7000 AVR_PREFIX = $(BIN_PATH) avr- CC = $(AVR_PREFIX)gcc @@ -67,7 +68,7 @@ $(NAME).elf: $(OBJS) boot.elf: $(BOOT_OBJS) $(CC) $(CFLAGS) -o $@ $(BOOT_OBJS) \ - -Wl,--section-start=.text=0x7000 + -Wl,--section-start=.text=$(BOOT_ADDR) %.bin: %.elf $(BUILD) $(OBJCOPY) -j .text -j .data -O binary $< $@ @@ -132,8 +133,6 @@ prog: -U hfuse:w:0xde:m \ -U lock:w:0x2f:m -# -U flash:w:$(NAME).bin:r \ - on: ssh $(HOST) poke 0x10010318 4