Applied https://github.com/wpilibsuite/allwpilib/pull/503

WPILib is handling interrupts incorrectly.  Backport their fix.

Change-Id: I14cad35799482dd4665cdb57816e2e8fab474f1d
diff --git a/third_party/allwpilib_2017/wpilibc/athena/src/InterruptableSensorBase.cpp b/third_party/allwpilib_2017/wpilibc/athena/src/InterruptableSensorBase.cpp
index f5a006d..7545b1b 100644
--- a/third_party/allwpilib_2017/wpilibc/athena/src/InterruptableSensorBase.cpp
+++ b/third_party/allwpilib_2017/wpilibc/athena/src/InterruptableSensorBase.cpp
@@ -108,7 +108,13 @@
   result = HAL_WaitForInterrupt(m_interrupt, timeout, ignorePrevious, &status);
   wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
 
-  return static_cast<WaitResult>(result);
+  // Rising edge result is the interrupt bit set in the byte 0xFF
+  // Falling edge result is the interrupt bit set in the byte 0xFF00
+  // Set any bit set to be true for that edge, and AND the 2 results
+  // together to match the existing enum for all interrupts
+  int32_t rising = (result & 0xFF) ? 0x1 : 0x0;
+  int32_t falling = ((result & 0xFF00) ? 0x0100 : 0x0);
+  return static_cast<WaitResult>(falling | rising);
 }
 
 /**