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

View File

@@ -35,7 +35,7 @@ public:
static bool CheckSolenoidChannel(uint32_t channel);
static bool CheckPDPChannel(uint32_t channel);
static const uint32_t kDigitalChannels = 20;
static const uint32_t kDigitalChannels = 26;
static const uint32_t kAnalogInputs = 8;
static const uint32_t kAnalogOutputs = 2;
static const uint32_t kSolenoidChannels = 8;

View File

@@ -28,7 +28,7 @@ public abstract class SensorBase { // TODO: Refactor
/**
* Number of digital channels per digital sidecar
*/
public static final int kDigitalChannels = 20;
public static final int kDigitalChannels = 26;
/**
* Number of digital modules
* XXX: This number is incorrect. We need to find the correct number.