Skip to content

Commit

Permalink
clockout: fix lsco logic
Browse files Browse the repository at this point in the history
To be able to properly enable the LSE, the power domain needs to be up
first

Signed-off-by: Jean-Baptiste Theou <[email protected]>
  • Loading branch information
jbtheou committed Jan 29, 2024
1 parent cd0921d commit 7cd6ac2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rcc/clockout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub trait LSCOExt {

impl LSCOExt for LscoPin {
fn lsco(self, src: LSCOSrc, rcc: &mut Rcc) -> Lsco {
rcc.unlock_rtc();
let src_select_bit = match src {
LSCOSrc::LSE => {
rcc.enable_lse(false);
Expand All @@ -40,7 +41,6 @@ impl LSCOExt for LscoPin {
false
}
};
rcc.unlock_rtc();
rcc.rb.bdcr.modify(|_, w| w.lscosel().bit(src_select_bit));
Lsco {
pin: self.into_alternate(),
Expand Down

0 comments on commit 7cd6ac2

Please sign in to comment.