Skip to content

Commit 9629867

Browse files
committed
Merge branch 'hhgarnes-patch-2'
2 parents 7b11860 + 1dce271 commit 9629867

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Arduino.mk

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,13 +1282,22 @@ ifndef AVRDUDE_OPTS
12821282
AVRDUDE_OPTS = -q -V
12831283
endif
12841284

1285-
AVRDUDE_COM_OPTS = $(AVRDUDE_OPTS) -p $(MCU)
1285+
# Decouple the mcu between the compiler options (-mmcu) and the avrdude options (-p).
1286+
# This is needed to be able to compile for attiny84a but specify the upload mcu as attiny84.
1287+
# We default to picking the -mmcu flag, but you can override this by setting
1288+
# AVRDUDE_MCU in your makefile.
1289+
ifndef AVRDUDE_MCU
1290+
AVRDUDE_MCU = $(MCU)
1291+
endif
1292+
1293+
AVRDUDE_COM_OPTS = $(AVRDUDE_OPTS) -p $(AVRDUDE_MCU)
12861294
ifdef AVRDUDE_CONF
12871295
AVRDUDE_COM_OPTS += -C $(AVRDUDE_CONF)
12881296
endif
12891297

12901298
# -D - Disable auto erase for flash memory
1291-
# (-D is needed for Mega boards. See https://github.com/sudar/Arduino-Makefile/issues/114#issuecomment-25011005)
1299+
# Note: -D is needed for Mega boards.
1300+
# (See https://github.com/sudar/Arduino-Makefile/issues/114#issuecomment-25011005)
12921301
AVRDUDE_ARD_OPTS = -D -c $(AVRDUDE_ARD_PROGRAMMER) -b $(AVRDUDE_ARD_BAUDRATE) -P
12931302
ifeq ($(CURRENT_OS), WINDOWS)
12941303
# get_monitor_port checks to see if the monitor port exists, assuming it is
@@ -1353,6 +1362,9 @@ ifndef AVRDUDE_ISP_FUSES_POST
13531362
endif
13541363
endif
13551364

1365+
# Note: setting -D to disable flash erase before programming may cause issues
1366+
# with some boards like attiny84a, making the program not "take",
1367+
# so we do not set it by default.
13561368
AVRDUDE_ISP_OPTS = -c $(ISP_PROG) -b $(AVRDUDE_ISP_BAUDRATE)
13571369

13581370
ifndef $(ISP_PORT)

HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it
1010
- Tweak: Various spelling/grammar/typo fixes (https://github.com/dcousens)
1111
- Tweak: Clarified some 1.5+ issues in docs (Issue #352) (https://github.com/sej7278)
1212
- Tweak: Added some more Continuous Integration tests (https://github.com/sej7278)
13+
- New: Add option to split avrdude MCU from avr-gcc MCU (Issue #357) (https://github.com/hhgarnes)
1314

1415
### 1.5 (2015-04-07)
1516
- New: Add support for new 1.5.x library layout (Issue #275) (https://github.com/lukasz-e)

0 commit comments

Comments
 (0)