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

Start cleaning up I2C code #236

merged 12 commits into from May 8, 2020

Start cleaning up I2C code #236

merged 12 commits into from May 8, 2020


Copy link

This PR starts cleaning up the I2C module, specifically the clock configuration. It follows the example of the USART cleanup in #223.

I'm not done yet, but the work done here is already an improvement on its own.

This follows the example set in `usart` and other modules. It's not
strictly necessary (`i2c` is a relatively small module), but I think
it's still an improvement.
I always like to put inherent impls before trait implementations.
Following this rule consistently makes the code a bit more readable, I
This prevents a name collision that would have been caused by a change
I'm currently working on.
I don't see a reason to tie an I2C clock configuration to a specific
instance. All it does is prevent re-use of the clock configuration for
several I2C instances.
@david-sawatzke david-sawatzke merged commit 924a29d into lpc-rs:master May 8, 2020
@hannobraun hannobraun deleted the i2c branch May 9, 2020 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants