Skip to content

Commit 0c97556

Browse files
Merge pull request #200 from ISSUIUC/feature/midas-b2b-en.
Add B2B Enable for MIDAS Mini
2 parents 819b3bb + be703a2 commit 0c97556

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

MIDAS/src/hardware/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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);

MIDAS/src/systems.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)