Skip to content

Fixdefines #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions hardware/arduino/bootloaders/atmega/ATmegaBOOT_168.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ int main(void)
} else {
getNch(3);
byte_response(0x00);

}
}

Expand Down Expand Up @@ -580,7 +581,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
Expand Down Expand Up @@ -679,7 +680,7 @@ int main(void)
"rjmp write_page \n\t"
"block_done: \n\t"
"clr __zero_reg__ \n\t" //restore zero register
#if defined __AVR_ATmega168__ || __AVR_ATmega328P__ || __AVR_ATmega128__ || __AVR_ATmega1280__ || __AVR_ATmega1281__
#if defined (__AVR_ATmega168__) || defined (__AVR_ATmega328P__) || defined (__AVR_ATmega128__) || defined (__AVR_ATmega1280__) || defined (__AVR_ATmega1281__)
: "=m" (SPMCSR) : "M" (PAGE_SIZE) : "r0","r16","r17","r24","r25","r28","r29","r30","r31"
#else
: "=m" (SPMCR) : "M" (PAGE_SIZE) : "r0","r16","r17","r24","r25","r28","r29","r30","r31"
Expand Down
2 changes: 1 addition & 1 deletion hardware/arduino/bootloaders/atmega/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ STK500-2 = $(STK500) -d$(MCU_TARGET) -ms -q -lCF -LCF -cUSB -I200kHz -s -wt


OBJ = $(PROGRAM).o
OPTIMIZE = -O2
OPTIMIZE = -Os

DEFS =
LIBS =
Expand Down
4 changes: 2 additions & 2 deletions hardware/arduino/bootloaders/bt/ATmegaBOOT_168.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ putch(0x0D);
"rjmp write_page \n\t"
"block_done: \n\t"
"clr __zero_reg__ \n\t" //restore zero register
#if defined __AVR_ATmega168__ || __AVR_ATmega328P__
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
: "=m" (SPMCSR) : "M" (PAGE_SIZE) : "r0","r16","r17","r24","r25","r28","r29","r30","r31"
#else
: "=m" (SPMCR) : "M" (PAGE_SIZE) : "r0","r16","r17","r24","r25","r28","r29","r30","r31"
Expand Down Expand Up @@ -707,7 +707,7 @@ putch(0x0D);
putch(0x14);
for (w=0;w < length.word;w++) { // Can handle odd and even lengths okay
if (flags.eeprom) { // Byte access EEPROM read
#if defined __AVR_ATmega168__ || __AVR_ATmega328P__
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
while(EECR & (1<<EEPE));
EEAR = (uint16_t)(void *)address.word;
EECR |= (1<<EERE);
Expand Down