mirror of
https://github.com/processing/processing4.git
synced 2026-02-02 13:21:07 +01:00
Serial: Only use workaround if we're using serialEvent
This commit is contained in:
@@ -461,7 +461,10 @@ public class Serial implements SerialPortEventListener {
|
||||
long start = System.nanoTime();
|
||||
// this method can be called from the context of another thread
|
||||
synchronized (buffer) {
|
||||
toRead = 1;
|
||||
// read one byte at a time if the sketch is using serialEvent
|
||||
if (serialEventMethod != null) {
|
||||
toRead = 1;
|
||||
}
|
||||
long len = System.nanoTime()-start;
|
||||
if (maxReadSyncTime < len) {
|
||||
maxReadSyncTime = len;
|
||||
|
||||
Reference in New Issue
Block a user