Skip to content
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

Wire: Let requestFrom return the number of available bytes #165

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matthijskooijman
Copy link

Previously, it would return the number of requested bytes, even if the
slave returned a NAK on the address byte, preventing libraries to detect
such a NAK. For example, the SparkFun HTU21D library would fail to read
humidity, because the "I'm not ready measuring"-NAK would look like a
successful read, but with dummy data.

This matches the return value with that of the official Arduino versions
and the documentation at
https://www.arduino.cc/en/Reference/WireRequestFrom

Previously, it would return the number of requested bytes, even if the
slave returned a NAK on the address byte, preventing libraries to detect
such a NAK. For example, the SparkFun HTU21D library would fail to read
humidity, because the "I'm not ready measuring"-NAK would look like a
successful read, but with dummy data.

This matches the return value with that of the official Arduino versions
and the documentation at
https://www.arduino.cc/en/Reference/WireRequestFrom
@GrumpyOldPizza
Copy link
Owner

ACK. I recall having coded that specifically as to one of the cores (must have been ArduinoCore-samd at the time) had exactly those semantics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants