IO: Add a 100ms timeout to I2C to allow communication with Arduino

Note this currently does not include the compiled binary for linux-arm64
This commit is contained in:
gohai
2018-06-28 15:31:39 -07:00
committed by Gottfried Haider
parent 41a52e7423
commit 0bb5b77328
+3
View File
@@ -323,6 +323,9 @@ JNIEXPORT jint JNICALL Java_processing_io_NativeInterface_transferI2c
packets.nmsgs++;
}
// set the timeout to 100ms - this helps slow devices such as the
// Arduino Uno to keep up
ioctl(handle, I2C_TIMEOUT, 10);
int ret = ioctl(handle, I2C_RDWR, &packets);
if (ret < 0) {
ret = -errno;