Commit 511348fb authored by Dean Camera's avatar Dean Camera
Browse files

Improve ATPROGRAM build module to support UC3 devices and use intelligent erase for XMEGA and UC3.

parent fab16786
......@@ -63,13 +63,27 @@ ifneq ($(ATPROGRAM_PORT),)
BASE_ATPROGRAM_FLAGS += --port $(ATPROGRAM_PORT)
endif
atprogram: $(TARGET).hex $(MAKEFILE_LIST)
# Construct the flags to use for the various memory spaces
ifeq ($(ARCH), AVR8)
ATPROGRAM_FLASH_FLAGS := --chiperase --flash
ATPROGRAM_EEPROM_FLAGS := --eeprom
else ifeq ($(ARCH), XMEGA)
ATPROGRAM_FLASH_FLAGS := --erase --flash
ATPROGRAM_EEPROM_FLAGS := --eeprom
else ifeq ($(ARCH), UC3)
ATPROGRAM_FLASH_FLAGS := --erase
ATPROGRAM_EEPROM_FLAGS := --eeprom
else
$(error Unsupported architecture "$(ARCH)")
endif
atprogram: $(TARGET).elf $(MAKEFILE_LIST)
@echo $(MSG_ATPROGRAM_CMD) Programming device \"$(MCU)\" FLASH using \"$(ATPROGRAM_PROGRAMMER)\"
atprogram $(BASE_ATPROGRAM_FLAGS) program --chiperase --flash --file $(TARGET).hex
atprogram $(BASE_ATPROGRAM_FLAGS) program $(ATPROGRAM_FLASH_FLAGS) --file $<
atprogram-ee: $(TARGET).eep $(MAKEFILE_LIST)
atprogram-ee: $(TARGET).elf $(MAKEFILE_LIST)
@echo $(MSG_ATPROGRAM_CMD) Programming device \"$(MCU)\" EEPROM using \"$(ATPROGRAM_PROGRAMMER)\"
atprogram $(BASE_ATPROGRAM_FLAGS) program --eeprom --file $(TARGET).eep
atprogram $(BASE_ATPROGRAM_FLAGS) program $(ATPROGRAM_EEPROM_FLAGS) --file $<
# Phony build targets for this module
.PHONY: atprogram atprogram-ee
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment