Skip to content

Commit bb92bdd

Browse files
committed
cleanup
1 parent f9499ee commit bb92bdd

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

  • embassy-stm32/src/rcc

embassy-stm32/src/rcc/c5.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,20 @@ use crate::time::Hertz;
77
/// HSI speed
88
pub const HSI_FREQ: Hertz = Hertz(144_000_000);
99

10-
pub enum HsiMode {
11-
/// Full 144MHz speed
12-
FullSpeed,
13-
14-
/// HSI divided by 3 144/3=48MHz
15-
Div3,
16-
}
17-
1810
/// Configuration of the core clocks
1911
#[non_exhaustive]
2012
#[derive(Clone, Copy)]
2113
pub struct Config {
22-
///
14+
/// Enable HSI full speed tap (144MHz)
2315
pub hsi: bool,
2416

17+
/// Enable HSI Div 3 tap (48MHz)
2518
pub hsi_div3: bool,
2619

20+
/// System Clock Configuration
2721
pub sys: Sysclk,
2822

2923
pub ahb_pre: AHBPrescaler,
30-
3124
pub apb1_pre: APBPrescaler,
3225
pub apb2_pre: APBPrescaler,
3326
pub apb3_pre: APBPrescaler,
@@ -108,11 +101,9 @@ pub(crate) unsafe fn init(config: Config) {
108101

109102
//let rtc = config.ls.init();
110103

111-
// Set hpre
112104
RCC.cfgr2().modify(|w| w.set_hpre(config.ahb_pre));
113105
while RCC.cfgr2().read().hpre() != config.ahb_pre {}
114106

115-
// set ppre
116107
RCC.cfgr2().modify(|w| {
117108
w.set_ppre1(config.apb1_pre);
118109
w.set_ppre2(config.apb2_pre);

0 commit comments

Comments
 (0)