mirror of
https://github.com/SlimeVR/SlimeVR-Tracker-ESP.git
synced 2026-04-06 02:01:57 +02:00
Fix I2C clock stretch limit to fix BNO085 resets
This commit is contained in:
@@ -1339,7 +1339,7 @@ void BNO080::saveCalibration()
|
||||
//Returns false if failed
|
||||
boolean BNO080::waitForI2C()
|
||||
{
|
||||
for (uint8_t counter = 0; counter < 255; counter++) //Don't got more than 255
|
||||
for (uint8_t counter = 0; counter < 100; counter++) //Don't got more than 255
|
||||
{
|
||||
if (_i2cPort->available() > 0)
|
||||
return (true);
|
||||
|
||||
@@ -83,9 +83,8 @@ void setup()
|
||||
digitalWrite(LOADING_LED, LOW);
|
||||
|
||||
// join I2C bus
|
||||
Wire.flush();
|
||||
Wire.begin(PIN_IMU_SDA, PIN_IMU_SCL);
|
||||
Wire.setClockStretchLimit(4000);
|
||||
Wire.setClockStretchLimit(150000L); // Default streatch limit 150mS
|
||||
Wire.setClock(100000);
|
||||
Serial.begin(serialBaudRate);
|
||||
while (!Serial)
|
||||
|
||||
Reference in New Issue
Block a user