mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +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");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user