Skip to content

Update readBytesUntil.adoc #697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 6, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Data type: `size_t`.

[float]
=== Notes and Warnings
The terminator character is discarded from the serial buffer.
The terminator character is discarded from the serial buffer, unless the return value equals `length`. If the return value is less than `length`, it cannot be determined whether this is due to a time-out or due to the detection of the supplied terminator. This function relies on millis() which uses timer0's overflow interrupt.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless the return value equals `length`. 

I think this is a reasonable clarification to add to the documentation, but the approach of talking about the return value made it a bit hard for me to understand when I put my "beginner glasses" on. I think it can be reworded to be more clear.

What do you think about this:

unless the number of characters read equals length.


If the return value is less than `length`, it cannot be determined whether this is due to a time-out or due to the detection of the supplied terminator.

I feel that this information is already provided by the main description:

The function terminates if the terminator character is detected, the determined length has been read, or it times out


This function relies on millis() which uses timer0's overflow interrupt.

Is this true for all architectures officially supported by Arduino?:

We need to be careful to not assume that Arduino == AVR because it's much more than that. However, we don't need to worry about covering 3rd party cores in the Arduino Language Reference. It is the responsibility of their authors to document where there are differences from the official Arduino documentation.

[%hardbreaks]

--
Expand Down