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

Clean up serial module #161

Merged
merged 5 commits into from Nov 2, 2020
Merged

Clean up serial module #161

merged 5 commits into from Nov 2, 2020

Conversation

hannobraun
Copy link
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
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
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
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.

Copy link
Collaborator

@korken89 korken89 left a comment

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.

None yet

2 participants