arduino/Arduino — pull request #1869 by kevin-pololu (2014-02-18 04:20:58+00:00)
Title: SAM Wire: fixed NACK/timeout behavior of requestFrom() and available()

"readed" is no longer incremented in requestFrom() if TWI_WaitByteReceived() gets a NACK or times out. This corrects the behavior (return values) of requestFrom() and available() to match the Arduino reference; they should return the number of bytes actually available for read(), not the number of bytes requested, which was the previous behavior. Fixes arduino/Arduino#1311