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

Improve blocking i2c ergonomics #229

Closed
wants to merge 3 commits into from

Conversation

TheZoq2
Copy link
Member

@TheZoq2 TheZoq2 commented Jun 20, 2020

Lumpio- in the community discord rightfully pointed out that our current blocking i2c struct takes a lot of unnamed parameters for initialisation. This replaces those unnamed parameter with a default-constructible struct, which allows either the builder pattern, or Struct{fields, .. default()} initialisation to be used.

I also renamed retries to attempts because I think retries is ambiguous. I interpret it as "how many extra tries should we make", but the implementation is "how many attempts should we make.

Finally, I moved the mapr reference requried for i2c1 to the end of the parameter list to the end, next to apb. This makes a lot more sense to me since most of our APIs takes those parameters last, and it's more compatible with i2c2

@TheZoq2
Copy link
Member Author

TheZoq2 commented Jun 20, 2020

Closing in favour of #231

@TheZoq2 TheZoq2 closed this Jun 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant