Skip to content

Commit 2162e01

Browse files
authored
clockout: fix lsco logic (#121)
To be able to properly enable the LSE, the power domain needs to be up first Signed-off-by: Jean-Baptiste Theou <[email protected]> Co-authored-by: Jean-Baptiste Theou <[email protected]>
1 parent cd0921d commit 2162e01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rcc/clockout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub trait LSCOExt {
3030

3131
impl LSCOExt for LscoPin {
3232
fn lsco(self, src: LSCOSrc, rcc: &mut Rcc) -> Lsco {
33+
rcc.unlock_rtc();
3334
let src_select_bit = match src {
3435
LSCOSrc::LSE => {
3536
rcc.enable_lse(false);
@@ -40,7 +41,6 @@ impl LSCOExt for LscoPin {
4041
false
4142
}
4243
};
43-
rcc.unlock_rtc();
4444
rcc.rb.bdcr.modify(|_, w| w.lscosel().bit(src_select_bit));
4545
Lsco {
4646
pin: self.into_alternate(),

0 commit comments

Comments
 (0)