Add a hook in the IMU code for the camera board communications
Change-Id: Ib667ba814ce1e3e376252bba3375bedcf98ff707
diff --git a/frc971/wpilib/ADIS16448.h b/frc971/wpilib/ADIS16448.h
index a631fee..1846723 100644
--- a/frc971/wpilib/ADIS16448.h
+++ b/frc971/wpilib/ADIS16448.h
@@ -45,6 +45,10 @@
// readings.
void operator()();
+ void set_spi_idle_callback(std::function<void()> spi_idle_callback) {
+ spi_idle_callback_ = std::move(spi_idle_callback);
+ }
+
void Quit() { run_ = false; }
double gyro_x_zeroed_offset() const { return gyro_x_zeroed_offset_; }
@@ -89,6 +93,7 @@
frc::DigitalInput *const dio1_;
frc::DigitalOutput *reset_ = nullptr;
+ std::function<void()> spi_idle_callback_ = []() {};
::std::atomic<bool> run_{true};
// The averaged values of the gyro over 6 seconds after power up.