mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
[hal] Add warning about onboard I2C (#3871)
Adds HAL layer warning for #3842. This is needed in the case when a vendor uses the HAL directly rather than using the WPILib I2C class. This should not result in a duplicate warning for WPILib I2C users due to the duplicate message checking performed in HAL_SendError(). We don't want to remove the WPILib I2C warning because it gives stack trace information while the HAL layer one can't.
This commit is contained in:
@@ -54,6 +54,10 @@ void HAL_InitializeI2C(HAL_I2CPort port, int32_t* status) {
|
||||
}
|
||||
|
||||
if (port == HAL_I2C_kOnboard) {
|
||||
HAL_SendError(0, 0, 0,
|
||||
"Onboard I2C port is subject to system lockups. See Known "
|
||||
"Issues page for details",
|
||||
"", "", true);
|
||||
std::scoped_lock lock(digitalI2COnBoardMutex);
|
||||
i2COnboardObjCount++;
|
||||
if (i2COnboardObjCount > 1) {
|
||||
|
||||
Reference in New Issue
Block a user