mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Fixes receive size in Java I2C (#715)
Allows underrun, which matches c++ behavior. Fixes #711
This commit is contained in:
committed by
Peter Johnson
parent
b9aabc71b0
commit
f4dce9e608
@@ -83,7 +83,7 @@ public class I2C extends SensorBase {
|
||||
status = I2CJNI.i2CTransaction(m_port, (byte) m_deviceAddress, dataToSendBuffer,
|
||||
(byte) sendSize, dataReceivedBuffer, (byte) receiveSize);
|
||||
if (receiveSize > 0 && dataReceived != null) {
|
||||
dataReceivedBuffer.get(dataReceived);
|
||||
dataReceivedBuffer.get(dataReceived, 0, receiveSize);
|
||||
}
|
||||
return status < 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user