-
-
Notifications
You must be signed in to change notification settings - Fork 730
Open
Description
In a tight timing loop (without delays, such as Serial.print()), Serial1.available() returns a lower value than is correct.
For example Serial1.readBytes(buf, Serial1.available())); does not read the whole buffer.
If you use int a=Serial.readBytes(buf, SERIAL_BUFFER_SIZE); then a will report correctly how many bytes were read, this is a different value than Serial1.available(); - usually Serial1.available(); is one byte less.
This leads to the bytes in buf being truncated.
If there is a slight delay in the loop, the problem goes away, so it is hard to debug.
Metadata
Metadata
Assignees
Labels
No labels