File tree 1 file changed +5
-12
lines changed
1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change 32
32
#define sbi (sfr , bit ) (_SFR_BYTE(sfr) |= _BV(bit))
33
33
#endif
34
34
35
+ #include "pins_arduino.h"
35
36
#include "twi.h"
36
37
37
38
static volatile uint8_t twi_state ;
@@ -63,18 +64,10 @@ void twi_init(void)
63
64
{
64
65
// initialize state
65
66
twi_state = TWI_READY ;
66
-
67
- #if defined(__AVR_ATmega168__ ) || defined(__AVR_ATmega8__ ) || defined(__AVR_ATmega328P__ )
68
- // activate internal pull-ups for twi
69
- // as per note from atmega8 manual pg167
70
- sbi (PORTC , 4 );
71
- sbi (PORTC , 5 );
72
- #else
73
- // activate internal pull-ups for twi
74
- // as per note from atmega128 manual pg204
75
- sbi (PORTD , 0 );
76
- sbi (PORTD , 1 );
77
- #endif
67
+
68
+ // activate internal pullups for twi.
69
+ digitalWrite (SDA , 1 );
70
+ digitalWrite (SCL , 1 );
78
71
79
72
// initialize twi prescaler and bit rate
80
73
cbi (TWSR , TWPS0 );
You can’t perform that action at this time.
0 commit comments