X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Ftwi.c;h=0d03950f95fe22d74e5763be804c0f0abd448ff5;hb=9c6545aacf8bb77445e7c19e41117d2318d752cc;hp=d0c6537428369569fd50cea491eeaf89dbf719ac;hpb=bcf38f772b397e7a8ba781a69aacb9380e54b32a;p=bertos.git diff --git a/drv/twi.c b/drv/twi.c old mode 100755 new mode 100644 index d0c65374..0d03950f --- a/drv/twi.c +++ b/drv/twi.c @@ -1,8 +1,33 @@ /** * \file * * * \brief Driver for the AVR ATMega TWI (implementation) @@ -15,6 +40,9 @@ /*#* *#* $Log$ + *#* Revision 1.8 2007/06/07 14:35:12 batt + *#* Merge from project_ks. + *#* *#* Revision 1.7 2006/07/19 12:56:26 bernie *#* Convert to new Doxygen style. *#* @@ -41,9 +69,9 @@ #include "twi.h" #include -#include +#include #include // BV() -#include +#include /* CLOCK_FREQ */ #include #include @@ -238,12 +266,12 @@ void twi_init(void) * probably due to some unwanted interaction between the * port pin and the TWI lines. */ -#if defined(__AVR_ATmega64__) +#if CPU_AVR_ATMEGA64 || CPU_AVR_ATMEGA128 || CPU_AVR_ATMEGA1281 PORTD |= BV(PD0) | BV(PD1); - DDRD |= BV(PD0) | BV(PD1); -#elif defined(__AVR_ATmega8__) + DDRD |= BV(PD0) | BV(PD1); +#elif CPU_AVR_ATMEGA8 PORTC |= BV(PC4) | BV(PC5); - DDRC |= BV(PC4) | BV(PC5); + DDRC |= BV(PC4) | BV(PC5); #else #error Unsupported architecture #endif