diff options
author | Martyn Ranyard <ranyardm@gmail.com> | 2012-11-02 21:27:23 +0000 |
---|---|---|
committer | Cristian Maglie <c.maglie@arduino.cc> | 2015-07-14 16:16:31 +0200 |
commit | 83fab1343607abee3569f7187e58cac7c02846dc (patch) | |
tree | 79a4264085583bcfccc3c554d4535571f88c786c /bootloaders | |
parent | d76d58a12e6982c54ca8a1d51b96fb9f864fc569 (diff) |
Bootloaders: wrong #ifdefs, should be defined() not just tested (i.e. noteq 0)
Close #126
Diffstat (limited to 'bootloaders')
-rw-r--r-- | bootloaders/atmega/ATmegaBOOT_168.c | 6 | ||||
-rw-r--r-- | bootloaders/bt/ATmegaBOOT_168.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/bootloaders/atmega/ATmegaBOOT_168.c b/bootloaders/atmega/ATmegaBOOT_168.c index d0d4dab..ff2c4e4 100644 --- a/bootloaders/atmega/ATmegaBOOT_168.c +++ b/bootloaders/atmega/ATmegaBOOT_168.c @@ -682,7 +682,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_ATmega328__ || __AVR_ATmega128__ || __AVR_ATmega1280__ || __AVR_ATmega1281__
+#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__) || 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"
@@ -715,7 +715,7 @@ int main(void) 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__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__)
+#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__)
while(EECR & (1<<EEPE));
EEAR = (uint16_t)(void *)address.word;
EECR |= (1<<EERE);
@@ -931,7 +931,7 @@ void putch(char ch) while (!(UCSR1A & _BV(UDRE1)));
UDR1 = ch;
}
-#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined (__AVR_ATmega328__)
+#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined (__AVR_ATmega328__)
while (!(UCSR0A & _BV(UDRE0)));
UDR0 = ch;
#else
diff --git a/bootloaders/bt/ATmegaBOOT_168.c b/bootloaders/bt/ATmegaBOOT_168.c index 7ce2832..d477e7a 100644 --- a/bootloaders/bt/ATmegaBOOT_168.c +++ b/bootloaders/bt/ATmegaBOOT_168.c @@ -680,7 +680,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__ || __AVR_ATmega_328__ +#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega_328__) : "=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" @@ -712,7 +712,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__ || __AVR_ATmega328__ +#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__) while(EECR & (1<<EEPE)); EEAR = (uint16_t)(void *)address.word; EECR |= (1<<EERE); |