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

STM32: Fix restriction on GPIO clock enables for F407 Discovery board #2680

Merged
merged 1 commit into from
Mar 4, 2020
Merged

STM32: Fix restriction on GPIO clock enables for F407 Discovery board #2680

merged 1 commit into from
Mar 4, 2020

Conversation

hierophect
Copy link
Collaborator

@hierophect hierophect commented Mar 3, 2020

Also expanded for F405 SoC definition, for the possible future case a F405 board with the expanded pins is added. Resolves #2679.

@hierophect hierophect requested a review from tannewt March 3, 2020 22:25
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

This is good for now. Later we'll want to enable each GPIO on first use to save power. Thanks!

@tannewt tannewt merged commit 4aec5d1 into adafruit:master Mar 4, 2020
@hierophect hierophect deleted the stm32-clock-hotfix branch March 4, 2020 20:30
@hierophect
Copy link
Collaborator Author

@tannewt maybe that would be best added as a new utility in microcontroller/Pin.c? Something like "port_on" and "port_off" that you'd call in every construct and de-init/reset function, respectively. "port_on" would check if no pins are active and turn the port clock on if not, "port_off" would do the opposite.

@tannewt
Copy link
Member

tannewt commented Mar 5, 2020

Do we need it outside of DigitalInOut? The GPIO clocks are only used by it I'd think.

@hierophect
Copy link
Collaborator Author

@tannewt no you need them for anything that uses a pin, they're included in every ST msp function for every peripheral.

@tannewt
Copy link
Member

tannewt commented Mar 5, 2020

Ok, sounds good to factor it out into microcontroller/Pin.c. Could it be in claim_pin?

@hierophect
Copy link
Collaborator Author

Probably? I can't think of any edge cases off the top of my head where that wouldn't be enough.

@hierophect hierophect added the stm label Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

STM32F4 Discovery: Unable to set port D pin direction as OUTPUT
2 participants