From e7ef23d30c4e1605efe0254749d08b21e351c47b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 13 Jan 2020 20:44:15 +0800 Subject: [PATCH] wrpll: use CONFIG_CLOCK_FREQUENCY and rtio_frequency in trim_dcxos --- artiq/firmware/libboard_artiq/wrpll.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/artiq/firmware/libboard_artiq/wrpll.rs b/artiq/firmware/libboard_artiq/wrpll.rs index fbf133d4b..ed0f27ba6 100644 --- a/artiq/firmware/libboard_artiq/wrpll.rs +++ b/artiq/firmware/libboard_artiq/wrpll.rs @@ -357,7 +357,8 @@ fn trim_dcxos(f_helper: u32, f_main: u32, f_cdr: u32) -> Result<(i32, i32), &'st const TIMER_WIDTH: u32 = 23; const COUNTER_DIV: u32 = 2; - const F_SYS: f64 = 125.0e6; + const F_SYS: f64 = csr::CONFIG_CLOCK_FREQUENCY as f64; + #[cfg(rtio_frequency = "125.0")] const F_MAIN: f64 = 125.0e6; const F_HELPER: f64 = F_MAIN * ((1 << 15) as f64)/((1<<15) as f64 + 1.0);