diff options
| -rw-r--r-- | embassy-stm32/src/rcc/f4.rs | 7 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/mod.rs | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/embassy-stm32/src/rcc/f4.rs b/embassy-stm32/src/rcc/f4.rs index 2ae0d15cb..ee9cb2897 100644 --- a/embassy-stm32/src/rcc/f4.rs +++ b/embassy-stm32/src/rcc/f4.rs | |||
| @@ -473,6 +473,11 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 473 | Rtc::set_clock_source(clock_source); | 473 | Rtc::set_clock_source(clock_source); |
| 474 | }); | 474 | }); |
| 475 | 475 | ||
| 476 | let rtc = match config.rtc { | ||
| 477 | Some(RtcClockSource::LSI) => Some(LSI_FREQ), | ||
| 478 | _ => None, | ||
| 479 | }; | ||
| 480 | |||
| 476 | set_freqs(Clocks { | 481 | set_freqs(Clocks { |
| 477 | sys: Hertz(sysclk), | 482 | sys: Hertz(sysclk), |
| 478 | apb1: Hertz(pclk1), | 483 | apb1: Hertz(pclk1), |
| @@ -492,6 +497,8 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 492 | 497 | ||
| 493 | #[cfg(any(stm32f427, stm32f429, stm32f437, stm32f439, stm32f446, stm32f469, stm32f479))] | 498 | #[cfg(any(stm32f427, stm32f429, stm32f437, stm32f439, stm32f446, stm32f469, stm32f479))] |
| 494 | pllsai: None, | 499 | pllsai: None, |
| 500 | |||
| 501 | rtc: rtc, | ||
| 495 | }); | 502 | }); |
| 496 | } | 503 | } |
| 497 | 504 | ||
diff --git a/embassy-stm32/src/rcc/mod.rs b/embassy-stm32/src/rcc/mod.rs index 62c19bda6..698da8d80 100644 --- a/embassy-stm32/src/rcc/mod.rs +++ b/embassy-stm32/src/rcc/mod.rs | |||
| @@ -74,7 +74,7 @@ pub struct Clocks { | |||
| 74 | #[cfg(any(rcc_h5, rcc_h50, rcc_h7, rcc_h7ab))] | 74 | #[cfg(any(rcc_h5, rcc_h50, rcc_h7, rcc_h7ab))] |
| 75 | pub adc: Option<Hertz>, | 75 | pub adc: Option<Hertz>, |
| 76 | 76 | ||
| 77 | #[cfg(rcc_wb)] | 77 | #[cfg(any(rcc_wb, rcc_f4))] |
| 78 | /// Set only if the lsi or lse is configured | 78 | /// Set only if the lsi or lse is configured |
| 79 | pub rtc: Option<Hertz>, | 79 | pub rtc: Option<Hertz>, |
| 80 | } | 80 | } |
