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

Board based instantiation of chip drivers and interrupt mappings: Stm32f3 #2187

Merged
merged 1 commit into from Nov 12, 2020

Conversation

hudson-ayers
Copy link
Contributor

@hudson-ayers hudson-ayers commented Nov 3, 2020

Pull Request Overview

This pull request ports the stm32f3xx chip and the stm32f3discovery board to the new peripheral instantiation approach that does not rely on global variables (first proposed in #2069).

This chip was more challenging than most of the previous ones I have switched over, because it extensively relied on shared use of global statics for GPIO Pins / Ports, the clock manager (RCC), and the interrupt controller (EXTI). As a result I had to do a semi-significant refactoring of the GPIO driver to not rely on the assumption that references to gpio pins could be created from anywhere. The GPIO driver is now closer to the design of the GPIO driver for most other chips, but the "ports" and "pins" are still stored separately so that I could minimize the total amount of code I had to change.

Bright side: This PR removes 60 uses of unsafe across the stm32f3xx and stm32f3discovery crates!

Testing Strategy

This pull request was tested by compiling. But there are enough changes in this PR that hardware testing would be greatly appreciated.

TODO or Help Wanted

N/A

Documentation Updated

  • No updates are required.

Formatting

  • Ran make prepush.

@krady21 krady21 mentioned this pull request Nov 5, 2020
2 tasks
@hudson-ayers hudson-ayers added refactor stm32 Change pertains to the stm32 family of MCUSs labels Nov 6, 2020
@bradjc
Copy link
Contributor

bradjc commented Nov 6, 2020

In my mind the PRs needed to complete this transition to board-specified chip instantiation are all automatically last-call, but I think we should leave the PRs open for a couple days to give people a chance to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor stm32 Change pertains to the stm32 family of MCUSs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants