Skip to content

Commit

Permalink
Reordered Avrdude fuses
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoHood authored and abcminiuser committed Dec 31, 2017
1 parent 78b8e42 commit f46d40f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions DMBS/avrdude.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ The following targets are supported by this module:

<table>
<tbody>
<tr>
<td>avrdude-lfuse</td>
<td>Program the device low fuse. Requires AVRDUDE_LFUSE variable set.</td>
</tr>
<tr>
<td>avrdude-hfuse</td>
<td>Program the device high fuse. Requires AVRDUDE_HFUSE variable set.</td>
Expand All @@ -38,17 +42,13 @@ The following targets are supported by this module:
<td>avrdude-efuse</td>
<td>Program the device extended fuse. Requires AVRDUDE_EFUSE variable set.</td>
</tr>
<tr>
<td>avrdude-lfuse</td>
<td>Program the device low fuse. Requires AVRDUDE_LFUSE variable set.</td>
</tr>
<tr>
<td>avrdude-lock</td>
<td>Program the device lock bits. Requires AVRDUDE_LOCK variable set.</td>
</tr>
<tr>
<td>avrdude-fuses</td>
<td>Program the device fuses (hfuse, efuse, lfuse, lock bits).</td>
<td>Program the device fuses (lfuse, hfuse, efuse, lock bits).</td>
</tr>
<tr>
<td>avrdude</td>
Expand Down
24 changes: 12 additions & 12 deletions DMBS/avrdude.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
#

DMBS_BUILD_MODULES += AVRDUDE
DMBS_BUILD_TARGETS += avrdude-hfuse avrdude-efuse avrdude-lfuse avrdude-lock avrdude-fuses
DMBS_BUILD_TARGETS += avrdude-lfuse avrdude-hfuse avrdude-efuse avrdude-lock avrdude-fuses
DMBS_BUILD_TARGETS += avrdude avrdude-ee avrdude-all avrdude-all-ee
DMBS_BUILD_MANDATORY_VARS += MCU TARGET
DMBS_BUILD_OPTIONAL_VARS += AVRDUDE_PROGRAMMER AVRDUDE_PORT AVRDUDE_FLAGS AVRDUDE_MEMORY AVRDUDE_BAUD
DMBS_BUILD_OPTIONAL_VARS += AVRDUDE_LFUSE AVRDUDE_HFUSE AVRDUDE_EUSE AVRDUDE_LOCK
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=

Expand All @@ -23,9 +24,9 @@ AVRDUDE_PROGRAMMER ?= jtagicemkii
AVRDUDE_PORT ?= usb
AVRDUDE_FLAGS ?=
AVRDUDE_MEMORY ?= flash
AVRDUDE_LFUSE ?=
AVRDUDE_HFUSE ?=
AVRDUDE_EFUSE ?=
AVRDUDE_LFUSE ?=
AVRDUDE_LOCK ?=
AVRDUDE_BAUD ?=

Expand All @@ -40,10 +41,9 @@ $(call ERROR_IF_EMPTY, AVRDUDE_PORT)
MSG_AVRDUDE_CMD := ' [AVRDUDE] :'

# Construct base avrdude command flags
ifeq ($(AVRDUDE_BAUD),)
BASE_AVRDUDE_FLAGS := -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
else
BASE_AVRDUDE_FLAGS := -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -b $(AVRDUDE_BAUD)
BASE_AVRDUDE_FLAGS := -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
ifneq ($(AVRDUDE_BAUD),)
BASE_AVRDUDE_FLAGS += -b $(AVRDUDE_BAUD)
endif

# Programs in the target FLASH memory using AVRDUDE
Expand All @@ -57,6 +57,11 @@ avrdude-ee: $(TARGET).eep $(MAKEFILE_LIST)
avrdude $(BASE_AVRDUDE_FLAGS) -U eeprom:w:$< $(AVRDUDE_FLAGS)

# Programs in the target fuses using AVRDUDE
avrdude-lfuse: $(MAKEFILE_LIST)
@echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" low fuse using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\"
$(call ERROR_IF_EMPTY, AVRDUDE_LFUSE)
avrdude $(BASE_AVRDUDE_FLAGS) -Ulfuse:w:$(AVRDUDE_LFUSE):m $(AVRDUDE_FLAGS)

avrdude-hfuse: $(MAKEFILE_LIST)
@echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" high fuse using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\"
$(call ERROR_IF_EMPTY, AVRDUDE_HFUSE)
Expand All @@ -67,17 +72,12 @@ avrdude-efuse: $(MAKEFILE_LIST)
$(call ERROR_IF_EMPTY, AVRDUDE_EFUSE)
avrdude $(BASE_AVRDUDE_FLAGS) -Uefuse:w:$(AVRDUDE_EFUSE):m $(AVRDUDE_FLAGS)

avrdude-lfuse: $(MAKEFILE_LIST)
@echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" low fuse using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\"
$(call ERROR_IF_EMPTY, AVRDUDE_LFUSE)
avrdude $(BASE_AVRDUDE_FLAGS) -Ulfuse:w:$(AVRDUDE_LFUSE):m $(AVRDUDE_FLAGS)

avrdude-lock: $(MAKEFILE_LIST)
@echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" lock bits using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\"
$(call ERROR_IF_EMPTY, AVRDUDE_LOCK)
avrdude $(BASE_AVRDUDE_FLAGS) -Ulock:w:$(AVRDUDE_LOCK):m $(AVRDUDE_FLAGS)

avrdude-fuses: avrdude-hfuse avrdude-efuse avrdude-lfuse avrdude-lock
avrdude-fuses: avrdude-lfuse avrdude-hfuse avrdude-efuse avrdude-lock

avrdude-all: avrdude avrdude-fuses

Expand Down

0 comments on commit f46d40f

Please sign in to comment.