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/control_loops/drivetrain/localizer.h b/y2019/control_loops/drivetrain/localizer.h
index 1575efb..879cd0f 100644
--- a/y2019/control_loops/drivetrain/localizer.h
+++ b/y2019/control_loops/drivetrain/localizer.h
@@ -306,7 +306,7 @@
MatchFrames(scores, best_matches, target_views.size());
for (size_t ii = 0; ii < target_views.size(); ++ii) {
size_t view_idx = best_frames[ii];
- if (view_idx < 0 || view_idx >= camera_views.size()) {
+ if (view_idx >= camera_views.size()) {
AOS_LOG(ERROR, "Somehow, the view scorer failed.\n");
h_functions->push_back(
[](const State &, const Input &) { return Output::Zero(); });
diff --git a/y2019/image_streamer/BUILD b/y2019/image_streamer/BUILD
index f394b91..19e7b43 100644
--- a/y2019/image_streamer/BUILD
+++ b/y2019/image_streamer/BUILD
@@ -1,3 +1,5 @@
+load("@org_frc971//tools/build_rules:select.bzl", "compiler_select")
+
package(default_visibility = ["//visibility:public"])
cc_binary(
@@ -28,7 +30,14 @@
"-Wno-cast-align",
"-Wno-cast-qual",
"-Wno-error=type-limits",
- ],
+ ] + compiler_select({
+ "clang": [],
+ "gcc": [
+ "-Wno-misleading-indentation",
+ "-Wno-char-subscripts",
+ "-Wno-class-memaccess",
+ ],
+ }),
target_compatible_with = ["@platforms//os:linux"],
deps = [
"//third_party/cimg:CImg",
diff --git a/y2019/jevois/BUILD b/y2019/jevois/BUILD
index 674924a..adb1dd2 100644
--- a/y2019/jevois/BUILD
+++ b/y2019/jevois/BUILD
@@ -1,4 +1,5 @@
load("//motors:macros.bzl", "hex_from_elf")
+load("@org_frc971//tools/build_rules:select.bzl", "compiler_select")
jevois_crc_args = [
"$(location //third_party/pycrc:pycrc_main)",
@@ -124,6 +125,10 @@
srcs = [
"uart_test.cc",
],
+ copts = compiler_select({
+ "gcc": ["-Wno-stringop-overflow"],
+ "clang": [],
+ }),
target_compatible_with = ["@platforms//os:linux"],
deps = [
":uart",
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);
}
}