File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
15
15
- Add dac
16
16
- Fix flash error flag clearing
17
17
- Clarify README for windows users
18
+ - Add an option to allow overclocking [ #494 ]
18
19
19
20
### Added
20
21
21
22
- Allow to set HSE bypass bit in ` RCC ` clock configuration register to use an external clock input on the ` OSC_IN ` pin
22
23
- support ` embedded-hal-1.0 `
24
+
25
+ [ #494 ] : https://github.com/stm32-rs/stm32f1xx-hal/pull/494
23
26
24
27
## [ v0.10.0] - 2022-12-12
25
28
Original file line number Diff line number Diff line change @@ -507,6 +507,7 @@ pub struct Config {
507
507
#[ cfg( any( feature = "stm32f103" , feature = "connectivity" ) ) ]
508
508
pub usbpre : UsbPre ,
509
509
pub adcpre : AdcPre ,
510
+ pub allow_overclock : bool ,
510
511
}
511
512
512
513
impl Default for Config {
@@ -521,6 +522,7 @@ impl Default for Config {
521
522
#[ cfg( any( feature = "stm32f103" , feature = "connectivity" ) ) ]
522
523
usbpre : UsbPre :: Div15 ,
523
524
adcpre : AdcPre :: Div2 ,
525
+ allow_overclock : false ,
524
526
}
525
527
}
526
528
}
@@ -681,6 +683,7 @@ impl Config {
681
683
#[ cfg( any( feature = "stm32f103" , feature = "connectivity" ) ) ]
682
684
usbpre,
683
685
adcpre : apre_bits,
686
+ allow_overclock : false ,
684
687
}
685
688
}
686
689
@@ -724,11 +727,12 @@ impl Config {
724
727
) ;
725
728
726
729
assert ! (
727
- sysclk <= 72_000_000
728
- && hclk <= 72_000_000
729
- && pclk1 <= 36_000_000
730
- && pclk2 <= 72_000_000
731
- && adcclk <= 14_000_000
730
+ self . allow_overclock
731
+ || ( sysclk <= 72_000_000
732
+ && hclk <= 72_000_000
733
+ && pclk1 <= 36_000_000
734
+ && pclk2 <= 72_000_000
735
+ && adcclk <= 14_000_000 )
732
736
) ;
733
737
734
738
Clocks {
@@ -763,6 +767,7 @@ fn rcc_config_usb() {
763
767
#[ cfg( any( feature = "stm32f103" , feature = "connectivity" ) ) ]
764
768
usbpre : UsbPre :: Div1 ,
765
769
adcpre : AdcPre :: Div8 ,
770
+ allow_overclock : false ,
766
771
} ;
767
772
assert_eq ! ( config, config_expected) ;
768
773
You can’t perform that action at this time.
0 commit comments