-
Notifications
You must be signed in to change notification settings - Fork 67
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
Update stm32f3 to v0.11.0 #97
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for keeping an eye out for updates to stm32f3 and ways to make the code nicer :)
Cargo.toml
Outdated
@@ -23,7 +23,7 @@ cortex-m = "0.6" | |||
cortex-m-rt = "0.6" | |||
embedded-hal = "0.2" | |||
nb = "0.1" | |||
stm32f3 = "0.10" | |||
stm32f3 = "0.11.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure we don't want to go for the more general "0.11"?
Aus of the Changelog they seem to go from 0.n.0
to 0.n+1.0
quite reliabely so incoperating a sub-sub version might allow for a seamless bugfix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, I should use "0.11". Thanks for pointing this out :)
Cargo's version always translates to the "^0.11.0" semver version number, unless stated otherwise. So it should not make a difference, as 0.11.1
would automatically be pulled in, when such a version would be released.
acr.acr().modify(|_, w| { | ||
if hclk <= 24_000_000 { | ||
w.latency().ws0() | ||
} else if hclk <= 48_000_000 { | ||
w.latency().ws1() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All those magic numbers make me nervous.
I'm not sure if it helps that they are documented but not explained in stm32f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the documentation of the stm32f3 is always very brief. But more detailed explanation is not the intent of the stm32f3
crate, as this is auto-generated code from svd files. A more detailed explanation is always in the reference manual. However, it does not hurt to add documentation here, to explain, why this is needed.
Remove now unneeded unsafe from the flash state configuration in
src/rcc.rs
and useHCLK
instead ofSYSCLK
as the reference manual suggests.