HAL_AVR: started I2C in high speed mode

this speeds up the compass a lot
This commit is contained in:
Andrew Tridgell 2013-01-08 15:29:29 +11:00 committed by geermc4
parent 75c1666302
commit 7f20f720e8
1 changed files with 4 additions and 0 deletions

View File

@ -78,6 +78,10 @@ void AVRI2CDriver::begin() {
TWBR = ((CPU_FREQ / 100000) - 16) / 2;
// enable twi module, acks, and twi interrupt
TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA);
// start in high speed. When a driver gets an error it drops it to
// low speed
setHighSpeed(true);
}
void AVRI2CDriver::end() {