Make the compressor work.
Change-Id: I9f47afba08028d6000aad5ab91cc51cc5f02f081
diff --git a/y2018/wpilib_interface.cc b/y2018/wpilib_interface.cc
index 7dd1f11..b644ca1 100644
--- a/y2018/wpilib_interface.cc
+++ b/y2018/wpilib_interface.cc
@@ -933,6 +933,18 @@
::std::thread solenoid_thread(::std::ref(solenoid_writer));
+ int32_t status = 0;
+ HAL_CompressorHandle compressor = HAL_InitializeCompressor(0, &status);
+ if (status != 0) {
+ LOG(ERROR, "Compressor status is nonzero, %d\n",
+ static_cast<int>(status));
+ }
+ HAL_SetCompressorClosedLoopControl(compressor, true, &status);
+ if (status != 0) {
+ LOG(ERROR, "Compressor status is nonzero, %d\n",
+ static_cast<int>(status));
+ }
+
// Wait forever. Not much else to do...
while (true) {
const int r = select(0, nullptr, nullptr, nullptr, nullptr);