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

Thoughts on clock config #157

Open
David-OConnor opened this issue Oct 25, 2020 · 4 comments
Open

Thoughts on clock config #157

David-OConnor opened this issue Oct 25, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@David-OConnor
Copy link
Contributor

It seems like the current system fails silently, and gives the user too many degrees of freedom. Eg the illusion you can set whatever speeds you want. I think the STM32Cube IDE visual clock config is a good guide for what configs are valid.

Suggestion: Instead of setting speeds, set the various scalers. This alone reduces the degrees of freedom. Have a helper method to show what speeds these output. Calculate the speeds, and validate before setting. This deals with errors in 2 ways: Prevents requesting speeds that can't be set using the scalers and 2: Fails explicitly if the resulting speeds are out of range.

@Sh3Rm4n Sh3Rm4n added the enhancement New feature or request label Oct 25, 2020
@David-OConnor
Copy link
Contributor Author

David-OConnor commented Oct 25, 2020

Closing in favor of #159

@Sh3Rm4n
Copy link
Member

Sh3Rm4n commented Oct 26, 2020

Also some ideas came up in #156.

@David-OConnor
Copy link
Contributor Author

David-OConnor commented Jan 5, 2021

I just noticed that the L0 hal implementation is very similar to the clocks module in my fork. Its base struct holds prescaler values. Its primary API is to use a default. It uses enums for the various scalers, and has functions to show you the resulting speeds.

@Sh3Rm4n
Copy link
Member

Sh3Rm4n commented Mar 28, 2021

This is an issue, I still want to tackle, but had no time as of now. I summarized my preferences how to implement a more robust and flexible clock configuration in #156 (review)

@Sh3Rm4n Sh3Rm4n reopened this Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants