mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user