From 8f5ca0a943be1ca6d72b04ab264fdf9abd50ebfb Mon Sep 17 00:00:00 2001 From: Martyn Ranyard Date: Fri, 2 Nov 2012 19:16:54 +0000 Subject: [PATCH] Fixed EEPE flag check. Here, using the flag itself makes the bootloader build where it currently does not for the 328 amongst others --- hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168.c b/hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168.c index ff21903ed..90899a269 100644 --- a/hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168.c +++ b/hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168.c @@ -578,7 +578,7 @@ int main(void) /* if ((length.byte[0] & 0x01) == 0x01) length.word++; //Even up an odd number of bytes */ if ((length.byte[0] & 0x01)) length.word++; //Even up an odd number of bytes cli(); //Disable interrupts, just to be sure -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega1281__) +#if defined(EEPE) while(bit_is_set(EECR,EEPE)); //Wait for previous EEPROM writes to complete #else while(bit_is_set(EECR,EEWE)); //Wait for previous EEPROM writes to complete