Skip to content

Start cleaning up I2C code - #236

Merged
david-sawatzke merged 12 commits into
lpc-rs:masterfrom
braun-embedded:i2c
May 8, 2020
Merged

Start cleaning up I2C code#236
david-sawatzke merged 12 commits into
lpc-rs:masterfrom
braun-embedded:i2c

Conversation

@hannobraun

Copy link
Copy Markdown
Member

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.

hannobraun added 12 commits May 7, 2020 14:02
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
believe.
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.
@hannobraun
hannobraun requested a review from david-sawatzke May 8, 2020 12:00
@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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants