File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -729,15 +729,27 @@ impl CFGR {
729729 VOSscale :: PwrScale1 => w. vos ( ) . scale1 ( ) ,
730730 } ) ;
731731
732- if config. overdrive {
733- pwr. cr1 . modify ( |_, w| w. oden ( ) . set_bit ( ) ) ;
734- }
735-
736732 // Enable PLL
737733 rcc. cr . modify ( |_, w| w. pllon ( ) . on ( ) ) ;
738734
739735 // Wait for PLL to stabilise
740736 while rcc. cr . read ( ) . pllrdy ( ) . is_not_ready ( ) { }
737+
738+ //Over-drive
739+ if config. overdrive {
740+ // Entering Over-drive mode
741+ //enable the Over-drive mode
742+ pwr. cr1 . modify ( |_, w| w. oden ( ) . set_bit ( ) ) ;
743+
744+ //wait for the ODRDY flag to be set
745+ while !pwr. csr1 . read ( ) . odrdy ( ) . bit_is_set ( ) { }
746+
747+ //switch the voltage regulator from Normal mode to Over-drive mode
748+ pwr. cr1 . modify ( |_, w| w. odswen ( ) . set_bit ( ) ) ;
749+
750+ //Wait for the ODSWRDY flag in the PWR_CSR1 to be set.
751+ while !pwr. csr1 . read ( ) . odswrdy ( ) . bit_is_set ( ) { }
752+ }
741753 }
742754
743755 if self . use_pll48clk {
You can’t perform that action at this time.
0 commit comments