Skip to content

Commit d2595f5

Browse files
committed
Merge branch 'master' into canbus-with-crate
2 parents bd0dd68 + b2a4c0f commit d2595f5

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

CHANGELOG.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1313

1414
### Changed
1515

16-
- **Breaking** The feature gate requires you to select a subvaraint if possible. ([#67](https://github.com/stm32-rs/stm32f3xx-hal/pull/67))
17-
- **Breaking** Split up `stm32f302` into sub-targets `stm32f302xb`,`stm32f302xc`,`stm32f302xd`,`stm32f302xe`
1816
- The system clock calculation is more fine grained now. ([#67](https://github.com/stm32-rs/stm32f3xx-hal/pull/67))
1917
Now the system clock can be some value, like 14 MHz, which can not a
2018
be represented as a multiple of the oscillator clock:
@@ -34,6 +32,12 @@ let clocks = rcc
3432
external oscillator clock on most devices. Some devices have even the
3533
possibility to divide the internal oscillator clock.
3634

35+
### Breaking changes
36+
37+
- The feature gate requires you to select a subvariant if possible. ([#75](https://github.com/stm32-rs/stm32f3xx-hal/pull/75))
38+
- Split up `stm32f302` into sub-targets `stm32f302xb`,`stm32f302xc`,`stm32f302xd`,`stm32f302xe`
39+
- Bump `stm32f3` dependency to `0.11.0` ([#97](https://github.com/stm32-rs/stm32f3xx-hal/pull/97))
40+
3741
## [v0.4.3] - 2020-04-11
3842

3943
### Added
@@ -134,7 +138,7 @@ let clocks = rcc
134138

135139
- Various peripheral mappings for some devices ([#12](https://github.com/stm32-rs/stm32f3xx-hal/pull/12))
136140

137-
### Breaking changers
141+
### Breaking changes
138142

139143
- Switch to the `embedded-hal` v2 digital pin trait.
140144

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cortex-m = "0.6"
2323
cortex-m-rt = "0.6"
2424
embedded-hal = "0.2"
2525
nb = "0.1"
26-
stm32f3 = "0.10"
26+
stm32f3 = "0.11"
2727

2828
[dependencies.embedded-hal-can]
2929
version = "0.1.0"

src/rcc.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -524,18 +524,17 @@ impl CFGR {
524524

525525
assert!(pclk2 <= 72_000_000);
526526

527-
// adjust flash wait states
528-
unsafe {
529-
acr.acr().modify(|_, w| {
530-
w.latency().bits(if sysclk <= 24_000_000 {
531-
0b000
532-
} else if sysclk <= 48_000_000 {
533-
0b001
534-
} else {
535-
0b010
536-
})
537-
})
538-
}
527+
// Adjust flash wait states according to the
528+
// HCLK frequency (cpu core clock)
529+
acr.acr().modify(|_, w| {
530+
if hclk <= 24_000_000 {
531+
w.latency().ws0()
532+
} else if hclk <= 48_000_000 {
533+
w.latency().ws1()
534+
} else {
535+
w.latency().ws2()
536+
}
537+
});
539538

540539
let (usbpre, usbclk_valid) = usb_clocking::is_valid(sysclk, self.hse, pclk1, &pll_config);
541540

0 commit comments

Comments
 (0)