1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Merge branch 'master' of git@github.com:arduino/Arduino

This commit is contained in:
Tom Igoe
2011-02-24 09:31:13 -05:00
6 changed files with 24 additions and 9 deletions

View File

@ -79,7 +79,7 @@ void twi_init(void)
// initialize twi prescaler and bit rate
cbi(TWSR, TWPS0);
cbi(TWSR, TWPS1);
TWBR = ((CPU_FREQ / TWI_FREQ) - 16) / 2;
TWBR = ((F_CPU / TWI_FREQ) - 16) / 2;
/* twi bit rate formula from atmega128 manual pg 204
SCL Frequency = CPU Clock Frequency / (16 + (2 * TWBR))

View File

@ -24,10 +24,6 @@
//#define ATMEGA8
#ifndef CPU_FREQ
#define CPU_FREQ 16000000L
#endif
#ifndef TWI_FREQ
#define TWI_FREQ 100000L
#endif