diff --git a/optiboot/bootloaders/optiboot/Makefile b/optiboot/bootloaders/optiboot/Makefile index 8bec2913d..b1819468f 100644 --- a/optiboot/bootloaders/optiboot/Makefile +++ b/optiboot/bootloaders/optiboot/Makefile @@ -718,3 +718,6 @@ clean_asm: help: @echo -e $(HELPTEXT) + +.DEFAULT: + @echo No target named \"$<\": Maybe you need \"-f Makefile.mega0\"? diff --git a/optiboot/bootloaders/optiboot/Makefile.mega0 b/optiboot/bootloaders/optiboot/Makefile.mega0 index f1a9cab93..7c2bfce46 100644 --- a/optiboot/bootloaders/optiboot/Makefile.mega0 +++ b/optiboot/bootloaders/optiboot/Makefile.mega0 @@ -138,8 +138,8 @@ atmega%: attiny%: $(MAKE) -f $(MF) optiboot_attiny$*.hex -HELPTEXT += "target optiboot_*.hex - Any approriate mega-0, tiny-0, or tiny-1\n" -HELPTEXT += " ie: optiboot_atmega4809\n" +HELPTEXT += "target *.hex - Any approriate mega-0, tiny-0,1 or 2\n" +HELPTEXT += " ie: atmega4809\n" HELPTEXT += "target drazzy402,412 - Dr Azzy's 8pin dev boards.\n" drazzy%2: $(MAKE) -f $(MF) optiboot_attiny$*2.hex UARTTX=A1 TIMEOUT=8 LED=A7 diff --git a/optiboot/bootloaders/optiboot/parse_options.mk b/optiboot/bootloaders/optiboot/parse_options.mk index efa5e4389..c69cec6f5 100644 --- a/optiboot/bootloaders/optiboot/parse_options.mk +++ b/optiboot/bootloaders/optiboot/parse_options.mk @@ -10,6 +10,13 @@ endif dummy = FORCE endif +ifdef NODATE +ifneq ($(NODATE),0) +VERSION_CMD = -DPRODUCTION=1 +endif +dummy = FORCE +endif + # Build Options @@ -142,11 +149,26 @@ endif HELPTEXT += "Option AVR_FREQ= - Clock rate of AVR CPU\n" +HELPTEXT += "Option BOOT_ON_POR - Run bootloader on power-on\n" +ifdef NO_START_APP_ON_POR +ifneq ($(NO_START_APP_ON_POR),0) +POR_CMD = -DNO_START_APP_ON_POR=1 +dummy = FORCE +endif +endif + +ifdef BOOT_ON_POR +ifneq ($(NO_START_APP_ON_POR),0) +POR_CMD = -DNO_START_APP_ON_POR=1 +dummy = FORCE +endif +endif + LED_OPTIONS = $(LED_START_FLASHES_CMD) $(LED_DATA_FLASH_CMD) $(LED_CMD) $(LED_START_ON_CMD) $(LEDINV_CMD) CPU_OPTIONS = $(RESETPIN_CMD) $(TIMEOUT_CMD) $(FCPU_CMD) COMMON_OPTIONS = $(BIGBOOT_CMD) $(APPSPM_CMD) $(VERSION_CMD) -COMMON_OPTIONS += $(SUPPORT_EEPROM_CMD) +COMMON_OPTIONS += $(SUPPORT_EEPROM_CMD) $(POR_CMD) #UART is handled separately and only passed for devices with more than one. HELPTEXT += "Option UART=n - use UARTn for communications\n" diff --git a/optiboot/bootloaders/optiboot/pin_defs_x.h b/optiboot/bootloaders/optiboot/pin_defs_x.h index e9722cf6c..3b1d2500c 100644 --- a/optiboot/bootloaders/optiboot/pin_defs_x.h +++ b/optiboot/bootloaders/optiboot/pin_defs_x.h @@ -785,37 +785,92 @@ * The 14, 20, and 24pin packages all conveniently have the UART on the * same port pins, and the same pinmux structure! */ -#if defined(__AVR_ATtiny1614__) || defined(__AVR_ATtiny1604__) || \ - defined(__AVR_ATtiny814__) || defined(__AVR_ATtiny804__) || \ - defined(__AVR_ATtiny1606__) || defined(__AVR_ATtiny806__) || \ - defined(__AVR_ATtiny406__) || defined(__AVR_ATtiny3216__) || \ - defined(__AVR_ATtiny816__) || defined(__AVR_ATtiny416__) || \ - defined(__AVR_ATtiny1617__) || defined(__AVR_ATtiny3217__) || \ - defined(__AVR_ATtiny1607__) || defined(__AVR_ATtiny817__) -#define MYPMUX_REG PORTMUX.CTRLB +#if /* 24pin: xxx7 */ \ + defined(__AVR_ATtiny3217__) /* 3207 doesn't exist */ || \ + defined(__AVR_ATtiny1617__) || defined(__AVR_ATtiny1607__) || \ + defined(__AVR_ATtiny817__) || defined(__AVR_ATtiny807__) || \ + defined(__AVR_ATtiny417__) /* 407 doesn't exist */ || \ + /* 20 pin: xxx6 */ \ + defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3206__) || \ + defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny1606__) || \ + defined(__AVR_ATtiny816__) || defined(__AVR_ATtiny806__) || \ + defined(__AVR_ATtiny416__) || defined(__AVR_ATtiny406__) || \ + /* 14 pin: xxx4 */ \ + defined(__AVR_ATtiny1614__) || defined(__AVR_ATtiny1604__) || \ + defined(__AVR_ATtiny814__) || defined(__AVR_ATtiny804__) || \ + defined(__AVR_ATtiny414__) || defined(__AVR_ATtiny404__) + +# define MYPMUX_REG PORTMUX.CTRLB # if (UARTTX == B2) -# define UART_NAME "B2" -# ifndef USART0 -# error Pin on USART0, but no USART0 exists -# endif -# define MYUART USART0 -# define MYUART_TXPORT VPORTB -# define MYUART_TXPIN (1<