Skip to content

Commit cc1f437

Browse files
Replaced I2C transaction with readOnly and writeBulk
Contributed by Justin Wise
1 parent 90a29a8 commit cc1f437

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/io/github/pseudoresonance/pixy2api/links/I2CLink.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public int receive(byte[] buffer, int length, Checksum cs) {
8787
// n is the number read -- it most likely won't be equal to length
8888
n = 0;
8989
byte[] read = new byte[length - i];
90-
i2c.transaction(new byte[0], (byte) 0, read, (length - i));
90+
i2c.readOnly(read, (length - i));
9191
for (int k = 0; k < read.length; k++) {
9292
n++;
9393
byte b = read[k];
@@ -129,7 +129,7 @@ public int send(byte[] buffer, int length) {
129129
else
130130
packet = PIXY_I2C_MAX_SEND;
131131
byte[] send = Arrays.copyOfRange(buffer, i, packet);
132-
i2c.transaction(send, packet, new byte[0], 0);
132+
i2c.writeBulk(send, packet);
133133
}
134134
return length;
135135
}

0 commit comments

Comments
 (0)