mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Add allocation checking for I2C MXP. Update DIO counts in Lib layer until resource checking moves down to HAL
Change-Id: I0abe80bcbe9cbbc81f0887a1cd1a3aa0862df5f1
This commit is contained in:
@@ -1453,6 +1453,8 @@ void i2CInitialize(uint8_t port, int32_t *status) {
|
||||
} else if(port == 1) {
|
||||
i2CMXPObjCount++;
|
||||
if (i2CMXPHandle > 0) return;
|
||||
if(!allocateDIO(getPort(24), false, status)) return;
|
||||
if(!allocateDIO(getPort(25), false, status)) return;
|
||||
digitalSystem->writeEnableMXPSpecialFunction(digitalSystem->readEnableMXPSpecialFunction(status)|0xC000, status);
|
||||
i2CMXPHandle = i2clib_open("/dev/i2c-1");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user