mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Fixed solenoid allocation bug exposed by adding status pointer initialization
Change-Id: Ibabdf2f1716554b85fd1056c6f1bbe614fa97f4e
This commit is contained in:
@@ -34,7 +34,7 @@ public abstract class SolenoidBase extends SensorBase {
|
||||
m_ports = new ByteBuffer[SensorBase.kSolenoidChannels];
|
||||
for (int i = 0; i < SensorBase.kSolenoidChannels; i++) {
|
||||
ByteBuffer port = SolenoidJNI.getPortWithModule((byte) moduleNumber, (byte) i);
|
||||
IntBuffer status = IntBuffer.allocate(1);
|
||||
IntBuffer status = ByteBuffer.allocateDirect(4).asIntBuffer();
|
||||
m_ports[i] = SolenoidJNI.initializeSolenoidPort(port, status);
|
||||
HALUtil.checkStatus(status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user