From d76d58a12e6982c54ca8a1d51b96fb9f864fc569 Mon Sep 17 00:00:00 2001 From: Martyn Ranyard Date: Fri, 2 Nov 2012 21:45:58 +0000 Subject: Bootloaders: adds support for 328-nonp chips --- bootloaders/atmega/ATmegaBOOT_168.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'bootloaders/atmega/ATmegaBOOT_168.c') diff --git a/bootloaders/atmega/ATmegaBOOT_168.c b/bootloaders/atmega/ATmegaBOOT_168.c index 90899a2..d0d4dab 100644 --- a/bootloaders/atmega/ATmegaBOOT_168.c +++ b/bootloaders/atmega/ATmegaBOOT_168.c @@ -73,7 +73,7 @@ /* the current avr-libc eeprom functions do not support the ATmega168 */ /* own eeprom write/read functions are used instead */ -#if !defined(__AVR_ATmega168__) || !defined(__AVR_ATmega328P__) +#if !defined(__AVR_ATmega168__) || !defined(__AVR_ATmega328P__) || !defined(__AVR_ATmega328__) #include #endif @@ -202,6 +202,11 @@ #define SIG3 0x0F #define PAGE_SIZE 0x40U //64 words +#elif defined __AVR_ATmega328__ +#define SIG2 0x95 +#define SIG3 0x14 +#define PAGE_SIZE 0x40U //64 words + #elif defined __AVR_ATmega162__ #define SIG2 0x94 #define SIG3 0x04 @@ -367,7 +372,7 @@ int main(void) UBRRHI = (F_CPU/(BAUD_RATE*16L)-1) >> 8; UCSRA = 0x00; UCSRB = _BV(TXEN)|_BV(RXEN); -#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) +#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined (__AVR_ATmega328__) #ifdef DOUBLE_SPEED UCSR0A = (1<