Skip to content

Clean up serial module - #161

Merged
korken89 merged 5 commits into
stm32-rs:masterfrom
braun-embedded:usart-pins
Nov 2, 2020
Merged

korken89 merged 5 commits into
stm32-rs:masterfrom
braun-embedded:usart-pins

Conversation

@hannobraun

Copy link
Copy Markdown
Collaborator

Mostly cleans up how supported pins are defined, but also includes commits that clean up the use statements (which required a small change to gpio). All details in the commits.

@hannobraun

Copy link
Copy Markdown
Collaborator Author

Looks like there are some problems with the CI build (it builds for me locally). I'll take a look tomorrow.

@hannobraun

Copy link
Copy Markdown
Collaborator Author

Okay, that was a simple fix. I did some rebasing before pushing the branch. The error probably slipped in when I was doing that, and I forgot to run the build again.

In any case, it works now.

Replaces the combinatorial explosion of the previous pin macro with a
more targeted approach. The new macro implements one trait for each kind
of pin. The `Pins` trait is then implemented using blanked
implementations using the pin-traits.
Now pins can be accessed using, for example, `crate::gpio::PA1` instead
of `crate::gpio::gpioa::PA1`. The names are already unambigous, and not
only can this make all imports slighly more convenient, it can also help
cut down a lot on use statements required for macro-generated code.
@hannobraun

Copy link
Copy Markdown
Collaborator Author

Rebased on master, incorporating #150 into the configuration.

@MabezDev, @korken89, @MathiasKoch: It would be great if handling this pull request could be a priority over other USART-related pull requests. I believe this is a clear-cut improvement, but keeping it up to date with further changes is going to be a very error-prone process.

@korken89 korken89 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nice cleanup!

@korken89
korken89 merged commit afbd8e5 into stm32-rs:master Nov 2, 2020
@hannobraun
hannobraun deleted the usart-pins branch November 3, 2020 12:12
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