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:
Kevin O'Connor
2014-07-17 10:24:45 -04:00
parent b128828977
commit 02a28c8f04
3 changed files with 4 additions and 2 deletions

View File

@@ -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");
}