Die on duplicate/invalid DigitalInput's
Haven't actually checked whether running FATAL checks on every single
access causes any issues, but the CHECK's in the constructors are fine
at least.
Change-Id: Icdca5556c5d041f8812468b19de6690dc80bf416
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/frc971/wpilib/ahal/DigitalInput.cc b/frc971/wpilib/ahal/DigitalInput.cc
index 3e07208..d922cae 100644
--- a/frc971/wpilib/ahal/DigitalInput.cc
+++ b/frc971/wpilib/ahal/DigitalInput.cc
@@ -43,6 +43,7 @@
channel, HAL_GetErrorMessage(status));
m_handle = HAL_kInvalidHandle;
m_channel = std::numeric_limits<int>::max();
+ HAL_CHECK_STATUS(status) << ": Channel " << channel;
return;
}
@@ -72,6 +73,7 @@
int32_t status = 0;
bool value = HAL_GetDIO(m_handle, &status);
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+ HAL_CHECK_STATUS(status);
return value;
}