File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,11 @@ void setup()
8686 digitalWrite (IMU_CS_PIN, HIGH);
8787 digitalWrite (MMC5983_CS, HIGH);
8888
89+ // b2b pins
90+ pinMode (B2B_EN, OUTPUT);
91+ pinMode (B2B_READY, INPUT);
92+ digitalWrite (B2B_EN, HIGH); // Enables the B2B bus
93+
8994 // configure output leds
9095 pinMode (LED_BLUE, OUTPUT);
9196 pinMode (LED_GREEN, OUTPUT);
Original file line number Diff line number Diff line change @@ -428,6 +428,13 @@ DECLARE_THREAD(cam, RocketSystems *arg)
428428 while (true )
429429 {
430430
431+ // Check the status of the B2B chip, if it's bad then we don't waste time with an I2C check.
432+ if (digitalRead (B2B_READY) == LOW) {
433+ THREAD_SLEEP (200 );
434+ continue ;
435+ }
436+
437+ // Check if CAM specifically is on the I2C bus
431438 Wire.beginTransmission (0x69 );
432439 byte error = Wire.endTransmission ();
433440
You can’t perform that action at this time.
0 commit comments