aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-08-18 10:19:54 +0000
committerGitHub <[email protected]>2023-08-18 10:19:54 +0000
commit94fa95c699df78c44750b63ba1a44c07802d0165 (patch)
tree94c317c0dcb0fb1bd74430e4e64b8872eb950f96
parent2a4ebdc150ba7c32d7dacc12aec85bccf05a41ff (diff)
parent62e66cdda39d3689c5884bd883621f5fb7553117 (diff)
Merge pull request #1793 from ARizzo35/stm32l4-rtc-pwren
stm32l4: set pwren in rcc regardless of clock source
-rw-r--r--embassy-stm32/src/rcc/l4.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/embassy-stm32/src/rcc/l4.rs b/embassy-stm32/src/rcc/l4.rs
index b2828e58e..b34b8caab 100644
--- a/embassy-stm32/src/rcc/l4.rs
+++ b/embassy-stm32/src/rcc/l4.rs
@@ -410,10 +410,11 @@ pub(crate) unsafe fn init(config: Config) {
410 while RCC.cfgr().read().sws() != Sw::MSI {} 410 while RCC.cfgr().read().sws() != Sw::MSI {}
411 } 411 }
412 412
413 RCC.apb1enr1().modify(|w| w.set_pwren(true));
414
413 match config.rtc_mux { 415 match config.rtc_mux {
414 RtcClockSource::LSE32 => { 416 RtcClockSource::LSE32 => {
415 // 1. Unlock the backup domain 417 // 1. Unlock the backup domain
416 RCC.apb1enr1().modify(|w| w.set_pwren(true));
417 PWR.cr1().modify(|w| w.set_dbp(true)); 418 PWR.cr1().modify(|w| w.set_dbp(true));
418 419
419 // 2. Setup the LSE 420 // 2. Setup the LSE