-
-
Notifications
You must be signed in to change notification settings - Fork 721
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
Update Wire peripheral handler #669
base: master
Are you sure you want to change the base?
Conversation
The existing onService method for I2C peripheral (slave) implementation swapped the sense of onRequest (master read) and onReceive (master write) handlers. It also didn't handle writes correctly, requiring two write operations to get bytes out of the buffer and in the onReceive handler. This implementation follows the SERCOM I2C flow defined for the default clock-stretching case (CTRLB.SCLSM=0) as described in the SAMD21 datasheet. Make sure the write NACK only happens on a stop
Memory usage change @ 4ca9f97
Click for full report table
|
Thanks @stonehippo. Since I have seen this misconception happen several times, I would like to clarify that unrelated failures of the CI runs should never be the reason for a PR to one of Arduino's repositories not being reviewed or merged. The review of pull requests is done (or neglected 😢) by humans. The automated CI system is only there to facilitate the review. The reviewer is fully able to interpret the CI results and disregard the pre-existing failures that are completely unrelated to the changes proposed in the pull request. So their failure does not in any way block progress on the project development. The automated systems assist us, but they do not control us. Of course those failing CI runs may cause confusion for the contributors, so it is certainly important to maintain the CI system. |
Thanks, @per1234. I should also say that I had to cancel the other PR due to an error on my side of things (I made that PR from the master branch of my fork, which was a mistake, and when I corrected that, it closed the old PR automatically). |
The existing onService method for I2C peripheral (slave) implementation
swapped the sense of onRequest (master read) and onReceive (master
write) handlers. It also didn't handle writes correctly, requiring two
write operations to get bytes out of the buffer and in the onReceive
handler.
This implementation follows the SERCOM I2C flow defined for the
default clock-stretching case (CTRLB.SCLSM=0) as described in the
SAMD21 datasheet.
(this was originally submitted as #605, but got blocked due to another issue with tests; see #616. Re-submitting, with the update rebased against latest master).