@@ -476,8 +476,8 @@ void beginGNSS()
476476// Configuration can take >1s so configure during splash
477477void configureGNSS ()
478478{
479- if (online.gnss == false ) return ;
480-
479+ if (online.gnss == false ) return ;
480+
481481 i2cGNSS.setAutoPVTcallbackPtr (&storePVTdata); // Enable automatic NAV PVT messages with callback to storePVTdata
482482 i2cGNSS.setAutoHPPOSLLHcallbackPtr (&storeHPdata); // Enable automatic NAV HPPOSLLH messages with callback to storeHPdata
483483
@@ -811,3 +811,24 @@ void beginIdleTasks()
811811 index); // Core where task should run, 0=core, 1=Arduino
812812 }
813813}
814+
815+ void beginI2C ()
816+ {
817+ Wire.begin (); // Start I2C on core 1
818+ // Wire.setClock(400000);
819+
820+ // begin/end wire transmission to see if bus is responding correctly
821+ // All good: 0ms, response 2
822+ // SDA/SCL shorted: 1000ms timeout, response 5
823+ // SCL/VCC shorted: 14ms, response 5
824+ // SCL/GND shorted: 1000ms, response 5
825+ // SDA/VCC shorted: 1000ms, reponse 5
826+ // SDA/GND shorted: 14ms, response 5
827+ unsigned long startTime = millis ();
828+ Wire.beginTransmission (0x15 ); // Dummy address
829+ int endValue = Wire.endTransmission ();
830+ if (endValue == 2 )
831+ online.i2c = true ;
832+ else
833+ Serial.println (" Error: I2C Bus Not Responding" );
834+ }
0 commit comments