#some features may be deactivated to fit into bootloader section
#ATTANTION: CONFIG_NO... feature deactivation may not be optimal!
+FUSEOPT_16 = -U lfuse:w:0x1f:m -U hfuse:w:0xc0:m
+BOOTLOADER_ADDRESS_16 = 0x3800
+DEFINES_16 = -DCONFIG_USE__EXCESSIVE_ASSEMBLER -DCONFIG_NO__NEED_WATCHDOG -DCONFIG_NO__PRECISESLEEP
+
+
+
FUSEOPT_88 = -U lfuse:w:0xd7:m -U hfuse:w:0xd4:m -U efuse:w:0xf8:m
BOOTLOADER_ADDRESS_88 = 0x1800
DEFINES_88 = -DCONFIG_NO__FLASH_BYTE_READACCESS -DCONFIG_NO__HAVE_READ_LOCK_FUSE
-FUSEOPT_32 = -U lfuse:w:0x1f:m -U hfuse:w:0xc0:m
+FUSEOPT_32 = $(FUSEOPT_16)
BOOTLOADER_ADDRESS_32 = 0x7000
DEFINES_32 = #-DEMPTY
BOOTLOADER_ADDRESS = $(BOOTLOADER_ADDRESS_8)
MCUARCH = avr4
DEFINES += $(DEFINES_8)
+else ifeq ($(DEVICE), atmega16)
+ FUSEOPT = $(FUSEOPT_16)
+ BOOTLOADER_ADDRESS = $(BOOTLOADER_ADDRESS_16)
+ MCUARCH = avr5
+ DEFINES += $(DEFINES_16)
else ifeq ($(DEVICE), atmega32)
FUSEOPT = $(FUSEOPT_32)
BOOTLOADER_ADDRESS = $(BOOTLOADER_ADDRESS_32)
SIGNATURE_BYTES
#elif defined (__AVR_ATmega8__) || defined (__AVR_ATmega8A__) || defined (__AVR_ATmega8HVA__)
0x1e, 0x93, 0x07, 0
+#elif defined (__AVR_ATmega16__)
+ 0x1e, 0x94, 0x03, 0
#elif defined (__AVR_ATmega32__)
0x1e, 0x95, 0x02, 0
#elif defined (__AVR_ATmega48__) || defined (__AVR_ATmega48A__) || defined (__AVR_ATmega48P__)
rval = rq->wIndex.bytes[0] & 3;
rval = signatureBytes[rval];
#if HAVE_READ_LOCK_FUSE
-#if defined (__AVR_ATmega8__) || defined (__AVR_ATmega8A__) || defined (__AVR_ATmega32__)
+#if defined (__AVR_ATmega8__) || defined (__AVR_ATmega8A__) || defined (__AVR_ATmega16__) || defined (__AVR_ATmega32__)
}else if(rq->wValue.bytes[0] == 0x58 && rq->wValue.bytes[1] == 0x00){ /* read lock bits */
rval = boot_lock_fuse_bits_get(GET_LOCK_BITS);
}else if(rq->wValue.bytes[0] == 0x50 && rq->wValue.bytes[1] == 0x00){ /* read lfuse bits */
#else
#if defined (__AVR_ATmega8__) || defined (__AVR_ATmega8A__) || defined (__AVR_ATmega8HVA__)
#define funcaddr___bootloader__do_spm 0x1826
+ #elif defined (__AVR_ATmega16__)
+ #define funcaddr___bootloader__do_spm 0x3854
#elif defined (__AVR_ATmega32__)
#define funcaddr___bootloader__do_spm 0x7054
#elif defined (__AVR_ATmega88__) || defined (__AVR_ATmega88P__) || defined (__AVR_ATmega88A__) || defined (__AVR_ATmega88PA__)
* try to make this array as big as possible
* (so bootloader always uses 2kbytes flash)
*/
-#if defined (__AVR_ATmega8__) || defined (__AVR_ATmega8A__) || defined (__AVR_ATmega8HVA__) || defined (__AVR_ATmega32__)
+#if defined (__AVR_ATmega8__) || defined (__AVR_ATmega8A__) || defined (__AVR_ATmega8HVA__) || defined (__AVR_ATmega16__) || defined (__AVR_ATmega32__)
#if defined (__AVR_ATmega8__) || defined (__AVR_ATmega8A__) || defined (__AVR_ATmega8HVA__)
#if (BOOTLOADER_ADDRESS != 0x1800)
#error BOOTLOADER_ADDRESS!=0x1800, on current MCU "funcaddr___bootloader__do_spm" might be currupted - please edit spminterface.h for nonstandard use
#endif
+#elif defined (__AVR_ATmega16__)
+ #if (BOOTLOADER_ADDRESS != 0x3800)
+ #error BOOTLOADER_ADDRESS!=0x3800, on current MCU "funcaddr___bootloader__do_spm" might be currupted - please edit spminterface.h for nonstandard use
+ #endif
#elif defined (__AVR_ATmega32__)
#if (BOOTLOADER_ADDRESS != 0x7000)
#error BOOTLOADER_ADDRESS!=0x7000, on current MCU "funcaddr___bootloader__do_spm" might be currupted - please edit spminterface.h for nonstandard use