Skip to content

Commit 8473f37

Browse files
davidv1992rnijveld
authored andcommitted
Switch to HSE as HSI is too inaccurate.
1 parent 87982ab commit 8473f37

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

statime-stm32/src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ systick_monotonic!(Systick, 1_000);
4949

5050
#[app(device = stm32f7xx_hal::pac, dispatchers = [CAN1_RX0])]
5151
mod app {
52+
use stm32f7xx_hal::rcc::{HSEClock, HSEClockMode};
53+
5254
use super::*;
5355
use crate::port::TimerName;
5456

@@ -73,7 +75,11 @@ mod app {
7375
// Setup clocks
7476
let clocks = {
7577
let rcc = p.RCC.constrain();
76-
let clocks = rcc.cfgr.sysclk(216.MHz()).hclk(216.MHz());
78+
let clocks = rcc
79+
.cfgr
80+
.hse(HSEClock::new(8.MHz(), HSEClockMode::Bypass))
81+
.sysclk(216.MHz())
82+
.hclk(216.MHz());
7783
clocks.freeze()
7884
};
7985

0 commit comments

Comments
 (0)