We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1747292 commit 57b4b0eCopy full SHA for 57b4b0e
libraries/Wire/utility/twi.c
@@ -79,7 +79,7 @@ void twi_init(void)
79
// initialize twi prescaler and bit rate
80
cbi(TWSR, TWPS0);
81
cbi(TWSR, TWPS1);
82
- TWBR = ((CPU_FREQ / TWI_FREQ) - 16) / 2;
+ TWBR = ((F_CPU / TWI_FREQ) - 16) / 2;
83
84
/* twi bit rate formula from atmega128 manual pg 204
85
SCL Frequency = CPU Clock Frequency / (16 + (2 * TWBR))
libraries/Wire/utility/twi.h
@@ -24,10 +24,6 @@
24
25
//#define ATMEGA8
26
27
- #ifndef CPU_FREQ
28
- #define CPU_FREQ 16000000L
29
- #endif
30
-
31
#ifndef TWI_FREQ
32
#define TWI_FREQ 100000L
33
#endif
0 commit comments