From 69cddc6b862a85823d28e6339d3a94415e21eee9 Mon Sep 17 00:00:00 2001 From: Spaqin Date: Thu, 28 Oct 2021 16:34:22 +0800 Subject: [PATCH] rtio_clocking: add warnings for unsupported rtio_clock settings (#1773) --- artiq/firmware/runtime/rtio_clocking.rs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/artiq/firmware/runtime/rtio_clocking.rs b/artiq/firmware/runtime/rtio_clocking.rs index 8f2560ead..f0330b4d9 100644 --- a/artiq/firmware/runtime/rtio_clocking.rs +++ b/artiq/firmware/runtime/rtio_clocking.rs @@ -83,9 +83,13 @@ pub mod crg { info!("Using external clock"); 1 }, - _ => { + RtioClock::Int_125 => { info!("Using internal RTIO clock"); 0 + }, + _ => { + warn!("rtio_clock setting '{:?}' is not supported. Using default internal RTIO clock instead", clk); + 0 } }; unsafe { @@ -181,8 +185,21 @@ fn setup_si5324_as_synthesizer(cfg: RtioClock) { crystal_ref: true } }, - _ => { // 125MHz output, from crystal, 7 Hz, default (if chosen option is not supported) - info!("using internal 125MHz RTIO clock"); // covers also RtioClock::Int_125 + RtioClock::Int_125 => { // 125MHz output, from crystal, 7 Hz + info!("using internal 125MHz RTIO clock"); + si5324::FrequencySettings { + n1_hs : 10, + nc1_ls : 4, + n2_hs : 10, + n2_ls : 19972, + n31 : 4565, + n32 : 4565, + bwsel : 4, + crystal_ref: true + } + } + _ => { // 125MHz output like above, default (if chosen option is not supported) + warn!("rtio_clock setting '{:?}' is not supported. Falling back to default internal 125MHz RTIO clock.", cfg); si5324::FrequencySettings { n1_hs : 10, nc1_ls : 4,