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

Possible typo in maximal frequency. #144

Open
matoushybl opened this issue Oct 19, 2021 · 2 comments
Open

Possible typo in maximal frequency. #144

matoushybl opened this issue Oct 19, 2021 · 2 comments

Comments

@matoushybl
Copy link
Contributor

matoushybl commented Oct 19, 2021

There are two different frequencies mentioned in the comments and in the code.

stm32f7xx-hal/src/rcc.rs

Lines 468 to 476 in 0a0d06d

let mut pclk1: u32 = min(max_pclk1, self.pclk1.unwrap_or(hclk));
// PCLK2 (APB2). Must be <= 108 Mhz. By default, min(hclk, 108Mhz) is
// chosen
// Add limits dependens on OD follows by DS Table 16.
let max_pclk2 = if sysclk <= 180_000_000 {
90_000_000
} else {
108_000_000
};

@hannobraun
Copy link
Contributor

Thank you, good catch! Just from reading the code, it's not clear to me whether this is actually wrong, but it definitely looks dubious.

Even it this doesn't need fixing, a better comment would be great.

@matoushybl
Copy link
Contributor Author

Oh, I see it now. Sorry for the mistake, I agree with adding a slightly improved comment, but I believe we could also extract the frequencies for example to a module with constants.

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

No branches or pull requests

2 participants