mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Add warning about onboard I2C (#3842)
This commit is contained in:
@@ -16,6 +16,14 @@ using namespace frc;
|
||||
I2C::I2C(Port port, int deviceAddress)
|
||||
: m_port(static_cast<HAL_I2CPort>(port)), m_deviceAddress(deviceAddress) {
|
||||
int32_t status = 0;
|
||||
|
||||
if (port == I2C::Port::kOnboard) {
|
||||
FRC_ReportError(warn::Warning, "{}",
|
||||
"Onboard I2C port is subject to system lockups. See Known "
|
||||
"Issues page for "
|
||||
"details");
|
||||
}
|
||||
|
||||
HAL_InitializeI2C(m_port, &status);
|
||||
FRC_CheckErrorStatus(status, "Port {}", port);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user