got it so the gyro should work
I basically split the linear code from the gyro board up into a state
machine that runs in ISRs.
diff --git a/bbb_cape/src/cape/data_struct.h b/bbb_cape/src/cape/data_struct.h
index fdcb064..95992b9 100644
--- a/bbb_cape/src/cape/data_struct.h
+++ b/bbb_cape/src/cape/data_struct.h
@@ -26,6 +26,12 @@
// If the current gyro_angle has been not updated because of a bad
// reading from the sensor.
uint8_t old_gyro_reading : 1;
+ // If the gyro is still initializing.
+ // If this is 1, then all of the other gyro data is invalid.
+ uint8_t uninitialized_gyro : 1;
+ // If the gyro is still zeroing.
+ // If this is 1, then all of the other gyro data is invalid.
+ uint8_t zeroing_gyro : 1;
// If we're not going to get any more good gyro_angles.
uint8_t bad_gyro : 1;
};