Add I2C and ADC support for ATMega1280 (contributed by Fabio Bizzi)
authorlottaviano <lottaviano@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 3 Aug 2010 10:54:58 +0000 (10:54 +0000)
committerlottaviano <lottaviano@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 3 Aug 2010 10:54:58 +0000 (10:54 +0000)
I modified a bit the patch for i2c since it didn't apply cleanly.

git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4131 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/avr/drv/adc_avr.c
bertos/cpu/avr/drv/i2c_avr.c

index 7e932f62ecd1e2d1751058c7450f735d1f68978c..3eb08b79c2c2cf84bc582c797e912e19f5e828cb 100644 (file)
@@ -101,7 +101,8 @@ void adc_hw_select_ch(uint8_t ch)
        /* Set to 0 all mux registers */
        #if CPU_AVR_ATMEGA8 || CPU_AVR_ATMEGA328P || CPU_AVR_ATMEGA168
                ADMUX &= ~(BV(MUX3) | BV(MUX2) | BV(MUX1) | BV(MUX0));
-       #elif CPU_AVR_ATMEGA32 || CPU_AVR_ATMEGA64 || CPU_AVR_ATMEGA128 || CPU_AVR_ATMEGA1281
+       #elif CPU_AVR_ATMEGA32 || CPU_AVR_ATMEGA64 || CPU_AVR_ATMEGA128 || CPU_AVR_ATMEGA1281 \
+             || CPU_AVR_ATMEGA1280
                ADMUX &= ~(BV(MUX4) | BV(MUX3) | BV(MUX2) | BV(MUX1) | BV(MUX0));
        #else
                #error Unknown CPU
index 64d77786671c6e95cdb3b4114ffe45cc052efcc0..918d2758cf07a6121f865b498df5b4ffe12f8369 100644 (file)
@@ -384,7 +384,7 @@ void i2c_hw_init(I2c *i2c, int dev, uint32_t clock)
                 * probably due to some unwanted interaction between the
                 * port pin and the TWI lines.
                 */
-       #if CPU_AVR_ATMEGA64 || CPU_AVR_ATMEGA128 || CPU_AVR_ATMEGA1281
+       #if CPU_AVR_ATMEGA64 || CPU_AVR_ATMEGA128 || CPU_AVR_ATMEGA1281 || CPU_AVR_ATMEGA1280
                PORTD |= BV(PD0) | BV(PD1);
                DDRD  |= BV(PD0) | BV(PD1);
        #elif CPU_AVR_ATMEGA8