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/cpu: Add functions for low power mode clock config #12579

Merged
merged 1 commit into from
Nov 1, 2019

Conversation

bergzand
Copy link
Member

Contribution description

This PR adds functions for managing the clock config in low power mode for the STM32 devices.

Testing procedure

I'm not really sure, it should at least compile for all stm32 based devices

Issues/PRs references

Required for #12556

@bergzand bergzand added Type: new feature The issue requests / The PR implemements a new feature for RIOT CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: cpu Area: CPU/MCU ports labels Oct 26, 2019
Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

How about F0, F3 and L1 ?

cpu/stm32_common/cpu_common.c Outdated Show resolved Hide resolved
@bergzand
Copy link
Member Author

How about F0, F3 and L1 ?

As far as I could find, the F0, F1, F3 and L1 don't have these registers. No low power mode clock enable for them.

considering this case, do you think it makes sense to omit the function completely? The other solution is to add an empty function for those. I'm not really sure what the 'better' solution is in this case

@benpicco
Copy link
Contributor

do you think it makes sense to omit the function completely? The other solution is to add an empty function for those. I'm not really sure what the 'better' solution is in this case

Depends, is it more convenient if you can just always can call that function even if it's a No-Op or would that code path not be taken on those devices because they need an entirely different driver?

@bergzand
Copy link
Member Author

Depends, is it more convenient if you can just always can call that function even if it's a No-Op or would that code path not be taken on those devices because they need an entirely different driver?

I've been thinking about it a bit and I prefer to omit them for the cases where it would result in a No-op. The functions are internal and specific to a subset stm32 devices, they should only be used for periph drivers. In this case I prefer to have a hard fail on compilation compared to a silent "failure".

We can always add the No-op functions if it is more convenient on the periph side.

Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

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

Adds a new function, code looks clean and no side effects.

@bergzand
Copy link
Member Author

bergzand commented Nov 1, 2019

Squashed!

@benpicco benpicco merged commit 926bdc9 into RIOT-OS:master Nov 1, 2019
@fjmolinas fjmolinas added this to the Release 2020.01 milestone Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants