Update WPILib, roborio compilers, and CTRE Phoenix libraries
This borrows heavily from work that Ravago did to initially get this
stuff working.
Tested rudimentary functionality on a test bench, ensured that we could:
* Enable the robot.
* Read joystick and button values.
* Switch between auto and teleop modes.
* Read sensor values (encoder, absolute encoder, potentiometer).
* Read PDP values.
* Drive PWM motors.
* Drive CANivore motors.
Non-WPILib changes are made to accommodate the upgrade roborio
compiler's improved pickiness.
Merge commit '125aac16d9bf03c833ffa18de2f113a33758a4b8' into HEAD
Change-Id: I8648956fb7517b2d784bf58e0a236742af7a306a
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/y2019/wpilib_interface.cc b/y2019/wpilib_interface.cc
index 09d2225..ace17fb 100644
--- a/y2019/wpilib_interface.cc
+++ b/y2019/wpilib_interface.cc
@@ -366,10 +366,7 @@
spi_ = spi;
spi_->SetClockRate(1e6);
spi_->SetChipSelectActiveHigh();
- spi_->SetClockActiveLow();
- spi_->SetSampleDataOnFalling();
- // It ignores you if you try changing this...
- spi_->SetMSBFirst();
+ spi_->SetMode(frc::SPI::Mode::kMode3);
}
void set_activate_usb(std::unique_ptr<frc::DigitalInput> activate_usb) {
@@ -488,9 +485,7 @@
if (dummy_spi_) {
dummy_spi_->SetClockRate(1e5);
dummy_spi_->SetChipSelectActiveLow();
- dummy_spi_->SetClockActiveLow();
- dummy_spi_->SetSampleDataOnFalling();
- dummy_spi_->SetMSBFirst();
+ dummy_spi_->SetMode(frc::SPI::Mode::kMode3);
}
}