I2c: default to 5ms timeout, and faster bus speed

we will slow down the speed when we get a failure
This commit is contained in:
Andrew Tridgell 2012-01-04 16:36:47 +11:00
parent 60185509f4
commit cdd5589498
2 changed files with 6 additions and 2 deletions

View File

@ -108,7 +108,9 @@ static void init_ardupilot()
//
#ifndef DESKTOP_BUILD
I2c.begin();
I2c.timeOut(20);
I2c.timeOut(5);
// initially set a fast I2c speed, and drop it on first failures
I2c.setSpeed(true);
#endif
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV16); // 1MHZ SPI rate

View File

@ -108,7 +108,9 @@ static void init_ardupilot()
//
#ifndef DESKTOP_BUILD
I2c.begin();
I2c.timeOut(20);
I2c.timeOut(5);
// initially set a fast I2c speed, and drop it on first failures
I2c.setSpeed(true);
#endif
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV16); // 1MHZ SPI rate