We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9541cbb commit e85aec5Copy full SHA for e85aec5
1 file changed
java/libraries/serial/src/processing/serial/Serial.java
@@ -461,7 +461,10 @@ public void serialEvent(SerialPortEvent event) {
461
long start = System.nanoTime();
462
// this method can be called from the context of another thread
463
synchronized (buffer) {
464
- toRead = 1;
+ // read one byte at a time if the sketch is using serialEvent
465
+ if (serialEventMethod != null) {
466
+ toRead = 1;
467
+ }
468
long len = System.nanoTime()-start;
469
if (maxReadSyncTime < len) {
470
maxReadSyncTime = len;
0 commit comments